-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
- add support for node_os_channel_upgrade
#22187
Conversation
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.
LGTM!
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.
JK, I take it back. Almost there with a minor addition to fix an existing test
autoChannelUpgrade := d.Get("automatic_channel_upgrade").(string) | ||
nodeOsChannelUpgrade := d.Get("node_os_channel_upgrade").(string) | ||
if autoChannelUpgrade != "" { | ||
if autoChannelUpgrade == string(managedclusters.UpgradeChannelNodeNegativeimage) && nodeOsChannelUpgrade != string(managedclusters.NodeOSUpgradeChannelNodeImage) { |
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.
Looks like this wants to be
if autoChannelUpgrade == string(managedclusters.UpgradeChannelNodeNegativeimage) && nodeOsChannelUpgrade != string(managedclusters.NodeOSUpgradeChannelNodeImage) { | |
if autoChannelUpgrade == string(managedclusters.UpgradeChannelNodeNegativeimage) && string(managedclusters.NodeOSUpgradeChannelNodeImage) != "" && nodeOsChannelUpgrade != string(managedclusters.NodeOSUpgradeChannelNodeImage) { |
to get around
=== CONT TestAccKubernetesCluster_upgradeChannel
testcase.go:110: Step 5/10 error: Error running apply: exit status 1
Error: `node_os_channel_upgrade` must be set to `NodeImage` if `automatic_channel_upgrade` is set to `node-image`
with azurerm_kubernetes_cluster.test,
on terraform_plugin_test.tf line 22, in resource "azurerm_kubernetes_cluster" "test":
22: resource "azurerm_kubernetes_cluster" "test" {
--- FAIL: TestAccKubernetesCluster_upgradeChannel (795.62s)
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.
Whoops! Checked the api here and passing in
"autoUpgradeProfile": {
"upgradeChannel": "node-image"
},
returns
"autoUpgradeProfile": {
"upgradeChannel": "node-image",
"nodeOSUpgradeChannel": "NodeImage"
},
So my old comment is wrong
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.
LGTM once tests pass! My old review comment was wrong 🙈
autoChannelUpgrade := d.Get("automatic_channel_upgrade").(string) | ||
nodeOsChannelUpgrade := d.Get("node_os_channel_upgrade").(string) | ||
if autoChannelUpgrade != "" { | ||
if autoChannelUpgrade == string(managedclusters.UpgradeChannelNodeNegativeimage) && nodeOsChannelUpgrade != string(managedclusters.NodeOSUpgradeChannelNodeImage) { |
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.
Whoops! Checked the api here and passing in
"autoUpgradeProfile": {
"upgradeChannel": "node-image"
},
returns
"autoUpgradeProfile": {
"upgradeChannel": "node-image",
"nodeOSUpgradeChannel": "NodeImage"
},
So my old comment is wrong
Thanks for the review @mbfrahry! Relevant tests are passing so this should be good to merge. |
…de` (hashicorp#22187) * add support for node os upgrade channel * goimports * remove duplicated setting on autoUpgradeProfile * fix tests * reference temp name for rotation properly and try different sku for dedicated host
@stephybun @mbfrahry this is a breaking change for anyone who was setting Ideally this can be fixed in a patch release ASAP? |
Thanks for pointing this out @stevehipwell. I've opened #22284 to rearrange the validation which should go into the next release. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Tests are still running.
Superseded #21386
Related to #20171