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

Resources from gitrepo are reported as existing with targetCustomizations and doNotDeploy: true #2411

Open
1 task done
thehejik opened this issue May 6, 2024 · 1 comment
Labels

Comments

@thehejik
Copy link

thehejik commented May 6, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

With following fleet.yaml from gitrepo its resources are reported as existing even if these resources are actually not deployed on any cluster. After clicking on the resource name Rancher errors out.

defaultNamespace: fleet-nginx-github
targetCustomizations:
- name: dev
  doNotDeploy: true
  clusterSelector:
    matchLabels:
      env: dev

Sample deployment.yaml used together with fleet.yaml:

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: fleet-nginx
  name: fleet-nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: fleet-nginx
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: fleet-nginx
    spec:
      containers:r 
      - image: nginx:alpine
        name: nginx
        ports:
        - containerPort: 80

The clusterSelector matches to a cluster (with env: dev label) where the resources are actually not deployed. The target cluster is correctly ignored but non-existing resources are actually reported:
image

On attempt to click on the non-existing resource name on cluster dhcp12:
image

Rancher errors out:
image

The issue was found when validating #2245 and it is present in Rancher 2.7.7, 2.8.3 and in 2.9-head.

Expected Behavior

Resources that are not deployed on any cluster should not be reported as Ready, esp. for a cluster specified in targetCustomizations and with doNotDeploy: true entry set. Anyway targetCustomizations and doNotDeploy keys are working as expected.

It would be nice if the non-existing resources are not reported as Ready.

Steps To Reproduce

  1. Deploy 2 clusters with k3s, first for local and second for downstream cluster
  2. Install rancher 2.7.7 (or 2.8.3 or 2.9-head) on local cluster
  3. import the second k3s as downstream cluster
  4. Add label env: dev to your downstream cluster
  5. Add a gitrepo in fleet-default namespace with mentioned resources
  6. Observe status of the gitrepo - There are no targets recognized correctly, but resources are reported as Ready
  7. Click on the resource name in gitrepo detail view - there will be error in rancher.

Environment

- Architecture:
- Fleet Version: 0.8, 0.9, 0.10
- Cluster:
  - Provider: k3s
  - Kubernetes Version: any

Logs

No response

Anything else?

No response

@thehejik thehejik changed the title Resources from gitrepo are reported as existing with targetCustomizations and doNotDeploy: true Resources from gitrepo are reported as existing with targetCustomizations and doNotDeploy: true May 6, 2024
@manno
Copy link
Member

manno commented May 29, 2024

After #2115 we should be able to show the resources that are actually deployed per cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants