Skip to content

Commit

Permalink
add checksum annotation for replicated-secret
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig O'Donnell committed Oct 4, 2023
1 parent 32c2257 commit 52f976c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/actions/validate-endpoints/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ inputs:
description: 'License fields to validate'
required: false
default: '[]'
version-label:
description: 'Version label to validate'
required: false
default: ''
integration-enabled:
description: 'If integration mode is enabled or not'
required: false
Expand Down Expand Up @@ -87,6 +91,8 @@ runs:
- name: Validate /app/info endpoint
shell: bash
env:
VERSION_LABEL: ${{ inputs.version-label }}
run: |
appStatus=$(curl -s --fail --show-error localhost:8888/api/v1/app/info | jq -r .appStatus | tr -d '\n')
Expand All @@ -95,6 +101,15 @@ runs:
exit 1
fi
if [ -n "$VERSION_LABEL" ]; then
versionLabel=$(curl -s --fail --show-error localhost:8888/api/v1/app/info | jq -r .currentRelease.versionLabel | tr -d '\n')
if [ "$versionLabel" != "$VERSION_LABEL" ]; then
echo "Expected version label to be '$VERSION_LABEL', but is '$versionLabel'."
exit 1
fi
fi
- name: Validate /app/updates endpoint
shell: bash
run: |
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
- name: Create release
id: create-release
uses: replicatedhq/replicated-actions/create-release@v1.1.1
uses: replicatedhq/replicated-actions/create-release@v1.5.2
with:
app-slug: ${{ env.APP_SLUG }}
api-token: ${{ secrets.C11Y_MATRIX_TOKEN }}
Expand Down Expand Up @@ -268,6 +268,18 @@ jobs:
license-fields: ${{ env.LICENSE_FIELDS }}
integration-enabled: 'false'

- name: Upgrade via Helm as subchart in production mode to a new version
run: |
helm upgrade test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false --set replicated.versionLabel=1.0.0 --wait --timeout 2m
- name: Validate endpoints
uses: ./.github/actions/validate-endpoints
with:
license-id: ${{ env.LICENSE_ID }}
license-fields: ${{ env.LICENSE_FIELDS }}
version-label: '1.0.0'
integration-enabled: 'false'

- name: Uninstall test-chart via Helm
run: helm uninstall test-chart --wait --timeout 2m

Expand Down
2 changes: 2 additions & 0 deletions chart/templates/replicated-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ spec:
{{- include "replicated.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/replicated-secret: {{ include (print $.Template.BasePath "/replicated-secret.yaml") . | sha256sum }}
labels:
{{- include "replicated.labels" . | nindent 8 }}
spec:
Expand Down

0 comments on commit 52f976c

Please sign in to comment.