openshift: validate when applying objects

Right now if there's a yml thats indented incorrectly, but parts of it
are fine, oc apply will apply those parts that are valid and just ignore
the rest. So, lets add a --validate=strict to have it reject these
entirely, so we know they have something wrong in them and we can fix
it, rather than being confused that they didn't apply anything.

Signed-off-by: Kevin Fenzi kevin@scrye.com
This commit is contained in:
Kevin Fenzi 2023-11-08 14:11:02 -08:00
parent 1f1624d5ac
commit 9e2b0cda9d
2 changed files with 2 additions and 2 deletions

View file

@ -14,5 +14,5 @@
register: object_file
- name: Call `oc apply` on the copied file
shell: oc -n {{os_app}} apply -f /etc/openshift_apps/{{os_app}}/{{objectname}}
shell: oc -n {{os_app}} apply --validate=strict -f /etc/openshift_apps/{{os_app}}/{{objectname}}
when: object_template.changed or object_template_fullpath.changed or object_file.changed

View file

@ -19,7 +19,7 @@
dest=/etc/openshift_apps/{{app}}/project.yml
- name: Create project
shell: oc apply -f /etc/openshift_apps/{{app}}/project.yml
shell: oc apply -f --validate=strict /etc/openshift_apps/{{app}}/project.yml
when: "'not found' in project_exists.stderr"
- name: deployer.yml