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

[SURE-8482] Misleading error message when trying to deploy cluster resources with targetNamespace #2484

Open
kkaempf opened this issue Jun 4, 2024 · 1 comment

Comments

@kkaempf
Copy link
Collaborator

kkaempf commented Jun 4, 2024

Issue description:

When deploying the sample code attached by the client (sample.zip), an error is thrown by Fleet :

Error while running post render on files: invalid cluster scoped object [name=kube-ops-view-2 kind=ClusterRole apiVersion=rbac.authorization.k8s.io/v1] found, consider using "defaultNamespace", not "namespace" in fleet.yaml

This is related to the following GitHub issue: #752.

When GitRepo.spec.targetNamespace is set, Fleet fails at creating cluster-scoped objects (as documented here: https://fleet.rancher.io/ref-crds#gitrepospec).

The error message is misleading and does not point to the actual problem when attempting to deploy cluster-wide resources and having targetNamespace present in the Git Repo.

Repro steps:

Use the sample code (sample.zip) to create a repo
Apply the gitrepo.yaml file with the needed modifications
The error will appear on the UI in the Git Repos section of Continuous Delivery (along with a "Err Applied" state, see "Error message repo.png" for example screenshot)
Comment/remove GitRepo.spec.targetNamespace from the repo
App will be deployed without errors

Workaround:

Is a workaround available and implemented? no

Actual behavior:

The error message speaks about using the defaultNamespace, which is not the problem in practice.

Expected behavior:

The error message in the UI should indicate that using targetNamespace is the cause of the deployment failure of a cluster-wide resource.

Files, logs, traces:

See attachments for sample code and a screenshot of the error message in the UI

@manno
Copy link
Member

manno commented Jun 5, 2024

We should try to make the error message clearer.

As stated in #2065 the error should no longer be overwritten.

@manno manno added this to the v2.9-Next1 milestone Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants