-
Notifications
You must be signed in to change notification settings - Fork 674
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
base: master
Are you sure you want to change the base?
Conversation
ibm/service/kubernetes/resource_ibm_container_vpc_alb_create_test.go
Outdated
Show resolved
Hide resolved
|
||
targetEnv, err := getClusterTargetHeader(d, meta) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
targetEnvV2, err := getVpcClusterTargetHeader(d, meta) |
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.
Bit odd to me that we are calling a vpc function from a data source responsible for classic clusters.
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.
+1 I believe this change should go to ibm/service/kubernetes/data_source_ibm_container_vpc_cluster.go
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.
Discussed offline, needed because we want to use a v2 API with SDK.
// You need to set up env vars: | ||
// export IBM_CLUSTER_VPC_ID | ||
// export IBM_CLUSTER_VPC_RESOURCE_GROUP_ID | ||
// export IBM_CLUSTER_VPC_SUBNET_ID |
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.
acctest.go could be updated with these filenames for these fields.
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.
Fixed
Computed: true, | ||
Description: "Status of the ALB", | ||
}, | ||
"ingress_image": { |
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.
Shouldn't we call this field version
?
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.
Fixed
} | ||
|
||
numOfInstances := "2" | ||
if v, ok := d.GetOk("user_ip"); ok { | ||
userIP = v.(string) | ||
} | ||
params := v1.ALBConfig{ |
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.
params
are only used if the user wants to enable the ALB, we should move initializing/configuring the variable there. I also don't see that setting ingress_image
has any effect as it's not passed to the params.
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.
Fixed
Co-authored-by: Attila Szucs <[email protected]>
Co-authored-by: Attila Szucs <[email protected]>
Co-authored-by: Attila Szucs <[email protected]>
Co-authored-by: Attila Szucs <[email protected]>
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "ALB zone", | ||
Deprecated: "Remove this attribute's configuration as it no longer is used", |
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.
Maybe
Deprecated: "Remove this attribute's configuration as it no longer is used", | |
Deprecated: "This field deprecated and no longer supported", |
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.
Fixed
@@ -57,6 +57,11 @@ func DataSourceIBMContainerVPCClusterALB() *schema.Resource { | |||
Type: schema.TypeString, | |||
Computed: true, | |||
}, | |||
"ingress_image": { |
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.
same version
related observation
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.
Fixed
|
||
targetEnv, err := getClusterTargetHeader(d, meta) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
targetEnvV2, err := getVpcClusterTargetHeader(d, meta) |
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.
+1 I believe this change should go to ibm/service/kubernetes/data_source_ibm_container_vpc_cluster.go
ibm/service/kubernetes/resource_ibm_container_vpc_cluster_test.go
Outdated
Show resolved
Hide resolved
ibm/service/kubernetes/resource_ibm_container_vpc_cluster_test.go
Outdated
Show resolved
Hide resolved
ibm/service/kubernetes/resource_ibm_container_vpc_cluster_test.go
Outdated
Show resolved
Hide resolved
Co-authored-by: Balázs Szekeres <[email protected]>
Co-authored-by: Balázs Szekeres <[email protected]>
Co-authored-by: Balázs Szekeres <[email protected]>
Co-authored-by: Balázs Szekeres <[email protected]>
Co-authored-by: Balázs Szekeres <[email protected]>
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.
General comment: The description fields are sometimes sentences with/without a .
and sometimes just a few words. It would be nice to have them in a uniform way.
"version": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "The type of Ingress image that you want to use for your ALB deployment.", |
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
or private
so I do not think this a valid wording.
Description: "The type of Ingress image that you want to use for your ALB deployment.", | |
Description: "the version of the ALB image", |
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.
"version": { | ||
Type: schema.TypeString, | ||
Computed: true, | ||
Description: "The type of Ingress image that you want to use for your ALB deployment.", |
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
or private
so I do not think this a valid wording.
Description: "The type of Ingress image that you want to use for your ALB deployment.", | |
Description: "the version of the ALB image", |
Maybe a pointer could be nice to acquire the current supported images, in the description.
@@ -35,7 +35,7 @@ func ResourceIBMContainerAlbCreate() *schema.Resource { | |||
Default: true, | |||
Description: "If set to true, the ALB is enabled by default.", | |||
}, | |||
"ingress_image": { | |||
"version": { |
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.
description update
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.
As it's an already existing field, we can't just rename it. We have to handle the change properly.
|
||
numOfInstances := "2" | ||
if v, ok := d.GetOk("user_ip"); ok { |
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.
This is also only relevant if enable == true
, should be moved to the if condition.
@@ -187,7 +217,6 @@ func resourceIBMContainerALBUpdate(d *schema.ResourceData, meta interface{}) err | |||
|
|||
if d.HasChange("enable") { | |||
enable := d.Get("enable").(bool) | |||
disableDeployment := d.Get("disable_deployment").(bool) | |||
albID := d.Id() | |||
params := v1.ALBConfig{ |
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.
Similarly to the other cases, params
is only needed if enable == true
, should be moved there.
@@ -35,7 +35,7 @@ func ResourceIBMContainerAlbCreate() *schema.Resource { | |||
Default: true, | |||
Description: "If set to true, the ALB is enabled by default.", | |||
}, | |||
"ingress_image": { | |||
"version": { |
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.
As it's an already existing field, we can't just rename it. We have to handle the change properly.
@@ -91,11 +96,13 @@ func ResourceIBMContainerAlbCreate() *schema.Resource { | |||
Type: schema.TypeString, | |||
Computed: true, | |||
Description: "ALB name", | |||
Deprecated: "Remove this attribute's configuration as it no longer is used", |
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.
There are some Deprecated descriptions in this file that should be also updated to be consistent.
The scope of this PR is updating the current ALB solutions based on our current API and introduce ingress status and ingress config in cluster resource and data source.
More info about the ingress status report: https://cloud.ibm.com/docs/containers?topic=containers-ingress-status
Community Note
Relates OR Closes #0000
Output from acceptance testing: