Skip to content

Commit 22e6c83

Browse files
Resolve go.mod conflicts for Hyperdisk feature
1 parent 2cb0f07 commit 22e6c83

File tree

903 files changed

+443424
-205684
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

903 files changed

+443424
-205684
lines changed

go.mod

+28-25
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
module sigs.k8s.io/gcp-compute-persistent-disk-csi-driver
22

3-
go 1.17
3+
go 1.19
44

55
require (
6-
cloud.google.com/go v0.65.0
7-
github.com/GoogleCloudPlatform/k8s-cloud-provider v0.0.0-20200415212048-7901bc822317
6+
cloud.google.com/go/compute v1.19.0 // indirect
7+
github.com/GoogleCloudPlatform/k8s-cloud-provider v1.18.0
88
github.com/container-storage-interface/spec v1.5.0
9-
github.com/golang/protobuf v1.5.2
10-
github.com/google/uuid v1.1.2
9+
github.com/golang/protobuf v1.5.3
10+
github.com/google/uuid v1.3.0
1111
github.com/kubernetes-csi/csi-proxy/client v1.0.0
1212
github.com/kubernetes-csi/csi-test/v4 v4.2.0
1313
github.com/onsi/ginkgo v1.14.2
1414
github.com/onsi/gomega v1.10.4
15-
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43
16-
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22
17-
google.golang.org/api v0.34.0
18-
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c
19-
google.golang.org/grpc v1.38.0
15+
golang.org/x/oauth2 v0.7.0
16+
golang.org/x/sys v0.7.0
17+
google.golang.org/api v0.118.0
18+
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
19+
google.golang.org/grpc v1.55.0
2020
gopkg.in/gcfg.v1 v1.2.3
2121
gopkg.in/warnings.v0 v0.1.2 // indirect
2222
k8s.io/apimachinery v0.22.0
@@ -30,23 +30,23 @@ require (
3030
)
3131

3232
require (
33-
google.golang.org/protobuf v1.26.0
34-
k8s.io/cloud-provider v0.22.0
35-
)
36-
37-
require (
33+
cloud.google.com/go/compute/metadata v0.2.3
34+
cloud.google.com/go/iam v0.13.0 // indirect
35+
cloud.google.com/go/kms v1.10.2
3836
github.com/Microsoft/go-winio v0.4.16 // indirect
3937
github.com/beorn7/perks v1.0.1 // indirect
4038
github.com/blang/semver v3.5.1+incompatible // indirect
41-
github.com/cespare/xxhash/v2 v2.1.1 // indirect
39+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
4240
github.com/davecgh/go-spew v1.1.1 // indirect
4341
github.com/fsnotify/fsnotify v1.4.9 // indirect
4442
github.com/go-logr/logr v1.2.0 // indirect
4543
github.com/gogo/protobuf v1.3.2 // indirect
4644
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
47-
github.com/google/go-cmp v0.5.5 // indirect
45+
github.com/google/go-cmp v0.5.9 // indirect
4846
github.com/google/gofuzz v1.1.0 // indirect
49-
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
47+
github.com/google/s2a-go v0.1.0 // indirect
48+
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
49+
github.com/googleapis/gax-go/v2 v2.8.0 // indirect
5050
github.com/googleapis/gnostic v0.5.5 // indirect
5151
github.com/hashicorp/errwrap v1.0.0 // indirect
5252
github.com/hashicorp/go-multierror v1.0.0 // indirect
@@ -63,18 +63,21 @@ require (
6363
github.com/prometheus/procfs v0.6.0 // indirect
6464
github.com/sirupsen/logrus v1.8.1 // indirect
6565
github.com/spf13/pflag v1.0.5 // indirect
66-
go.opencensus.io v0.22.4 // indirect
67-
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 // indirect
68-
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
69-
golang.org/x/text v0.3.6 // indirect
66+
go.opencensus.io v0.24.0 // indirect
67+
golang.org/x/crypto v0.7.0 // indirect
68+
golang.org/x/net v0.9.0 // indirect
69+
golang.org/x/term v0.7.0 // indirect
70+
golang.org/x/text v0.9.0 // indirect
7071
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
71-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
72-
google.golang.org/appengine v1.6.6 // indirect
72+
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
73+
google.golang.org/appengine v1.6.7 // indirect
74+
google.golang.org/protobuf v1.30.0
7375
gopkg.in/inf.v0 v0.9.1 // indirect
7476
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
7577
gopkg.in/yaml.v2 v2.4.0 // indirect
76-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
78+
gopkg.in/yaml.v3 v3.0.1 // indirect
7779
k8s.io/api v0.22.0 // indirect
80+
k8s.io/cloud-provider v0.24.1
7881
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
7982
sigs.k8s.io/yaml v1.2.0 // indirect
8083
)

go.sum

+194-25
Large diffs are not rendered by default.

pkg/common/utils.go

+12
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,18 @@ func ValidateSnapshotType(snapshotType string) error {
259259
}
260260
}
261261

262+
// ParseMachineType returns an extracted machineType from a URL, or empty if not found.
263+
// machineTypeUrl: Full or partial URL of the machine type resource, in the format:
264+
//
265+
// zones/zone/machineTypes/machine-type
266+
func ParseMachineType(machineTypeUrl string) (string, error) {
267+
machineType := machineTypeRegex.FindStringSubmatch(machineTypeUrl)
268+
if machineType == nil {
269+
return "", fmt.Errorf("failed to parse machineTypeUrl. Expected suffix: zones/{zone}/machineTypes/{machine-type}. Got: %s", machineTypeUrl)
270+
}
271+
return machineType[1], nil
272+
}
273+
262274
// ConvertStringToInt64 converts a string to int64
263275
func ConvertStringToInt64(str string) (int64, error) {
264276
quantity, err := resource.ParseQuantity(str)

pkg/common/utils_test.go

+54
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,60 @@ func TestSnapshotStorageLocations(t *testing.T) {
578578
}
579579
}
580580

581+
func TestParseMachineType(t *testing.T) {
582+
tests := []struct {
583+
desc string
584+
inputMachineTypeUrl string
585+
expectedMachineType string
586+
expectError bool
587+
}{
588+
{
589+
desc: "full URL machine type",
590+
inputMachineTypeUrl: "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-c/machineTypes/c3-highcpu-4",
591+
expectedMachineType: "c3-highcpu-4",
592+
},
593+
{
594+
desc: "partial URL machine type",
595+
inputMachineTypeUrl: "zones/us-central1-c/machineTypes/n2-standard-4",
596+
expectedMachineType: "n2-standard-4",
597+
},
598+
{
599+
desc: "custom partial URL machine type",
600+
inputMachineTypeUrl: "zones/us-central1-c/machineTypes/e2-custom-2-4096",
601+
expectedMachineType: "e2-custom-2-4096",
602+
},
603+
{
604+
desc: "incorrect URL",
605+
inputMachineTypeUrl: "https://www.googleapis.com/compute/v1/projects/psch-gke-dev/zones/us-central1-c",
606+
expectError: true,
607+
},
608+
{
609+
desc: "incorrect partial URL",
610+
inputMachineTypeUrl: "zones/us-central1-c/machineTypes/",
611+
expectError: true,
612+
},
613+
{
614+
desc: "missing zone",
615+
inputMachineTypeUrl: "zones//machineTypes/n2-standard-4",
616+
expectError: true,
617+
},
618+
}
619+
for _, tc := range tests {
620+
t.Run(tc.desc, func(t *testing.T) {
621+
actualMachineFamily, err := ParseMachineType(tc.inputMachineTypeUrl)
622+
if err != nil && !tc.expectError {
623+
t.Errorf("Got error %v parsing machine type %s; expect no error", err, tc.inputMachineTypeUrl)
624+
}
625+
if err == nil && tc.expectError {
626+
t.Errorf("Got no error parsing machine type %s; expect an error", tc.inputMachineTypeUrl)
627+
}
628+
if err == nil && actualMachineFamily != tc.expectedMachineType {
629+
t.Errorf("Got %s parsing machine type; expect %s", actualMachineFamily, tc.expectedMachineType)
630+
}
631+
})
632+
}
633+
}
634+
581635
func TestConvertStringToInt64(t *testing.T) {
582636
tests := []struct {
583637
desc string

test/e2e/tests/single_zone_e2e_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import (
4141

4242
const (
4343
testNamePrefix = "gcepd-csi-e2e-"
44-
44+
4545
defaultSizeGb int64 = 5
4646
defaultRepdSizeGb int64 = 200
4747
defaultMwSizeGb int64 = 200

test/k8s-integration/main.go

-9
Original file line numberDiff line numberDiff line change
@@ -478,15 +478,6 @@ func handle() error {
478478
return fmt.Errorf("Unknown deployment strategy %s", testParams.deploymentStrategy)
479479
}
480480

481-
<<<<<<< HEAD
482-
=======
483-
skipDiskImageSnapshots := false
484-
if mustParseVersion(testParams.clusterVersion).lessThan(mustParseVersion("1.22.0")) {
485-
// Disk image cloning in only supported from 1.22 on.
486-
skipDiskImageSnapshots = true
487-
}
488-
489-
>>>>>>> Test pd-extreme k8s integration
490481
// Run the tests using the k8sSourceDir kubernetes
491482
if len(*storageClassFiles) != 0 {
492483
applicableStorageClassFiles := []string{}

vendor/cloud.google.com/go/compute/internal/version.go

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/cloud.google.com/go/compute/metadata/CHANGES.md

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)