-
Notifications
You must be signed in to change notification settings - Fork 102
Fix: Trigger nodeSet reconciler with ansibleVarsFrom changes #1766
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
Open
oliashish
wants to merge
6
commits into
main
Choose a base branch
from
fix/nodeset-reconcile-with-secret-change
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+322
−0
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
777fe8a
Fix: Trigger nodeSet reconciler with ansibleVarsFrom changes
oliashish 041c79f
fix: return value from per node level processing function
oliashish aed228c
fix: refactored for deployment controller and optimization
oliashish ddd51dd
fix: added test cases for ansibleVarsFrom changes
oliashish 35d6f71
removed extra line after comment
oliashish e662eec
fix: test cases and verified them
oliashish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
48 changes: 48 additions & 0 deletions
48
test/kuttl/tests/dataplane-deploy-no-nodes-test/08-ansiblevars-deploy.yaml
This file contains hidden or 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,48 @@ | ||
| # Test ansibleVarsFrom ConfigMap/Secret change detection | ||
| # First, delete the failed deployment from step 05 to clear the NodeSet error state | ||
| # This step can be ignored if we did not want to check the status of the nodeSet | ||
| # and verify if that is waiting for deployment. | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestStep | ||
| commands: | ||
| - script: oc delete openstackdataplanedeployment edpm-compute-no-nodes-non-existent-service -n openstack-kuttl-tests --ignore-not-found=true | ||
oliashish marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| --- | ||
| # Create ConfigMap and Secret for ansibleVarsFrom | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: ansiblevars-test-cm | ||
| data: | ||
| test_var: original-value | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: ansiblevars-test-secret | ||
| stringData: | ||
| secret_var: original-secret-value | ||
| --- | ||
| # Patch existing NodeSet to add ansibleVarsFrom | ||
| apiVersion: dataplane.openstack.org/v1beta1 | ||
| kind: OpenStackDataPlaneNodeSet | ||
| metadata: | ||
| name: edpm-compute-no-nodes | ||
| spec: | ||
| nodeTemplate: | ||
| ansible: | ||
| ansibleVarsFrom: | ||
| - configMapRef: | ||
| name: ansiblevars-test-cm | ||
| - secretRef: | ||
| name: ansiblevars-test-secret | ||
| --- | ||
| # Create deployment to capture the hashes | ||
| apiVersion: dataplane.openstack.org/v1beta1 | ||
| kind: OpenStackDataPlaneDeployment | ||
| metadata: | ||
| name: edpm-ansiblevars-deploy | ||
| spec: | ||
| nodeSets: | ||
| - edpm-compute-no-nodes | ||
| servicesOverride: | ||
| - configure-os | ||
61 changes: 61 additions & 0 deletions
61
test/kuttl/tests/dataplane-deploy-no-nodes-test/08-assert.yaml
This file contains hidden or 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,61 @@ | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestAssert | ||
| timeout: 600 | ||
| collectors: | ||
| - type: command | ||
| command: oc logs -n openstack-operators -l openstack.org/operator-name=openstack | ||
| name: operator-logs | ||
| --- | ||
| # Assert NodeSet is Ready with configMapHashes populated | ||
| apiVersion: dataplane.openstack.org/v1beta1 | ||
| kind: OpenStackDataPlaneNodeSet | ||
| metadata: | ||
| name: edpm-compute-no-nodes | ||
| namespace: openstack-kuttl-tests | ||
| status: | ||
| conditions: | ||
| - message: NodeSet Ready | ||
| reason: Ready | ||
| status: "True" | ||
| type: Ready | ||
| - message: Deployment completed | ||
| reason: Ready | ||
| status: "True" | ||
| type: DeploymentReady | ||
| - message: Input data complete | ||
| reason: Ready | ||
| status: "True" | ||
| type: InputReady | ||
| - message: NodeSetDNSDataReady ready | ||
| reason: Ready | ||
| status: "True" | ||
| type: NodeSetDNSDataReady | ||
| - message: NodeSetIPReservationReady ready | ||
| reason: Ready | ||
| status: "True" | ||
| type: NodeSetIPReservationReady | ||
| - message: ServiceAccount created | ||
| reason: Ready | ||
| status: "True" | ||
| type: ServiceAccountReady | ||
| - message: Setup complete | ||
| reason: Ready | ||
| status: "True" | ||
| type: SetupReady | ||
| configMapHashes: | ||
| ansiblevars-test-cm: n5bbhc6h5fdhf8h57bh665h5b9h576h598h7dh5fdh667hch5b5h89h9dh668hc4hc6h669h74h575hf4h596h66dhd5h5f7hb7h689hf9hddh64q | ||
| secretHashes: | ||
| ansiblevars-test-secret: n5d8h67h5b8hc9h5cfh54bh76h544h66chf7h8bh5fbh59chdch76h96h54bh74h9bh5bh5cdh94h566h699h99hdch65fh5d6h5fbh5bfh586hfcq | ||
| --- | ||
| # Assert deployment completed with hashes | ||
| apiVersion: dataplane.openstack.org/v1beta1 | ||
| kind: OpenStackDataPlaneDeployment | ||
| metadata: | ||
| name: edpm-ansiblevars-deploy | ||
| namespace: openstack-kuttl-tests | ||
| status: | ||
| deployed: true | ||
| configMapHashes: | ||
| ansiblevars-test-cm: n5bbhc6h5fdhf8h57bh665h5b9h576h598h7dh5fdh667hch5b5h89h9dh668hc4hc6h669h74h575hf4h596h66dhd5h5f7hb7h689hf9hddh64q | ||
| secretHashes: | ||
| ansiblevars-test-secret: n5d8h67h5b8hc9h5cfh54bh76h544h66chf7h8bh5fbh59chdch76h96h54bh74h9bh5bh5cdh94h566h699h99hdch65fh5d6h5fbh5bfh586hfcq |
25 changes: 25 additions & 0 deletions
25
test/kuttl/tests/dataplane-deploy-no-nodes-test/09-ansiblevars-update.yaml
This file contains hidden or 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,25 @@ | ||
| # Update ConfigMap and Secret content to trigger change detection | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: ansiblevars-test-cm | ||
| data: | ||
| test_var: updated-value | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: ansiblevars-test-secret | ||
| stringData: | ||
| secret_var: updated-secret-value | ||
| --- | ||
| # Create deployment to capture the new hashes after content update | ||
| apiVersion: dataplane.openstack.org/v1beta1 | ||
| kind: OpenStackDataPlaneDeployment | ||
| metadata: | ||
| name: edpm-ansiblevars-deploy-update | ||
| spec: | ||
| nodeSets: | ||
| - edpm-compute-no-nodes | ||
| servicesOverride: | ||
| - configure-os |
63 changes: 63 additions & 0 deletions
63
test/kuttl/tests/dataplane-deploy-no-nodes-test/09-assert.yaml
This file contains hidden or 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,63 @@ | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestAssert | ||
| timeout: 600 | ||
| collectors: | ||
| - type: command | ||
| command: oc logs -n openstack-operators -l openstack.org/operator-name=openstack | ||
| name: operator-logs | ||
| --- | ||
| # Assert NodeSet is Ready after deployment with updated ConfigMap/Secret completes | ||
| # The hash values will differ from step 08 due to content change | ||
| apiVersion: dataplane.openstack.org/v1beta1 | ||
| kind: OpenStackDataPlaneNodeSet | ||
| metadata: | ||
| name: edpm-compute-no-nodes | ||
| namespace: openstack-kuttl-tests | ||
| status: | ||
| conditions: | ||
| - message: NodeSet Ready | ||
| reason: Ready | ||
| status: "True" | ||
| type: Ready | ||
| - message: Deployment completed | ||
| reason: Ready | ||
| status: "True" | ||
| type: DeploymentReady | ||
| - message: Input data complete | ||
| reason: Ready | ||
| status: "True" | ||
| type: InputReady | ||
| - message: NodeSetDNSDataReady ready | ||
| reason: Ready | ||
| status: "True" | ||
| type: NodeSetDNSDataReady | ||
| - message: NodeSetIPReservationReady ready | ||
| reason: Ready | ||
| status: "True" | ||
| type: NodeSetIPReservationReady | ||
| - message: ServiceAccount created | ||
| reason: Ready | ||
| status: "True" | ||
| type: ServiceAccountReady | ||
| - message: Setup complete | ||
| reason: Ready | ||
| status: "True" | ||
| type: SetupReady | ||
| configMapHashes: | ||
| ansiblevars-test-cm: nd7h5fdh54bh8chb7h5hc8h654hf8h5d5h66bh54dh56fh7bhf5h98h66fh59ch87h9ch5d6h664h668hb7h66fh7fh598h9fh57dhfh5fch655q | ||
| secretHashes: | ||
| ansiblevars-test-secret: n56hffh656h98hc9h4h79h86h5bfh695hd7h5f9h5d4h87h85h546h7dhc5h98h676h5fh66bh66bhb5h679h77hf8hdbh569h66dhb5h59dq | ||
| --- | ||
| # Assert deployment completed with new hashes | ||
| apiVersion: dataplane.openstack.org/v1beta1 | ||
| kind: OpenStackDataPlaneDeployment | ||
| metadata: | ||
| name: edpm-ansiblevars-deploy-update | ||
| namespace: openstack-kuttl-tests | ||
| status: | ||
| deployed: true | ||
| configMapHashes: | ||
| ansiblevars-test-cm: nd7h5fdh54bh8chb7h5hc8h654hf8h5d5h66bh54dh56fh7bhf5h98h66fh59ch87h9ch5d6h664h668hb7h66fh7fh598h9fh57dhfh5fch655q | ||
| secretHashes: | ||
| ansiblevars-test-secret: n56hffh656h98hc9h4h79h86h5bfh695hd7h5f9h5d4h87h85h546h7dhc5h98h676h5fh66bh66bhb5h679h77hf8hdbh569h66dhb5h59dq | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.