Skip to content

Commit 429959a

Browse files
Merge pull request #71 from IBM/develop
Merge develop to main for v1.1.1 release
2 parents 27e5bee + 19ef186 commit 429959a

File tree

10 files changed

+46
-34
lines changed

10 files changed

+46
-34
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,5 @@ jobs:
9696
OCP_NAMESPACE=molecule-${GITHUB_REF_NAME}-${RUNNER_OS} molecule test --all
9797
env:
9898
OPENSHIFT_SERVER: ${{ secrets.OPENSHIFT_SERVER }}
99-
OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
99+
OPENSHIFT_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }}
100+
ZOSCB_RELEASE: ibm-zoscb.${{ vars.ZOSCB_RELEASE }}

ibm/operator_collection_sdk/README.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ If your local environment is also offline, then you must download the required A
9494
ansible-playbook ibm.operator_collection_sdk.create_offline_requirements
9595
```
9696

97-
**Note:** Offline Python dependencies are currently not supported in the v2.2.2 release of the IBM z/OS Cloud Broker, so the `requirements.txt` file will be removed in the Operator Collection once it has been converted to execute offline.
98-
9997

10098
# Usage Examples
10199
**Note:** To execute this playbook, it is required that your are in the root directory of the collection that you are developing, with a valid `galaxy.yml` and `operator-config.yml` file in the same directory
@@ -204,23 +202,22 @@ Enter your ZosEndpoint name:
204202
[kubernetes]:https://github.com/kubernetes-client/python#installation
205203
[broker]:https://ibm.biz/ibm-zoscb-install
206204

207-
## Configure extra-vars file to bypass prompts
208-
If you find yourself inputting vars_prompts frequently, append `--extra-vars <vars>.json` to your playbook command/alias
209-
210-
```bash
211-
ansible-playbook create_credential_secret.yml --extra-vars vars.json
212-
```
205+
## Configure ocsdk-extra-vars file to bypass prompts
206+
If you find yourself inputting vars_prompts frequently, create an `ocsdk-extra-vars.yaml` file. If `create_operator.yml` detects this file, it will automatically use it.
213207

214-
Example `vars.json` file:
208+
Example `ocsdk-extra-vars.yaml` file:
215209

210+
```yaml
211+
zosendpoint_type: remote
212+
zosendpoint_name: my-endpoint
213+
zosendpoint_host: 1.2.3.4
214+
zosendpoint_port: '22'
215+
username: user
216+
ssh_key: ~/.ssh/id_rsa
217+
passphrase: my_ssh_passphrase
216218
```
217-
{
218-
username: "testuser",
219-
operator_name: "racf",
220-
ssh_key: "~/.ssh/id_rsa",
221-
secret_name: "test-secret"
222-
}
223-
```
219+
220+
Note: We do not recommend explicitly specifying passphrases in this file as they should be passed through the vars prompt. If the passphrase is specified however, we recommend that the `ocsdk-extra-vars.yaml` file be added to your `.gitignore` file to prevent the exposure of your passphrase on Github.
224221

225222
## Suppress playbook warning messages
226223
Set the following environment variables to suppress the WARNING messages listed below when executing playbooks within the IBM Operator Collection SDK collection.

ibm/operator_collection_sdk/galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace: ibm
88
name: operator_collection_sdk
99

1010
# The version of the collection. Must be compatible with semantic versioning
11-
version: 1.1.0
11+
version: 1.1.1
1212

1313
# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
1414
readme: README.md

ibm/operator_collection_sdk/playbooks/molecule/create_operator_local/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
name: ibm-zoscb
5050
source: ibm-operator-catalog
5151
sourceNamespace: openshift-marketplace
52-
startingCSV: ibm-zoscb.v2.2.2
52+
startingCSV: "{{ zoscb_release }}"
5353

5454
- name: Validate Subscription installed successfully
5555
kubernetes.core.k8s_info:

ibm/operator_collection_sdk/playbooks/molecule/create_operator_local/molecule.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ provisioner:
3030
zosendpoint_name: ibmcloud-vm
3131
openshift_token: ${OPENSHIFT_TOKEN}
3232
openshift_server: ${OPENSHIFT_SERVER}
33+
zoscb_release: ${ZOSCB_RELEASE:-ibm-zoscb.v2.2.4}
3334
scenario:
3435
test_sequence:
3536
- prepare

ibm/operator_collection_sdk/playbooks/molecule/create_redeploy_delete_operator/converge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
name: ibm-zoscb
5050
source: ibm-operator-catalog
5151
sourceNamespace: openshift-marketplace
52-
startingCSV: ibm-zoscb.v2.2.2
52+
startingCSV: "{{ zoscb_release }}"
5353

5454
- name: Validate Subscription installed successfully
5555
kubernetes.core.k8s_info:

ibm/operator_collection_sdk/playbooks/molecule/create_redeploy_delete_operator/molecule.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ provisioner:
3131
secret_name: "test-secret"
3232
openshift_token: ${OPENSHIFT_TOKEN}
3333
openshift_server: ${OPENSHIFT_SERVER}
34+
zoscb_release: ${ZOSCB_RELEASE:-ibm-zoscb.v2.2.4}
3435
skip_credential_check: true
3536
scenario:
3637
test_sequence:

ibm/operator_collection_sdk/playbooks/redeploy_operator.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
vars:
3333
path: "{{ local_directory }}"
3434
namespace: "{{ target_namespace }}"
35+
redeploy: true
3536

3637
- name: Get SubOperatorConfig
3738
kubernetes.core.k8s_info:
@@ -90,23 +91,32 @@
9091
wait_sleep: 5
9192
wait_timeout: 140
9293

94+
- name: Set OperatorCollection name
95+
ansible.builtin.set_fact:
96+
operatorcollection_name: "{{ operator_name + '.' + operator_domain + '.' + operator_version }}"
97+
9398
- name: Create OperatorCollection
9499
kubernetes.core.k8s:
95100
state: present
96101
definition:
97102
apiVersion: zoscb.ibm.com/v2beta2
98103
kind: OperatorCollection
99104
metadata:
100-
name: "{{ oc_results.resources[0].metadata.name }}"
105+
name: "{{ operatorcollection_name }}"
101106
namespace: "{{ target_namespace }}"
102-
labels: "{{ oc_results.resources[0].metadata.labels }}"
103-
spec: "{{ oc_results.resources[0].spec }}"
107+
labels:
108+
managed-by: ibm-zos-cloud-broker
109+
operator-domain: "{{ operator_domain }}"
110+
operator-name: "{{ operator_name }}"
111+
operator-version: "{{ operator_version }}"
112+
spec:
113+
skipSignatureVerification: true
104114

105115
- name: Validate OperatorCollection installed successfully
106116
kubernetes.core.k8s_info:
107117
api_version: zoscb.ibm.com/v2beta2
108118
kind: OperatorCollection
109-
name: "{{ oc_results.resources[0].metadata.name }}"
119+
name: "{{ operatorcollection_name }}"
110120
namespace: "{{ target_namespace }}"
111121
register: updated_oc_results
112122
until: "updated_oc_results.resources[0].status.phase is defined and updated_oc_results.resources[0].status.phase == 'Successful'"
@@ -120,16 +130,18 @@
120130
apiVersion: zoscb.ibm.com/v2beta2
121131
kind: SubOperatorConfig
122132
metadata:
123-
name: "{{ soc_results.resources[0].metadata.name }}"
133+
name: "{{ operatorcollection_name }}-soc"
124134
namespace: "{{ target_namespace }}"
125-
labels: "{{ soc_results.resources[0].metadata.labels }}"
126-
spec: "{{ soc_results.resources[0].spec }}"
135+
spec:
136+
credentialType: "{{ soc_results.resources[0].spec.credentialType }}"
137+
mapping: "{{ soc_results.resources[0].spec.mapping }}"
138+
operatorCollection: "{{ operatorcollection_name }}"
127139

128140
- name: Validate SubOperatorConfig installed successfully
129141
kubernetes.core.k8s_info:
130142
api_version: zoscb.ibm.com/v2beta2
131143
kind: SubOperatorConfig
132-
name: "{{ soc_results.resources[0].metadata.name }}"
144+
name: "{{ operatorcollection_name }}-soc"
133145
namespace: "{{ target_namespace }}"
134146
register: updated_soc_results
135147
until: "updated_soc_results.resources[0].status.phase is defined and updated_soc_results.resources[0].status.phase == 'Successful'"

ibm/operator_collection_sdk/playbooks/roles/pre_check/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
- name: Read operator-config.yml
5454
ansible.builtin.set_fact:
55-
operator_config: "{{ lookup('template', '{{ oc_file_results.files[0].path }}')|from_yaml }}"
55+
operator_config: "{{ lookup('template', '{{ oc_file_results.files[0].path }}')| from_yaml | to_json | from_json }}"
5656

5757
- name: Set operator variables
5858
ansible.builtin.set_fact:

ibm/operator_collection_sdk/playbooks/roles/upload_collection_to_manager/tasks/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@
5050
msg: "OperatorCollection doesn't exist"
5151
when: soc_results.resources | length > 0 and oc_results.resources | length == 0
5252

53-
- name: Copy local build to manager pod
53+
- name: Copy local build to manager pod using existing collection path
5454
ansible.builtin.command: oc cp {{ find_result.files[0].path }} "{{ pod_results.resources[0].metadata.namespace }}/{{ pod_results.resources[0].metadata.name }}":"{{ oc_results.resources[0].status.config.collectionPath }}"
55-
when: soc_results.resources | length > 0 and oc_results.resources | length > 0
55+
when: soc_results.resources | length > 0 and oc_results.resources | length > 0 and (redeploy is not defined or redeploy is false)
5656

5757
- name: Create directory on pod if doesn't exist
5858
ansible.builtin.command: oc exec -i -n "{{ pod_results.resources[0].metadata.namespace }}" "{{ pod_results.resources[0].metadata.name }}" -- mkdir -p /opt/collections/suboperator/{{ operator_name }}/{{ operator_version }}
59-
when: soc_results.resources | length == 0
59+
when: soc_results.resources | length == 0 and (redeploy is not defined or redeploy is false)
6060

61-
- name: Copy local build to manager pod during initial operator creation
61+
- name: Copy local build to manager pod using new collection path
6262
ansible.builtin.command: oc cp {{ find_result.files[0].path }} "{{ pod_results.resources[0].metadata.namespace }}/{{ pod_results.resources[0].metadata.name }}":/opt/collections/suboperator/{{ operator_name }}/{{ operator_version }}/{{ find_result.files[0].path | basename }}
63-
when: soc_results.resources | length == 0
63+
when: soc_results.resources | length == 0 or (redeploy is defined and redeploy is true)

0 commit comments

Comments
 (0)