When using certificate in a Jenkins folder containing spaces, path in option "--certificate-authority" is not escaped resulting in error.

      By default, --certificate-authority is always added, but we don't want these if we use a pod to interact with another OpenShift cluster.

      Is this possible to :

      • Espace string
      • Provide an option to disable these default flag, and disable adding any flag concerning certificate in command line

          [JENKINS-70710] Certificate options not escaped

          Apoorva added a comment -

          Hello jgaube, I've been working on this issue, and as per the description, I could understand that we are looking for ways to either provide an option so that we can avoid using any flag w.r.t certificate in the command line, OR add `escape` character right before the space, for situations when the certificate_authority path has a directory with spaces in its name.

          Could you please help me confirm, if this understanding is correctly aligned or not? Also, if you can share some set of steps to reproduce it, that'll be of great help!

          Apoorva added a comment - Hello jgaube , I've been working on this issue, and as per the description, I could understand that we are looking for ways to either provide an option so that we can avoid using any flag w.r.t certificate in the command line, OR add `escape` character right before the space, for situations when the certificate_authority path has a directory with spaces in its name. Could you please help me confirm, if this understanding is correctly aligned or not? Also, if you can share some set of steps to reproduce it, that'll be of great help!

          jimmy added a comment -

          Hello,

          For me there is two things yes :

          • By default if no certificate is provided, do not try to load any certificate
          • If a certificate is provided, espace the path

          To reproduce the issue, you have to reproduce an environment where agent from Kubernetes Cloud are launched in a Kubernetes cluster, and we use OpenShift Client to interact with another cluster.

          Doing that, you don't want OpenShift plugin to load the CA certificate of the Kubernetes cluster where the agent is. This is why I ask for the first things. And if you add the CA Certificate of the targeted OpenShift cluster, but you work in a Jenkins folder with a space, you have the second issue. (you can reproduce it by adding an OpenShift Cluster and a Ca-certificate in Jenkins configuration, and launch a pipeline using Openshift Client and target this cluster with the certificate, in a folder with a space).

           

          jimmy added a comment - Hello, For me there is two things yes : By default if no certificate is provided, do not try to load any certificate If a certificate is provided, espace the path To reproduce the issue, you have to reproduce an environment where agent from Kubernetes Cloud are launched in a Kubernetes cluster, and we use OpenShift Client to interact with another cluster. Doing that, you don't want OpenShift plugin to load the CA certificate of the Kubernetes cluster where the agent is . This is why I ask for the first things. And if you add the CA Certificate of the targeted OpenShift cluster, but you work in a Jenkins folder with a space, you have the second issue. (you can reproduce it by adding an OpenShift Cluster and a Ca-certificate in Jenkins configuration, and launch a pipeline using Openshift Client and target this cluster with the certificate, in a folder with a space).  

          Apoorva added a comment -

          jgaube Thanks for sharing the details.
          I've been trying to reproduce it, but a little flaky on the part "launch a pipeline using Openshift Client and target this cluster with the certificate, in a folder with a space". Will it be feasible for you to share an example of Jenkinsfile or DSL syntax that helps you to perform the aforementioned?

          Apoorva added a comment - jgaube Thanks for sharing the details. I've been trying to reproduce it, but a little flaky on the part "launch a pipeline using Openshift Client and target this cluster with the certificate, in a folder with a space". Will it be feasible for you to share an example of Jenkinsfile or DSL syntax that helps you to perform the aforementioned?

          Apoorva added a comment -

          Hello jgaube, I have been working with my team to manage a reproducer. While we were discussing the same, we had a little confusion regarding where the directory/folder with space exists. Does it exist on a workstation, or on the server? 
          These details would help us to reproduce it at our end, and validate the changes to be made in an efficient way.

          Apoorva added a comment - Hello jgaube , I have been working with my team to manage a reproducer. While we were discussing the same, we had a little confusion regarding where the directory/folder with space exists . Does it exist on a workstation, or on the server?  These details would help us to reproduce it at our end, and validate the changes to be made in an efficient way.

          jimmy added a comment -

          Hi,

          We are using agent provisionned on Kubernetes using Kubernetes Cloud.

          When we are in a Jenkins folder with space in it, or any parent folder having space in it, workspace inside this agent contains a space.

          If you want to reproduce it, create a Jenkins folder with a space, and run your job inside it, using an agent on Kubernetes Cloud.

          jimmy added a comment - Hi, We are using agent provisionned on Kubernetes using Kubernetes Cloud. When we are in a Jenkins folder with space in it, or any parent folder having space in it, workspace inside this agent contains a space. If you want to reproduce it, create a Jenkins folder with a space, and run your job inside it, using an agent on Kubernetes Cloud.

            jupierce Justin Pierce
            jgaube jimmy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: