-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
azurerm_kubernetes_cluster
- support for the revisions
for istio addon
#26546
base: main
Are you sure you want to change the base?
azurerm_kubernetes_cluster
- support for the revisions
for istio addon
#26546
Conversation
680512f
to
d516c68
Compare
Optional: true, | ||
Computed: true, |
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.
Is there a reason this needs to be Computed
? We avoid introducing new properties that are both Optional
+Computed
(O+C), in particular lists of primitives unless there is a good reason to. This is because the provider is sometimes unable to tell whether a change has happened to an O+C property when a user tries to update it. We have a more detailed explanation over in the contributor docs in case you're interested.
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.
Updated in latest commit
Type: pluginsdk.TypeSet, | ||
Optional: true, | ||
Computed: true, | ||
MinItems: 1, |
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 would be a breaking change for users that have this block set.
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.
Sorry, are you referring to MinItems? As in it would be a breaking change when in future this MinItems changes? And vice versa for MaxItems?
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.
I was referring to the MinItems
, but my suspicion that it would be a breaking change was incorrect. Specifying a MinItems
would have implied that the property must be set with at least one element in the list, but because it's Optional
is appears to really only be a validation that's applied if the property has been set. Good to know.
Unfortunately adding this property is still going to be a breaking change since users will need to add this property to ignore_changes
to prevent a diff when they upgrade to a version that will include this change.
From the sounds of it it also seems like this property might actually want to be Required
instead of Optional
?
Computed: true, | ||
MinItems: 1, | ||
MaxItems: 2, | ||
Set: set.HashStringIgnoreCase, |
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.
Does this need to be a set?
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.
No need, but Set feels more suitable in this case to stop users from inputting duplicates, can update to List if preferred.
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.
We only use sets if the API doesn't preserve the ordering.
Regarding duplicates, you could add some validation in the expand function to check for duplicates and can error at apply time if that helps?
if existing != nil && existing.Istio != nil && existing.Istio.Revisions != nil { | ||
profile.Istio.Revisions = existing.Istio.Revisions |
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.
What is this for?
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.
Previously, if the service_mesh_profile is set with istio, it will be deployed fine, but any updates for service_mesh_profile properties later will cause error returned by the AKS API because the revisions has not been specified.
I have added this block so that if user wants to update the service_mesh_profile without revisions, it will by default use whatever revisions it already has as returned by the AKS API.
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.
Based on this it sounds like this property might actually want to be Required
instead of Optional
internal/services/containers/kubernetes_cluster_network_resource_test.go
Outdated
Show resolved
Hide resolved
internal/services/containers/kubernetes_cluster_network_resource_test.go
Outdated
Show resolved
Hide resolved
…data source feat: add revisions setting in azurerm_kubernetes_cluster resource & data source feat: add doc & acceptance tests for new property feat: add revisions setting in azurerm_kubernetes_cluster resource & data source Update kubernetes_cluster_network_resource_test.go fix: fix issues based on pr reviews Update website/docs/r/kubernetes_cluster.html.markdown Co-Authored-By: stephybun <[email protected]>
0089c72
to
34371c9
Compare
Community Note
Description
Adds new property
revisions
forazurerm_kubernetes_cluster
istio addon. This configuration allows users to bring set istio control plane revisions for managing upgrades the minor revision using canary upgrade process.PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_kubernetes_cluster
- support for therevisions
property forservice_mesh_profile
.This is a (please select all that apply):
Related Issue(s)
Closes #25724
Note
If this PR changes meaningfully during the course of review please update the title and description as required.