mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-07 05:22:39 +00:00
Fix the integration test for helm_registry_auth with helm >= 3.18.0 and clarify idempotency. (#946) (#961)
This is a backport of PR #946 as merged into main (642eb93).
SUMMARY
Fix the integration test for helm_registry_auth with helm >= 3.18.0 and clarify idempotency.
Fixes #944
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
helm_registry_auth
ADDITIONAL INFORMATION
Caused by the changes in helm starting from 3.18.0
Reviewed-by: Bianca Henderson <beeankha@gmail.com>
This commit is contained in:
@@ -108,15 +108,19 @@
|
||||
assert:
|
||||
that: "'Removing login credentials' in _helm_registry_auth_logout.stderr"
|
||||
|
||||
- name: Test logout idempotency
|
||||
helm_registry_auth:
|
||||
host: localhost:{{ registry_port }}
|
||||
state: absent
|
||||
register: _helm_registry_auth_logout_idempotency
|
||||
- name: Test idempotency of logout with helm < 3.18.0
|
||||
when: _helm_version.stdout is ansible.builtin.version('v3.18.0', '<')
|
||||
block:
|
||||
|
||||
- name: Assert logout operation did not report change
|
||||
ansible.builtin.assert:
|
||||
that: _helm_registry_auth_logout_idempotency is not changed
|
||||
- name: Test logout idempotency
|
||||
helm_registry_auth:
|
||||
host: localhost:{{ registry_port }}
|
||||
state: absent
|
||||
register: _helm_registry_auth_logout_idempotency
|
||||
|
||||
- name: Assert logout operation did not report change
|
||||
ansible.builtin.assert:
|
||||
that: _helm_registry_auth_logout_idempotency is not changed
|
||||
|
||||
- name: Ensure that not able to push to the registry
|
||||
ansible.builtin.shell: >-
|
||||
@@ -133,8 +137,7 @@
|
||||
# Helm binary prints the message to stderr
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- "'push access denied' in _save_chart.stderr"
|
||||
- "'authorization failed' in _save_chart.stderr"
|
||||
- "'push access denied' in _save_chart.stderr or 'basic credential not found' in _save_chart.stderr"
|
||||
- "_save_chart.rc != 0"
|
||||
- "'localhost:{{ registry_port }}' not in _config_json.content | b64decode"
|
||||
|
||||
@@ -155,7 +158,8 @@
|
||||
- name: Assert that the registry is not logged in and auth data is not saved
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- "'401 Unauthorized' in _helm_registry_auth_wrong.stderr"
|
||||
- "'401' in _helm_registry_auth_wrong.stderr"
|
||||
- "'unauthorized' in _helm_registry_auth_wrong.stderr | lower"
|
||||
- "'{{ wrong_password }}' not in _helm_registry_auth_correct.command"
|
||||
- "'{{ wrong_password }}' not in _helm_registry_auth_correct.stdout"
|
||||
- "'{{ wrong_password }}' not in _helm_registry_auth_correct.stderr"
|
||||
|
||||
Reference in New Issue
Block a user