-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alb fix and add Ingress status report #5160
Draft
szombi
wants to merge
17
commits into
IBM-Cloud:master
Choose a base branch
from
szombi:alb-fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b159c63
ALB fixes and add ALB status report
szombi 2fa8cd9
ALB fixes and add ALB status report
szombi 1f26307
ALB fixes and add ALB status report
szombi d252635
ALB fixes and add ALB status report
szombi 1148e0b
Merge remote-tracking branch 'origin/master' into alb-fix
szombi 20139fa
ALB fixes and add ALB status report
szombi 2e9d5db
Update ibm/service/kubernetes/data_source_ibm_container_alb_test.go
szombi 61a5899
Update ibm/service/kubernetes/data_source_ibm_container_alb.go
szombi 4a6f60d
Update ibm/service/kubernetes/resource_ibm_container_cluster.go
szombi 4367a94
Update ibm/service/kubernetes/resource_ibm_container_alb.go
szombi 42d69bc
Update ibm/service/kubernetes/data_source_ibm_container_alb_test.go
szombi 12c680c
Update ibm/service/kubernetes/data_source_ibm_container_alb_test.go
szombi a88cc9a
Update ibm/service/kubernetes/resource_ibm_container_vpc_cluster_test.go
szombi 279c71a
Update ibm/service/kubernetes/resource_ibm_container_vpc_cluster_test.go
szombi d8d7dee
Update ibm/service/kubernetes/resource_ibm_container_vpc_cluster_test.go
szombi cba81fa
ALB fixes and add ALB status report
szombi c15ef6f
Merge remote-tracking branch 'origin/master' into alb-fix
szombi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
ibm/service/kubernetes/data_source_ibm_container_alb_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// Copyright IBM Corp. 2017, 2024 All Rights Reserved. | ||
// Licensed under the Mozilla Public License v2.0 | ||
|
||
package kubernetes_test | ||
|
||
import ( | ||
"fmt" | ||
"regexp" | ||
"testing" | ||
|
||
acc "github.com/IBM-Cloud/terraform-provider-ibm/ibm/acctest" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" | ||
) | ||
|
||
func TestAccIBMContainerALBDataSource_Basic(t *testing.T) { | ||
clusterName := fmt.Sprintf("terraform_%d", acctest.RandIntRange(10, 100)) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { acc.TestAccPreCheck(t) }, | ||
Providers: acc.TestAccProviders, | ||
CheckDestroy: testAccCheckIBMContainerALBDestroy, | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccCheckIBMContainerALBDataSourceBasic(clusterName, true), | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestMatchResourceAttr( | ||
"data.ibm_container_alb.alb", "alb_id", regexp.MustCompile("^(public|private)-cr.*-alb[1-10]$")), | ||
resource.TestMatchResourceAttr( | ||
"data.ibm_container_alb.alb", "enable", regexp.MustCompile("^true|false$")), | ||
resource.TestMatchResourceAttr( | ||
"data.ibm_container_alb.alb", "alb_type", regexp.MustCompile("^public|private$")), | ||
resource.TestMatchResourceAttr( | ||
"data.ibm_container_alb.alb", "state", regexp.MustCompile("^enabled|disabled$")), | ||
resource.TestCheckResourceAttr( | ||
"data.ibm_container_alb.alb", "zone", acc.Zone), | ||
resource.TestMatchResourceAttr( | ||
"data.ibm_container_alb.alb", "status", regexp.MustCompile("^healthy|warning|disabled$")), | ||
), | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
func testAccCheckIBMContainerALBDataSourceBasic(clusterName string, enable bool) string { | ||
config := fmt.Sprintf(`resource "ibm_container_cluster" "testacc_cluster" { | ||
name = "%s" | ||
datacenter = "%s" | ||
default_pool_size = 1 | ||
machine_type = "%s" | ||
hardware = "shared" | ||
public_vlan_id = "%s" | ||
private_vlan_id = "%s" | ||
timeouts { | ||
create = "120m" | ||
update = "120m" | ||
} | ||
} | ||
|
||
data "ibm_container_alb" "alb" { | ||
alb_id = ibm_container_cluster.testacc_cluster.albs[0].id | ||
}`, clusterName, acc.Datacenter, acc.MachineType, acc.PublicVlanID, acc.PrivateVlanID) | ||
|
||
return config | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type is either
public
orprivate
so I do not think this a valid wording.Maybe a pointer could be nice to acquire the current supported images, in the description.
And I believe we should change the
alb_type
description to a more meaningful one like:the type of ALB, available options: public, private
but since it is not part of this change I can't comment there.