{"record":{"id":"43add6162df8441d","repo":"kubernetes/kops","slug":"sshkey-name-is-required","errorCode":null,"errorMessage":"SSHKey.Name is required","messagePattern":"SSHKey\\.Name is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/linodetasks/sshkey.go","lineNumber":49,"sourceCode":"type SSHKey struct {\n\tName      *string\n\tID        *int\n\tLifecycle fi.Lifecycle\n\tPublicKey *fi.Resource\n}\n\nvar _ fi.CloudupTask = &SSHKey{}\nvar _ fi.CompareWithID = &SSHKey{}\n\nfunc (s *SSHKey) CompareWithID() *string {\n\treturn s.Name\n}\n\nfunc (s *SSHKey) Find(c *fi.CloudupContext) (*SSHKey, error) {\n\tcloud := c.T.Cloud.(linode.LinodeCloud)\n\tname := fi.ValueOf(s.Name)\n\tif name == \"\" {\n\t\treturn nil, fmt.Errorf(\"SSHKey.Name is required\")\n\t}\n\n\tkeys, err := cloud.Client().ListSSHKeys(c.Context(), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error listing Akamai (Linode) SSH keys: %w\", err)\n\t}\n\n\tvar matched *linodego.SSHKey\n\tfor i := range keys {\n\t\tkey := &keys[i]\n\t\tif key.Label != name {\n\t\t\tcontinue\n\t\t}\n\n\t\tif matched != nil {\n\t\t\treturn nil, fmt.Errorf(\"found multiple SSH keys named %q\", name)\n\t\t}\n\t\tmatched = key","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/linodetasks/sshkey.go#L31-L67","documentation":"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.","triggerScenarios":"An SSHKey task in the cluster spec has no Name set, so Find cannot identify which Linode SSH key to match.","commonSituations":"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.","solutions":["Set the Name field on the SSHKey task to the label of an existing Linode SSH key","Check templating so the name variable isn't empty","Re-run kops update with a complete spec"],"exampleFix":"// before\nsshKey: {}\n// after\nsshKey:\n  name: my-ssh-key-prod","handlingStrategy":"validation","validationCode":"if sshKeyTask.Name == \"\" { return fmt.Errorf(\"SSHKey task requires a name matching a Linode SSH key label\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set Name on SSHKey tasks","Add spec validation before apply","Check template variables render non-empty values"],"tags":["ssh","linode","validation"],"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-12T12:17:11.808Z"}