-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Signed-off-by: Alex Collins <alex_collins@intuit.com>
- Loading branch information
Showing
15 changed files
with
136 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package commands | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"os" | ||
|
||
"github.com/TwinProduction/go-color" | ||
"github.com/argoproj/pkg/errors" | ||
|
||
workflowpkg "github.com/argoproj/argo-workflows/v3/pkg/apiclient/workflow" | ||
"github.com/argoproj/argo-workflows/v3/workflow/verify" | ||
) | ||
|
||
func verifyWorkflows(ctx context.Context, serviceClient workflowpkg.WorkflowServiceClient, namespace string, workflowNames []string) { | ||
_, _ = fmt.Fprintln(os.Stderr, "verifying workflows...") | ||
failAtEnd := false | ||
for _, name := range workflowNames { | ||
wf, err := serviceClient.GetWorkflow(ctx, &workflowpkg.WorkflowGetRequest{ | ||
Namespace: namespace, | ||
Name: name, | ||
}) | ||
errors.CheckError(err) | ||
if err := verify.Workflow(wf); err != nil { | ||
_, _ = fmt.Fprintf(os.Stdout, "%s %s: %v\n", color.Ize(color.Red, "✖"), name, err) | ||
failAtEnd = true | ||
} else { | ||
_, _ = fmt.Fprintf(os.Stdout, "%s %s\n", color.Ize(color.Green, "✔"), name) | ||
} | ||
} | ||
if failAtEnd { | ||
os.Exit(1) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -eu -o pipefail | ||
|
||
kubectl delete wf -l workflows.argoproj.io/test | ||
|
||
grep -lR 'workflows.argoproj.io/test' examples/* | while read f ; do | ||
./dist/argo submit --watch --verify $f | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package json | ||
|
||
import "encoding/json" | ||
|
||
func Jsonify(v interface{}) (map[string]interface{}, error) { | ||
data, err := json.Marshal(v) | ||
if err != nil { | ||
return nil, err | ||
} | ||
x := make(map[string]interface{}) | ||
return x, json.Unmarshal(data, &x) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package python | ||
|
||
import ( | ||
"fmt" | ||
|
||
_ "github.com/go-python/gpython/builtin" | ||
"github.com/go-python/gpython/compile" | ||
"github.com/go-python/gpython/py" | ||
"github.com/go-python/gpython/vm" | ||
) | ||
|
||
func Run(s string, globals map[string]interface{}) error { | ||
x, err := compile.Compile(s, "<stdin>", "exec", 0, true) | ||
if err != nil { | ||
return err | ||
} | ||
m := py.NewModule("__main__", "", nil, dict(globals)) | ||
code, ok := x.(*py.Code) | ||
if !ok { | ||
return fmt.Errorf("obj cannot be cast to code") | ||
} | ||
_, err = vm.EvalCode(code, m.Globals, nil) | ||
return err | ||
} |
Oops, something went wrong.