Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/2310 test env data #2472

Merged
merged 6 commits into from
Nov 14, 2024
Merged

Chore/2310 test env data #2472

merged 6 commits into from
Nov 14, 2024

Conversation

dleard
Copy link
Contributor

@dleard dleard commented Nov 14, 2024

Adds test fixtures specific for the test environment & supporting k8s architecture to load them via a job

- create
apiGroups:
- ''
resources:

Check notice

Code scanning / SonarCloud

Allowing command execution is security sensitive

<!--SONAR_ISSUE_KEY:AZMsjm0MdIJSHOskeSGM-->Remove the command execution permission for this role. <p>See more on <a href="https://sonarcloud.io/project/issues?id=bcgov_cas-registration&issues=AZMsjm0MdIJSHOskeSGM&open=AZMsjm0MdIJSHOskeSGM&pullRequest=2472">SonarQube Cloud</a></p>
Comment on lines 17 to 18
- name: load-test-data
image: openshift/origin-cli
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if we run a command in a pod with our django image?

        - name: load-test-data
          image: "{{ .Values.backend.image.repository }}:{{ .Values.defaultImageTag | default .Values.backend.image.tag }}"
          imagePullPolicy: {{ .Values.backend.image.pullPolicy }}
          env:
            - name: DJANGO_SECRET_KEY
              valueFrom:
                secretKeyRef:
                  key: django-secret-key
                  name: {{ include "cas-bciers.fullname" . }}-backend
            - name: DB_USER
              valueFrom:
                secretKeyRef:
                  key: user
                  name: cas-obps-postgres-pguser-registration
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: password
                  name: cas-obps-postgres-pguser-registration
            - name: DB_NAME
              valueFrom:
                secretKeyRef:
                  key: dbname
                  name: cas-obps-postgres-pguser-registration
            - name: DB_PORT
              valueFrom:
                secretKeyRef:
                  key: pgbouncer-port
                  name: cas-obps-postgres-pguser-registration
            - name: DB_HOST
              valueFrom:
                secretKeyRef:
                  key: pgbouncer-host
                  name: cas-obps-postgres-pguser-registration
            - name: BACKEND_HOST
              value: {{ .Values.backend.route.host }}
          command:
            - bash
            - '-c'
            - |
              poetry run python manage.py load_test_data

@dleard dleard force-pushed the chore/2310-test-env-data branch from 1aaaf6a to 1a0a3b8 Compare November 14, 2024 22:43
@dleard dleard force-pushed the chore/2310-test-env-data branch from 1a0a3b8 to 675cba7 Compare November 14, 2024 22:53
Copy link
Contributor

@pbastia pbastia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@dleard dleard merged commit 87b7517 into develop Nov 14, 2024
40 checks passed
@dleard dleard deleted the chore/2310-test-env-data branch November 14, 2024 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants