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

uptest e2e fails when namespaced is not specified for the namespaced Claim #38

Open
ytsarev opened this issue Oct 28, 2022 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@ytsarev
Copy link
Member

ytsarev commented Oct 28, 2022

What happened?

The uptest e2e is ambiguously failing when the namespace is not specified for a namespaced Claim

How can we reproduce it?

Consider the Claim example from upbound/platform-ref-gcp#39

cat examples/cluster-claim.yaml
apiVersion: gcp.platformref.upbound.io/v1alpha1
kind: Cluster
metadata:
  name: platform-ref-gcp-cluster
  namespace: default
  annotations:
    uptest.upbound.io/pre-delete-hook: testhooks/delete-release.sh
spec:
 ....

If we remove explicit namespace: default from this Claim it will make uptest failing

   logger.go:42: 16:10:19 | case/0-apply | Error from server (NotFound): postgresqlinstances.gcp.platformref.upbound.io "platform-ref-gcp-db" not found

as the assert will treat it as cluster-scoped resource

cat case/01-assert.yaml
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 2400
commands:
- command: ${KUBECTL} wait cluster.gcp.platformref.upbound.io/platform-ref-gcp-cluster --for=delete --timeout 10s --namespace default
- command: ${KUBECTL} wait postgresqlinstance.gcp.platformref.upbound.io/platform-ref-gcp-db --for=delete --timeout 10s
- command: ${KUBECTL} wait managed --all --for=delete --timeout 10s

meanwhile, the Claim will be put into the automatically generated namespace

k get claim -A
NAMESPACE              NAME                                                                READY   CONNECTION-SECRET          AGE
kuttl-test-good-crow   postgresqlinstance.gcp.platformref.upbound.io/platform-ref-gcp-db   True    platform-ref-gcp-db-conn   47m

Possible solutions

  • teach uptest to construct assert with automatically generated namespace
  • just document the need of explicit namespace specification for the namespace resources

What environment did it happen in?

  • universal-crossplane-1.9.1-up.2
  • uptest v0.2.0
@ytsarev ytsarev added bug Something isn't working needs-epic-link labels Oct 28, 2022
@jeanduplessis jeanduplessis added this to the 1.0 milestone Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants