Skip to content

Commit

Permalink
fix: remove break
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Sukhin <[email protected]>
  • Loading branch information
vsukhin committed Jan 15, 2025
1 parent 9a76197 commit bb9bfb2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/crd/crd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func TestGenerateYAML(t *testing.T) {

t.Run("generate single CRD yaml", func(t *testing.T) {
// given
expected := "apiVersion: executor.testkube.io/v1\nkind: Webhook\nmetadata:\n name: name1\n namespace: namespace1\n labels:\n key1: value1\n annotations:\n key2: value2 \nspec:\n events:\n - start-test\n uri: http://localhost\n selector: app=backend\n payloadObjectField: text\n payloadTemplate: {{ .Id }}\n payloadTemplateReference: ref\n headers:\n Content-Type: appication/xml\n disabled: true\n config:\n var1:\n value: pb\n var2:\n secret:\n namespace: ns\n name: secret\n key: pr\n parameters:\n var3:\n description: descr\n required: true\n example: 12345\n default: 0\n pattern: [0-9]*\n webhookTemplateRef:\n name: tmpl\n\n"
expected := "apiVersion: executor.testkube.io/v1\nkind: Webhook\nmetadata:\n name: name1\n namespace: namespace1\n labels:\n key1: value1\n annotations:\n key2: value2 \nspec:\n events:\n - start-test\n uri: http://localhost\n selector: app=backend\n payloadObjectField: text\n payloadTemplate: {{ .Id }}\n payloadTemplateReference: ref\n headers:\n Content-Type: appication/xml\n disabled: true\n config:\n var1:\n value: pb\n var2:\n secret:\n namespace: ns\n name: secret\n key: pr\n parameters:\n var3:\n description: descr\n required: true\n example: 12345\n default: 0\n pattern: [0-9]*\n webhookTemplateRef:\n name: tmpl\n"
webhooks := []testkube.Webhook{
{
Name: "name1",
Expand Down Expand Up @@ -57,7 +57,7 @@ func TestGenerateYAML(t *testing.T) {

t.Run("generate multiple CRDs yaml", func(t *testing.T) {
// given
expected := "apiVersion: executor.testkube.io/v1\nkind: Webhook\nmetadata:\n name: name1\n namespace: namespace1\n labels:\n key1: value1\n annotations:\n key3: value3 \nspec:\n events:\n - start-test\n uri: http://localhost\n selector: app=backend\n payloadObjectField: text\n payloadTemplate: {{ .Id }}\n payloadTemplateReference: ref\n headers:\n Content-Type: appication/xml\n disabled: true\n config:\n var1:\n value: pb\n var2:\n secret:\n namespace: ns\n name: secret\n key: pr\n parameters:\n var3:\n description: descr\n required: true\n example: 12345\n default: 0\n pattern: [0-9]*\n webhookTemplateRef:\n name: tmpl\n\n\n---\napiVersion: executor.testkube.io/v1\nkind: Webhook\nmetadata:\n name: name2\n namespace: namespace2\n labels:\n key2: value2\n annotations:\n key4: value4 \nspec:\n events:\n - end-test-success\n uri: http://localhost\n selector: app=backend\n payloadObjectField: text\n payloadTemplate: {{ .Id }}\n payloadTemplateReference: ref\n headers:\n Content-Type: appication/xml\n disabled: true\n config:\n var1:\n value: pb\n var2:\n secret:\n namespace: ns\n name: secret\n key: pr\n parameters:\n var3:\n description: descr\n required: true\n example: 12345\n default: 0\n pattern: [0-9]*\n webhookTemplateRef:\n name: tmpl\n\n"
expected := "apiVersion: executor.testkube.io/v1\nkind: Webhook\nmetadata:\n name: name1\n namespace: namespace1\n labels:\n key1: value1\n annotations:\n key3: value3 \nspec:\n events:\n - start-test\n uri: http://localhost\n selector: app=backend\n payloadObjectField: text\n payloadTemplate: {{ .Id }}\n payloadTemplateReference: ref\n headers:\n Content-Type: appication/xml\n disabled: true\n config:\n var1:\n value: pb\n var2:\n secret:\n namespace: ns\n name: secret\n key: pr\n parameters:\n var3:\n description: descr\n required: true\n example: 12345\n default: 0\n pattern: [0-9]*\n webhookTemplateRef:\n name: tmpl\n\n---\napiVersion: executor.testkube.io/v1\nkind: Webhook\nmetadata:\n name: name2\n namespace: namespace2\n labels:\n key2: value2\n annotations:\n key4: value4 \nspec:\n events:\n - end-test-success\n uri: http://localhost\n selector: app=backend\n payloadObjectField: text\n payloadTemplate: {{ .Id }}\n payloadTemplateReference: ref\n headers:\n Content-Type: appication/xml\n disabled: true\n config:\n var1:\n value: pb\n var2:\n secret:\n namespace: ns\n name: secret\n key: pr\n parameters:\n var3:\n description: descr\n required: true\n example: 12345\n default: 0\n pattern: [0-9]*\n webhookTemplateRef:\n name: tmpl\n"
webhooks := []testkube.Webhook{
{
Name: "name1",
Expand Down
1 change: 0 additions & 1 deletion pkg/crd/templates/webhook.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,3 @@ spec:
webhookTemplateRef:
name: {{ .WebhookTemplateRef.Name }}
{{- end }}

0 comments on commit bb9bfb2

Please sign in to comment.