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

Failed to plan when there are resources that have multi-API versions on the v0.47.3-rc0 #4981

Open
ffjlabo opened this issue Jun 19, 2024 · 1 comment
Assignees
Labels
area/piped kind/bug Something isn't working

Comments

@ffjlabo
Copy link
Member

ffjlabo commented Jun 19, 2024

What happened:

Failed to plan when the gatekeeper's constraint template that has multi api version on the v0.47.3-rc0.

340704613-1b23754d-3c64-4d7b-867c-f1205d011869_png__1595×362_

What you expected to happen:

It would be nice to plan the deployment.

How to reproduce it:

  • Prepare Gatekeeper
  • Apply 2 ConstraintTemplate of templates.gatekeeper.sh/v1beta1 on the old version’s piped and then update the piped to the v0.47.3-rc0
/constraint-template/
  - app.pipecd.yaml
  - k8srequiredlabels_template.yaml
  - k8suniquelabel_template.yaml <- delete
  • Delete one of the resources

Environment:

  • piped version: v0.47.3-rc0
  • control-plane version:
  • Others:
@ffjlabo ffjlabo added the kind/bug Something isn't working label Jun 19, 2024
@ffjlabo
Copy link
Member Author

ffjlabo commented Jun 19, 2024

Why this happened
When checking the resource ConstraintTemplate templates.gatekeeper.sh/v1beta1, it fails because it is considered as not found.

This is related to the fix for #4916

Currently, piped checks whether the resource is cluster-scoped or not by using the resource info from the actual cluster.
The resource info is based on the preferred version which is determined by each resource.
ref: https://pkg.go.dev/k8s.io/client-go/discovery#DiscoveryClient.ServerPreferredResources

Gatekeeper allows us to use templates.gatekeeper.sh/v1beta1 or templates.gatekeeper.sh/v1.
And use templates.gatekeeper.sh/v1 as preferred apiVersion.

It might be good to use the preferred version for the resource key.
But we need to get info about the preferred version to use (e.g. how to create it?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/piped kind/bug Something isn't working
Projects
Status: 🌮 Postponed
Status: In Progress
Development

No branches or pull requests

1 participant