-
Notifications
You must be signed in to change notification settings - Fork 98
[patch] Require RSL secret name as API parameter #1742
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: aib2op
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
- name: Read rsl config from environment | ||
ansible.builtin.set_fact: | ||
rslcfg: | ||
url: "{{ lookup('env', 'RSL_URL') }}" | ||
rsl_token: "{{ lookup('env', 'RSL_TOKEN') }}" | ||
org_id : "{{ lookup('env', 'RSL_ORG_ID') }}" | ||
|
||
|
||
- name: "Debug: rsl information" #TODO: remove before PR | ||
debug: | ||
msg: | ||
- "rsl url ................. {{ rslcfg.url }}" | ||
- "rsl token ............. {{ rslcfg.rsl_token }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not print the secret token value. |
||
- "rsl org id .............. {{ rslcfg.org_id }}" | ||
|
||
|
||
- name: "Validate rsl configuration" | ||
when: rslcfg.url | length == 0 | ||
fail: | ||
msg: "rslcfg.url must not empty" | ||
|
||
- name: "Validate rsl configuration" | ||
when: rslcfg.rsl_token | length == 0 | ||
fail: | ||
msg: "rslcfg.rsl_token must not empty" | ||
|
||
- name: "Validate rsl configuration" | ||
when: rslcfg.org_id | length == 0 | ||
fail: | ||
msg: "rslcfg.org_id must not empty" | ||
|
||
- name: Create rsl secret | ||
kubernetes.core.k8s: | ||
state: present | ||
namespace: "{{ aibroker_namespace }}" | ||
template: "templates/rsl/rsl-secret.yml.j2" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,12 @@ spec: | |
url: "{{ drocfg.url }}" | ||
secretName: "{{ mas_aibroker_dro_token_secret }}" | ||
ca: "{{ drocfg.ca }}" | ||
|
||
rsl: | ||
url: "{{ rslcfg.url }}" | ||
token : "{{ rslcfg.rsl_token }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The token should not be included here as it is a secret value. There should be a field called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The field names also need to match those in https://github.ibm.com/maximoappsuite/ibm-mas-aibroker/pull/156 |
||
orgId: "{{ rslcfg.org_id }}" | ||
|
||
sls: | ||
url: "{{ slscfg.url }}" | ||
secretName: "{{ mas_aibroker_sls_secret }}" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
kind: Secret | ||
apiVersion: v1 | ||
type: Opaque | ||
metadata: | ||
name: {{ mas_aibroker_rsl_token_secret }} | ||
namespace: {{ aibroker_namespace }} | ||
labels: | ||
mas.ibm.com/applicationId: aibroker | ||
mas.ibm.com/instanceId: "{{ mas_instance_id }}" | ||
{% if custom_labels is defined and custom_labels.items() %} | ||
{% for key, value in custom_labels.items() %} | ||
"{{ key }}": "{{ value }}" | ||
{% endfor %} | ||
{% endif %} | ||
data: | ||
RSL_TOKEN: "{{ rslcfg.registration_key | b64encode }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
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.
For consistency I would write "rsl" in capital letters here in the human-readable message.