Make required field determine whether the parameter is required
What type of PR is this?
/kind optimization /area devops
What this PR does / why we need it:
Make required field decide whether the form item is required.
We have decided to add a required field to determine whether the parameter is required to input instead of using default
field. See
for more.
Which issue(s) this PR fixes:
Fixes #
Special notes for reviewers:
Steps to test:
- Apply a ClusterTemplate for test:
cat <<'EOF' | kubectl apply -f - apiVersion: devops.kubesphere.io/v1alpha3 kind: ClusterTemplate metadata: name: echo spec: parameters: - default: John name: 姓 required: false - default: Niang name: 名 required: true template: | pipeline { agent none stages { stage('echo') { steps { echo 'Hello, $(.params.姓)-$(.params.名)!' } } } } EOF
- Create a Pipeline for test
- Edit Pipeline and select the ClusterTemplate created just now
- See the result
Does this PR introduced a user-facing change?
None
Additional documentation, usage docs, etc.: