From 2bf14f60a08efe2d264c0250d562d5348e9ee0fe Mon Sep 17 00:00:00 2001 From: Simon Behar Date: Fri, 26 Mar 2021 15:18:32 -0700 Subject: [PATCH] chore: Lint master Signed-off-by: Simon Behar --- cmd/argo/commands/server_test.go | 3 ++- cmd/argo/lint/lint_test.go | 6 ++--- cmd/argoexec/commands/emissary.go | 8 +++--- cmd/argoexec/commands/emissary_test.go | 8 +++--- examples/example-golang/main.go | 30 +++++++++++------------ examples/validation_test.go | 2 +- examples/validator.go | 3 +-- hack/crds.go | 4 +-- hack/docgen.go | 2 +- hack/parse_examples.go | 2 +- hack/swagger/secondaryswaggergen.go | 2 +- server/artifacts/artifact_server_test.go | 2 +- server/auth/serviceaccount/claims_test.go | 2 +- test/e2e/cli_test.go | 2 +- util/archive/archive_test.go | 2 +- util/file/fileutil_test.go | 2 +- util/util.go | 2 +- workflow/artifacts/gcs/gcs.go | 2 +- workflow/artifacts/git/git.go | 4 +-- workflow/artifacts/git/git_test.go | 2 +- workflow/artifacts/hdfs/hdfs.go | 4 +-- workflow/executor/common/common.go | 2 +- workflow/executor/emissary/binary.go | 2 +- workflow/executor/emissary/emissary.go | 6 ++--- workflow/executor/executor.go | 2 +- workflow/executor/executor_test.go | 4 +-- workflow/util/util_test.go | 6 ++--- 27 files changed, 57 insertions(+), 59 deletions(-) diff --git a/cmd/argo/commands/server_test.go b/cmd/argo/commands/server_test.go index 3da6ca8aa322..965322ed6b9b 100644 --- a/cmd/argo/commands/server_test.go +++ b/cmd/argo/commands/server_test.go @@ -1,9 +1,10 @@ package commands import ( - "github.com/stretchr/testify/assert" "os" "testing" + + "github.com/stretchr/testify/assert" ) func TestDefaultSecureMode(t *testing.T) { diff --git a/cmd/argo/lint/lint_test.go b/cmd/argo/lint/lint_test.go index 0e4cc12d54b8..d95c62ad710d 100644 --- a/cmd/argo/lint/lint_test.go +++ b/cmd/argo/lint/lint_test.go @@ -68,7 +68,7 @@ spec: func TestLintFile(t *testing.T) { file, err := ioutil.TempFile("", "*.yaml") assert.NoError(t, err) - err = ioutil.WriteFile(file.Name(), lintFileData, 0644) + err = ioutil.WriteFile(file.Name(), lintFileData, 0o644) assert.NoError(t, err) defer os.Remove(file.Name()) @@ -97,7 +97,7 @@ func TestLintFile(t *testing.T) { func TestLintMultipleKinds(t *testing.T) { file, err := ioutil.TempFile("", "*.yaml") assert.NoError(t, err) - err = ioutil.WriteFile(file.Name(), lintFileData, 0644) + err = ioutil.WriteFile(file.Name(), lintFileData, 0o644) assert.NoError(t, err) defer os.Remove(file.Name()) @@ -129,7 +129,7 @@ func TestLintMultipleKinds(t *testing.T) { func TestLintWithOutput(t *testing.T) { file, err := ioutil.TempFile("", "*.yaml") assert.NoError(t, err) - err = ioutil.WriteFile(file.Name(), lintFileData, 0644) + err = ioutil.WriteFile(file.Name(), lintFileData, 0o644) assert.NoError(t, err) defer os.Remove(file.Name()) diff --git a/cmd/argoexec/commands/emissary.go b/cmd/argoexec/commands/emissary.go index 3291f526a012..db21a6f5df3a 100644 --- a/cmd/argoexec/commands/emissary.go +++ b/cmd/argoexec/commands/emissary.go @@ -39,14 +39,14 @@ func NewEmissaryCommand() *cobra.Command { exitCode := 64 defer func() { - err := ioutil.WriteFile(varRunArgo+"/ctr/"+containerName+"/exitcode", []byte(strconv.Itoa(exitCode)), 0600) + err := ioutil.WriteFile(varRunArgo+"/ctr/"+containerName+"/exitcode", []byte(strconv.Itoa(exitCode)), 0o600) if err != nil { logger.Error(fmt.Errorf("failed to write exit code: %w", err)) } }() // this also indicates we've started - if err := os.MkdirAll(varRunArgo+"/ctr/"+containerName, 0700); err != nil { + if err := os.MkdirAll(varRunArgo+"/ctr/"+containerName, 0o700); err != nil { return fmt.Errorf("failed to create ctr directory: %w", err) } @@ -190,7 +190,7 @@ func saveArtifact(srcPath string) error { dstPath := varRunArgo + "/outputs/artifacts/" + srcPath + ".tgz" logger.Infof("%s -> %s", srcPath, dstPath) z := filepath.Dir(dstPath) - if err := os.MkdirAll(z, 0700); err != nil { // chmod rwx------ + if err := os.MkdirAll(z, 0o700); err != nil { // chmod rwx------ return fmt.Errorf("failed to create directory %s: %w", z, err) } dst, err := os.Create(dstPath) @@ -224,7 +224,7 @@ func saveParameter(srcPath string) error { dstPath := varRunArgo + "/outputs/parameters/" + srcPath logger.Infof("%s -> %s", srcPath, dstPath) z := filepath.Dir(dstPath) - if err := os.MkdirAll(z, 0700); err != nil { // chmod rwx------ + if err := os.MkdirAll(z, 0o700); err != nil { // chmod rwx------ return fmt.Errorf("failed to create directory %s: %w", z, err) } dst, err := os.Create(dstPath) diff --git a/cmd/argoexec/commands/emissary_test.go b/cmd/argoexec/commands/emissary_test.go index e335466926c0..1225c8b56495 100644 --- a/cmd/argoexec/commands/emissary_test.go +++ b/cmd/argoexec/commands/emissary_test.go @@ -26,7 +26,7 @@ func TestEmissary(t *testing.T) { x := filepath.Join(wd, "../../../dist/argosay") - err = ioutil.WriteFile(varRunArgo+"/template", []byte(`{}`), 0600) + err = ioutil.WriteFile(varRunArgo+"/template", []byte(`{}`), 0o600) assert.NoError(t, err) t.Run("Exit0", func(t *testing.T) { @@ -62,7 +62,7 @@ func TestEmissary(t *testing.T) { syscall.SIGTERM: "terminated", syscall.SIGKILL: "killed", } { - err := ioutil.WriteFile(varRunArgo+"/ctr/main/signal", []byte(strconv.Itoa(int(signal))), 0600) + err := ioutil.WriteFile(varRunArgo+"/ctr/main/signal", []byte(strconv.Itoa(int(signal))), 0o600) assert.NoError(t, err) var wg sync.WaitGroup wg.Add(1) @@ -83,7 +83,7 @@ func TestEmissary(t *testing.T) { ] } } -`), 0600) +`), 0o600) assert.NoError(t, err) err := run(x, []string{"echo", "hello", "/tmp/artifact"}) assert.NoError(t, err) @@ -102,7 +102,7 @@ func TestEmissary(t *testing.T) { ] } } -`), 0600) +`), 0o600) assert.NoError(t, err) err := run(x, []string{"echo", "hello", "/tmp/parameter"}) assert.NoError(t, err) diff --git a/examples/example-golang/main.go b/examples/example-golang/main.go index 31f7611d56bd..2b255bb6549a 100644 --- a/examples/example-golang/main.go +++ b/examples/example-golang/main.go @@ -18,25 +18,23 @@ import ( wfclientset "github.com/argoproj/argo-workflows/v3/pkg/client/clientset/versioned" ) -var ( - helloWorldWorkflow = wfv1.Workflow{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "hello-world-", - }, - Spec: wfv1.WorkflowSpec{ - Entrypoint: "whalesay", - Templates: []wfv1.Template{ - { - Name: "whalesay", - Container: &corev1.Container{ - Image: "docker/whalesay:latest", - Command: []string{"cowsay", "hello world"}, - }, +var helloWorldWorkflow = wfv1.Workflow{ + ObjectMeta: metav1.ObjectMeta{ + GenerateName: "hello-world-", + }, + Spec: wfv1.WorkflowSpec{ + Entrypoint: "whalesay", + Templates: []wfv1.Template{ + { + Name: "whalesay", + Container: &corev1.Container{ + Image: "docker/whalesay:latest", + Command: []string{"cowsay", "hello world"}, }, }, }, - } -) + }, +} func main() { // get current user to determine home directory diff --git a/examples/validation_test.go b/examples/validation_test.go index 17af8bccd480..badf0de08367 100644 --- a/examples/validation_test.go +++ b/examples/validation_test.go @@ -12,7 +12,7 @@ func TestValidateExamples(t *testing.T) { t.Errorf("There was an error: %s", err) } if len(failures) > 0 { - var fails = []string{} + fails := []string{} for path, fail := range failures { fails = append(fails, fmt.Sprintf("Validation failed - %s: %s", path, strings.Join(fail, "\n"))) } diff --git a/examples/validator.go b/examples/validator.go index 4b1e6ca5b312..b01cb9deb1b4 100644 --- a/examples/validator.go +++ b/examples/validator.go @@ -21,7 +21,6 @@ func contains(s []string, e string) bool { } func ValidateArgoYamlRecursively(fromPath string, skipFileNames []string) (map[string][]string, error) { - schemaBytes, err := ioutil.ReadFile("../api/jsonschema/schema.json") if err != nil { return nil, err @@ -36,7 +35,7 @@ func ValidateArgoYamlRecursively(fromPath string, skipFileNames []string) (map[s return err } if contains(skipFileNames, info.Name()) { - //fmt.Printf("skipping %+v \n", info.Name()) + // fmt.Printf("skipping %+v \n", info.Name()) return filepath.SkipDir } if info.IsDir() { diff --git a/hack/crds.go b/hack/crds.go index 74dfc99fcb52..0a5420044e57 100644 --- a/hack/crds.go +++ b/hack/crds.go @@ -43,7 +43,7 @@ func cleanCRD(filename string) { if err != nil { panic(err) } - err = ioutil.WriteFile(filename, data, 0666) + err = ioutil.WriteFile(filename, data, 0o666) if err != nil { panic(err) } @@ -72,7 +72,7 @@ func removeCRDValidation(filename string) { if err != nil { panic(err) } - err = ioutil.WriteFile(filename, data, 0666) + err = ioutil.WriteFile(filename, data, 0o666) if err != nil { panic(err) } diff --git a/hack/docgen.go b/hack/docgen.go index d808e4e748cf..87f5a359d9aa 100644 --- a/hack/docgen.go +++ b/hack/docgen.go @@ -345,7 +345,7 @@ func (c *DocGeneratorContext) generate() string { func generateDocs() { println("generating docs/fields.md") c := NewDocGeneratorContext() - err := ioutil.WriteFile("docs/fields.md", []byte(c.generate()), 0644) + err := ioutil.WriteFile("docs/fields.md", []byte(c.generate()), 0o644) if err != nil { panic(err) } diff --git a/hack/parse_examples.go b/hack/parse_examples.go index 15b5770a05a3..af63a3572fc2 100644 --- a/hack/parse_examples.go +++ b/hack/parse_examples.go @@ -35,7 +35,7 @@ func parseExamples() { file = linkRegex.ReplaceAll(file, []byte(newLink)) file = detailsRegex.ReplaceAll(file, []byte(newDetails)) - err = ioutil.WriteFile("site/fields/index.html", file, 0644) + err = ioutil.WriteFile("site/fields/index.html", file, 0o644) if err != nil { panic(err) } diff --git a/hack/swagger/secondaryswaggergen.go b/hack/swagger/secondaryswaggergen.go index de205c020d56..41abf79dfb1c 100644 --- a/hack/swagger/secondaryswaggergen.go +++ b/hack/swagger/secondaryswaggergen.go @@ -51,7 +51,7 @@ func secondarySwaggerGen() { panic(err) } newContents := strings.ReplaceAll(string(read), "argo-workflows", "argo_workflows") - err = ioutil.WriteFile("pkg/apiclient/_.secondary.swagger.json", []byte(newContents), 0666) + err = ioutil.WriteFile("pkg/apiclient/_.secondary.swagger.json", []byte(newContents), 0o666) if err != nil { panic(err) } diff --git a/server/artifacts/artifact_server_test.go b/server/artifacts/artifact_server_test.go index 4b8c75654e95..66187cbc1f16 100644 --- a/server/artifacts/artifact_server_test.go +++ b/server/artifacts/artifact_server_test.go @@ -42,7 +42,7 @@ type fakeArtifactDriver struct { } func (a *fakeArtifactDriver) Load(_ *wfv1.Artifact, path string) error { - return ioutil.WriteFile(path, a.data, 0666) + return ioutil.WriteFile(path, a.data, 0o666) } func (a *fakeArtifactDriver) Save(_ string, _ *wfv1.Artifact) error { diff --git a/server/auth/serviceaccount/claims_test.go b/server/auth/serviceaccount/claims_test.go index 9cefe07ee613..9e1596b31a2e 100644 --- a/server/auth/serviceaccount/claims_test.go +++ b/server/auth/serviceaccount/claims_test.go @@ -41,7 +41,7 @@ func TestClaimSetFor(t *testing.T) { // set-up test tmp, err := ioutil.TempFile("", "") assert.NoError(t, err) - err = ioutil.WriteFile(tmp.Name(), []byte(token), 0644) + err = ioutil.WriteFile(tmp.Name(), []byte(token), 0o644) assert.NoError(t, err) defer func() { _ = os.Remove(tmp.Name()) }() diff --git a/test/e2e/cli_test.go b/test/e2e/cli_test.go index eccc9792bb9a..69085afd195d 100644 --- a/test/e2e/cli_test.go +++ b/test/e2e/cli_test.go @@ -657,7 +657,7 @@ func (s *CLISuite) TestWorkflowLint() { data, err := ioutil.ReadFile("smoke/basic.yaml") s.CheckError(err) // Write data to dst - err = ioutil.WriteFile(filepath.Join(tmp, "my-workflow.yaml"), data, 0644) + err = ioutil.WriteFile(filepath.Join(tmp, "my-workflow.yaml"), data, 0o644) s.CheckError(err) s.Given(). RunCli([]string{"lint", tmp}, func(t *testing.T, output string, err error) { diff --git a/util/archive/archive_test.go b/util/archive/archive_test.go index 2c8f7f6a5ee3..378447948f78 100644 --- a/util/archive/archive_test.go +++ b/util/archive/archive_test.go @@ -17,7 +17,7 @@ func tempFile(dir, prefix, suffix string) (*os.File, error) { if dir == "" { dir = os.TempDir() } else { - err := os.MkdirAll(dir, 0700) + err := os.MkdirAll(dir, 0o700) if err != nil { return nil, err } diff --git a/util/file/fileutil_test.go b/util/file/fileutil_test.go index fb668b4677c3..d54e22d52985 100644 --- a/util/file/fileutil_test.go +++ b/util/file/fileutil_test.go @@ -39,7 +39,7 @@ func TestExistsInTar(t *testing.T) { var buf bytes.Buffer writer := tar.NewWriter(&buf) for _, f := range files { - mode := os.FileMode(0600) + mode := os.FileMode(0o600) if f.isDir { mode |= os.ModeDir } diff --git a/util/util.go b/util/util.go index e51cab4ea1cc..72fd94655abe 100644 --- a/util/util.go +++ b/util/util.go @@ -51,7 +51,7 @@ func GetSecrets(ctx context.Context, clientSet kubernetes.Interface, namespace, // Write the Terminate message in pod spec func WriteTeriminateMessage(message string) { - err := ioutil.WriteFile("/dev/termination-log", []byte(message), 0644) + err := ioutil.WriteFile("/dev/termination-log", []byte(message), 0o644) if err != nil { panic(err) } diff --git a/workflow/artifacts/gcs/gcs.go b/workflow/artifacts/gcs/gcs.go index be98f296a049..73207f64cef9 100644 --- a/workflow/artifacts/gcs/gcs.go +++ b/workflow/artifacts/gcs/gcs.go @@ -107,7 +107,7 @@ func downloadObject(client *storage.Client, bucket, key, objName, path string) e localPath := filepath.Join(path, relObjPath) objectDir, _ := filepath.Split(localPath) if objectDir != "" { - if err := os.MkdirAll(objectDir, 0700); err != nil { + if err := os.MkdirAll(objectDir, 0o700); err != nil { return fmt.Errorf("mkdir %s: %v", objectDir, err) } } diff --git a/workflow/artifacts/git/git.go b/workflow/artifacts/git/git.go index c976cd386a3d..8b84fd1b2c6f 100644 --- a/workflow/artifacts/git/git.go +++ b/workflow/artifacts/git/git.go @@ -41,7 +41,7 @@ func (g *ArtifactDriver) auth() (func(), transport.AuthMethod, []string, error) if err != nil { return nil, nil, nil, err } - err = ioutil.WriteFile(privateKeyFile.Name(), []byte(g.SSHPrivateKey), 0600) + err = ioutil.WriteFile(privateKeyFile.Name(), []byte(g.SSHPrivateKey), 0o600) if err != nil { return nil, nil, nil, err } @@ -77,7 +77,7 @@ case "$1" in Username*) echo "${GIT_USERNAME}" ;; Password*) echo "${GIT_PASSWORD}" ;; esac -`), 0755) +`), 0o755) if err != nil { return nil, nil, nil, err } diff --git a/workflow/artifacts/git/git_test.go b/workflow/artifacts/git/git_test.go index 9b4b6f0bc563..e45894a6c554 100644 --- a/workflow/artifacts/git/git_test.go +++ b/workflow/artifacts/git/git_test.go @@ -17,7 +17,7 @@ func TestGitArtifactDriver_Load(t *testing.T) { driver := &ArtifactDriver{} path := "/tmp/git-found" assert.NoError(t, os.RemoveAll(path)) - assert.NoError(t, os.MkdirAll(path, 0777)) + assert.NoError(t, os.MkdirAll(path, 0o777)) err := driver.Load(&wfv1.Artifact{ ArtifactLocation: wfv1.ArtifactLocation{ Git: &wfv1.GitArtifact{ diff --git a/workflow/artifacts/hdfs/hdfs.go b/workflow/artifacts/hdfs/hdfs.go index 39f76412a7cf..3900c115d575 100644 --- a/workflow/artifacts/hdfs/hdfs.go +++ b/workflow/artifacts/hdfs/hdfs.go @@ -159,7 +159,7 @@ func (driver *ArtifactDriver) Load(_ *wfv1.Artifact, path string) error { dirPath := filepath.Dir(driver.Path) if dirPath != "." && dirPath != "/" { // Follow umask for the permission - err = os.MkdirAll(dirPath, 0777) + err = os.MkdirAll(dirPath, 0o777) if err != nil { return err } @@ -208,7 +208,7 @@ func (driver *ArtifactDriver) Save(path string, outputArtifact *wfv1.Artifact) e dirPath := filepath.Dir(driver.Path) if dirPath != "." && dirPath != "/" { // Follow umask for the permission - err = hdfscli.MkdirAll(dirPath, 0777) + err = hdfscli.MkdirAll(dirPath, 0o777) if err != nil { return err } diff --git a/workflow/executor/common/common.go b/workflow/executor/common/common.go index 5066ff28c946..ac5d9c52bb76 100644 --- a/workflow/executor/common/common.go +++ b/workflow/executor/common/common.go @@ -150,7 +150,7 @@ func CopyArchive(ctx context.Context, c KubernetesClientInterface, containerName if err != nil { return err } - f, err := os.OpenFile(destPath, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0666) + f, err := os.OpenFile(destPath, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0o666) if err != nil { return err } diff --git a/workflow/executor/emissary/binary.go b/workflow/executor/emissary/binary.go index 21835449cd1c..10d66dea5b75 100644 --- a/workflow/executor/emissary/binary.go +++ b/workflow/executor/emissary/binary.go @@ -16,7 +16,7 @@ func copyBinary() error { return err } defer func() { _ = in.Close() }() - out, err := os.OpenFile("/var/run/argo/argoexec", os.O_RDWR|os.O_CREATE, 0500) // r-x------ + out, err := os.OpenFile("/var/run/argo/argoexec", os.O_RDWR|os.O_CREATE, 0o500) // r-x------ if err != nil { return err } diff --git a/workflow/executor/emissary/emissary.go b/workflow/executor/emissary/emissary.go index b0610e7cbec0..bd5ce9fa3e08 100644 --- a/workflow/executor/emissary/emissary.go +++ b/workflow/executor/emissary/emissary.go @@ -62,7 +62,7 @@ func (e emissary) writeTemplate(t wfv1.Template) error { if err != nil { return err } - return ioutil.WriteFile("/var/run/argo/template", data, 0400) // chmod -r-------- + return ioutil.WriteFile("/var/run/argo/template", data, 0o400) // chmod -r-------- } func (e emissary) GetFileContents(_ string, sourcePath string) (string, error) { @@ -137,7 +137,7 @@ func (e emissary) isComplete(containerNames []string) bool { func (e emissary) Kill(ctx context.Context, containerNames []string, terminationGracePeriodDuration time.Duration) error { for _, containerName := range containerNames { - if err := ioutil.WriteFile("/var/run/argo/ctr/"+containerName+"/signal", []byte(strconv.Itoa(int(syscall.SIGTERM))), 0600); err != nil { + if err := ioutil.WriteFile("/var/run/argo/ctr/"+containerName+"/signal", []byte(strconv.Itoa(int(syscall.SIGTERM))), 0o600); err != nil { return err } } @@ -148,7 +148,7 @@ func (e emissary) Kill(ctx context.Context, containerNames []string, termination return err } for _, containerName := range containerNames { - if err := ioutil.WriteFile("/var/run/argo/ctr/"+containerName+"/signal", []byte(strconv.Itoa(int(syscall.SIGKILL))), 0600); err != nil { + if err := ioutil.WriteFile("/var/run/argo/ctr/"+containerName+"/signal", []byte(strconv.Itoa(int(syscall.SIGKILL))), 0o600); err != nil { return err } } diff --git a/workflow/executor/executor.go b/workflow/executor/executor.go index 43f071239f0e..6f58f8ec3de3 100644 --- a/workflow/executor/executor.go +++ b/workflow/executor/executor.go @@ -251,7 +251,7 @@ func (we *WorkflowExecutor) StageFiles() error { default: return nil } - err := ioutil.WriteFile(filePath, body, 0644) + err := ioutil.WriteFile(filePath, body, 0o644) if err != nil { return errors.InternalWrapError(err) } diff --git a/workflow/executor/executor_test.go b/workflow/executor/executor_test.go index 8985070eb248..205af46bc1f5 100644 --- a/workflow/executor/executor_test.go +++ b/workflow/executor/executor_test.go @@ -250,7 +250,7 @@ func TestChmod(t *testing.T) { permissions perm }{ { - 0777, + 0o777, false, perm{ "drwxrwxrwx", @@ -258,7 +258,7 @@ func TestChmod(t *testing.T) { }, }, { - 0777, + 0o777, true, perm{ "drwxrwxrwx", diff --git a/workflow/util/util_test.go b/workflow/util/util_test.go index d6c963a75a9f..55277ef0b39e 100644 --- a/workflow/util/util_test.go +++ b/workflow/util/util_test.go @@ -103,7 +103,7 @@ func TestReadFromSingleorMultiplePath(t *testing.T) { content := []byte(tc.contents[i]) tmpfn := filepath.Join(dir, tc.fileNames[i]) filePaths = append(filePaths, tmpfn) - err := ioutil.WriteFile(tmpfn, content, 0666) + err := ioutil.WriteFile(tmpfn, content, 0o666) if err != nil { t.Error("Could not write to temporary file") } @@ -155,7 +155,7 @@ func TestReadFromSingleorMultiplePathErrorHandling(t *testing.T) { tmpfn := filepath.Join(dir, tc.fileNames[i]) filePaths = append(filePaths, tmpfn) if tc.exists[i] { - err := ioutil.WriteFile(tmpfn, content, 0666) + err := ioutil.WriteFile(tmpfn, content, 0o666) if err != nil { t.Error("Could not write to temporary file") } @@ -530,7 +530,7 @@ func TestApplySubmitOpts(t *testing.T) { file, err := ioutil.TempFile("", "") assert.NoError(t, err) defer func() { _ = os.Remove(file.Name()) }() - err = ioutil.WriteFile(file.Name(), []byte(`a: 81861780812`), 0644) + err = ioutil.WriteFile(file.Name(), []byte(`a: 81861780812`), 0o644) assert.NoError(t, err) err = ApplySubmitOpts(wf, &wfv1.SubmitOpts{ParameterFile: file.Name()}) assert.NoError(t, err)