{"record":{"id":"4ba34a59d1d1e81d","repo":"crowdsecurity/crowdsec","slug":"unsupported-mode-q-in-kubernetes-acquisition-onl","errorCode":null,"errorMessage":"unsupported mode %q in kubernetes acquisition, only %q is supported","messagePattern":"unsupported mode %q in kubernetes acquisition, only %q is supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/kubernetes/config.go","lineNumber":66,"sourceCode":"\tif c.Mode == \"\" {\n\t\tc.Mode = configuration.TAIL_MODE\n\t}\n\tif c.KubeConfigFile == \"\" {\n\t\tif home, err := os.UserHomeDir(); err == nil {\n\t\t\tc.KubeConfigFile = filepath.Join(home, \".kube\", \"config\")\n\t\t}\n\t}\n}\n\nfunc (c *Configuration) Validate() error {\n\tif c.Selector == \"\" {\n\t\treturn errors.New(\"selector must be set in kubernetes acquisition\")\n\t}\n\tif _, err := labels.Parse(c.Selector); err != nil {\n\t\treturn fmt.Errorf(\"invalid selector %q in kubernetes acquisition: %w\", c.Selector, err)\n\t}\n\tif c.Mode != configuration.TAIL_MODE {\n\t\treturn fmt.Errorf(\"unsupported mode %q in kubernetes acquisition, only %q is supported\", c.Mode, configuration.TAIL_MODE)\n\t}\n\treturn nil\n}\n\nfunc (s *Source) UnmarshalConfig(yamlConfig []byte) error {\n\tcfg, err := ConfigurationFromYAML(yamlConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif s.logger != nil {\n\t\ts.logger.Tracef(\"Kubernetes configuration: %+v\", cfg)\n\t}\n\n\ts.config = cfg\n\ts.client = nil\n\ts.cancels = nil\n","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/kubernetes/config.go#L48-L84","documentation":"Returned by Configuration.Validate when the kubernetes acquisition 'mode' is set to anything other than the only supported value (tail mode, the default). The offending input is the mode key in the kubernetes acquisition config.","triggerScenarios":"Thrown at pkg/acquisition/modules/kubernetes/config.go:66 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set mode: tail in the acquisition yaml, or omit mode (defaults to tail)","Remove unsupported mode values such as cat or oneshot"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}