Skip to content

Conversation

0xavi0
Copy link
Contributor

@0xavi0 0xavi0 commented Sep 26, 2024

Changes the job handling so jobs are deleted after they succeed. Jobs are created when they are needed, this avoids having always a minimum of 1 job per gitrepo resource.

It also deletes the Owns(job) statement from the reconciler setup as we're already setting the controller reference when creating the job and the Owns statement makes extra reconciler calls that are not needed.

Refers to #2870

@0xavi0 0xavi0 force-pushed the 2870-clean-successful-jobs branch 4 times, most recently from b12b7b9 to d2a85d8 Compare September 26, 2024 14:03
@manno manno changed the title Changes job handling in gitopts controller Changes job handling in gitops controller Sep 27, 2024
@0xavi0 0xavi0 force-pushed the 2870-clean-successful-jobs branch 3 times, most recently from d496fa9 to e6cb13b Compare September 27, 2024 15:34
@0xavi0 0xavi0 self-assigned this Sep 27, 2024
@0xavi0 0xavi0 marked this pull request as ready for review September 27, 2024 16:06
@0xavi0 0xavi0 requested a review from a team as a code owner September 27, 2024 16:06
@0xavi0 0xavi0 force-pushed the 2870-clean-successful-jobs branch 3 times, most recently from 2a532e9 to 9afd993 Compare September 30, 2024 14:55
Changes the job handling so jobs are deleted after they succeed.
Jobs are created when they are needed, this avoids having always a minimum of 1 job per
`gitrepo` resource.

It also deletes the Owns(job) statement from the reconciler setup as we're already setting
the controller reference when creating the job and the Owns statement makes extra reconciler
calls that are not needed.

Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
@0xavi0 0xavi0 force-pushed the 2870-clean-successful-jobs branch from 9afd993 to dadd231 Compare October 1, 2024 06:33
Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
@0xavi0 0xavi0 force-pushed the 2870-clean-successful-jobs branch from dadd231 to 453ceea Compare October 1, 2024 06:39
@0xavi0 0xavi0 requested a review from weyfonk October 1, 2024 07:18
@0xavi0 0xavi0 requested a review from weyfonk October 1, 2024 08:05
Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
@0xavi0 0xavi0 merged commit 57c2f83 into rancher:main Oct 1, 2024
12 checks passed
@0xavi0 0xavi0 mentioned this pull request Oct 2, 2024
3 tasks
@kkaempf kkaempf added this to the v2.10.0 milestone Oct 2, 2024
0xavi0 added a commit to 0xavi0/fleet that referenced this pull request Oct 3, 2024
The job also deletes all completed gitjobs, not leaving the last one active, as
rancher#2903 was merged.

Also fixes the ServiceAccount to be able to list and delete jobs.

Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
0xavi0 added a commit to 0xavi0/fleet that referenced this pull request Oct 4, 2024
The job also deletes all completed gitjobs, not leaving the last one active, as
rancher#2903 was merged.

Also fixes the ServiceAccount to be able to list and delete jobs.

Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
0xavi0 added a commit to 0xavi0/fleet that referenced this pull request Oct 7, 2024
* Changes job handling in gitopts controller

Changes the job handling so jobs are deleted after they succeed.
Jobs are created when they are needed, this avoids having always a minimum of 1 job per
`gitrepo` resource.

It also deletes the Owns(job) statement from the reconciler setup as we're already setting
the controller reference when creating the job and the Owns statement makes extra reconciler
calls that are not needed.

---------

Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
0xavi0 added a commit that referenced this pull request Oct 7, 2024
The job also deletes all completed gitjobs, not leaving the last one active, as
#2903 was merged.

Also fixes the ServiceAccount to be able to list and delete jobs.

Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
0xavi0 added a commit to 0xavi0/fleet that referenced this pull request Oct 7, 2024
The job also deletes all completed gitjobs, not leaving the last one active, as
rancher#2903 was merged.

Also fixes the ServiceAccount to be able to list and delete jobs.

Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
0xavi0 added a commit that referenced this pull request Oct 7, 2024
* Changes job handling in gitops controller (#2903)

* Changes job handling in gitopts controller

Changes the job handling so jobs are deleted after they succeed.
Jobs are created when they are needed, this avoids having always a minimum of 1 job per
`gitrepo` resource.

It also deletes the Owns(job) statement from the reconciler setup as we're already setting
the controller reference when creating the job and the Owns statement makes extra reconciler
calls that are not needed.

Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
0xavi0 added a commit that referenced this pull request Oct 7, 2024
The job also deletes all completed gitjobs, not leaving the last one active, as
#2903 was merged.

Also fixes the ServiceAccount to be able to list and delete jobs.

Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants