Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(doc strings): Fix bug related documentation/clean up of default configurations #2331 #2388

Merged
merged 3 commits into from
Mar 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions workflow/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ type WorkflowControllerConfig struct {
// Config customized Docker Sock path
DockerSockPath string `json:"dockerSockPath,omitempty"`

// Default workflow spec, will be adde to workflow if the parameters are not set in the workflow
DefautWorkflowSpec *wfv1.WorkflowSpec `json:"workflowDefaults,omitempty"`
}

Expand Down
3 changes: 1 addition & 2 deletions workflow/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ func (wfc *WorkflowController) processNextItem() bool {
// workflowController. Values in the workflow will be given the upper hand over the defaults.
// The defaults for the workflow controller is set in the WorkflowController.Config.DefautWorkflowSpec
func (wfc *WorkflowController) addingWorkflowDefaultValueIfValueNotExist(wf *wfv1.Workflow) error {
//var workflowSpec *wfv1.WorkflowSpec = &wf.Spec
if wfc.Config.DefautWorkflowSpec != nil {
defaultsSpec, err := json.Marshal(*wfc.Config.DefautWorkflowSpec)
if err != nil {
Expand All @@ -441,7 +440,7 @@ func (wfc *WorkflowController) addingWorkflowDefaultValueIfValueNotExist(wf *wfv
if err != nil {
return err
}
// https://github.com/kubernetes/apimachinery/blob/2373d029717c4d169463414a6127cd1d0d12680e/pkg/util/strategicpatch/patch.go#L94
// https: //godoc.org/k8s.io/apimachinery/pkg/util/strategicpatch#StrategicMergePatch
new, err := strategicpatch.StrategicMergePatch(defaultsSpec, workflowSpec, wfv1.WorkflowSpec{})
if err != nil {
return err
Expand Down