{"record":{"id":"5339b48d0ebf6b3c","repo":"kubernetes/kops","slug":"marshaling-azure-cloud-config-w","errorCode":null,"errorMessage":"marshaling Azure cloud config: %w","messagePattern":"marshaling Azure cloud config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/template_functions.go","lineNumber":735,"sourceCode":"\t\t// Azure reads its cloud config from the azure-cloud-provider Secret.\n\tdefault:\n\t\targv = append(argv, \"--cloud-config=/etc/kubernetes/cloud.config\")\n\t}\n\n\treturn argv, nil\n}\n\n// AzureCloudConfig returns the base64-encoded Azure cloud provider\n// configuration. kOps publishes it in the azure-cloud-provider Secret, which the\n// cloud-controller-manager and CSI drivers load via --cloud-config-secret-name.\nfunc (tf *TemplateFunctions) AzureCloudConfig() (string, error) {\n\tconfig, err := azure.BuildCloudConfig(tf.Cluster)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdata, err := json.Marshal(config)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"marshaling Azure cloud config: %w\", err)\n\t}\n\treturn base64.StdEncoding.EncodeToString(data), nil\n}\n\n// DNSControllerArgv returns the args to the DNS controller\nfunc (tf *TemplateFunctions) DNSControllerArgv() ([]string, error) {\n\tcluster := tf.Cluster\n\n\tvar argv []string\n\n\t// @check if the dns controller has custom configuration\n\tif cluster.Spec.ExternalDNS == nil {\n\t\targv = append(argv, []string{\"--watch-ingress=false\"}...)\n\n\t\tklog.V(4).Infof(\"watch-ingress=false set on dns-controller\")\n\t} else {\n\t\t// @check if the watch ingress is set\n\t\tvar watchIngress bool","sourceCodeStart":717,"sourceCodeEnd":753,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/template_functions.go#L717-L753","documentation":"Thrown in AzureCloudConfig when encoding the Azure cloud-provider configuration struct (built by azure.BuildCloudConfig) to JSON fails. json.Marshal almost never fails on plain config structs; if it fires, the built config contains a value of an unsupported type (e.g. a channel, function, complex number, or a cycle introduced by a config field).","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/template_functions.go:735 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the built Azure cloud config for unusual field types (cycles, func/chan fields) added by recent changes","Fix the azure.BuildCloudConfig output so it only contains JSON-serializable values","Capture the wrapped *json.MarshalerError details (type and field) to locate the offending value"],"exampleFix":null,"handlingStrategy":"try-catch","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"}