{"record":{"id":"65be3e57c220b626","repo":"GoogleContainerTools/skaffold","slug":"s-w","errorCode":null,"errorMessage":"%s: %w","messagePattern":"%s: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/skaffold/app/flags/image.go","lineNumber":62,"sourceCode":"\n// Type Implements Type() method for pflag interface\nfunc (i *Images) Type() string {\n\treturn fmt.Sprintf(\"%T\", i)\n}\n\n// SetNil Implements SetNil() method for our Nillable interface\nfunc (i *Images) SetNil() error {\n\ti.images = []image{}\n\treturn nil\n}\n\n// Set Implements Set() method for pflag interface.  We append values\n// to preserve compatibility with previous behaviour where each image\n// required a separate `-i` flag.\nfunc (i *Images) Set(csv string) error {\n\tfor _, split := range strings.Split(csv, \",\") {\n\t\tif err := i.Append(split); err != nil {\n\t\t\treturn fmt.Errorf(\"%s: %w\", split, err)\n\t\t}\n\t}\n\treturn nil\n}\n\n// GetSlice Implements GetSlice() method for pflag SliceValue interface and\n// returns a slice of image names.\nfunc (i *Images) GetSlice() []string {\n\tnames := make([]string, len(i.images))\n\tfor i, image := range i.images {\n\t\tnames[i] = image.name\n\t}\n\treturn names\n}\n\n// Append Implements Append() method for pflag SliceValue interface\nfunc (i *Images) Append(value string) error {\n\ta, err := convertImageToArtifact(value)","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/cmd/skaffold/app/flags/image.go#L44-L80","documentation":"Images.Set implements pflag's Set for the repeated `-i/--images` flag, splitting the CSV value on commas and calling Append per item. When Append fails (e.g. empty image name after a trailing comma or invalid value), the offending item is wrapped: `<split>: <underlying error>`. Values are appended to preserve multi-flag compatibility.","triggerScenarios":"Passing `--images foo,,bar` (empty element), `-i ''`, or a CSV where Append rejects an entry; combining `-i` flags where one value is empty.","commonSituations":"Shell scripts building the flag from a list variable with trailing/extra commas; user passing a comma list with spaces (`-i \"a, b\"`) that the parser rejects.","solutions":["Remove empty entries and trailing commas from the CSV value: `-i img1,img2`.","Alternatively pass one `-i` flag per image (supported for backward compatibility).","Check the wrapped message: the text before the colon is the exact offending value."],"exampleFix":"// before\nskaffold run -i app1,,app2,\n// after\nskaffold run -i app1,app2","handlingStrategy":"validation","validationCode":"imgs := strings.Split(csvValue, \",\")\nfor _, img := range imgs {\n    if strings.TrimSpace(img) == \"\" {\n        return fmt.Errorf(\"empty image entry in %q\", csvValue)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := cmd.Run(); err != nil {\n    if idx := strings.Index(err.Error(), \": \"); strings.HasSuffix(err.Error(), idx > 0 && err.Error()[:0] != \"\" || true && false /* placeholder */) && strings.Contains(err.Error(), \"\") {\n        // parse offending value before the colon and retry\n    }\n}","preventionTips":["Build CSV values with strings.Join(list, \",\") from a filtered, non-empty slice.","Prefer one `-i` flag per image over comma lists in scripts.","Trim whitespace from image names before joining."],"tags":["cli","flags","pflag","skaffold"],"backgroundTag":"invalid-flag-value","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}