{"record":{"id":"9554297237cf00cf","repo":"abiosoft/colima","slug":"update-not-supported-for-the-s-runtime-955429","errorCode":null,"errorMessage":"update not supported for the %s runtime","messagePattern":"update not supported for the (.+?) runtime","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"environment/container/kubernetes/kubernetes.go","lineNumber":277,"sourceCode":"\t// cleanup is manual\n\ta.Add(c.deleteAllContainers)\n\n\tc.teardownKubeconfig(a)\n\n\treturn a.Exec()\n}\n\nfunc (c kubernetesRuntime) Dependencies() []string {\n\treturn []string{\"kubectl\"}\n}\n\nfunc (c kubernetesRuntime) Version(context.Context) string {\n\tversion, _ := c.host.RunOutput(\"kubectl\", \"--context\", config.CurrentProfile().ID, \"version\", \"--short\")\n\treturn version\n}\n\nfunc (c *kubernetesRuntime) Update(ctx context.Context) (bool, error) {\n\treturn false, fmt.Errorf(\"update not supported for the %s runtime\", Name)\n}\n","sourceCodeStart":259,"sourceCodeEnd":279,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/environment/container/kubernetes/kubernetes.go#L259-L279","documentation":"kubernetesRuntime.Update is intentionally not implemented: it unconditionally returns (false, fmt.Errorf(\"update not supported for the %s runtime\", Name)) where Name is the k3s-based runtime. Colima's update flow only supports updating the container runtimes (docker/containerd); the embedded Kubernetes cluster must be recreated rather than upgraded in place.","triggerScenarios":"Any code path or CLI flow that calls Update() on the kubernetes runtime — most visibly 'colima update' on a profile that has Kubernetes enabled, or an external consumer of the environment package calling runtime.Update(ctx).","commonSituations":"Users run 'colima update' expecting both docker and k3s to be upgraded; scripts automating 'colima update' after a brew upgrade; CI pipelines trying to keep the cluster current.","solutions":["Update the VM and container runtime only ('colima update') and recreate the cluster to change Kubernetes version: 'colima delete profile --data kubernetes' (or delete the profile with --data) then 'colima start --kubernetes --kubernetes-version <new>'.","Pin the version explicitly on start: 'colima start --kubernetes --kubernetes-version v1.31.2+k3s1' after recreating.","If you hit this programmatically, check runtime identity first and skip Update for the kubernetes runtime (see defense strategy).","Track upstream colima: in-place k3s upgrades are a known gap; watch release notes for 'colima update' kubernetes support."],"exampleFix":"// before\nupdated, err := runtime.Update(ctx) // errors for kubernetes runtime\n// after\nif runtime.Name() == kubernetes.Name {\n    log.Println(\"kubernetes runtime must be recreated to update; skipping\")\n} else {\n    updated, err := runtime.Update(ctx)\n}","handlingStrategy":"type-guard","validationCode":"// skip the call for runtimes that do not support update\nif runtime.Name() == kubernetes.Name { // \"kubernetes\"\n    return errors.New(\"kubernetes runtime cannot be updated in place; recreate the cluster\")\n}","typeGuard":"func isUpdatableRuntime(name string) bool {\n    switch name {\n    case docker.Name, containerd.Name:\n        return true\n    default: // kubernetes and none\n        return false\n    }\n}","tryCatchPattern":"updated, err := runtime.Update(ctx)\nif err != nil && strings.Contains(err.Error(), \"update not supported\") {\n    updated, err = false, nil // expected for the kubernetes runtime\n}","preventionTips":["Treat 'colima update' as runtime-only; script kubernetes upgrades as delete+recreate.","Pin --kubernetes-version explicitly in start scripts for reproducibility.","Check runtime identity before calling Update in automation code."],"tags":["kubernetes","k3s","update","unsupported-operation"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}