Having just upgraded Jenkins to latest LTS and associated plugins, found all kubernetes jobs to fail due to following:
Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: ad33ed53-da13-4d9a-86a3-dbc8df079dc8 java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because "stringRequest" is null at PluginClassLoader for kubernetes-credentials//org.jenkinsci.plugins.kubernetes.credentials.Utils.ensureFIPSCompliantRequest(Utils.java:85) at PluginClassLoader for kubernetes-credentials//org.jenkinsci.plugins.kubernetes.auth.KubernetesAuthConfig.<init>(KubernetesAuthConfig.java:23) at PluginClassLoader for kubernetes-cli//org.jenkinsci.plugins.kubernetes.cli.kubeconfig.KubeConfigWriter.getConfigBuilderWithAuth(KubeConfigWriter.java:164) at PluginClassLoader for kubernetes-cli//org.jenkinsci.plugins.kubernetes.cli.kubeconfig.KubeConfigWriter.writeKubeConfig(KubeConfigWriter.java:138) at PluginClassLoader for kubernetes-cli//org.jenkinsci.plugins.kubernetes.cli.GenericBuildStep.start(GenericBuildStep.java:59) at PluginClassLoader for workflow-cps//org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:323)
We use `withKubeConfig` - example call from the Jenkinsfile:
stage('Print cluster info') {
steps {
withKubeConfig([credentialsId: env.KUBE_CONFIG_SECRET_NAME]) {
sh '''
kubectl cluster-info
'''
}
}
}
Per the kubernetes-cli-plugin docs, `serverUrl` isn't mandatory when using kubeconfig
This is a bug introduced in https://issues.jenkins.io/browse/JENKINS-73525
- is duplicated by
-
JENKINS-73610 FIPS compliance checks fail when serverUrl isn't defined (not mandatory for kubeconfig)
- Closed