Skip to content

Commit

Permalink
Merge pull request kedacore#40 from joelsmith/main
Browse files Browse the repository at this point in the history
Revert most of PR kedacore#39
  • Loading branch information
openshift-merge-robot authored May 31, 2023
2 parents b7d5e90 + e608501 commit a1921b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 6 additions & 2 deletions hack/cma-generate-csv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ jq_filter="$jq_filter"'walk(if type == "string" and . == "keda-olm-operator" the
jq_filter="$jq_filter"'del(.spec.replaces) | '
# update the json example CR so that it shows you how to install to "openshift-keda" namespace instead of "keda" namespace
jq_filter="$jq_filter"'.metadata.annotations."alm-examples" |= sub("\"namespace\": \"keda\""; "\"namespace\": \"openshift-keda\"") | '
# create a spot to pass in the operand image specs as env vars
jq_filter="$jq_filter"'.spec.install.spec.deployments[0].spec.template.spec.containers[0].env += [{"name":"KEDA_OPERATOR_IMAGE","value":"CMA_OPERAND_PLACEHOLDER_1"},{"name":"KEDA_METRICS_SERVER_IMAGE","value":"CMA_OPERAND_PLACEHOLDER_2"},{"name":"KEDA_ADMISSION_WEBHOOKS_IMAGE","value":"CMA_OPERAND_PLACEHOLDER_3"}]'
# set the command to bash instead of /manager
jq_filter="$jq_filter"'.spec.install.spec.deployments[0].spec.template.spec.containers[0].command |= [ "/usr/bin/bash" ] |'
# export the env vars and then exec /manager. This hack is needed due to OSBS requiring that env vars have the prefix RELATED_IMAGE_, so bash translates from OSBS-style env vars to operator env vars. See https://osbs.readthedocs.io/en/latest/users.html?highlight=operator#pullspec-locations
jq_filter="$jq_filter"'.spec.install.spec.deployments[0].spec.template.spec.containers[0].args |= ["-c", "export KEDA_OPERATOR_IMAGE=$RELATED_IMAGE_1; export KEDA_METRICS_SERVER_IMAGE=$RELATED_IMAGE_2; export KEDA_ADMISSION_WEBHOOKS_IMAGE=$RELATED_IMAGE_3; exec /manager \"$0\" \"$@\"" ] + . |'
# create a spot to pass in the operand image specs as env vars using OSBS-style RELATED_IMAGE_ names
jq_filter="$jq_filter"'.spec.install.spec.deployments[0].spec.template.spec.containers[0].env += [{"name":"RELATED_IMAGE_1","value":"CMA_OPERAND_PLACEHOLDER_1"},{"name":"RELATED_IMAGE_2","value":"CMA_OPERAND_PLACEHOLDER_2"},{"name":"RELATED_IMAGE_3","value":"CMA_OPERAND_PLACEHOLDER_3"}]'

# pipe the filtered upstream CSV and the patch together to jq to combine them
{ bin/yaml2json keda/${ver}/manifests/keda.v${ver}.clusterserviceversion.yaml | jq "$jq_filter";
Expand Down
10 changes: 6 additions & 4 deletions keda/2.10.1/manifests/cma.v2.10.1.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -561,22 +561,24 @@ spec:
spec:
containers:
- args:
- -c
- export KEDA_OPERATOR_IMAGE=$RELATED_IMAGE_1; export KEDA_METRICS_SERVER_IMAGE=$RELATED_IMAGE_2; export KEDA_ADMISSION_WEBHOOKS_IMAGE=$RELATED_IMAGE_3; exec /manager "$0" "$@"
- --leader-elect
- --zap-log-level=info
- --zap-encoder=console
- --zap-time-encoding=rfc3339
command:
- /manager
- /usr/bin/bash
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
- name: KEDA_OPERATOR_IMAGE
- name: RELATED_IMAGE_1
value: CMA_OPERAND_PLACEHOLDER_1
- name: KEDA_METRICS_SERVER_IMAGE
- name: RELATED_IMAGE_2
value: CMA_OPERAND_PLACEHOLDER_2
- name: KEDA_ADMISSION_WEBHOOKS_IMAGE
- name: RELATED_IMAGE_3
value: CMA_OPERAND_PLACEHOLDER_3
image: ghcr.io/kedacore/keda-olm-operator:2.10.1
imagePullPolicy: Always
Expand Down

0 comments on commit a1921b0

Please sign in to comment.