-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[AKS] Add mutable fips cli flags (enable/disable on nodepool update) #7752
Changes from all commits
a758ef2
20fcf94
cd7a754
fefd3b8
0eee557
c57ff8a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4645,6 +4645,109 @@ def test_aks_create_update_vtpm_flow(self, resource_group, resource_group_locati | |
checks=[self.is_empty()], | ||
) | ||
|
||
@AllowLargeResponse() | ||
@AKSCustomResourceGroupPreparer( | ||
random_name_length=17, name_prefix="clitest", location="eastus2euap" | ||
) | ||
def test_aks_create_update_fips_flow(self, resource_group, resource_group_location): | ||
# reset the count so in replay mode the random names will start with 0 | ||
self.test_resources_count = 0 | ||
aks_name = self.create_random_name("cliakstest", 16) | ||
node_pool_name = self.create_random_name("c", 6) | ||
node_pool_name_second = self.create_random_name("c", 6) | ||
self.kwargs.update( | ||
{ | ||
"resource_group": resource_group, | ||
"name": aks_name, | ||
"dns_name_prefix": self.create_random_name("cliaksdns", 16), | ||
"location": resource_group_location, | ||
"resource_type": "Microsoft.ContainerService/ManagedClusters", | ||
"node_pool_name": node_pool_name, | ||
"node_pool_name_second": node_pool_name_second, | ||
"ssh_key_value": self.generate_ssh_keys(), | ||
} | ||
) | ||
|
||
# 1. create | ||
create_cmd = ( | ||
"aks create --resource-group={resource_group} --name={name} --location={location} " | ||
"--nodepool-name {node_pool_name} -c 1 --enable-managed-identity " | ||
"--ssh-key-value={ssh_key_value} " | ||
'--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/MutableFipsPreview ' | ||
"--enable-fips-image" | ||
) | ||
self.cmd( | ||
create_cmd, | ||
checks=[ | ||
self.check("provisioningState", "Succeeded"), | ||
self.check("agentPoolProfiles[0].enableFips", True), | ||
], | ||
) | ||
|
||
# verify same update no change | ||
self.cmd( | ||
"aks nodepool update --resource-group={resource_group} --cluster-name={name} --name={node_pool_name} " | ||
'--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/MutableFipsPreview ' | ||
"--enable-fips-image", | ||
checks=[ | ||
self.check("provisioningState", "Succeeded"), | ||
self.check("enableFips", True), | ||
], | ||
) | ||
|
||
# update nodepool1 to disable | ||
self.cmd( | ||
"aks nodepool update --resource-group={resource_group} --cluster-name={name} --name={node_pool_name} " | ||
'--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/MutableFipsPreview ' | ||
"--disable-fips-image", | ||
checks=[ | ||
self.check("provisioningState", "Succeeded"), | ||
self.check("enableFips", False), | ||
], | ||
) | ||
|
||
# 2. add nodepool2 | ||
self.cmd( | ||
"aks nodepool add " | ||
"--resource-group={resource_group} " | ||
"--cluster-name={name} " | ||
"--name={node_pool_name_second} " | ||
"--os-type Linux " | ||
'--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/MutableFipsPreview ', | ||
checks=[ | ||
self.check("provisioningState", "Succeeded"), | ||
self.check("enableFips", False), | ||
], | ||
) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add an update without either --enable-fips-image or --disable-fips-image, EnableFips should not change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
# verify same update no change | ||
self.cmd( | ||
"aks nodepool update --resource-group={resource_group} --cluster-name={name} --name={node_pool_name_second} " | ||
'--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/MutableFipsPreview ' | ||
"--disable-fips-image", | ||
checks=[ | ||
self.check("provisioningState", "Succeeded"), | ||
self.check("enableFips", False), | ||
], | ||
) | ||
|
||
# update nodepool2 to enable | ||
self.cmd( | ||
"aks nodepool update --resource-group={resource_group} --cluster-name={name} --name={node_pool_name_second} " | ||
'--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/MutableFipsPreview ' | ||
"--enable-fips-image", | ||
checks=[ | ||
self.check("provisioningState", "Succeeded"), | ||
self.check("enableFips", True), | ||
], | ||
) | ||
|
||
# delete | ||
self.cmd( | ||
"aks delete -g {resource_group} -n {name} --yes --no-wait", | ||
checks=[self.is_empty()], | ||
) | ||
|
||
@AllowLargeResponse() | ||
@AKSCustomResourceGroupPreparer( | ||
random_name_length=17, name_prefix="clitest", location="westus2" | ||
|
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.
add an update without either --enable-fips-image or --disable-fips-image, EnableFips should not change.