{"record":{"id":"856f35706e0f6899","repo":"cilium/cilium","slug":"invalid-xds-mode-q","errorCode":null,"errorMessage":"invalid xDS mode %q","messagePattern":"invalid xDS mode %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/envoy/config/config.go","lineNumber":57,"sourceCode":")\n\nfunc (v XDSMode) IsADS() bool {\n\treturn strings.HasSuffix(string(v), \"ads\")\n}\n\nfunc (v XDSMode) IsStrictADS() bool {\n\treturn strings.HasPrefix(string(v), \"strict-\")\n}\n\n// Validate validates and normalizes the XDSMode\nfunc (v XDSMode) Validate() error {\n\tswitch v {\n\tcase EnvoyXDSModeSplit, EnvoyXDSModeDeltaSplit, EnvoyXDSModeADS, EnvoyXDSModeStrictADS:\n\t\treturn nil\n\tcase EnvoyXDSModeDeltaADS, EnvoyXDSModeStrictDeltaADS:\n\t\treturn fmt.Errorf(\"unimplemented xDS mode %q\", v)\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid xDS mode %q\", v)\n\t}\n}\n\nfunc (v XDSMode) EnvoyApiType() envoy_config_core.ApiConfigSource_ApiType {\n\tswitch v {\n\tcase EnvoyXDSModeDeltaSplit:\n\t\treturn envoy_config_core.ApiConfigSource_DELTA_GRPC\n\tcase EnvoyXDSModeADS, EnvoyXDSModeStrictADS:\n\t\treturn envoy_config_core.ApiConfigSource_AGGREGATED_GRPC\n\tcase EnvoyXDSModeDeltaADS, EnvoyXDSModeStrictDeltaADS:\n\t\treturn envoy_config_core.ApiConfigSource_AGGREGATED_DELTA_GRPC\n\t}\n\treturn envoy_config_core.ApiConfigSource_GRPC\n}\n\n// implement the pflag.Value interface\nvar _xdsMode_ XDSMode\nvar _ pflag.Value = &_xdsMode_","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/pkg/envoy/config/config.go#L39-L75","documentation":"XDSMode.Validate() returns this when the configured xDS mode string does not match any known mode constant. It is the 'invalid value' branch, as opposed to the 'known but unimplemented' branch. The configuration contains a typo or an entirely unknown mode name.","triggerScenarios":"Passing an unrecognized value for the xDS mode config option (e.g. --xds-mode=splt, empty/whitespace value, or a mode name from a different product).","commonSituations":"Typos in Helm values or ConfigMaps, case-sensitivity mistakes, config templating that yields an empty or wrong string, docs from a different Cilium version.","solutions":["Correct the mode to one of: split, delta-split, ads, strict-ads (delta ADS variants exist but are unimplemented)","Echo the configured value and compare exactly against the allowed constants (matching is case-sensitive)","Validate the rendered Helm/ConfigMap output to ensure the value isn't empty or mangled"],"exampleFix":"// before\n--xds-mode=\"Delta Split\"\n// after\n--xds-mode=\"delta-split\"","handlingStrategy":"validation","validationCode":"func knownXDSMode(s string) bool {\n    switch config.XDSMode(s) {\n    case config.EnvoyXDSModeSplit, config.EnvoyXDSModeDeltaSplit,\n        config.EnvoyXDSModeADS, config.EnvoyXDSModeStrictADS,\n        config.EnvoyXDSModeDeltaADS, config.EnvoyXDSModeStrictDeltaADS:\n        return true\n    }\n    return false\n}","typeGuard":null,"tryCatchPattern":"if err := mode.Validate(); err != nil {\n    if strings.Contains(err.Error(), \"invalid xDS mode\") {\n        return fmt.Errorf(\"config typo in xds-mode %q; allowed: split, delta-split, ads, strict-ads\", mode)\n    }\n    return err\n}","preventionTips":["Copy mode names exactly (case-sensitive) from the version's docs","Lint rendered Helm values/ConfigMaps for empty or mangled strings","Use config schemas/values.yaml constants rather than hand-typed strings"],"tags":["envoy","xds","configuration","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}