Skip to content

Commit

Permalink
Add test for scaffolding a SpinApp with variables
Browse files Browse the repository at this point in the history
Signed-off-by: Kate Goldenring <[email protected]>
  • Loading branch information
kate-goldenring committed Jul 31, 2024
1 parent 8319589 commit 5f068f0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/cmd/scaffold_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,19 @@ func TestScaffoldOutput(t *testing.T) {
},
expected: "keda_autoscaler.yml",
},
{
name: "variables are provided",
opts: ScaffoldOptions{
from: "ghcr.io/foo/example-app:v0.1.0",
replicas: 2,
executor: "containerd-shim-spin",
variables: map[string]string{
"bar": "yee",
"foo": "yoo",
},
},
expected: "variables.yml",
},
}

for _, tc := range testcases {
Expand Down
13 changes: 13 additions & 0 deletions pkg/cmd/testdata/variables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: core.spinoperator.dev/v1alpha1
kind: SpinApp
metadata:
name: example-app
spec:
image: "ghcr.io/foo/example-app:v0.1.0"
executor: containerd-shim-spin
replicas: 2
variables:
- name: bar
value: yee
- name: foo
value: yoo

0 comments on commit 5f068f0

Please sign in to comment.