kubernetes/kops · error

Volume.Name is required

Error message

Volume.Name is required

What it means

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.

Source

Thrown at upup/pkg/fi/cloudup/linodetasks/volume.go:51

	ID        *int
	Lifecycle fi.Lifecycle
	Region    *string
	SizeGB    *int
	Tags      []string
}

var _ fi.CloudupTask = &Volume{}
var _ fi.CompareWithID = &Volume{}

func (v *Volume) CompareWithID() *string {
	return v.Name
}

func (v *Volume) Find(c *fi.CloudupContext) (*Volume, error) {
	cloud := c.T.Cloud.(linode.LinodeCloud)
	name := fi.ValueOf(v.Name)
	if name == "" {
		return nil, fmt.Errorf("Volume.Name is required")
	}
	label := truncate.TruncateString(linode.NormalizeLinodeLabel(name), truncate.TruncateStringOptions{MaxLength: 32})
	listOptions, err := linode.ListOptionsForLabel(label)
	if err != nil {
		return nil, err
	}

	volumes, err := cloud.Client().ListVolumes(c.Context(), listOptions)
	if err != nil {
		return nil, fmt.Errorf("error listing Akamai (Linode) volumes: %w", err)
	}

	if len(volumes) == 0 {
		return nil, nil
	}

	// Name is unique, so we should only have one match
	matched := volumes[0]

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Set the volume's name in the cluster spec / task definition so v.Name is a non-empty string
  2. Check the template or manifest that produced the Volume task for a missing or empty name field
  3. Guard earlier with fi.RequiredField("Name") in Default/Validate so the failure surfaces at validation time instead of Find

Example fix

// before
volumes:
  - sizeGB: 100
    region: us-east
// after
volumes:
  - name: my-cluster-volumes
    sizeGB: 100
    region: us-east
Defensive patterns

Strategy: validation

Validate before calling

func validateVolume(v *linodetasks.Volume) error {
  if v == nil || v.Name == nil || fi.ValueOf(v.Name) == "" {
    return fmt.Errorf("Volume.Name is required")
  }
  return nil
}

Type guard

func hasName(v *linodetasks.Volume) bool {
  return v != nil && v.Name != nil && fi.ValueOf(v.Name) != ""
}

Prevention

When it happens

Trigger: Volume.Find is invoked (e.g. via fi build/discovery of the task) with v.Name == nil or pointing to an empty string.

Common situations: 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.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/b8defba1cb0d5d60. Report an issue: GitHub.