Repository navigation
fix(organizations): leave a content path without kustomization.yaml to Flux's generated kustomization - #503
Merged
Conversation
…o Flux's generated kustomization An organization write in mode commit into a content path without a kustomization.yaml (an organization created in mode apply) created one with its own files only, and the organization's Kustomization then pruned agent-manager/ and every other file that Flux had generated the list from. The write no longer creates that file, also not in a dry run or a credential operation, so Flux keeps generating the list. Part of #498.
A removal of the last file of a content path without kustomization.yaml writes the file with resources: [], so the path stays and Flux prunes. Test the kustomization above the content path, and say in the docs that a kustomization.yml gets no entry.
…tkeep A removal into a content path without kustomization.yaml adds a .gitkeep when git lacks it, instead of listing the path and writing resources: []. Flux keeps generating the list, so an agent merged in parallel or a submodule stays, and the path never disappears.
This was referenced Nov 30, 2026
fiunchinho
marked this pull request as ready for review
November 30, 2026 11:18
Published Helm chart
|
| Chart | agent-manager |
| Version | 3.5.12-rbea61a4ft20261130111713h6c93f98 |
| OCI reference | oci://gsoci.azurecr.io/charts/giantswarm/agent-manager:3.5.12-rbea61a4ft20261130111713h6c93f98 |
| Digest | sha256:b4703f787043cd652950548f5bedace5bea26282b06daeb71bcdedbd1dd35464 |
| Registry | public — gsoci.azurecr.io |
| Git catalog | giantswarm-test-catalog (index) |
Pull this chart
helm pull oci://gsoci.azurecr.io/charts/giantswarm/agent-manager --version 3.5.12-rbea61a4ft20261130111713h6c93f98Posted by architect-orb · build 13563 · commit 6c93f98 · updated in place on every push
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #498
Problem
Item 2 of #498 (R1-1). An organization's content path can have no
kustomization.yaml: git did not get one fromcreate_organizationin mode commit, for example for an organization created in mode apply. Flux then generates the content path's kustomization from its files, withagent-manager/of the agent tools. The next organization write in mode commit (contentWriter.land→orgCommit.open→layout.Build) createdkustomization.yamlwith the write's own files only. After the merge, the organization's Kustomization no longer builtagent-manager/or the other files, and with prune it removed the agents.Change
kustomization.yaml, an organization write in mode commit does not create one, and does not change the kustomization above the content path (leaveToFlux,internal/organizations/commit.go). Flux continues to generate the list. This applies tocontentWriter.landand to the credential operations (prepareCredentialCommit), to dry runs, and to writes that only remove a file.<content path>/.gitkeepwhen git does not have it (one read, no listing). Git keeps no empty directory, and the organization's Kustomization fails on a path that does not exist and prunes nothing. Flux's generator lists YAML files only, so the.gitkeepchanges nothing that Flux applies.delete_organizationremoves it with the content path.kustomization.ymlorKustomizationgets no second kustomization file.kustomization.yaml, nothing changes.create_organizationstill writes the emptykustomization.yamlof a new content path, and the objects path does not change.Tests
TestAnOrganizationWriteAfterItsFirstAgentKeepsTheAgent(internal/api):create_agentin mode commit into a content path withoutkustomization.yaml, merge, thenset_organization_egress_policyin mode commit: the pull request adds nokustomization.yaml, and the agent's files stay. Fails on main.TestOrganizationWritesLeaveAContentPathWithoutKustomizationToFlux: a content path whose agent an older agent-manager merged; a dry run, a write that only removes a file, a content path withkustomization.yml, and a kustomization above the content path with and without its entry. Fails on main.TestRemovingTheLastContentObjectKeepsTheContentPath: the removal of the last object keeps the path, withresources: []where akustomization.yamlexists, and with a.gitkeep(written only when git lacks it) where Flux generates the list.TestCredentialOperationCommitsConsumerAndEncryptedSecretTogether: a credential operation creates no content-pathkustomization.yaml. Fails on main.TestDeleteOrganizationInCommitModeTakesTwoSteps: the delete removes the.gitkeepwith the content path.The change does not touch cmd/serve.go, internal/agents/service.go or internal/api/mcp.go (#483).
Review
First review (Opus, gs-base:review-pr) and second review (Codex, 3 rounds, approved on cd2f02d).
kustomization.ymlorKustomizationnever lists the written objects.Part ofon a line of its own in this body.kustomization.yamlremoved the directory, so Flux pruned nothing. Fixed with the.gitkeep.resources: [], which pruned an agent merged in parallel. The.gitkeepreplaces it..gitkeepneeds no listing..gitkeepneeds no listing, so this no longer applies.#502 also holds two older defects found in this work: the parent step of
layout.Buildlists a directory only in akustomization.yaml, anddelete_agentof the last agent of a content path withoutkustomization.yamlremoves the directory.