Skip to content

Commit

Permalink
added testcases for 1.29 support
Browse files Browse the repository at this point in the history
  • Loading branch information
krunalhinguu committed Jun 11, 2024
1 parent 6d5a956 commit 0feefeb
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 46 deletions.
11 changes: 11 additions & 0 deletions tests/unit/cpi_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ func TestCPITemplateRenderedDaemonset(t *testing.T) {
name string
args args
}{
{
name: "Kubernetes 1.29",
args: args{
values: map[string]string{},
kubeVersion: "1.29",
namespace: "cpitest-" + strings.ToLower(random.UniqueId()),
releaseName: "cpitest-" + strings.ToLower(random.UniqueId()),
chartRelPath: cpiChart,
expectedImage: "rancher/mirrored-cloud-provider-vsphere-cpi-release-manager:v1.29.0",
},
},
{
name: "Kubernetes 1.28",
args: args{
Expand Down
216 changes: 170 additions & 46 deletions tests/unit/csi_template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,40 @@ func TestCSITemplateRenderedNodeDaemonset(t *testing.T) {
name string
args args
}{
{
name: "Kubernetes 1.29 Linux Only",
args: args{
values: map[string]string{"vCenter.clusterId": random.UniqueId()},
kubeVersion: "1.29",
namespace: "csitest-" + strings.ToLower(random.UniqueId()),
releaseName: "csitest-" + strings.ToLower(random.UniqueId()),
chartRelPath: csiChart,
windowsEnabled: false,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-node-driver-registrar:v2.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
},
},
},
{
name: "Kubernetes 1.29 Linux and Windows",
args: args{
values: map[string]string{
"vCenter.clusterId": random.UniqueId(),
"csiWindowsSupport:enabled": "true",
},
kubeVersion: "1.29",
namespace: "csitest-" + strings.ToLower(random.UniqueId()),
releaseName: "csitest-" + strings.ToLower(random.UniqueId()),
chartRelPath: csiChart,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-node-driver-registrar:v2.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
},
},
},
{
name: "Kubernetes 1.28 Linux Only",
args: args{
Expand All @@ -38,9 +72,9 @@ func TestCSITemplateRenderedNodeDaemonset(t *testing.T) {
chartRelPath: csiChart,
windowsEnabled: false,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-node-driver-registrar:v2.8.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.1.2",
"rancher/mirrored-sig-storage-livenessprobe:v2.10.0",
"rancher/mirrored-sig-storage-csi-node-driver-registrar:v2.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
},
},
},
Expand All @@ -56,9 +90,9 @@ func TestCSITemplateRenderedNodeDaemonset(t *testing.T) {
releaseName: "csitest-" + strings.ToLower(random.UniqueId()),
chartRelPath: csiChart,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-node-driver-registrar:v2.8.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.1.2",
"rancher/mirrored-sig-storage-livenessprobe:v2.10.0",
"rancher/mirrored-sig-storage-csi-node-driver-registrar:v2.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
},
},
},
Expand All @@ -72,9 +106,9 @@ func TestCSITemplateRenderedNodeDaemonset(t *testing.T) {
chartRelPath: csiChart,
windowsEnabled: false,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-node-driver-registrar:v2.8.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.1.2",
"rancher/mirrored-sig-storage-livenessprobe:v2.10.0",
"rancher/mirrored-sig-storage-csi-node-driver-registrar:v2.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
},
},
},
Expand All @@ -90,9 +124,9 @@ func TestCSITemplateRenderedNodeDaemonset(t *testing.T) {
releaseName: "csitest-" + strings.ToLower(random.UniqueId()),
chartRelPath: csiChart,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-node-driver-registrar:v2.8.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.1.2",
"rancher/mirrored-sig-storage-livenessprobe:v2.10.0",
"rancher/mirrored-sig-storage-csi-node-driver-registrar:v2.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
},
},
},
Expand Down Expand Up @@ -393,6 +427,68 @@ func TestCSITemplateRenderedControllerDeployment(t *testing.T) {
name string
args args
}{
{
name: "Kubernetes 1.29 with Block Snapshotter Enabled",
args: args{
values: map[string]string{
"vCenter.clusterId": random.UniqueId(),
"blockVolumeSnapshot.enabled": "true",
},
kubeVersion: "1.29",
namespace: "csitest-" + strings.ToLower(random.UniqueId()),
releaseName: "csitest-" + strings.ToLower(random.UniqueId()),
chartRelPath: csiChart,
csiResizerEnabled: false,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-attacher:v4.5.0",
"rancher/mirrored-sig-storage-csi-snapshotter:v7.0.1",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.2.0",
"rancher/mirrored-sig-storage-csi-provisioner:v4.0.0",
},
},
},
{
name: "Kubernetes 1.29 with CSI Resizer Enabled",
args: args{
values: map[string]string{
"vCenter.clusterId": random.UniqueId(),
"csiController.csiResizer.enabled": "true",
},
kubeVersion: "1.29",
namespace: "csitest-" + strings.ToLower(random.UniqueId()),
releaseName: "csitest-" + strings.ToLower(random.UniqueId()),
chartRelPath: csiChart,
csiResizerEnabled: false,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-attacher:v4.5.0",
"rancher/mirrored-sig-storage-csi-resizer:v1.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.2.0",
"rancher/mirrored-sig-storage-csi-provisioner:v4.0.0",
},
},
},
{
name: "Kubernetes 1.29",
args: args{
values: map[string]string{"vCenter.clusterId": random.UniqueId()},
kubeVersion: "1.29",
namespace: "csitest-" + strings.ToLower(random.UniqueId()),
releaseName: "csitest-" + strings.ToLower(random.UniqueId()),
chartRelPath: csiChart,
csiResizerEnabled: false,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-attacher:v4.5.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.2.0",
"rancher/mirrored-sig-storage-csi-provisioner:v4.0.0",
},
},
},
{
name: "Kubernetes 1.28 with Block Snapshotter Enabled",
args: args{
Expand All @@ -406,12 +502,12 @@ func TestCSITemplateRenderedControllerDeployment(t *testing.T) {
chartRelPath: csiChart,
csiResizerEnabled: false,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-attacher:v4.3.0",
"rancher/mirrored-sig-storage-csi-snapshotter:v6.2.2",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.1.2",
"rancher/mirrored-sig-storage-livenessprobe:v2.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.1.2",
"rancher/mirrored-sig-storage-csi-provisioner:v3.5.0",
"rancher/mirrored-sig-storage-csi-attacher:v4.5.0",
"rancher/mirrored-sig-storage-csi-snapshotter:v7.0.1",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.2.0",
"rancher/mirrored-sig-storage-csi-provisioner:v4.0.0",
},
},
},
Expand All @@ -428,12 +524,12 @@ func TestCSITemplateRenderedControllerDeployment(t *testing.T) {
chartRelPath: csiChart,
csiResizerEnabled: false,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-attacher:v4.3.0",
"rancher/mirrored-sig-storage-csi-resizer:v1.8.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.1.2",
"rancher/mirrored-sig-storage-livenessprobe:v2.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.1.2",
"rancher/mirrored-sig-storage-csi-provisioner:v3.5.0",
"rancher/mirrored-sig-storage-csi-attacher:v4.5.0",
"rancher/mirrored-sig-storage-csi-resizer:v1.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.2.0",
"rancher/mirrored-sig-storage-csi-provisioner:v4.0.0",
},
},
},
Expand All @@ -447,11 +543,11 @@ func TestCSITemplateRenderedControllerDeployment(t *testing.T) {
chartRelPath: csiChart,
csiResizerEnabled: false,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-attacher:v4.3.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.1.2",
"rancher/mirrored-sig-storage-livenessprobe:v2.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.1.2",
"rancher/mirrored-sig-storage-csi-provisioner:v3.5.0",
"rancher/mirrored-sig-storage-csi-attacher:v4.5.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.2.0",
"rancher/mirrored-sig-storage-csi-provisioner:v4.0.0",
},
},
},
Expand All @@ -468,12 +564,12 @@ func TestCSITemplateRenderedControllerDeployment(t *testing.T) {
chartRelPath: csiChart,
csiResizerEnabled: false,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-attacher:v4.3.0",
"rancher/mirrored-sig-storage-csi-resizer:v1.8.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.1.2",
"rancher/mirrored-sig-storage-livenessprobe:v2.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.1.2",
"rancher/mirrored-sig-storage-csi-provisioner:v3.5.0",
"rancher/mirrored-sig-storage-csi-attacher:v4.5.0",
"rancher/mirrored-sig-storage-csi-resizer:v1.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.2.0",
"rancher/mirrored-sig-storage-csi-provisioner:v4.0.0",
},
},
},
Expand All @@ -490,12 +586,12 @@ func TestCSITemplateRenderedControllerDeployment(t *testing.T) {
chartRelPath: csiChart,
csiResizerEnabled: false,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-attacher:v4.3.0",
"rancher/mirrored-sig-storage-csi-snapshotter:v6.2.2",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.1.2",
"rancher/mirrored-sig-storage-livenessprobe:v2.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.1.2",
"rancher/mirrored-sig-storage-csi-provisioner:v3.5.0",
"rancher/mirrored-sig-storage-csi-attacher:v4.5.0",
"rancher/mirrored-sig-storage-csi-snapshotter:v7.0.1",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.2.0",
"rancher/mirrored-sig-storage-csi-provisioner:v4.0.0",
},
},
},
Expand All @@ -509,11 +605,11 @@ func TestCSITemplateRenderedControllerDeployment(t *testing.T) {
chartRelPath: csiChart,
csiResizerEnabled: false,
expectedImages: []string{
"rancher/mirrored-sig-storage-csi-attacher:v4.3.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.1.2",
"rancher/mirrored-sig-storage-livenessprobe:v2.10.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.1.2",
"rancher/mirrored-sig-storage-csi-provisioner:v3.5.0",
"rancher/mirrored-sig-storage-csi-attacher:v4.5.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-driver:v3.2.0",
"rancher/mirrored-sig-storage-livenessprobe:v2.12.0",
"rancher/mirrored-cloud-provider-vsphere-csi-release-syncer:v3.2.0",
"rancher/mirrored-sig-storage-csi-provisioner:v4.0.0",
},
},
},
Expand Down Expand Up @@ -906,6 +1002,20 @@ func TestCSITemplateRenderedControllerDeploymentArgs(t *testing.T) {
name string
args args
}{
{
name: "Kubernetes 1.29",
args: args{
values: map[string]string{"vCenter.clusterId": random.UniqueId()},
kubeVersion: "1.29",
namespace: "csitest-" + strings.ToLower(random.UniqueId()),
releaseName: "csitest-" + strings.ToLower(random.UniqueId()),
chartRelPath: csiChart,
expectedArgs: []string{
"--fss-name=internal-feature-states.csi.vsphere.vmware.com",
"--fss-namespace=$(CSI_NAMESPACE)",
},
},
},
{
name: "Kubernetes 1.28",
args: args{
Expand Down Expand Up @@ -1083,6 +1193,20 @@ func TestCSITemplateRenderedNodeDaemonSetArgs(t *testing.T) {
name string
args args
}{
{
name: "Kubernetes 1.29",
args: args{
values: map[string]string{"vCenter.clusterId": random.UniqueId()},
kubeVersion: "1.29",
namespace: "csitest-" + strings.ToLower(random.UniqueId()),
releaseName: "csitest-" + strings.ToLower(random.UniqueId()),
chartRelPath: csiChart,
expectedArgs: []string{
"--fss-name=internal-feature-states.csi.vsphere.vmware.com",
"--fss-namespace=$(CSI_NAMESPACE)",
},
},
},
{
name: "Kubernetes 1.28",
args: args{
Expand Down

0 comments on commit 0feefeb

Please sign in to comment.