Skip to content

Commit

Permalink
Merge pull request #152 from upbound/backport-151-to-release-0.6
Browse files Browse the repository at this point in the history
[Backport release-0.6] Fix resource import test's new and old ID assertion
  • Loading branch information
ulucinar authored Oct 10, 2023
2 parents ccf0d63 + 4f00635 commit e94a8f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/templates/02-assert.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ commands:
{{- end }}
{{- end }}
{{- if not $resource.Namespace }}
- script: new_id=$(${KUBECTL} get {{ $resource.KindGroup }}/{{ $resource.Name }} -o=jsonpath='{.status.atProvider.id}') && old_id=$(${KUBECTL} get {{ $resource.KindGroup }}/{{ $resource.Name }} -o=jsonpath='{.metadata.annotations.uptest-old-id}') && [ "$new_id" == "$old_id" ]
- script: new_id="$(${KUBECTL} get {{ $resource.KindGroup }}/{{ $resource.Name }} -o=jsonpath='{.status.atProvider.id}')" && old_id="$(${KUBECTL} get {{ $resource.KindGroup }}/{{ $resource.Name }} -o=jsonpath='{.metadata.annotations.uptest-old-id}')" && [ "$new_id" = "$old_id" ]
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions internal/templates/renderer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ timeout: 10
commands:
- script: echo "Dump MR manifests for the import assertion step:"; ${KUBECTL} get managed -o yaml
- command: ${KUBECTL} wait s3.aws.upbound.io/example-bucket --for=condition=Test --timeout 10s
- script: new_id=$(${KUBECTL} get s3.aws.upbound.io/example-bucket -o=jsonpath='{.status.atProvider.id}') && old_id=$(${KUBECTL} get s3.aws.upbound.io/example-bucket -o=jsonpath='{.metadata.annotations.uptest-old-id}') && [ "$new_id" == "$old_id" ]
- script: new_id="$(${KUBECTL} get s3.aws.upbound.io/example-bucket -o=jsonpath='{.status.atProvider.id}')" && old_id="$(${KUBECTL} get s3.aws.upbound.io/example-bucket -o=jsonpath='{.metadata.annotations.uptest-old-id}')" && [ "$new_id" = "$old_id" ]
`,
"02-import.yaml": `# This file belongs to the resource import step.
apiVersion: kuttl.dev/v1beta1
Expand Down Expand Up @@ -221,7 +221,7 @@ timeout: 10
commands:
- script: echo "Dump MR manifests for the import assertion step:"; ${KUBECTL} get managed -o yaml
- command: ${KUBECTL} wait s3.aws.upbound.io/example-bucket --for=condition=Test --timeout 10s
- script: new_id=$(${KUBECTL} get s3.aws.upbound.io/example-bucket -o=jsonpath='{.status.atProvider.id}') && old_id=$(${KUBECTL} get s3.aws.upbound.io/example-bucket -o=jsonpath='{.metadata.annotations.uptest-old-id}') && [ "$new_id" == "$old_id" ]
- script: new_id="$(${KUBECTL} get s3.aws.upbound.io/example-bucket -o=jsonpath='{.status.atProvider.id}')" && old_id="$(${KUBECTL} get s3.aws.upbound.io/example-bucket -o=jsonpath='{.metadata.annotations.uptest-old-id}')" && [ "$new_id" = "$old_id" ]
`,
"02-import.yaml": `# This file belongs to the resource import step.
apiVersion: kuttl.dev/v1beta1
Expand Down

0 comments on commit e94a8f6

Please sign in to comment.