// UploadWorkflow Upload a workflow resource, deleting an existing one, if present
UploadWorkflow Upload a workflow resource, deleting an existing one, if present
// UploadWorkflow Upload a workflow resource deleting an existing one if present
func UploadWorkflow(workflow *workflowsv1.Workflow) error {
	log.Debugf(`Uploading workflow "%v"`, workflow.ObjectMeta.Name)
	client, err := CreateWorkflowsClient()
	if err != nil {
		return err
	}
	err = uploadWorkflow(client, workflow)
	if kubeerr.IsConflict(err) {
		log.Debugf(`A workflow with name "%v" already exists, deleting it`, workflow.ObjectMeta.Name)
		err = DeleteWorkflow(client, workflow)
		if err != nil {
			return err
		}
		err = uploadWorkflow(client, workflow)
	}
	if err != nil {
		return err
	}
	return nil
}
func UploadWorkflow ( workflow * workflowsv1 . Workflow ) error { log . Debugf ( `Uploading workflow "%v"` , workflow . ObjectMeta . Name ) client , err := CreateWorkflowsClient ( ) if err != nil { return err } err = uploadWorkflow ( client , workflow ) if kubeerr . IsConflict ( err ) { log . Debugf ( `A workflow with name "%v" already exists, deleting it` , workflow . ObjectMeta . Name ) err = DeleteWorkflow ( client , workflow ) if err != nil { return err } err = uploadWorkflow ( client , workflow ) } if err != nil { return err } return nil }
UploadWorkflow Upload a workflow resource, deleting an existing one, if present
UploadWorkflow Upload a workflow resource deleting an existing one if present