-
Notifications
You must be signed in to change notification settings - Fork 25
Add firewall_id to LNP #725
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
base: dev
Are you sure you want to change the base?
Conversation
Release v0.41.1
Release v0.42.0
| firewall_id: 123456 | ||
| label: new-pool-label | ||
| labels: | ||
| foo.example.com/test: bar | ||
| foo.example.com/test2: foo | ||
| taints: | ||
| - key: foo.example.com/test2 | ||
| value: test | ||
| effect: NoExecute | ||
| state: present | ||
| register: new_pool | ||
|
|
||
| - name: Assert node pool is added to cluster | ||
| assert: | ||
| that: | ||
| - new_pool.node_pool.count == 2 | ||
| - new_pool.node_pool.firewall_id == 123456 | ||
| - new_pool.node_pool.label == 'new-pool-label' | ||
| - new_pool.node_pool.type == 'g6-standard-1' | ||
| - new_pool.node_pool.nodes[0].status == 'ready' | ||
| - new_pool.node_pool.nodes[1].status == 'ready' | ||
| - new_pool.node_pool.labels['foo.example.com/test'] == 'bar' | ||
| - new_pool.node_pool.labels['foo.example.com/test2'] == 'foo' | ||
| - new_pool.node_pool.taints[0].key == 'foo.example.com/test2' | ||
| - new_pool.node_pool.taints[0].value == 'test' | ||
| - new_pool.node_pool.taints[0].effect == 'NoExecute' | ||
|
|
||
| - name: Attempt to update an invalid field on the node pool | ||
| linode.cloud.lke_node_pool: | ||
| cluster_id: '{{ create_cluster.cluster.id }}' | ||
|
|
||
| tags: [ 'my-pool' ] | ||
| type: g6-standard-2 | ||
| count: 2 | ||
| state: present | ||
| register: update_pool_fail | ||
| failed_when: '"failed to update" not in update_pool_fail.msg' | ||
|
|
||
| - name: Update the node pool | ||
| linode.cloud.lke_node_pool: | ||
| cluster_id: '{{ create_cluster.cluster.id }}' | ||
|
|
||
| firewall_id: 654321 | ||
| tags: ['my-pool'] | ||
| type: g6-standard-1 | ||
| count: 1 | ||
| skip_polling: true | ||
| label: updated-pool-label | ||
| autoscaler: | ||
| enabled: true | ||
| min: 1 | ||
| max: 3 | ||
| labels: | ||
| foo.example.com/update: updated | ||
| foo.example.com/test2: foo | ||
| taints: | ||
| - key: foo.example.com/update | ||
| value: updated | ||
| effect: PreferNoSchedule | ||
| state: present | ||
| register: update_pool | ||
|
|
||
| - name: Assert node pool is updated | ||
| assert: | ||
| that: | ||
| - update_pool.node_pool.count == 1 | ||
| - update_pool.node_pool.firewall_id == 654321 |
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.
Since these are integration tests that run against the API, I think the firewall ID should reflect that of an actual firewall.
Fortunately is an existing {{ firewall_id }} variable that we use to secure test resource:
| firewall_id: '{{ firewall_id }}' |
For firewall_id update, we should be able to use the firewall module at the beginning of this test to create a temporary firewall for the sake of testing.
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.
Makes sense. Thanks for the pointer!
📝 Description
What does this PR do and why is this change necessary?
✔️ How to Test
What are the steps to reproduce the issue or verify the changes?
ansible-playbook playbook.yaml)firewall2and re-run the playbook. Ensure that the firewall-id is updated both in UI the job went well.