GithubHelp home page GithubHelp logo

Comments (3)

aruiz14 avatar aruiz14 commented on June 2, 2024

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 (in fleet.yaml) match no clusters should prevent the relevant Content objects from being constantly created and deleted.

from fleet.

thehejik avatar thehejik commented on June 2, 2024

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 a gitRepo is pointing to a non-existing target its contents.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.

thehejik avatar thehejik commented on June 2, 2024

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 testing gitRepo 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 but doNotDeploy: true is set.
  • Once I added env: dev label to my cluster and pushed doNotDeploy: false to my testing repo the contents resource has been created.

All good, closing.

from fleet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.