kubernetes/kops · error

SSHKey.Name is required

Error message

SSHKey.Name is required

What it means

SSHKey.Find locates the corresponding Linode SSH key for the task. It requires the task's Name (the Linode key label) to look up; if empty it cannot search, so it throws immediately before any API call.

Source

Thrown at upup/pkg/fi/cloudup/linodetasks/sshkey.go:49

type SSHKey struct {
	Name      *string
	ID        *int
	Lifecycle fi.Lifecycle
	PublicKey *fi.Resource
}

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

func (s *SSHKey) CompareWithID() *string {
	return s.Name
}

func (s *SSHKey) Find(c *fi.CloudupContext) (*SSHKey, error) {
	cloud := c.T.Cloud.(linode.LinodeCloud)
	name := fi.ValueOf(s.Name)
	if name == "" {
		return nil, fmt.Errorf("SSHKey.Name is required")
	}

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

	var matched *linodego.SSHKey
	for i := range keys {
		key := &keys[i]
		if key.Label != name {
			continue
		}

		if matched != nil {
			return nil, fmt.Errorf("found multiple SSH keys named %q", name)
		}
		matched = key

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Set the Name field on the SSHKey task to the label of an existing Linode SSH key
  2. Check templating so the name variable isn't empty
  3. Re-run kops update with a complete spec

Example fix

// before
sshKey: {}
// after
sshKey:
  name: my-ssh-key-prod
Defensive patterns

Strategy: validation

Validate before calling

if sshKeyTask.Name == "" { return fmt.Errorf("SSHKey task requires a name matching a Linode SSH key label") }

Prevention

When it happens

Trigger: An SSHKey task in the cluster spec has no Name set, so Find cannot identify which Linode SSH key to match.

Common situations: A spec missing the sshkey name field, a template variable that rendered empty, or a newly added SSHKey task with only the key content supplied.

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/43add6162df8441d. Report an issue: GitHub.