Repository navigation
fix: offer --slug on update only where the API acts on it - #4
Merged
Merged
Conversation
Customers, deployment zones, entitlements, entitlement groups, licenses and service accounts are never renamed: their update accepts the slug already in the path and refuses any other. Their update commands still offered --slug, and the SDK dropped the field, so `entitlements update webhook --slug webhooks` printed "Entitlement updated", exited 0 and left the slug alone. --slug is now registered on create only for those six, so passing it to update is an unknown flag and exits 2. Components and instances keep it on update, where the API does act on a slug. Signed-off-by: Alexandre Bergere <alexandre.bergere@kaiten.sh>
backtrack5r3 (tomflenner)
approved these changes
Oct 8, 2026
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.
Problem
Customers, deployment zones, entitlements, entitlement groups, licenses and service accounts are never renamed. Their update accepts the slug already in the path and refuses any other with a 422,
<Operation>.SlugNotRenameable.Their
updatecommands still offered--slug, andsdk-godropped the field before sending it. Found on noprod:kaiten entitlements update webhook-2bb271 --slug webhookprinted "Entitlement updated", exited 0 and left the slug as it was.Change
--slugis registered oncreateonly, through a smallregisterSlugnext to eachregister. Passing it toupdateis an unknown flag and exits2, and--helpno longer advertises it.components updateandinstances updatekeep--slug: the API acts on it there, with a new component version or an instance rename.Tests
TestSlugFlagIsOfferedOnlyWhereTheAPIActsOnItpins which create and update commands carry--slug.TestExitCodeForUsageMistakesgainsentitlements update … --slug …, which must exit 2.mainand pass here.task lint: 0 issues.go test -race ./...: green.Not covered here
A slug inside
--fileor--payloadis still dropped bysdk-gov0.0.1. kaitencloud/sdk-go#4 fixes that by sending the slug so the API can refuse it. Once that is released, bumpingsdk-gohere turns that case into exit5with the API's message.🤖 Generated with Claude Code · ✅ Tested and approved by Alex (@Alexkuva), maintainer