-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch incorrect CloudStack upgrade comparison (#5910)
* Patch incorrect CloudStack upgrade comparison A subset of fields for the EKSA CloudStack API do not trigger creation of new CAPI templates when they are removed. The issue stems from the DeepDerivative function used to compare old with new to identify a diff. It does not compare fields when their type is defaulted meaning removal of the data alltogether isn't considered a change. This change compares the old and new objects in both directions ensuring we identify a diff. * Rename CloudStack unit test
- Loading branch information
1 parent
01b1fd6
commit e2d4fc4
Showing
3 changed files
with
695 additions
and
167 deletions.
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
109 changes: 109 additions & 0 deletions
109
pkg/providers/cloudstack/testdata/test_worker_spec.yaml
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,109 @@ | ||
apiVersion: anywhere.eks.amazonaws.com/v1alpha1 | ||
kind: Cluster | ||
metadata: | ||
name: test | ||
namespace: test-namespace | ||
spec: | ||
clusterNetwork: | ||
cni: cilium | ||
pods: | ||
cidrBlocks: | ||
- 192.168.0.0/16 | ||
services: | ||
cidrBlocks: | ||
- 10.96.0.0/12 | ||
controlPlaneConfiguration: | ||
count: 3 | ||
endpoint: | ||
host: 1.2.3.4 | ||
machineGroupRef: | ||
kind: CloudStackMachineConfig | ||
name: test-cp | ||
datacenterRef: | ||
kind: CloudStackDatacenterConfig | ||
name: test | ||
externalEtcdConfiguration: | ||
count: 3 | ||
machineGroupRef: | ||
kind: CloudStackMachineConfig | ||
name: test-etcd | ||
kubernetesVersion: "1.21" | ||
workerNodeGroupConfigurations: | ||
- count: 3 | ||
machineGroupRef: | ||
kind: CloudStackMachineConfig | ||
name: test | ||
name: md-0 | ||
taints: | ||
- key: key2 | ||
value: val2 | ||
effect: PreferNoSchedule | ||
--- | ||
apiVersion: anywhere.eks.amazonaws.com/v1alpha1 | ||
kind: CloudStackDatacenterConfig | ||
metadata: | ||
name: test | ||
namespace: test-namespace | ||
spec: | ||
account: "admin" | ||
domain: "domain1" | ||
zones: | ||
- name: "zone1" | ||
network: | ||
name: "net1" | ||
managementApiEndpoint: "http://127.16.0.1:8080/client/api" | ||
--- | ||
apiVersion: anywhere.eks.amazonaws.com/v1alpha1 | ||
kind: CloudStackMachineConfig | ||
metadata: | ||
name: test-cp | ||
namespace: test-namespace | ||
spec: | ||
computeOffering: | ||
name: "m4-large" | ||
users: | ||
- name: "mySshUsername" | ||
sshAuthorizedKeys: # The key below was manually generated and not used in any production systems | ||
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1BK73XhIzjX+meUr7pIYh6RHbvI3tmHeQIXY5lv7aztN1UoX+bhPo3dwo2sfSQn5kuxgQdnxIZ/CTzy0p0GkEYVv3gwspCeurjmu0XmrdmaSGcGxCEWT/65NtvYrQtUE5ELxJ+N/aeZNlK2B7IWANnw/82913asXH4VksV1NYNduP0o1/G4XcwLLSyVFB078q/oEnmvdNIoS61j4/o36HVtENJgYr0idcBvwJdvcGxGnPaqOhx477t+kfJAa5n5dSA5wilIaoXH5i1Tf/HsTCM52L+iNCARvQzJYZhzbWI1MDQwzILtIBEQCJsl2XSqIupleY8CxqQ6jCXt2mhae+wPc3YmbO5rFvr2/EvC57kh3yDs1Nsuj8KOvD78KeeujbR8n8pScm3WDp62HFQ8lEKNdeRNj6kB8WnuaJvPnyZfvzOhwG65/9w13IBl7B1sWxbFnq2rMpm5uHVK7mAmjL0Tt8zoDhcE1YJEnp9xte3/pvmKPkST5Q/9ZtR9P5sI+02jY0fvPkPyC03j2gsPixG7rpOCwpOdbny4dcj0TDeeXJX8er+oVfJuLYz0pNWJcT2raDdFfcqvYA0B0IyNYlj5nWX4RuEcyT3qocLReWPnZojetvAG/H8XwOh7fEVGqHAKOVSnPXCSQJPl6s0H12jPJBDJMTydtYPEszl4/CeQ== testemail@test.com" | ||
template: | ||
name: "centos7-k8s-118" | ||
affinityGroupIds: | ||
- control-plane-anti-affinity | ||
--- | ||
apiVersion: anywhere.eks.amazonaws.com/v1alpha1 | ||
kind: CloudStackMachineConfig | ||
metadata: | ||
name: test | ||
namespace: test-namespace | ||
spec: | ||
computeOffering: | ||
name: "m4-large" | ||
users: | ||
- name: "mySshUsername" | ||
sshAuthorizedKeys: # The key below was manually generated and not used in any production systems | ||
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1BK73XhIzjX+meUr7pIYh6RHbvI3tmHeQIXY5lv7aztN1UoX+bhPo3dwo2sfSQn5kuxgQdnxIZ/CTzy0p0GkEYVv3gwspCeurjmu0XmrdmaSGcGxCEWT/65NtvYrQtUE5ELxJ+N/aeZNlK2B7IWANnw/82913asXH4VksV1NYNduP0o1/G4XcwLLSyVFB078q/oEnmvdNIoS61j4/o36HVtENJgYr0idcBvwJdvcGxGnPaqOhx477t+kfJAa5n5dSA5wilIaoXH5i1Tf/HsTCM52L+iNCARvQzJYZhzbWI1MDQwzILtIBEQCJsl2XSqIupleY8CxqQ6jCXt2mhae+wPc3YmbO5rFvr2/EvC57kh3yDs1Nsuj8KOvD78KeeujbR8n8pScm3WDp62HFQ8lEKNdeRNj6kB8WnuaJvPnyZfvzOhwG65/9w13IBl7B1sWxbFnq2rMpm5uHVK7mAmjL0Tt8zoDhcE1YJEnp9xte3/pvmKPkST5Q/9ZtR9P5sI+02jY0fvPkPyC03j2gsPixG7rpOCwpOdbny4dcj0TDeeXJX8er+oVfJuLYz0pNWJcT2raDdFfcqvYA0B0IyNYlj5nWX4RuEcyT3qocLReWPnZojetvAG/H8XwOh7fEVGqHAKOVSnPXCSQJPl6s0H12jPJBDJMTydtYPEszl4/CeQ== testemail@test.com" | ||
template: | ||
name: "centos7-k8s-118" | ||
affinityGroupIds: | ||
- worker-affinity | ||
userCustomDetails: | ||
foo: bar | ||
--- | ||
apiVersion: anywhere.eks.amazonaws.com/v1alpha1 | ||
kind: CloudStackMachineConfig | ||
metadata: | ||
name: test-etcd | ||
namespace: test-namespace | ||
spec: | ||
computeOffering: | ||
name: "m4-large" | ||
users: | ||
- name: "mySshUsername" | ||
sshAuthorizedKeys: # The key below was manually generated and not used in any production systems | ||
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1BK73XhIzjX+meUr7pIYh6RHbvI3tmHeQIXY5lv7aztN1UoX+bhPo3dwo2sfSQn5kuxgQdnxIZ/CTzy0p0GkEYVv3gwspCeurjmu0XmrdmaSGcGxCEWT/65NtvYrQtUE5ELxJ+N/aeZNlK2B7IWANnw/82913asXH4VksV1NYNduP0o1/G4XcwLLSyVFB078q/oEnmvdNIoS61j4/o36HVtENJgYr0idcBvwJdvcGxGnPaqOhx477t+kfJAa5n5dSA5wilIaoXH5i1Tf/HsTCM52L+iNCARvQzJYZhzbWI1MDQwzILtIBEQCJsl2XSqIupleY8CxqQ6jCXt2mhae+wPc3YmbO5rFvr2/EvC57kh3yDs1Nsuj8KOvD78KeeujbR8n8pScm3WDp62HFQ8lEKNdeRNj6kB8WnuaJvPnyZfvzOhwG65/9w13IBl7B1sWxbFnq2rMpm5uHVK7mAmjL0Tt8zoDhcE1YJEnp9xte3/pvmKPkST5Q/9ZtR9P5sI+02jY0fvPkPyC03j2gsPixG7rpOCwpOdbny4dcj0TDeeXJX8er+oVfJuLYz0pNWJcT2raDdFfcqvYA0B0IyNYlj5nWX4RuEcyT3qocLReWPnZojetvAG/H8XwOh7fEVGqHAKOVSnPXCSQJPl6s0H12jPJBDJMTydtYPEszl4/CeQ== testemail@test.com" | ||
template: | ||
name: "centos7-k8s-118" | ||
affinityGroupIds: | ||
- etcd-affinity | ||
|
||
--- |
Oops, something went wrong.