ks-devops
ks-devops copied to clipboard
【devops】pipeline running error after modify the jenkinsfile parameters
Describe the bug When the pipeline is running,Three situations occur randomly
Situation 1:The input window gets the parameter value of the previous jenkinsfile. The pipeline in jenkins and k8s has been updated to the parameter value of the current jenkinsfile at this time, and an error 500 will be reported when you click Run
Situation 2:
The input window does not display the jenkinsfile parameter value, and it runs normally (but the window does not display the jenkinsfile parameter to the user, which loses the meaning of setting the jenkinsfile parameter)
Situation 3:The input window shows that the current jenkinsfile parameter value is running normally,everything is ok
Environment kubesphere v3.1.0 kubernetes v1.20.4
To Reproduce
-
create a pipeline. add jenkinsfile
-
first run, There is no jenkinsfile parameter "Greeting" in the entry window
But Jenkins has already got the "Greeting" parameter
Check the running log, Greeting has been used
-
Modify the "Greeting" parameter in jenkinsfile to "Greeting1"
-
Second run,There is still no jenkinsfile parameter in the input window
Check the running log, actually we have used Greeting1 in the jenkinsfile parameter
-
Modify the jenkinsfile parameter Greeting1 parameter to Greeting2
-
Third run,The input window loaded the previous parameter Greeting1, but the put request has been successfully sent and the backend changed to Greeting2, 500 error was reported.
Expected behavior pipeline running normally
Kubesphere Chinese Community https://kubesphere.com.cn/forum/d/4586-devopspipeline-jenkinsfile
/priority high /area devops
@LinuxSuRen @huanggze
Consider you have parameter arg1
which is not in the Jenkinsfile. The possible reason is that you created a parameter via UI. Please see also the following screenshot:
This is a drawback of Jenkins Pipeline. We cannot fix this from the KubeSphere DevOps side. In my opinion, there're two possible solutions that we can improve.
- always get the parameter list before popping the box when users click the run button
- for multi-cluster case: The API is
http://ip:port/kapis/clusters/host/devops.kubesphere.io/v1alpha2/devops/testk682v/pipelines/asdf/
- for single-cluster case: The API is
http://ip:port/kapis/devops.kubesphere.io/v1alpha2/devops/testk682v/pipelines/asdf/
- for multi-cluster case: The API is
- disable the UI parameter settings (need more discussion)
- or put the parameters into Jenkinsfile directly when saving it
/cc @kubesphere/sig-console , please take a look at this issue. Thanks.
/remove-priority high /priority medium
arg1
created by via UI as you say.There will be problems when using web UI parameters and jenkinsfiles parameters at the same time. Put the parameters into Jenkinsfile directly when saving it maybe good idea.thanks a lot
/area console