Skip to content

Commit

Permalink
go-yaml version update (#438)
Browse files Browse the repository at this point in the history
* go-yaml version update

* update go-yaml package to latest

* remove extra verbs

* remove duplicate verbs and add correct test files for resiliency UT

---------

Co-authored-by: Shayna Finocchiaro <shayna_finocchiaro@dell.com>
  • Loading branch information
2 people authored and KerryKovacevic committed Jan 25, 2024
1 parent 49aa3eb commit 2839e5c
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 32 deletions.
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ go 1.21

require (
github.com/cert-manager/cert-manager v1.12.3
github.com/go-yaml/yaml v2.1.0+incompatible
github.com/stretchr/testify v1.8.2
github.com/vmware-tanzu/velero v1.12.0
go.uber.org/zap v1.24.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.27.2
k8s.io/apiextensions-apiserver v0.27.2
k8s.io/apimachinery v0.27.2
Expand Down Expand Up @@ -64,7 +64,6 @@ require (
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/component-base v0.27.2 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230515203736-54b630e78af5 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o=
github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
Expand Down
4 changes: 0 additions & 4 deletions operatorconfig/driverconfig/powerflex/v2.8.0/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch", "patch"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
Expand All @@ -34,7 +33,6 @@ rules:
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update", "patch", "delete"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["csinodes"]
verbs: ["get", "list", "watch", "update"]
Expand All @@ -47,7 +45,6 @@ rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch", "update", "delete"]
verbs: ["get", "list", "watch"]
# below for snapshotter
- apiGroups: [""]
resources: ["secrets"]
Expand All @@ -61,7 +58,6 @@ rules:
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots"]
verbs: ["get", "list", "watch", "update", "create", "delete"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots/status","volumesnapshotcontents/status"]
verbs: ["get", "list", "watch", "update", "patch"]
Expand Down
4 changes: 0 additions & 4 deletions operatorconfig/driverconfig/powerflex/v2.9.0/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch", "patch"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
Expand All @@ -34,7 +33,6 @@ rules:
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update", "patch", "delete"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["csinodes"]
verbs: ["get", "list", "watch", "update"]
Expand All @@ -47,7 +45,6 @@ rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch", "update", "delete"]
verbs: ["get", "list", "watch"]
# below for snapshotter
- apiGroups: [""]
resources: ["secrets"]
Expand All @@ -61,7 +58,6 @@ rules:
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots"]
verbs: ["get", "list", "watch", "update", "create", "delete"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots/status","volumesnapshotcontents/status"]
verbs: ["get", "list", "watch", "update", "patch"]
Expand Down
4 changes: 0 additions & 4 deletions operatorconfig/driverconfig/powerflex/v2.9.1/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch", "patch"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"]
Expand All @@ -34,7 +33,6 @@ rules:
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update", "patch", "delete"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["storage.k8s.io"]
resources: ["csinodes"]
verbs: ["get", "list", "watch", "update"]
Expand All @@ -47,7 +45,6 @@ rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch", "update", "delete"]
verbs: ["get", "list", "watch"]
# below for snapshotter
- apiGroups: [""]
resources: ["secrets"]
Expand All @@ -61,7 +58,6 @@ rules:
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots"]
verbs: ["get", "list", "watch", "update", "create", "delete"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots/status","volumesnapshotcontents/status"]
verbs: ["get", "list", "watch", "update", "patch"]
Expand Down
4 changes: 2 additions & 2 deletions pkg/modules/resiliency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestResiliencyInjectDeployment(t *testing.T) {
return false, controllerYAML.Deployment, tmpOperatorConfig, customResource
},
"success - valid Powerscale driver name": func(*testing.T) (bool, applyv1.DeploymentApplyConfiguration, utils.OperatorConfig, csmv1.ContainerStorageModule) {
customResource, err := getCustomResource("./testdata/cr_powerstore_resiliency.yaml")
customResource, err := getCustomResource("./testdata/cr_powerscale_resiliency.yaml")
if err != nil {
panic(err)
}
Expand All @@ -86,7 +86,7 @@ func TestResiliencyInjectDeployment(t *testing.T) {
return true, *newDeployment, operatorConfig, customResource
},
"success - valid Powerflex driver name": func(*testing.T) (bool, applyv1.DeploymentApplyConfiguration, utils.OperatorConfig, csmv1.ContainerStorageModule) {
customResource, err := getCustomResource("./testdata/cr_powerstore_resiliency.yaml")
customResource, err := getCustomResource("./testdata/cr_powerflex_resiliency.yaml")
if err != nil {
panic(err)
}
Expand Down
63 changes: 63 additions & 0 deletions pkg/modules/testdata/cr_powerflex_resiliency.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
apiVersion: storage.dell.com/v1
kind: ContainerStorageModule
metadata:
name: test-vxflexos
namespace: test-vxflexos
spec:
driver:
csiDriverType: "powerflex"
csiDriverSpec:
# fsGroupPolicy: Defines if the underlying volume supports changing ownership and permission of the volume before being mounted.
# Allowed values: ReadWriteOnceWithFSType, File , None
# Default value: ReadWriteOnceWithFSType
fSGroupPolicy: "File"
configVersion: v2.9.0
replicas: 1
dnsPolicy: ClusterFirstWithHostNet
forceUpdate: false
forceRemoveDriver: true

modules:
- name: resiliency
# enabled: Enable/Disable Resiliency feature
# Allowed values:
# true: enable Resiliency feature(deploy podmon sidecar)
# false: disable Resiliency feature(do not deploy podmon sidecar)
# Default value: false
enabled: false
configVersion: v1.8.0
components:
- name: podmon-controller
image: dellemc/podmon:v1.8.0
imagePullPolicy: IfNotPresent
args:
- "--labelvalue=csi-vxflexos"
- "--skipArrayConnectionValidation=false"
- "--driverPodLabelValue=dell-storage"
- "--ignoreVolumelessPods=false"
- "--arrayConnectivityPollRate=5"
- "--arrayConnectivityConnectionLossThreshold=3"
# Below 3 args should not be modified.
- "--csisock=unix:/var/run/csi/csi.sock"
- "--mode=controller"
- "--driver-config-params=/vxflexos-config-params/driver-config-params.yaml"
- name: podmon-node
image: dellemc/podmon:v1.8.0
imagePullPolicy: IfNotPresent
envs:
# podmonAPIPort: Defines the port to be used within the kubernetes cluster
# Allowed values: Any valid and free port (string)
# Default value: 8083
- name: "X_CSI_PODMON_API_PORT"
value: "8083"
args:
- "--labelvalue=csi-vxflexos"
- "--leaderelection=false"
- "--driverPodLabelValue=dell-storage"
- "--ignoreVolumelessPods=false"
- "--arrayConnectivityPollRate=5"
# Below 3 args should not be modified.
- "--csisock=unix:/var/lib/kubelet/plugins/vxflexos.emc.dell.com/csi_sock"
- "--mode=node"
- "--driver-config-params=/vxflexos-config-params/driver-config-params.yaml"

60 changes: 60 additions & 0 deletions pkg/modules/testdata/cr_powerscale_resiliency.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
apiVersion: storage.dell.com/v1
kind: ContainerStorageModule
metadata:
name: isilon
namespace: isilon
spec:
driver:
csiDriverType: "isilon"
configVersion: v2.9.0
authSecret: isilon-creds-custom
replicas: 1
common:
image: "dellemc/csi-isilon:v2.9.0"
imagePullPolicy: IfNotPresent

modules:
- name: resiliency
# enabled: Enable/Disable Resiliency feature
# Allowed values:
# true: enable Resiliency feature(deploy podmon sidecar)
# false: disable Resiliency feature(do not deploy podmon sidecar)
# Default value: false
enabled: false
configVersion: v1.8.0
components:
- name: podmon-controller
image: dellemc/podmon:v1.8.0
imagePullPolicy: IfNotPresent
args:
- "--labelvalue=csi-isilon"
- "--arrayConnectivityPollRate=60"
- "--skipArrayConnectionValidation=false"
- "--driverPodLabelValue=dell-storage"
- "--ignoreVolumelessPods=false"
- "--arrayConnectivityConnectionLossThreshold=3"
# Below 4 args should not be modified.
- "--csisock=unix:/var/run/csi/csi.sock"
- "--mode=controller"
- "--driverPath=csi-isilon.dellemc.com"
- "--driver-config-params=/csi-isilon-config-params/driver-config-params.yaml"
- name: podmon-node
image: dellemc/podmon:v1.8.0
imagePullPolicy: IfNotPresent
envs:
# podmonAPIPort: Defines the port to be used within the kubernetes cluster
# Allowed values: Any valid and free port (string)
# Default value: 8083
- name: "X_CSI_PODMON_API_PORT"
value: "8083"
args:
- "--labelvalue=csi-isilon"
- "--arrayConnectivityPollRate=60"
- "--leaderelection=false"
- "--driverPodLabelValue=dell-storage"
- "--ignoreVolumelessPods=false"
# Below 4 args should not be modified.
- "--csisock=unix:/var/lib/kubelet/plugins/csi-isilon/csi_sock"
- "--mode=node"
- "--driverPath=csi-isilon.dellemc.com"
- "--driver-config-params=/csi-isilon-config-params/driver-config-params.yaml"
2 changes: 1 addition & 1 deletion pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

csmv1 "github.com/dell/csm-operator/api/v1"
"github.com/dell/csm-operator/pkg/logger"
goYAML "github.com/go-yaml/yaml"
goYAML "gopkg.in/yaml.v3"

certmanagerv1 "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1"
velerov1 "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
Expand Down
2 changes: 0 additions & 2 deletions tests/e2e/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ require (
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/go-yaml/yaml v2.1.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
Expand Down Expand Up @@ -88,7 +87,6 @@ require (
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/exp v0.0.0-20221028150844-83b7d23a625f // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/sync v0.4.0 // indirect
Expand Down
11 changes: 0 additions & 11 deletions tests/e2e/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/go-yaml/yaml v2.1.0+incompatible h1:RYi2hDdss1u4YE7GwixGzWwVo47T8UQwnTLB6vQiq+o=
github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
Expand Down Expand Up @@ -145,7 +143,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo/v2 v2.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs=
github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM=
github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
Expand Down Expand Up @@ -242,8 +239,6 @@ go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20221028150844-83b7d23a625f h1:Al51T6tzvuh3oiwX11vex3QgJ2XTedFPGmbEVh8cdoc=
Expand Down Expand Up @@ -272,19 +267,13 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
Expand Down

0 comments on commit 2839e5c

Please sign in to comment.