{"record":{"id":"441ae2eab3c0a2b5","repo":"kubernetes/kops","slug":"invalid-instance-type-q-specified","errorCode":null,"errorMessage":"invalid instance type %q specified","messagePattern":"invalid instance type %q specified","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/awsup/mock_aws_cloud.go","lineNumber":306,"sourceCode":"\n// DefaultInstanceType determines an instance type for the specified cluster & instance group\nfunc (c *MockAWSCloud) DefaultInstanceType(cluster *kops.Cluster, ig *kops.InstanceGroup) (string, error) {\n\tswitch {\n\tcase ig.Spec.Role.IsControlPlaneType():\n\t\treturn \"m3.medium\", nil\n\tcase ig.Spec.Role.HasNode():\n\t\treturn \"t2.medium\", nil\n\tcase ig.Spec.Role.HasBastion():\n\t\treturn \"t2.micro\", nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"MockAWSCloud DefaultInstanceType does not handle %s\", ig.Spec.Role)\n\t}\n}\n\n// DescribeInstanceType calls ec2.DescribeInstanceType to get information for a particular instance type\nfunc (c *MockAWSCloud) DescribeInstanceType(instanceType string) (*ec2types.InstanceTypeInfo, error) {\n\tif instanceType == \"t2.invalidType\" {\n\t\treturn nil, fmt.Errorf(\"invalid instance type %q specified\", \"t2.invalidType\")\n\t}\n\tinfo := &ec2types.InstanceTypeInfo{\n\t\tNetworkInfo: &ec2types.NetworkInfo{\n\t\t\tMaximumNetworkInterfaces:  aws.Int32(1),\n\t\t\tIpv4AddressesPerInterface: aws.Int32(1),\n\t\t},\n\t\tMemoryInfo: &ec2types.MemoryInfo{\n\t\t\tSizeInMiB: aws.Int64(1024),\n\t\t},\n\t\tVCpuInfo: &ec2types.VCpuInfo{\n\t\t\tDefaultVCpus: aws.Int32(2),\n\t\t},\n\t}\n\tif instanceType == \"m3.medium\" {\n\t\tinfo.InstanceStorageInfo = &ec2types.InstanceStorageInfo{\n\t\t\tDisks: []ec2types.DiskInfo{\n\t\t\t\t{\n\t\t\t\t\tCount:    aws.Int32(1),","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/awsup/mock_aws_cloud.go#L288-L324","documentation":"Guard error from the MockAWSCloud test double: DescribeInstanceType was asked for an instance type that the mock's fixed table does not contain. The %q value is the unsupported instance type; this only occurs in tests, never against real AWS.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/awsup/mock_aws_cloud.go:306 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Extend the mock's instance type table to cover the type used by the test","Change the test to use one of the instance types already known to the mock"],"exampleFix":null,"handlingStrategy":"validation","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"}