Comments (3)
Additional QA
Solution
I moved the code that stores the encoded manifests (ensures that a Content
object exists with that content) after the targets are calculated, skipping that step if no targets were found.
Testing
- No regressions should be added due to this change.
- Creating a
bundle
whose targetCustomizations (infleet.yaml
) match no clusters should prevent the relevantContent
objects from being constantly created and deleted.
from fleet.
Test report
This seems to be fixed in fleet:103.1.3+up0.9.3-rc.2
on rancher v2.8-head
On fleet-0.9.2
I was unable to verify that the resource is getting deleted by a cleanup process and recreated automatically afterwards but I verified the resources are not created at all when the target doesn't exist on fleet-0.9.3
so it should prevent the described problem.
Before:
- I could see on previous
fleet-0.9.2
version that even when agitRepo
is pointing to a non-existing target itscontents.fleet.cattle.io
resource is always created and recreated when deleted manually.
After:
- On the other hand, on
fleet-0.9.3
the resource is only created when the target exists.
Note:
I wasn't using fleet.yaml and targetCustomizations
but only rancher UI to select desired Target for my testing gitRepo (No Clusters / All clusters in the Workspace).
Commands used for testing:
$ kubectl get contents.fleet.cattle.io -A -w
# To verify content of contents.fleet.cattle.io resource
$ kubectl get contents.fleet.cattle.io s-f96aa690fa5e38da8499e2a326b688a0db2c9263d88cfd85a243948f1fb41 -o jsonpath='{.content}' | base64 -d | gunzip -
# To delete the content resource
$ kubectl delete contents.fleet.cattle.io -A s-f96aa690fa5e38da8499e2a326b688a0db2c9263d88cfd85a243948f1fb41
from fleet.
Verified also with following targetCustomizations
and doNotDeploy: true
in fleet.yaml:
targetCustomizations:
- name: dev
doNotDeploy: true
clusterSelector:
matchLabels:
env: dev
Before:
(fleet:103.1.2+up0.9.2
)
- the
contents
resource for testinggitRepo
is getting created and deleted periodically when the target doesn't exist:
$ kubectl get contents.fleet.cattle.io -w
NAME AGE
s-503ff6ee308f9d83d835dfb233390776c839d6b1897395aea0e8cbb2c4539 0s
s-503ff6ee308f9d83d835dfb233390776c839d6b1897395aea0e8cbb2c4539 8m25s
s-503ff6ee308f9d83d835dfb233390776c839d6b1897395aea0e8cbb2c4539 0s
s-503ff6ee308f9d83d835dfb233390776c839d6b1897395aea0e8cbb2c4539 8m25s
$ kubectl logs -lapp=fleet-controller -n cattle-fleet-system -f
time="2024-04-12T08:57:32Z" level=info msg="Marking orphaned content[s-503ff6ee308f9d83d835dfb233390776c839d6b1897395aea0e8cbb2c4539] for deletion"
time="2024-04-12T09:02:32Z" level=info msg="Deleting orphaned content[s-503ff6ee308f9d83d835dfb233390776c839d6b1897395aea0e8cbb2c4539]"
time="2024-04-12T09:12:32Z" level=info msg="Marking orphaned content[s-503ff6ee308f9d83d835dfb233390776c839d6b1897395aea0e8cbb2c4539] for deletion"
time="2024-04-12T09:17:32Z" level=info msg="Deleting orphaned content[s-503ff6ee308f9d83d835dfb233390776c839d6b1897395aea0e8cbb2c4539]"
After:
(fleet:103.1.3+up0.9.3-rc.3
)
- the
contents
resource is not created at all when the target doesn't exist nor when the target exists butdoNotDeploy: true
is set. - Once I added
env: dev
label to my cluster and pusheddoNotDeploy: false
to my testing repo thecontents
resource has been created.
All good, closing.
from fleet.
Related Issues (20)
- [SURE-7930] Migrate rancher/build-tekton from Drone to Github Actions HOT 1
- Add tests for status updates
- Allow Force Update and initial clone for a gitrepo with `spec.disablePolling: true` set
- Race condition between gitops and gitrepo controller HOT 1
- Drift correction not working
- Improve CRD documentation (`kubectl explain`) HOT 1
- Feature Request: Enable namespaceAnnotations (and namespaceLabels) as targetCustomizations
- RPC error: ResourceExhausted: trying to send message larger than max 2097152 HOT 3
- cluster.desiredReady is wrong if bundledeployment was deleted HOT 1
- Bundle is not re-generated and Gitrepo status is not updated when deleting a bundle. HOT 1
- metrics: Add metrics to gitops controller
- Enable node selection for shards
- Grafana Dashboard for Metrics
- Fleet Repo doesn't show any error when there is an issue (in fleet 0.9) HOT 1
- Improve Content resources cleanup
- Add extraEnvs to allow setting env vars for the controller
- Error `no matches for kind \"GitRepo\" in version \"fleet.cattle.io/v1alpha1\"` in gitjob logs after start
- Error with stacktrace in gitjob pod after sending a webhook event with wrong credentials
- ‘Continuous Delivery Dashboard’ shows bundles in not ready state
- Force Update on GitRepo is creating multiple job workloads that fill-up the entire pod limit.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fleet.