Repository: argoproj/argo
Pull request #3353 (2020-06-30 17:42:34)

chore: Simplify deps by removing YAML
Checklist:

* [x] Either (a) I've created an [enhancement proposal](https://github.com/argoproj/argo/issues/new/choose) and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
* [x] The title of the PR is (a) [conventional](https://www.conventionalcommits.org/en/v1.0.0/), (b) states what changed, and (c) suffixes the related issues number. E.g. `"fix(controller): Updates such and such. Fixes #1234"`.  
* [x] I've signed the CLA.
* [ ] I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
* [ ] My builds are green. Try syncing with master if they are not. 
* [x] My organization is added to [USERS.md](https://github.com/argoproj/argo/blob/master/USERS.md).



Patch:
diff --git a/Makefile b/Makefile
index 15e622e19..101e12705 100644
--- a/Makefile
+++ b/Makefile
@@ -319,7 +319,7 @@ endif
 .PHONY: test
 test: server/static/files.go
 	@mkdir -p test-results
-	go test -v $(TEST_OPTS) `go list ./... | grep -v 'test/e2e'` 2>&1 | tee test-results/test.out
+	go test -v $(TEST_OPTS) ./... 2>&1 | tee test-results/test.out
 
 test-results/test-report.json: test-results/test.out
 	cat test-results/test.out | go tool test2json > test-results/test-report.json
@@ -430,30 +430,19 @@ mysql-cli:
 test-e2e: test-images cli
 	# Run E2E tests
 	@mkdir -p test-results
-	go test -timeout 15m -v -count 1 -p 1 --short ./test/e2e/... 2>&1 | tee test-results/test.out
+	go test -timeout 15m -v -count 1 --tags e2e -p 1 --short ./test/e2e 2>&1 | tee test-results/test.out
 
 .PHONY: test-e2e-cron
 test-e2e-cron: test-images cli
 	# Run E2E tests
 	@mkdir -p test-results
-	go test -timeout 5m -v -count 1 -parallel 10 -run CronSuite ./test/e2e 2>&1 | tee test-results/test.out
+	go test -timeout 5m -v -count 1 --tags e2e -parallel 10 -run CronSuite ./test/e2e 2>&1 | tee test-results/test.out
 
 .PHONY: smoke
 smoke: test-images
 	# Run smoke tests
 	@mkdir -p test-results
-	go test -timeout 1m -v -count 1 -p 1 -run SmokeSuite ./test/e2e 2>&1 | tee test-results/test.out
-
-.PHONY: test-api
-test-api:
-	# Run API tests
-	go test -timeout 1m -v -count 1 -p 1 -run ArgoServerSuite ./test/e2e
-
-.PHONY: test-cli
-test-cli: cli
-	# Run CLI tests
-	go test -timeout 2m -v -count 1 -p 1 -run CLISuite ./test/e2e
-	go test -timeout 2m -v -count 1 -p 1 -run CLIWithServerSuite ./test/e2e
+	go test -timeout 1m -v -count 1 --tags e2e -p 1 -run SmokeSuite ./test/e2e 2>&1 | tee test-results/test.out
 
 # clean
 
@@ -523,7 +512,7 @@ docs: swagger
 # pre-push
 
 .PHONY: pre-commit
-pre-commit: test lint codegen manifests start smoke test-api test-cli
+pre-commit: test lint codegen start
 
 # release - targets only available on release branch
 ifneq ($(findstring release,$(GIT_BRANCH)),)
diff --git a/go.mod b/go.mod
index c692e0772..7065a145b 100644
--- a/go.mod
+++ b/go.mod
@@ -22,7 +22,6 @@ require (
 	github.com/fatih/structs v1.1.0 // indirect
 	github.com/fsnotify/fsnotify v1.4.9 // indirect
 	github.com/gavv/httpexpect/v2 v2.0.3
-	github.com/ghodss/yaml v1.0.0
 	github.com/go-ini/ini v1.51.1 // indirect
 	github.com/go-openapi/jsonreference v0.19.3
 	github.com/go-openapi/spec v0.19.7
@@ -58,7 +57,6 @@ require (
 	github.com/prometheus/client_model v0.1.0
 	github.com/prometheus/common v0.7.0
 	github.com/prometheus/procfs v0.0.8 // indirect
-	github.com/robfig/cron v1.2.0
 	github.com/robfig/cron/v3 v3.0.1
 	github.com/satori/go.uuid v1.2.0 // indirect
 	github.com/sergi/go-diff v1.1.0 // indirect
@@ -86,7 +84,7 @@ require (
 	gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
 	gopkg.in/square/go-jose.v2 v2.5.0 // indirect
 	gopkg.in/src-d/go-git.v4 v4.13.1
-	gopkg.in/yaml.v2 v2.2.8
+	gopkg.in/yaml.v2 v2.2.8 // indirect
 	k8s.io/api v0.0.0-20191219150132-17cfeff5d095
 	k8s.io/apimachinery v0.16.7-beta.0
 	k8s.io/client-go v0.0.0-20191225075139-73fd2ddc9180
diff --git a/go.sum b/go.sum
index 7e788531f..fdaa86431 100644
--- a/go.sum
+++ b/go.sum
@@ -402,8 +402,6 @@ github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLk
 github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
 github.com/rivo/tview v0.0.0-20200219210816-cd38d7432498/go.mod h1:6lkG1x+13OShEf0EaOCaTQYyB7d5nSbb181KtjlS+84=
 github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
-github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
-github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
 github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
 github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
 github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
diff --git a/util/printer/workflow-printer.go b/util/printer/workflow-printer.go
index 366928457..0fd9da2a0 100644
--- a/util/printer/workflow-printer.go
+++ b/util/printer/workflow-printer.go
@@ -9,7 +9,7 @@ import (
 	"time"
 
 	"github.com/argoproj/pkg/humanize"
-	"gopkg.in/yaml.v2"
+	"sigs.k8s.io/yaml"
 
 	wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1"
 	"github.com/argoproj/argo/workflow/util"
diff --git a/workflow/controller/controller.go b/workflow/controller/controller.go
index 184dd5411..8a0d8ecb1 100644
--- a/workflow/controller/controller.go
+++ b/workflow/controller/controller.go
@@ -22,11 +22,8 @@ import (
 	"k8s.io/apimachinery/pkg/util/wait"
 	"k8s.io/apimachinery/pkg/watch"
 	"k8s.io/client-go/kubernetes"
-	"k8s.io/client-go/kubernetes/scheme"
-	typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1"
 	"k8s.io/client-go/rest"
 	"k8s.io/client-go/tools/cache"
-	"k8s.io/client-go/tools/record"
 	"k8s.io/client-go/util/workqueue"
 	"upper.io/db.v3/lib/sqlbuilder"
 
@@ -84,7 +81,7 @@ type WorkflowController struct {
 	hydrator              hydrator.Interface
 	wfArchive             sqldb.WorkflowArchive
 	metrics               metrics.Metrics
-	eventRecorder         record.EventRecorder
+	eventRecorderManager  EventRecorderManager
 	archiveLabelSelector  labels.Selector
 }
 
@@ -97,10 +94,6 @@ const (
 
 // NewWorkflowController instantiates a new WorkflowController
 func NewWorkflowController(restConfig *rest.Config, kubeclientset kubernetes.Interface, wfclientset wfclientset.Interface, namespace string, managedNamespace string, executorImage, executorImagePullPolicy, containerRuntimeExecutor, configMap string) *WorkflowController {
-	eventBroadcaster := record.NewBroadcaster()
-	eventBroadcaster.StartLogging(log.Debugf)
-	eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{Interface: kubeclientset.CoreV1().Events(namespace)})
-	eventRecorder := eventBroadcaster.NewRecorder(scheme.Scheme, apiv1.EventSource{Component: "workflow-controller"})
 	wfc := WorkflowController{
 		restConfig:                 restConfig,
 		kubeclientset:              kubeclientset,
@@ -115,7 +108,7 @@ func NewWorkflowController(restConfig *rest.Config, kubeclientset kubernetes.Int
 		configController:           config.NewController(namespace, configMap, kubeclientset),
 		completedPods:              make(chan string, 512),
 		gcPods:                     make(chan string, 512),
-		eventRecorder:              eventRecorder,
+		eventRecorderManager:       newEventRecorderManager(kubeclientset),
 	}
 	wfc.throttler = NewThrottler(0, wfc.wfQueue)
 	wfc.UpdateConfig()
diff --git a/workflow/controller/event_recorder_manager.go b/workflow/controller/event_recorder_manager.go
new file mode 100644
index 000000000..4988bb093
--- /dev/null
+++ b/workflow/controller/event_recorder_manager.go
@@ -0,0 +1,45 @@
+package controller
+
+import (
+	"sync"
+
+	log "github.com/sirupsen/logrus"
+	apiv1 "k8s.io/api/core/v1"
+	"k8s.io/client-go/kubernetes"
+	"k8s.io/client-go/kubernetes/scheme"
+	typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1"
+	"k8s.io/client-go/tools/record"
+)
+
+type EventRecorderManager interface {
+	Get(namespace string) record.EventRecorder
+}
+
+type eventRecorderManager struct {
+	kubernetes     kubernetes.Interface
+	lock           sync.Mutex
+	eventRecorders map[string]record.EventRecorder
+}
+
+func (m *eventRecorderManager) Get(namespace string) record.EventRecorder {
+	m.lock.Lock()
+	defer m.lock.Unlock()
+	eventRecorder, ok := m.eventRecorders[namespace]
+	if ok {
+		return eventRecorder
+	}
+	eventBroadcaster := record.NewBroadcaster()
+	eventBroadcaster.StartLogging(log.Debugf)
+	eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{Interface: m.kubernetes.CoreV1().Events(namespace)})
+	m.eventRecorders[namespace] = eventBroadcaster.NewRecorder(scheme.Scheme, apiv1.EventSource{Component: "workflow-controller"})
+	return m.eventRecorders[namespace]
+
+}
+
+func newEventRecorderManager(kubernetes kubernetes.Interface) EventRecorderManager {
+	return &eventRecorderManager{
+		kubernetes:     kubernetes,
+		lock:           sync.Mutex{},
+		eventRecorders: make(map[string]record.EventRecorder),
+	}
+}
diff --git a/workflow/controller/operator.go b/workflow/controller/operator.go
index db2d12cc2..c935bbd9b 100644
--- a/workflow/controller/operator.go
+++ b/workflow/controller/operator.go
@@ -131,7 +131,7 @@ func newWorkflowOperationCtx(wf *wfv1.Workflow, wfc *WorkflowController) *wfOper
 		completedPods:          make(map[string]bool),
 		succeededPods:          make(map[string]bool),
 		deadline:               time.Now().UTC().Add(maxOperationTime),
-		eventRecorder:          wfc.eventRecorder,
+		eventRecorder:          wfc.eventRecorderManager.Get(wf.Namespace),
 		preExecutionNodePhases: make(map[string]wfv1.NodePhase),
 	}
 
diff --git a/workflow/validate/validate.go b/workflow/validate/validate.go
index 0d5754950..30ae7f49e 100644
--- a/workflow/validate/validate.go
+++ b/workflow/validate/validate.go
@@ -10,7 +10,7 @@ import (
 	"strings"
 	"time"
 
-	"github.com/robfig/cron"
+	"github.com/robfig/cron/v3"
 	"github.com/sirupsen/logrus"
 	"github.com/valyala/fasttemplate"
 	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"


Test patch:
diff --git a/cmd/argo/commands/cron/get_test.go b/cmd/argo/commands/cron/get_test.go
index 0e0ab841a..555999e6b 100644
--- a/cmd/argo/commands/cron/get_test.go
+++ b/cmd/argo/commands/cron/get_test.go
@@ -3,8 +3,8 @@ package cron
 import (
 	"testing"
 
-	"github.com/ghodss/yaml"
 	"github.com/stretchr/testify/assert"
+	"sigs.k8s.io/yaml"
 
 	"github.com/argoproj/argo/pkg/apis/workflow/v1alpha1"
 )
diff --git a/cmd/argo/commands/get_test.go b/cmd/argo/commands/get_test.go
index d52a9645c..7555ed0aa 100644
--- a/cmd/argo/commands/get_test.go
+++ b/cmd/argo/commands/get_test.go
@@ -7,9 +7,9 @@ import (
 	"text/tabwriter"
 	"time"
 
-	"github.com/ghodss/yaml"
 	"github.com/stretchr/testify/assert"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	"sigs.k8s.io/yaml"
 
 	wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1"
 )
diff --git a/server/workflow/workflow_server_test.go b/server/workflow/workflow_server_test.go
index ad85a759f..4c64edd0c 100644
--- a/server/workflow/workflow_server_test.go
+++ b/server/workflow/workflow_server_test.go
@@ -508,8 +508,7 @@ const clusterworkflowtmpl = `
   "apiVersion": "argoproj.io/v1alpha1",
   "kind": "ClusterWorkflowTemplate",
   "metadata": {
-    "name": "cluster-workflow-template-whalesay-template",
-    "namespace": "workflows"
+    "name": "cluster-workflow-template-whalesay-template"
   },
   "spec": {
     "entrypoint": "whalesay-template",
diff --git a/test/e2e/argo_server_test.go b/test/e2e/argo_server_test.go
index 16888e93b..53845847f 100644
--- a/test/e2e/argo_server_test.go
+++ b/test/e2e/argo_server_test.go
@@ -1,3 +1,5 @@
+// +build e2e
+
 package e2e
 
 import (
diff --git a/test/e2e/cli_test.go b/test/e2e/cli_test.go
index 1a7790007..98decdbc7 100644
--- a/test/e2e/cli_test.go
+++ b/test/e2e/cli_test.go
@@ -1,3 +1,5 @@
+// +build e2e
+
 package e2e
 
 import (
diff --git a/test/e2e/cli_with_server_test.go b/test/e2e/cli_with_server_test.go
index 941863d51..5e5c34fc0 100644
--- a/test/e2e/cli_with_server_test.go
+++ b/test/e2e/cli_with_server_test.go
@@ -1,3 +1,5 @@
+// +build e2e
+
 package e2e
 
 import (
diff --git a/test/e2e/cluster_workflow_template_test.go b/test/e2e/cluster_workflow_template_test.go
index 56c8fa434..5122b9e43 100644
--- a/test/e2e/cluster_workflow_template_test.go
+++ b/test/e2e/cluster_workflow_template_test.go
@@ -1,3 +1,5 @@
+// +build e2e
+
 package e2e
 
 import (
diff --git a/test/e2e/cron_test.go b/test/e2e/cron_test.go
index 8fa794813..dce1d1daa 100644
--- a/test/e2e/cron_test.go
+++ b/test/e2e/cron_test.go
@@ -1,3 +1,5 @@
+// +build e2e
+
 package e2e
 
 import (
diff --git a/test/e2e/functional_test.go b/test/e2e/functional_test.go
index e09f13764..31f74b049 100644
--- a/test/e2e/functional_test.go
+++ b/test/e2e/functional_test.go
@@ -1,3 +1,5 @@
+// +build e2e
+
 package e2e
 
 import (
diff --git a/test/e2e/metrics_test.go b/test/e2e/metrics_test.go
index d4491a81b..26300b57e 100644
--- a/test/e2e/metrics_test.go
+++ b/test/e2e/metrics_test.go
@@ -1,3 +1,5 @@
+// +build e2e
+
 package e2e
 
 import (
diff --git a/test/e2e/smoke_test.go b/test/e2e/smoke_test.go
index 774caa98e..04670e269 100644
--- a/test/e2e/smoke_test.go
+++ b/test/e2e/smoke_test.go
@@ -1,3 +1,5 @@
+// +build e2e
+
 package e2e
 
 import (
diff --git a/test/e2e/workflow_template_test.go b/test/e2e/workflow_template_test.go
index 0277e6bc3..e22a004f5 100644
--- a/test/e2e/workflow_template_test.go
+++ b/test/e2e/workflow_template_test.go
@@ -1,3 +1,5 @@
+// +build e2e
+
 package e2e
 
 import (
diff --git a/workflow/common/convert_test.go b/workflow/common/convert_test.go
index efcee9455..32217bc65 100644
--- a/workflow/common/convert_test.go
+++ b/workflow/common/convert_test.go
@@ -3,8 +3,8 @@ package common
 import (
 	"testing"
 
-	"github.com/ghodss/yaml"
 	"github.com/stretchr/testify/assert"
+	"sigs.k8s.io/yaml"
 
 	"github.com/argoproj/argo/pkg/apis/workflow/v1alpha1"
 )
diff --git a/workflow/controller/controller_test.go b/workflow/controller/controller_test.go
index b85bc1405..171a2d065 100644
--- a/workflow/controller/controller_test.go
+++ b/workflow/controller/controller_test.go
@@ -6,6 +6,7 @@ import (
 	"time"
 
 	"k8s.io/apimachinery/pkg/labels"
+	"k8s.io/client-go/tools/record"
 
 	"github.com/stretchr/testify/assert"
 	authorizationv1 "k8s.io/api/authorization/v1"
@@ -16,7 +17,6 @@ import (
 	"k8s.io/client-go/kubernetes/fake"
 	k8stesting "k8s.io/client-go/testing"
 	"k8s.io/client-go/tools/cache"
-	"k8s.io/client-go/tools/record"
 	"k8s.io/client-go/util/workqueue"
 	"sigs.k8s.io/yaml"
 
@@ -102,6 +102,16 @@ spec:
       args: ["hello world"]
 `
 
+type testEventRecorderManager struct {
+	eventRecorder *record.FakeRecorder
+}
+
+func (t testEventRecorderManager) Get(string) record.EventRecorder {
+	return t.eventRecorder
+}
+
+var _ EventRecorderManager = &testEventRecorderManager{}
+
 func newController(objects ...runtime.Object) (context.CancelFunc, *WorkflowController) {
 	wfclientset := fakewfclientset.NewSimpleClientset(objects...)
 	informerFactory := wfextv.NewSharedInformerFactory(wfclientset, 10*time.Minute)
@@ -133,7 +143,7 @@ func newController(objects ...runtime.Object) (context.CancelFunc, *WorkflowCont
 		wfArchive:            sqldb.NullWorkflowArchive,
 		hydrator:             hydratorfake.Noop,
 		metrics:              metrics.New(metrics.ServerConfig{}, metrics.ServerConfig{}),
-		eventRecorder:        record.NewFakeRecorder(16),
+		eventRecorderManager: &testEventRecorderManager{eventRecorder: record.NewFakeRecorder(16)},
 		archiveLabelSelector: labels.Everything(),
 	}
 	return cancel, controller
diff --git a/workflow/controller/operator_metrics_test.go b/workflow/controller/operator_metrics_test.go
index 8b4110cae..03eba95be 100644
--- a/workflow/controller/operator_metrics_test.go
+++ b/workflow/controller/operator_metrics_test.go
@@ -1,9 +1,9 @@
 package controller
 
 import (
+	"fmt"
 	"testing"
 
-	"github.com/gogo/protobuf/proto"
 	"github.com/prometheus/client_golang/prometheus"
 	dto "github.com/prometheus/client_model/go"
 	"github.com/stretchr/testify/assert"
@@ -135,7 +135,7 @@ func getMetricStringValue(metric prometheus.Metric) (string, error) {
 	if err != nil {
 		return "", err
 	}
-	return proto.CompactTextString(metricString), nil
+	return fmt.Sprintf("%v", metricString), nil
 }
 
 var testMetricEmissionSameOperationCreationAndFailure = `
diff --git a/workflow/controller/operator_test.go b/workflow/controller/operator_test.go
index 349821c26..71ea4d4c0 100644
--- a/workflow/controller/operator_test.go
+++ b/workflow/controller/operator_test.go
@@ -13,7 +13,6 @@ import (
 	apiv1 "k8s.io/api/core/v1"
 	"k8s.io/apimachinery/pkg/api/resource"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
-	"k8s.io/client-go/tools/record"
 	"sigs.k8s.io/yaml"
 
 	"github.com/argoproj/argo/config"
@@ -2736,7 +2735,7 @@ func TestEventInvalidSpec(t *testing.T) {
 }
 
 func getEvents(controller *WorkflowController, num int) []string {
-	c := controller.eventRecorder.(*record.FakeRecorder).Events
+	c := controller.eventRecorderManager.(*testEventRecorderManager).eventRecorder.Events
 	events := make([]string, num)
 	for i := 0; i < num; i++ {
 		events[i] = <-c
diff --git a/workflow/controller/steps_test.go b/workflow/controller/steps_test.go
index 001d30bf3..2682d1df9 100644
--- a/workflow/controller/steps_test.go
+++ b/workflow/controller/steps_test.go
@@ -3,8 +3,8 @@ package controller
 import (
 	"testing"
 
-	"github.com/ghodss/yaml"
 	"github.com/stretchr/testify/assert"
+	"sigs.k8s.io/yaml"
 
 	wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1"
 	"github.com/argoproj/argo/test"
diff --git a/workflow/cron/operator_test.go b/workflow/cron/operator_test.go
index 4d76426ba..31ed71cb0 100644
--- a/workflow/cron/operator_test.go
+++ b/workflow/cron/operator_test.go
@@ -5,10 +5,10 @@ import (
 	"time"
 
 	"github.com/argoproj/pkg/humanize"
-	"github.com/ghodss/yaml"
 	"github.com/sirupsen/logrus"
 	"github.com/stretchr/testify/assert"
 	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	"sigs.k8s.io/yaml"
 
 	"github.com/argoproj/argo/pkg/apis/workflow/v1alpha1"
 	"github.com/argoproj/argo/pkg/client/clientset/versioned/fake"
@@ -241,7 +241,7 @@ func TestSpecError(t *testing.T) {
 	submissionErrorCond := woc.cronWf.Status.Conditions[0]
 	assert.Equal(t, v1.ConditionTrue, submissionErrorCond.Status)
 	assert.Equal(t, v1alpha1.ConditionTypeSpecError, submissionErrorCond.Type)
-	assert.Contains(t, submissionErrorCond.Message, "cron schedule is malformed: End of range (12737123) above maximum (12): 12737123")
+	assert.Contains(t, submissionErrorCond.Message, "cron schedule is malformed: end of range (12737123) above maximum (12): 12737123")
 }
 
 func TestReapplyUpdate(t *testing.T) {
@@ -259,6 +259,7 @@ func TestReapplyUpdate(t *testing.T) {
 		wfLister:    &fakeLister{},
 		cronWf:      &cronWf,
 		origCronWf:  cronWf.DeepCopy(),
+		name:        cronWf.Name,
 		log:         logrus.WithFields(logrus.Fields{}),
 		metrics:     &testMetrics,
 	}
diff --git a/workflow/util/util_test.go b/workflow/util/util_test.go
index 1a3f6e35c..4a6b8abaf 100644
--- a/workflow/util/util_test.go
+++ b/workflow/util/util_test.go
@@ -7,10 +7,10 @@ import (
 	"path/filepath"
 	"testing"
 
-	"github.com/ghodss/yaml"
 	"github.com/stretchr/testify/assert"
 	v1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	"sigs.k8s.io/yaml"
 
 	wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1"
 	fakeClientset "github.com/argoproj/argo/pkg/client/clientset/versioned/fake"