{"record":{"id":"b8defba1cb0d5d60","repo":"kubernetes/kops","slug":"volume-name-is-required","errorCode":null,"errorMessage":"Volume.Name is required","messagePattern":"Volume\\.Name is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/linodetasks/volume.go","lineNumber":51,"sourceCode":"\tID        *int\n\tLifecycle fi.Lifecycle\n\tRegion    *string\n\tSizeGB    *int\n\tTags      []string\n}\n\nvar _ fi.CloudupTask = &Volume{}\nvar _ fi.CompareWithID = &Volume{}\n\nfunc (v *Volume) CompareWithID() *string {\n\treturn v.Name\n}\n\nfunc (v *Volume) Find(c *fi.CloudupContext) (*Volume, error) {\n\tcloud := c.T.Cloud.(linode.LinodeCloud)\n\tname := fi.ValueOf(v.Name)\n\tif name == \"\" {\n\t\treturn nil, fmt.Errorf(\"Volume.Name is required\")\n\t}\n\tlabel := truncate.TruncateString(linode.NormalizeLinodeLabel(name), truncate.TruncateStringOptions{MaxLength: 32})\n\tlistOptions, err := linode.ListOptionsForLabel(label)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvolumes, err := cloud.Client().ListVolumes(c.Context(), listOptions)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing Akamai (Linode) volumes: %w\", err)\n\t}\n\n\tif len(volumes) == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// Name is unique, so we should only have one match\n\tmatched := volumes[0]","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/linodetasks/volume.go#L33-L69","documentation":"Volume.Find returns this error when the Volume task's Name field is empty. Find is used to look up an existing Linode volume by label, so without a name no lookup is possible. It is an early guard before any API call is made.","triggerScenarios":"Volume.Find is invoked (e.g. via fi build/discovery of the task) with v.Name == nil or pointing to an empty string.","commonSituations":"A cluster spec defines a volume without a volumeName/name field; a template or manifest omitted the name; fi.ValueOf dereferences a nil *string field.","solutions":["Set the volume's name in the cluster spec / task definition so v.Name is a non-empty string","Check the template or manifest that produced the Volume task for a missing or empty name field","Guard earlier with fi.RequiredField(\"Name\") in Default/Validate so the failure surfaces at validation time instead of Find"],"exampleFix":"// before\nvolumes:\n  - sizeGB: 100\n    region: us-east\n// after\nvolumes:\n  - name: my-cluster-volumes\n    sizeGB: 100\n    region: us-east","handlingStrategy":"validation","validationCode":"func validateVolume(v *linodetasks.Volume) error {\n  if v == nil || v.Name == nil || fi.ValueOf(v.Name) == \"\" {\n    return fmt.Errorf(\"Volume.Name is required\")\n  }\n  return nil\n}","typeGuard":"func hasName(v *linodetasks.Volume) bool {\n  return v != nil && v.Name != nil && fi.ValueOf(v.Name) != \"\"\n}","tryCatchPattern":null,"preventionTips":["Always set name on volume entries in cluster specs and templates","Add fi.RequiredField(\"Name\") checks in task Default/Validate so it fails at plan time","Run kops validate/plan (dry-run) before apply to surface missing fields early"],"tags":["linode","volume","validation","missing-field"],"backgroundTag":"missing-required-argument","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}