{"record":{"id":"55410d4d6b578a94","repo":"kubernetes/kops","slug":"unexpected-target-type-for-deletion-t-55410d","errorCode":null,"errorMessage":"unexpected target type for deletion: %T","messagePattern":"unexpected target type for deletion: %T","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awstasks/subnet.go","lineNumber":530,"sourceCode":"\t\t})\n\t}\n\n\treturn removals, nil\n}\n\ntype deleteSubnetIPv6CIDRBlock struct {\n\tvpcID         *string\n\tipv6CidrBlock *string\n\tassociationID *string\n}\n\nvar _ fi.CloudupDeletion = (*deleteSubnetIPv6CIDRBlock)(nil)\n\nfunc (d *deleteSubnetIPv6CIDRBlock) Delete(t fi.CloudupTarget) error {\n\tctx := context.TODO()\n\tawsTarget, ok := t.(*awsup.AWSAPITarget)\n\tif !ok {\n\t\treturn fmt.Errorf(\"unexpected target type for deletion: %T\", t)\n\t}\n\n\trequest := &ec2.DisassociateSubnetCidrBlockInput{\n\t\tAssociationId: d.associationID,\n\t}\n\t_, err := awsTarget.Cloud.EC2().DisassociateSubnetCidrBlock(ctx, request)\n\treturn err\n}\n\nfunc (d *deleteSubnetIPv6CIDRBlock) TaskName() string {\n\treturn \"SubnetIPv6CIDRBlock\"\n}\n\nfunc (d *deleteSubnetIPv6CIDRBlock) Item() string {\n\treturn fmt.Sprintf(\"%v: ipv6cidr=%v\", *d.vpcID, *d.ipv6CidrBlock)\n}\n\nfunc (d *deleteSubnetIPv6CIDRBlock) DeferDeletion() bool {","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awstasks/subnet.go#L512-L548","documentation":"The deferred deletion of a subnet IPv6 CIDR block only works against the AWS API target; the Delete method was handed a different CloudupTarget implementation (e.g. Terraform or a dry-run target), which cannot perform the EC2 disassociation.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awstasks/subnet.go:530 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run the deletion against the AWS target (plain `kops delete cluster`)","Apply the Terraform output so the AWS API target is used for cleanup"],"exampleFix":null,"handlingStrategy":"type-guard","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-12T12:17:11.808Z"}