Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-73610

FIPS compliance checks fail when serverUrl isn't defined (not mandatory for kubeconfig)

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major

      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

      https://github.com/jenkinsci/kubernetes-cli-plugin?tab=readme-ov-file#parameters-with-kubeconfig-file

       

      This is a bug introduced in https://issues.jenkins.io/browse/JENKINS-73525

       

       

          [JENKINS-73610] FIPS compliance checks fail when serverUrl isn't defined (not mandatory for kubeconfig)

          Clockrun Ren added a comment -

          I'm having same issue here.

          Jenkins 2.452.1 + kubernetes cli 2.48, works.

          After upgrade to 2.462.1, the plugin stops working.

           

          By applying this patch, it works again

          https://github.com/jmdesprez/kubernetes-credentials-plugin/tree/JENKINS-73610

          Clockrun Ren added a comment - I'm having same issue here. Jenkins 2.452.1 + kubernetes cli 2.48, works. After upgrade to 2.462.1, the plugin stops working.   By applying this patch, it works again https://github.com/jmdesprez/kubernetes-credentials-plugin/tree/JENKINS-73610

          Peter added a comment -

          jmdesprez I get the same issue with Kubernetes setup. Any plans to fix it soon?

          Peter added a comment - jmdesprez I get the same issue with Kubernetes setup. Any plans to fix it soon?

          Mark Waite added a comment - - edited

          Mark Waite added a comment - - edited peter_penzov a new release is available that includes the fix. Refer to https://github.com/jenkinsci/kubernetes-credentials-plugin/releases/tag/188.vcf079758e37b_

            jmdesprez Jean-Marc Desprez
            lees_nw Lee
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: