-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cr] Enhance custom resource hook type
This change set modifies the existing CRD type to CR type to keep the standards aligned. It also enhances support for accepting defintion key which enables support for adding labels. Now, source file is made optional. Signed-off-by: Pragadeeswaran Sathyanarayanan <[email protected]>
- Loading branch information
1 parent
9aa4294
commit 51a0b9f
Showing
5 changed files
with
70 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
ansible-core>=2.14.0 | ||
oauthlib>=3.2.0 # k8s lib that requires manual upgrade | ||
kubernetes | ||
kubernetes-validate | ||
openstacksdk | ||
jsonschema>=4.20.0 | ||
|
||
# Allows to unpin cryptography | ||
pyOpenSSL>=22.1.0 |
File renamed without changes.
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
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,47 @@ | ||
--- | ||
# Copyright Red Hat, Inc. | ||
# All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
|
||
- name: "Set custom resource definition path for {{ hook.name }}" | ||
when: | ||
- hook.source is defined | ||
ansible.builtin.set_fact: | ||
crd_path: >- | ||
{%- if hook.source is not ansible.builtin.abs -%} | ||
{{ | ||
( | ||
ansible.builtin.role_path, | ||
'../../hooks/crds', | ||
hook.src | ||
) | ansible.builtin.path_join | ansible.builtin.realpath | ||
}} | ||
{%- else -%} | ||
{{ hook.source | ansible.builtin.realpath}} | ||
{%- endif -%} | ||
- name: "Manage the k8s object" | ||
kubernetes.core.k8s: | ||
definition: "{{ hook.definition | default(omit) }}" | ||
kind: "{{ hook.kind | default(omit) }}" | ||
kubeconfig: "{{ cifmw_openshift_kubeconfig }}" | ||
name: "{{ hook.resource_name | default(omit) }}" | ||
src: "{{ crd_path | default(omit) }}" | ||
state: "{{ hook.state | default(present) }}" | ||
validate: | ||
fail_on_error: true | ||
wait: true | ||
wait_condition: "{{ hook.wait_condition | default(omit) }}" | ||
validate_certs: "{{ hook.validate_certs | default(false) }}" |
This file was deleted.
Oops, something went wrong.