{"record":{"id":"65833599e095232c","repo":"istio/istio","slug":"expecting-a-workloadgroup-artifact-file-or-the-nam","errorCode":null,"errorMessage":"expecting a WorkloadGroup artifact file or the name and namespace of an existing WorkloadGroup","messagePattern":"expecting a WorkloadGroup artifact file or the name and namespace of an existing WorkloadGroup","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"istioctl/pkg/workload/workload.go","lineNumber":217,"sourceCode":"}\n\nfunc configureCommand(ctx cli.Context) *cobra.Command {\n\tvar opts clioptions.ControlPlaneOptions\n\n\tconfigureCmd := &cobra.Command{\n\t\tUse:   \"configure\",\n\t\tShort: \"Generates all the required configuration files for a workload instance running on a VM or non-Kubernetes environment\",\n\t\tLong: `Generates all the required configuration files for workload instance on a VM or non-Kubernetes environment from a WorkloadGroup artifact.\nThis includes a MeshConfig resource, the cluster.env file, and necessary certificates and security tokens.\nConfigure requires either the WorkloadGroup artifact path or its location on the API server.`,\n\t\tExample: `  # configure example using a local WorkloadGroup artifact\n  istioctl x workload entry configure -f workloadgroup.yaml -o config\n\n  # configure example using the API server\n  istioctl x workload entry configure --name foo --namespace bar -o config`,\n\t\tArgs: func(cmd *cobra.Command, args []string) error {\n\t\t\tif filename == \"\" && (name == \"\" || namespace == \"\") {\n\t\t\t\treturn fmt.Errorf(\"expecting a WorkloadGroup artifact file or the name and namespace of an existing WorkloadGroup\")\n\t\t\t}\n\t\t\tif outputDir == \"\" {\n\t\t\t\treturn fmt.Errorf(\"expecting an output directory\")\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tkubeClient, err := ctx.CLIClientWithRevision(ctx.RevisionOrDefault(opts.Revision))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\twg := &clientnetworking.WorkloadGroup{}\n\t\t\tif filename != \"\" {\n\t\t\t\tif err := readWorkloadGroup(filename, wg); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/istio/istio/blob/8dc789c5cf17517c64e3c36cb3288230f149dfae/istioctl/pkg/workload/workload.go#L199-L235","documentation":"Args validator of `istioctl x workload entry configure` (istioctl/pkg/workload/workload.go:217). The command needs either a local WorkloadGroup artifact (-f) or both --name and --namespace to fetch one from the API server; if filename is empty and either name or namespace is empty it aborts with this error before touching the cluster.","triggerScenarios":"`istioctl x workload entry configure -o config` alone; `configure --name foo -o config` (namespace missing); `configure -f missing-and-no-name` (empty -f combined with partial identity flags).","commonSituations":"Operators configuring VMs who forget the file was never copied onto the VM; scripts where only one of name/namespace is parameterized; example commands copy-pasted without the -f or --name/--namespace part.","solutions":["Provide the artifact: `istioctl x workload entry configure -f workloadgroup.yaml -o config`","Or provide full identity: `istioctl x workload entry configure --name foo --namespace bar -o config`","If using the API server path, double-check BOTH --name and -n are set","Verify the artifact file exists on this machine before running"],"exampleFix":"# before\nistioctl x workload entry configure -o config\n# after\nistioctl x workload entry configure -f workloadgroup.yaml -o config","handlingStrategy":"validation","validationCode":"if [ -z \"$FILE\" ] && { [ -z \"$WG_NAME\" ] || [ -z \"$WG_NS\" ]; }; then\n  echo \"need -f <file> OR both --name and --namespace\" >&2; exit 2\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Choose one source of truth per run: artifact file or API identity, never mix","Test -f \"$FILE\" && [ -s \"$FILE\" ] before passing it, so an empty/missing file fails early","Document in runbooks that BOTH --name and -n are required when -f is absent"],"tags":["istioctl","workload","vm","cli-usage","argument-validation"],"backgroundTag":null,"analyzedSha":"8dc789c5cf17517c64e3c36cb3288230f149dfae","analyzedAt":"2026-08-15T15:16:55.434Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}