{"record":{"id":"bb3aedb5316ebf67","repo":"kubernetes/kops","slug":"sizegb-cannot-be-decreased","errorCode":null,"errorMessage":"SizeGB cannot be decreased","messagePattern":"SizeGB cannot be decreased","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/linodetasks/volume.go","lineNumber":101,"sourceCode":"\nfunc (v *Volume) Run(c *fi.CloudupContext) error {\n\treturn fi.CloudupDefaultDeltaRunMethod(v, c)\n}\n\nfunc (_ *Volume) CheckChanges(actual, expected, changes *Volume) error {\n\tif actual != nil {\n\t\tif changes.ID != nil {\n\t\t\treturn fi.CannotChangeField(\"ID\")\n\t\t}\n\t\tif changes.Name != nil {\n\t\t\treturn fi.CannotChangeField(\"Name\")\n\t\t}\n\t\tif changes.Region != nil {\n\t\t\treturn fi.CannotChangeField(\"Region\")\n\t\t}\n\t\tif changes.SizeGB != nil {\n\t\t\tif fi.ValueOf(expected.SizeGB) < fi.ValueOf(actual.SizeGB) {\n\t\t\t\treturn fmt.Errorf(\"SizeGB cannot be decreased\")\n\t\t\t}\n\t\t}\n\t\tif changes.Tags != nil {\n\t\t\treturn fi.CannotChangeField(\"Tags\")\n\t\t}\n\t} else {\n\t\tif expected.Name == nil {\n\t\t\treturn fi.RequiredField(\"Name\")\n\t\t}\n\t\tif expected.Region == nil {\n\t\t\treturn fi.RequiredField(\"Region\")\n\t\t}\n\t\tif expected.SizeGB == nil {\n\t\t\treturn fi.RequiredField(\"SizeGB\")\n\t\t}\n\t\tif fi.ValueOf(expected.SizeGB) < 10 {\n\t\t\treturn fmt.Errorf(\"SizeGB must be at least 10 GB\")\n\t\t}","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/linodetasks/volume.go#L83-L119","documentation":"Volume.CheckChanges returns this error when a kOps update tries to shrink an existing Linode volume. Linode (like most block storage APIs) does not support shrinking volumes, so the task refuses the change before calling the API.","triggerScenarios":"During an update, changes.SizeGB != nil and fi.ValueOf(expected.SizeGB) < fi.ValueOf(actual.SizeGB) — the spec's new size is smaller than the existing volume's size.","commonSituations":"An operator reduced the volumeSize in the cluster spec or a template and applied the update to an existing cluster; a template generated with a smaller default was reused for a cluster with a larger volume.","solutions":["Restore the volume size in the spec to be >= the current volume size","If shrinkage is truly needed, create a new larger-capacity-compatible workflow: snapshot/copy data, delete the old volume, and create a new one at the smaller size (data loss risk)","Keep volume sizes immutable in your provisioning pipeline to avoid accidental shrink requests"],"exampleFix":"// before (cluster spec)\nvolumeSize: 50   # existing volume is 100 GB\n// after\nvolumeSize: 100  # only increases are allowed","handlingStrategy":"validation","validationCode":"// before applying a spec change\nif desired.VolumeSize < currentVolumeSizeGB {\n  return fmt.Errorf(\"cannot shrink volume from %d to %d GB; volumes only grow\", currentVolumeSizeGB, desired.VolumeSize)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat volume size as increase-only in your spec review process","Snapshot the current volume size (kops get / linode-cli volumes list) before editing specs","Avoid reusing templates with smaller defaults against existing clusters","If shrinkage is required, plan explicit data migration to a new volume"],"tags":["linode","volume","validation","resize","immutable"],"backgroundTag":"volume-shrink-not-supported","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"}