Repository navigation
fix(agents): keep an organization's content path when its last agent goes - #520
Merged
Merged
Conversation
…goes delete_agent in mode commit of the last agent of a content path without kustomization.yaml adds <content path>/.gitkeep when git lacks it, so Flux builds an empty kustomization and prunes the HelmRelease. The marker is one definition, agents.KeepFile and agents.KeepContent, which the organization writes use too. Part of #502
Published Helm chart
|
| Chart | agent-manager |
| Version | 4.1.2-r998d20c7t20261201161749h37201e6 |
| OCI reference | oci://gsoci.azurecr.io/charts/giantswarm/agent-manager:4.1.2-r998d20c7t20261201161749h37201e6 |
| Digest | sha256:9121fca1e285fece9877ef7f3a9350a7378f4d6aa02e3ec228626297ac2240b4 |
| 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 4.1.2-r998d20c7t20261201161749h37201e6Posted by architect-orb · build 14113 · commit 37201e6 · 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 #502
Problem
An organization's content path can have no
kustomization.yaml(an organization created in mode apply): Flux then generates its kustomization. When it holds onlyagent-manager/with one agent,delete_agentin mode commit removes the agent's file andagent-manager/kustomization.yaml. Git keeps no empty directory, so after the merge the content path is gone. The organization's Kustomization then fails with "kustomization path not found" before it prunes, the agent's HelmRelease stays, and no later change of the organization is applied until a person restores the path (#502 item 3).Change
agent-manager/kustomization.yaml), and the base branch has neither<content path>/kustomization.yamlnor<content path>/.gitkeep, the pull request also adds<content path>/.gitkeep. Flux's generator builds a path without YAML files as an empty kustomization, so the HelmRelease is pruned. A dry run shows the.gitkeepincommit.files.kustomization.yaml(it stays, without theagent-managerentry), whenagent-manager/keeps other agents, or when the target is not an organization's content path (Follow-ups of leaving a content path without kustomization.yaml to Flux #502 item 4).agents.KeepFileandagents.KeepContent, which the organization writes (leaveToFlux, from fix(organizations): leave a content path without kustomization.yaml to Flux's generated kustomization #503) now use too. Its content is unchanged.agentCommit.open(internal/agents/commit.go);cmd/serve.go,internal/agents/service.goandinternal/api/mcp.goare not changed.docs/organizations-commit-mode.mdhas one new bullet.Tests
TestCommitDeleteOfAnOrganizationsLastAgentKeepsItsContentPath(internal/agents/commit_test.go): delete of the last agent of a content path withoutkustomization.yaml, with the organization's Kustomization refused and read, adds the.gitkeepon the dry run and on the pull request's head; a content path with akustomization.yaml, a.gitkeepalready in git, and another agent inagent-manager/add none. The two adding cases fail on main.go test ./internal/agents/ ./internal/organizations/ ./internal/api/and golangci-lint pass.Review
delete_agentwith a target the caller names (repository,branch,path) equal to the content path goes throughexplicitLocation, is not marked as the content path and gets no.gitkeep. The fix of #502 item 4 (the.gitkeepfor every target) covers it.