fleet
fleet copied to clipboard
Resources from gitrepo are reported as existing with `targetCustomizations` and `doNotDeploy: true`
Is there an existing issue for this?
- [X] 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:
On attempt to click on the non-existing resource name on cluster dhcp12:
Rancher errors out:
The issue was found when validating https://github.com/rancher/fleet/issues/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
- Deploy 2 clusters with k3s, first for local and second for downstream cluster
- Install rancher 2.7.7 (or 2.8.3 or 2.9-head) on local cluster
- import the second k3s as downstream cluster
- Add label
env: dev
to your downstream cluster - Add a gitrepo in
fleet-default
namespace with mentioned resources - Observe status of the gitrepo - There are no targets recognized correctly, but resources are reported as
Ready
- 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