Skip to content

Commit 2d7aa75

Browse files
authored
Merge pull request #1831 from travisyx/fix-ci
Fix ci tests
2 parents feb8570 + 05599f2 commit 2d7aa75

File tree

7 files changed

+49
-6
lines changed

7 files changed

+49
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- op: add
2+
path: /spec/template/spec/containers/4/args/-
3+
value: --supports-dynamic-throughput-provisioning=hyperdisk-balanced,hyperdisk-throughput,hyperdisk-ml
4+
5+
- op: add
6+
path: /spec/template/spec/containers/4/args/-
7+
value: --supports-dynamic-iops-provisioning=hyperdisk-balanced,hyperdisk-extreme

deploy/kubernetes/overlays/prow-stable-sidecar-rc-master/kustomization.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,11 @@ patchesJson6902:
2424
kind: Deployment
2525
name: csi-gce-pd-controller
2626
version: v1
27+
- path: driver-args.yaml
28+
target:
29+
group: apps
30+
kind: Deployment
31+
name: csi-gce-pd-controller
32+
version: v1
2733
transformers:
2834
- ../../images/prow-stable-sidecar-rc-master
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: storage.k8s.io/v1
2+
kind: StorageClass
3+
metadata:
4+
name: csi-gcepd-balanced
5+
provisioner: pd.csi.storage.gke.io
6+
parameters:
7+
type: pd-balanced
8+
volumeBindingMode: WaitForFirstConsumer

test/k8s-integration/config/sc-balanced.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ metadata:
55
provisioner: pd.csi.storage.gke.io
66
parameters:
77
type: pd-balanced
8+
# Add labels for testing.
9+
labels: key1=value1,key2=value2
810
volumeBindingMode: WaitForFirstConsumer

test/k8s-integration/main.go

+16-2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ var (
6262
storageClassFiles = flag.String("storageclass-files", "", "name of storageclass yaml file to use for test relative to test/k8s-integration/config. This may be a comma-separated list to test multiple storage classes")
6363
snapshotClassFiles = flag.String("snapshotclass-files", "", "name of snapshotclass yaml file to use for test relative to test/k8s-integration/config. This may be a comma-separated list to test multiple storage classes")
6464
vacFiles = flag.String("volumeattributesclass-files", "", "name of volumeattributesclass yaml file to use for test relative to test/k8s-integration/config. This may be a comma-separated list to test multiple volumeattributesclasses.")
65+
scVacFile = flag.String("storageclass-for-vac-file", "", "name of storageclass yaml file to use for test relative to test/k8s-integraion/config against the volumeattributesclass-files.")
6566
inProw = flag.Bool("run-in-prow", false, "is the test running in PROW")
6667

6768
// Driver flags
@@ -160,6 +161,10 @@ func main() {
160161
ensureVariable(storageClassFiles, true, "One of storageclass-file and migration-test must be set")
161162
}
162163

164+
if len(*vacFiles) != 0 {
165+
ensureVariable(scVacFile, true, "storageclass-for-vac-file must be set when volumeattributesclass-files is set")
166+
}
167+
163168
if !*bringupCluster && *platform != "windows" {
164169
ensureVariable(kubeFeatureGates, false, "kube-feature-gates set but not bringing up new cluster")
165170
} else {
@@ -563,6 +568,13 @@ func handle() error {
563568
applicableVacFiles = append(applicableVacFiles, vacFile)
564569
}
565570
}
571+
scForVac := ""
572+
if len(*scVacFile) > 0 {
573+
storageClassFile := strings.TrimSpace(*scVacFile)
574+
if len(storageClassFile) != 0 {
575+
scForVac = storageClassFile
576+
}
577+
}
566578
var ginkgoErrors []string
567579
var testOutputDirs []string
568580

@@ -577,8 +589,8 @@ func handle() error {
577589
}
578590
}
579591
// Run volume modify tests
580-
if len(applicableStorageClassFiles) > 0 {
581-
testParams.storageClassFile = applicableStorageClassFiles[0]
592+
if len(scForVac) > 0 {
593+
testParams.storageClassFile = scForVac
582594
for _, vacFile := range applicableVacFiles {
583595
outputDir := strings.TrimSuffix(vacFile, ".yaml")
584596
testOutputDirs = append(testOutputDirs, outputDir)
@@ -587,6 +599,8 @@ func handle() error {
587599
ginkgoErrors = append(ginkgoErrors, err.Error())
588600
}
589601
}
602+
// Unset the VAC file for future tests
603+
testParams.volumeAttributesClassFile = ""
590604
}
591605
// Run snapshot tests, if there are applicable files, using the first storage class.
592606
if len(applicableStorageClassFiles) > 0 {

test/run-k8s-integration-ci.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ readonly use_kubetest2=${USE_KUBETEST2:-true}
3030
readonly test_pd_labels=${TEST_PD_LABELS:-true}
3131
readonly migration_test=${MIGRATION_TEST:-false}
3232
readonly test_disk_image_snapshot=${TEST_DISK_IMAGE_SNAPSHOT:-true}
33+
readonly test_volumeattributesclass=${TEST_VOLUMEATTRIBUTESCLASS:-true}
3334

3435
readonly GCE_PD_TEST_FOCUS="PersistentVolumes\sGCEPD|[V|v]olume\sexpand|\[sig-storage\]\sIn-tree\sVolumes\s\[Driver:\sgcepd\]|allowedTopologies|Pod\sDisks|PersistentVolumes\sDefault"
3536

@@ -42,12 +43,12 @@ rm -rf /usr/local/go && tar -xzf go_tar.tar.gz -C /usr/local
4243
# to run go commands with this go version.
4344
export PATH=$PATH:/usr/local/go/bin && go version && rm go_tar.tar.gz
4445

45-
storage_classes=sc-balanced.yaml,sc-ssd.yaml,sc-xfs.yaml
46+
storage_classes=sc-ssd.yaml,sc-xfs.yaml
4647

4748
if [[ $test_pd_labels = true ]] ; then
48-
storage_classes=${storage_classes},sc-standard.yaml
49+
storage_classes=${storage_classes},sc-balanced.yaml
4950
else
50-
storage_classes=${storage_classes},sc-standard-no-labels.yaml
51+
storage_classes=${storage_classes},sc-balanced-no-labels.yaml
5152
fi
5253

5354
if [[ -n $gce_region ]] ; then
@@ -117,4 +118,8 @@ else
117118
base_cmd="${base_cmd} --snapshotclass-files=pd-volumesnapshotclass.yaml"
118119
fi
119120

121+
if [ "$test_volumeattributesclass" = true]; then
122+
base_cmd="${base_cmd} --volumeattributesclass-files=hdb-volumeattributesclass.yaml --storageclass-for-vac-file=sc-hdb.yaml --kube-runtime-config=api/all=true"
123+
fi
124+
120125
eval "$base_cmd"

test/run-k8s-integration.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ base_cmd="${PKGDIR}/bin/k8s-integration-test \
4747
--run-in-prow=true --service-account-file=${E2E_GOOGLE_APPLICATION_CREDENTIALS} \
4848
--do-driver-build=${do_driver_build} --teardown-driver=${teardown_driver} \
4949
--do-k8s-build=${do_k8s_build} --boskos-resource-type=${boskos_resource_type} \
50-
--storageclass-files=sc-hdb.yaml --snapshotclass-files=pd-volumesnapshotclass.yaml \
50+
--storageclass-files=sc-balanced.yaml --snapshotclass-files=pd-volumesnapshotclass.yaml \
5151
--volumeattributesclass-files=hdb-volumeattributesclass.yaml \
52+
--storageclass-for-vac-file=sc-hdb.yaml \
5253
--kube-runtime-config=api/all=true \
5354
--deployment-strategy=${deployment_strategy} --test-version=${test_version} \
5455
--num-nodes=3 --image-type=${image_type} --use-kubetest2=${use_kubetest2}"

0 commit comments

Comments
 (0)