Skip to content

Commit

Permalink
[minor] Added HMAC to COS role (#1215)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishal-patel-7 authored Aug 30, 2024
1 parent d80f848 commit cee68b0
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 3 deletions.
4 changes: 4 additions & 0 deletions tekton/src/params/install.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@
type: string
description: COS action to be performed (provision or deprovision)
default: ""
- name: use_hmac
type: string
description: Optional boolean variable weather hmac is enabled or not
default: ""

# MAS Integration - Grafana
# -----------------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions tekton/src/pipelines/fvt-deprovision-after.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ spec:
- name: cos_action
type: string
default: ""
- name: use_hmac
type: string
default: ""

# IBM Event Streams
- name: eventstreams_resourcegroup
Expand Down
5 changes: 5 additions & 0 deletions tekton/src/pipelines/gitops/deprovision-mas-deps.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ spec:
- name: ibmcloud_apikey
type: string
default: ""
- name: use_hmac
type: string
default: ""

tasks:
{% if wait_for_deprovision == true %}
Expand Down Expand Up @@ -198,6 +201,8 @@ spec:
value: $(params.ibmcloud_resourcegroup)
- name: ibmcloud_apikey
value: $(params.ibmcloud_apikey)
- name: use_hmac
value: $(params.use_hmac)

workspaces:
- name: configs
Expand Down
6 changes: 6 additions & 0 deletions tekton/src/pipelines/gitops/gitops-mas-deps.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ spec:
type: string
description: COS action to be performed (provision or deprovision)
default: ""
- name: use_hmac
type: string
description: Optional boolean variable weather hmac is enabled or not
default: ""

- name: ibmcloud_apikey
type: string
Expand Down Expand Up @@ -214,6 +218,8 @@ spec:
value: $(params.ibmcloud_resourcegroup)
- name: ibmcloud_apikey
value: $(params.ibmcloud_apikey)
- name: use_hmac
value: $(params.use_hmac)

workspaces:
- name: configs
Expand Down
6 changes: 5 additions & 1 deletion tekton/src/pipelines/install.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,14 @@ spec:
# 4. Other Dependecies
# -------------------------------------------------------------------------
# 4.1 Install Cloud Object Storage (COS)
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/dependencies/cos.yml.j2') | indent(4) }}
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/dependencies/cos.yml.j2', template_vars={'suffix': 'system'}) | indent(4) }}
runAfter:
- pre-install-check

{{ lookup('template', pipeline_src_dir ~ '/taskdefs/dependencies/cos.yml.j2', template_vars={'suffix': 'manage'}) | indent(4) }}
runAfter:
- suite-verify

# 4.2 Configure COS in MAS
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/core/suite-config-cos.yml.j2') | indent(4) }}
runAfter:
Expand Down
18 changes: 16 additions & 2 deletions tekton/src/pipelines/taskdefs/dependencies/cos.yml.j2
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
- name: cos
- name: cos-{{ suffix }}
timeout: "0"
params:
{{ lookup('template', pipeline_src_dir ~ '/taskdefs/common/cli-params.yml.j2') | indent(4) }}
- name: devops_suite_name
value: dependencies-cos
value: dependencies-cos-{{ suffix }}

- name: mas_instance_id
value: $(params.mas_instance_id)
Expand All @@ -21,6 +21,20 @@

- name: custom_labels
value: $(params.custom_labels)

{% if suffix == "system" %}
- name: mas_config_scope
value: system
- name: use_hmac
value: false
{% endif %}
{% if suffix == "manage" %}
- name: mas_config_scope
value: wsapp
- name: use_hmac
value: true
{% endif %}

taskRef:
kind: Task
name: mas-devops-cos
Expand Down
6 changes: 6 additions & 0 deletions tekton/src/tasks/dependencies/cos.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ spec:
type: string
description: Name of COS instance in IBM Cloud account
default: ""
- name: use_hmac
type: string
description: Optional boolean variable weather hmac is enabled or not
default: ""


stepTemplate:
Expand Down Expand Up @@ -72,6 +76,8 @@ spec:
value: $(params.cos_resourcegroup)
- name: IBMCLOUD_RESOURCEGROUP
value: $(params.ibmcloud_resourcegroup)
- name: USE_HMAC
value: $(params.use_hmac)
steps:
- name: cos
command:
Expand Down
4 changes: 4 additions & 0 deletions tekton/src/tasks/gitops/gitops-cos.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ spec:
type: string
- name: ibmcloud_apikey
type: string
- name: use_hmac
type: string

stepTemplate:
name: gitops-cos
Expand Down Expand Up @@ -62,6 +64,8 @@ spec:
value: $(params.ibmcloud_resourcegroup)
- name: IBMCLOUD_APIKEY
value: $(params.ibmcloud_apikey)
- name: USE_HMAC
value: $(params.use_hmac)
steps:
- args:
- |-
Expand Down
4 changes: 4 additions & 0 deletions tekton/src/tasks/gitops/gitops-deprovision-cos.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ spec:
type: string
- name: ibmcloud_apikey
type: string
- name: use_hmac
type: string

stepTemplate:
name: gitops-deprovision-cos
Expand Down Expand Up @@ -75,6 +77,8 @@ spec:
value: $(params.ibmcloud_resourcegroup)
- name: IBMCLOUD_APIKEY
value: $(params.ibmcloud_apikey)
- name: USE_HMAC
value: $(params.use_hmac)
steps:
- args:
- |-
Expand Down

0 comments on commit cee68b0

Please sign in to comment.