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

feat(charts): provide more control over helm tests #137

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

schahal
Copy link

@schahal schahal commented Mar 7, 2025

Motivation

There are times when we need a bit more control over the Pod that's run in helm test. For example:

  • Update the image to use a different repository (like a pull-thru cache)
  • Disable a test entirely due to a finicky CI or local network
  • Should a future test image have a breaking change, we can update args/commands via values as a quick workaround rather than waiting for a new helm release

Changes

This change pulls the defaults into the values.yaml for that control.

Optionally, we can enable/disable any of the tests.

Testing

Ran helm template test . before and after the change and confirmed the rendered templates are the same except for:

  • adding an explicit latest tag for the busybox image
  • formatting of command/args list
--- /tmp/localstack-orig.yaml	2025-03-07 09:35:10
+++ /tmp/localstack-new.yaml	2025-03-07 09:34:16
@@ -494,9 +494,15 @@
 spec:
   containers:
     - name: wget-edge
-      image: busybox
-      command: ['wget']
-      args: ['-q', '--server-response', '--output-document', '-', 'test-localstack:4566/_localstack/health']
+      image: busybox:latest
+      command:
+        - wget
+      args:
+        - "-q"
+        - "--server-response"
+        - "--output-document"
+        - "-"
+        - "test-localstack:4566/_localstack/health"
   restartPolicy: Never
 ---
 # Source: localstack/templates/tests/test-s3.yaml
@@ -517,7 +523,12 @@
   containers:
     - name: awscli-s3
       image: amazon/aws-cli
-      args: ['--debug', '--endpoint-url', 'http://test-localstack:4566', 's3', 'ls']
+      args:
+        - "--debug"
+        - "--endpoint-url"
+        - "http://test-localstack:4566"
+        - "s3"
+        - "ls"
       env:
       - name: AWS_ACCESS_KEY_ID
         value: test

@schahal schahal requested a review from alexrashed as a code owner March 7, 2025 17:45
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.

1 participant