{"record":{"id":"b074e0e129814085","repo":"istio/istio","slug":"cannot-create-revision-tag-q-found-existing-cont","errorCode":null,"errorMessage":"cannot create revision tag %q: found existing control plane revision with same name","messagePattern":"cannot create revision tag %q: found existing control plane revision with same name","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"istioctl/pkg/tag/generate.go","lineNumber":186,"sourceCode":"func checkTagNameCollidesWithRevisionName(\n\tctx context.Context,\n\tclient kubernetes.Interface,\n\topts *GenerateOptions,\n) error {\n\tif opts.Generate || opts.Overwrite || opts.Tag == DefaultRevisionName {\n\t\treturn nil\n\t}\n\trevServiceCollisions, err := GetServicesWithRevision(ctx, client, opts.IstioNamespace, opts.Tag)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// abort if there exists a revision with the target tag name\n\trevWebhookCollisions, err := GetWebhooksWithRevision(ctx, client, opts.Tag)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(revWebhookCollisions) > 0 || len(revServiceCollisions) > 0 {\n\t\treturn fmt.Errorf(\"cannot create revision tag %q: found existing control plane revision with same name\", opts.Tag)\n\t}\n\treturn nil\n}\n\nfunc checkControlPlaneExistenceOrDuplicate(\n\tctx context.Context,\n\tclient kubernetes.Interface,\n\topts *GenerateOptions,\n) (*admitv1.MutatingWebhookConfiguration, error) {\n\trevServices, err := GetServicesWithRevision(ctx, client, opts.IstioNamespace, opts.Revision)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(revServices) > 1 {\n\t\treturn nil, fmt.Errorf(\"cannot modify tag: found multiple canonical services with revision %q in namespace %q\", opts.Revision, opts.IstioNamespace)\n\t}\n\trevWebhooks, err := GetWebhooksWithRevision(ctx, client, opts.Revision)","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/istio/istio/blob/8dc789c5cf17517c64e3c36cb3288230f149dfae/istioctl/pkg/tag/generate.go#L168-L204","documentation":"checkTagDuplicate refuses to create a revision tag whose name collides with an existing control plane revision: it lists services labeled with the tag revision in the istio namespace (GetServicesWithRevision) and webhook configurations selecting that revision (GetWebhooksWithRevision); if either returns matches, the tag cannot be created because `istio.io/rev=<tag>` labels would route traffic to both. Note the earlier `checkControlPlaneExistenceOrDuplicate` nil-return quirk: it returns nil (no error) when the canonical revision does NOT exist, and this duplicate check is the hard guard for tag/rev collisions.","triggerScenarios":"`istioctl tag set mytag --revision myrev` where a revision literally named `mytag` already exists — i.e. there is already an istiod service `istiod-mytag` or a webhook configuration for revision `mytag`.","commonSituations":"Choosing a tag name equal to an existing revision (e.g. tagging `default` when a revision named `default` exists, or `stable` when `istiod-stable` is deployed); leftovers from a removed tag whose webhook/service were not cleaned up.","solutions":["Pick a different tag name that matches no existing revision.","Or clean up the colliding artifacts: delete the leftover `istiod-<tag>` service and webhook configuration, then retry.","List current revisions: `istioctl revision list` or `kubectl get svc,mutatingwebhookconfiguration -l istio.io/rev -n istio-system`."],"exampleFix":"# before\nistioctl tag set canary --revision 1-20  # a revision named 'canary' exists\n\n# after\nistioctl tag set prod-canary --revision 1-20","handlingStrategy":"validation","validationCode":"# pre-check for name collisions before tag set\nCOLLIDE=$(kubectl -n istio-system get svc,mutatingwebhookconfiguration -l istio.io/rev=\"$TAG\" -o name 2>/dev/null)\n[ -z \"$COLLIDE\" ] || { echo \"tag '$TAG' already names a revision\" >&2; exit 2; }\nistioctl tag set \"$TAG\" --revision \"$REV\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Choose tag names disjoint from all revision names.","After removing revisions, verify their istiod-<rev> service and webhook are also gone before reusing the name."],"tags":["istioctl","revision-tag","naming-conflict","kubernetes"],"backgroundTag":null,"analyzedSha":"8dc789c5cf17517c64e3c36cb3288230f149dfae","analyzedAt":"2026-08-15T15:16:55.434Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}