{"record":{"id":"7f370cc384d2d213","repo":"kubernetes/kops","slug":"task-t-did-not-have-a-name","errorCode":null,"errorMessage":"task %T did not have a name","messagePattern":"task %T did not have a name","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/template_functions.go","lineNumber":586,"sourceCode":"\tmatches := make([]fi.CloudupTask, 0, len(keys))\n\tfor _, key := range keys {\n\t\tmatches = append(matches, tasks[key])\n\t}\n\treturn matches, nil\n}\n\n// TaskKey returns the canonical task key used in the task map.\nfunc (tf *TemplateFunctions) TaskKey(task fi.CloudupTask) (string, error) {\n\tif task == nil {\n\t\treturn \"\", fmt.Errorf(\"task is nil\")\n\t}\n\thasName, ok := task.(fi.HasName)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"task %T does not implement HasName\", task)\n\t}\n\tname := fi.ValueOf(hasName.GetName())\n\tif name == \"\" {\n\t\treturn \"\", fmt.Errorf(\"task %T did not have a name\", task)\n\t}\n\treturn fi.TypeNameForTask(task) + \"/\" + name, nil\n}\n\n// SharedVPC is a simple helper function which makes the templates for a shared VPC clearer\nfunc (tf *TemplateFunctions) SharedVPC() bool {\n\treturn tf.Cluster.SharedVPC()\n}\n\n// GetInstanceGroup returns the instance group with the specified name\nfunc (tf *TemplateFunctions) GetInstanceGroup(name string) (*kops.InstanceGroup, error) {\n\tig := tf.KopsModelContext.FindInstanceGroup(name)\n\tif ig == nil {\n\t\treturn nil, fmt.Errorf(\"InstanceGroup %q not found\", name)\n\t}\n\treturn ig, nil\n}\n","sourceCodeStart":568,"sourceCodeEnd":604,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/template_functions.go#L568-L604","documentation":"Thrown in TaskKey when the task does implement HasName but GetName() returned nil or an empty string after fi.ValueOf dereferencing. The task is nameable but currently unnamed, so the canonical key cannot be built — usually a task constructed without setting its Name field.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/template_functions.go:586 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}