Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: scylladb/scylla-operator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f68c5a83dc3f53bdfec469efebedba8df9f7c680
Choose a base ref
..
head repository: scylladb/scylla-operator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 98d48f57b0554767fb18529048df239634e99581
Choose a head ref
Showing with 56 additions and 40 deletions.
  1. +56 −40 hack/ci-deploy-release.sh
96 changes: 56 additions & 40 deletions hack/ci-deploy-release.sh
Original file line number Diff line number Diff line change
@@ -111,69 +111,85 @@ fi

if [[ -n "${SO_SCYLLA_OPERATOR_RESOURCE_REQUESTS_CPU:-}" ]]; then
# SO_SCYLLA_OPERATOR_RESOURCE_REQUESTS_CPU is set and nonempty.
cat > "${ARTIFACTS_DEPLOY_DIR}/operator/cpu-requests.scylla-operator.deployment.patch.json" << EOF
[{"op": "add", "path": "/spec/template/spec/containers/0/resources/requests/cpu", "value": "${SO_SCYLLA_OPERATOR_RESOURCE_REQUESTS_CPU}"}]
EOF

cat << EOF | \
yq eval-all --inplace 'select(fileIndex == 0) as $f | select(fileIndex == 1) as $p | with( $f.patches; . += $p | ... style="") | $f' "${ARTIFACTS_DEPLOY_DIR}/operator/kustomization.yaml" -
path: "${ARTIFACTS_DEPLOY_DIR}/operator/cpu-requests.scylla-operator.deployment.patch.json"
target:
group: apps
version: v1
kind: Deployment
name: scylla-operator
- patch: |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: scylla-operator
namespace: scylla-operator
spec:
template:
spec:
containers:
- name: scylla-operator
resources:
requests:
cpu: "${SO_SCYLLA_OPERATOR_RESOURCE_REQUESTS_CPU}"
EOF
fi

if [[ -n "${SO_SCYLLA_OPERATOR_RESOURCE_REQUESTS_MEMORY:-}" ]]; then
# SO_SCYLLA_OPERATOR_RESOURCE_REQUESTS_MEMORY is set and nonempty.
cat > "${ARTIFACTS_DEPLOY_DIR}/operator/memory-requests.scylla-operator.deployment.patch.json" << EOF
[{"op": "add", "path": "/spec/template/spec/containers/0/resources/requests/memory", "value": "${SO_SCYLLA_OPERATOR_RESOURCE_REQUESTS_MEMORY}"}]
EOF

cat << EOF | \
yq eval-all --inplace 'select(fileIndex == 0) as $f | select(fileIndex == 1) as $p | with( $f.patches; . += $p | ... style="") | $f' "${ARTIFACTS_DEPLOY_DIR}/operator/kustomization.yaml" -
path: "${ARTIFACTS_DEPLOY_DIR}/operator/memory-requests.scylla-operator.deployment.patch.json"
target:
group: apps
version: v1
kind: Deployment
name: scylla-operator
- patch: |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: scylla-operator
namespace: scylla-operator
spec:
template:
spec:
containers:
- name: scylla-operator
resources:
requests:
memory: "${SO_SCYLLA_OPERATOR_RESOURCE_REQUESTS_MEMORY}"
EOF
fi

if [[ -n "${SO_SCYLLA_OPERATOR_RESOURCE_LIMITS_CPU:-}" ]]; then
# SO_SCYLLA_OPERATOR_RESOURCE_LIMITS_CPU is set and nonempty.
cat > "${ARTIFACTS_DEPLOY_DIR}/operator/cpu-limits.scylla-operator.deployment.patch.json" << EOF
[{"op": "add", "path": "/spec/template/spec/containers/0/resources/limits/cpu", "value": "${SO_SCYLLA_OPERATOR_RESOURCE_LIMITS_CPU}"}]
EOF

cat << EOF | \
yq eval-all --inplace 'select(fileIndex == 0) as $f | select(fileIndex == 1) as $p | with( $f.patches; . += $p | ... style="") | $f' "${ARTIFACTS_DEPLOY_DIR}/operator/kustomization.yaml" -
path: "${ARTIFACTS_DEPLOY_DIR}/operator/cpu-limits.scylla-operator.deployment.patch.json"
target:
group: apps
version: v1
kind: Deployment
name: scylla-operator
- patch: |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: scylla-operator
namespace: scylla-operator
spec:
template:
spec:
containers:
- name: scylla-operator
resources:
limits:
cpu: "${SO_SCYLLA_OPERATOR_RESOURCE_LIMITS_CPU}"
EOF
fi

if [[ -n "${SO_SCYLLA_OPERATOR_RESOURCE_LIMITS_MEMORY:-}" ]]; then
# SO_SCYLLA_OPERATOR_RESOURCE_LIMITS_MEMORY is set and nonempty.
cat > "${ARTIFACTS_DEPLOY_DIR}/operator/memory-limits.scylla-operator.deployment.patch.json" << EOF
[{"op": "add", "path": "/spec/template/spec/containers/0/resources/limits/memory", "value": "${SO_SCYLLA_OPERATOR_RESOURCE_LIMITS_MEMORY}"}]
EOF

cat << EOF | \
yq eval-all --inplace 'select(fileIndex == 0) as $f | select(fileIndex == 1) as $p | with( $f.patches; . += $p | ... style="") | $f' "${ARTIFACTS_DEPLOY_DIR}/operator/kustomization.yaml" -
path: "${ARTIFACTS_DEPLOY_DIR}/operator/memory-limits.scylla-operator.deployment.patch.json"
target:
group: apps
version: v1
kind: Deployment
name: scylla-operator
- patch: |-
apiVersion: apps/v1
kind: Deployment
metadata:
name: scylla-operator
namespace: scylla-operator
spec:
template:
spec:
containers:
- name: scylla-operator
resources:
limits:
memory: "${SO_SCYLLA_OPERATOR_RESOURCE_LIMITS_MEMORY}"
EOF
fi