Skip to content

Commit 345cc64

Browse files
authored
Merge pull request #3067 from dperny/change-csi-string
change CSI to Cluster in API
2 parents 62ffb2b + a5f27e4 commit 345cc64

8 files changed

Lines changed: 424 additions & 424 deletions

File tree

api/api.pb.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2779,10 +2779,10 @@ file {
27792779
}
27802780
}
27812781
value {
2782-
name: "CSI"
2782+
name: "CLUSTER"
27832783
number: 4
27842784
options {
2785-
66001: "MountTypeCSI"
2785+
66001: "MountTypeCluster"
27862786
}
27872787
}
27882788
options {

api/types.pb.go

Lines changed: 402 additions & 402 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/types.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ message Mount {
239239
VOLUME = 1 [(gogoproto.enumvalue_customname) = "MountTypeVolume"]; // Remote storage volumes
240240
TMPFS = 2 [(gogoproto.enumvalue_customname) = "MountTypeTmpfs"]; // Mount a tmpfs
241241
NPIPE = 3 [(gogoproto.enumvalue_customname) = "MountTypeNamedPipe"]; // Windows named pipes
242-
CSI = 4 [(gogoproto.enumvalue_customname) = "MountTypeCSI"]; // CSI volume
242+
CLUSTER = 4 [(gogoproto.enumvalue_customname) = "MountTypeCluster"]; // CSI volume
243243
}
244244

245245
// Type defines the nature of the mount.

manager/dispatcher/dispatcher_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,11 +655,11 @@ func TestAssignmentsWithVolume(t *testing.T) {
655655
Container: &api.ContainerSpec{
656656
Mounts: []api.Mount{
657657
{
658-
Type: api.MountTypeCSI,
658+
Type: api.MountTypeCluster,
659659
Source: "volumeName",
660660
Target: "/foo",
661661
}, {
662-
Type: api.MountTypeCSI,
662+
Type: api.MountTypeCluster,
663663
Source: "group:volumeGroup",
664664
Target: "/bar",
665665
},

manager/scheduler/filter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ func (f *VolumesFilter) SetTask(t *api.Task) bool {
419419
// hasCSI will be set true if one of the mounts is a CSI-type mount.
420420
hasCSI := false
421421
for _, mount := range c.Mounts {
422-
if mount.Type == api.MountTypeCSI {
422+
if mount.Type == api.MountTypeCluster {
423423
hasCSI = true
424424
f.requestedVolumes = append(f.requestedVolumes, &mount)
425425
}

manager/scheduler/scheduler_ginkgo_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ var _ = Describe("Scheduler", func() {
129129
Container: &api.ContainerSpec{
130130
Mounts: []api.Mount{
131131
{
132-
Type: api.MountTypeCSI,
132+
Type: api.MountTypeCluster,
133133
Source: "volume1",
134134
Target: "/var/",
135135
},
@@ -474,12 +474,12 @@ var _ = Describe("Scheduler", func() {
474474
Container: &api.ContainerSpec{
475475
Mounts: []api.Mount{
476476
{
477-
Type: api.MountTypeCSI,
477+
Type: api.MountTypeCluster,
478478
Source: "volume1",
479479
Target: "/var/",
480480
},
481481
{
482-
Type: api.MountTypeCSI,
482+
Type: api.MountTypeCluster,
483483
Source: "group:group2",
484484
Target: "/home/",
485485
},
@@ -511,7 +511,7 @@ var _ = Describe("Scheduler", func() {
511511
Container: &api.ContainerSpec{
512512
Mounts: []api.Mount{
513513
{
514-
Type: api.MountTypeCSI,
514+
Type: api.MountTypeCluster,
515515
Source: "volume1",
516516
Target: "/foo/",
517517
},
@@ -539,7 +539,7 @@ var _ = Describe("Scheduler", func() {
539539
Container: &api.ContainerSpec{
540540
Mounts: []api.Mount{
541541
{
542-
Type: api.MountTypeCSI,
542+
Type: api.MountTypeCluster,
543543
Source: "group:group2",
544544
Target: "/foo/",
545545
},

manager/scheduler/volumes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func (vs *volumeSet) chooseTaskVolumes(task *api.Task, nodeInfo *NodeInfo) ([]*a
111111
return nil, nil
112112
}
113113
for _, mount := range task.Spec.GetContainer().Mounts {
114-
if mount.Type == api.MountTypeCSI {
114+
if mount.Type == api.MountTypeCluster {
115115
candidate := vs.isVolumeAvailableOnNode(&mount, nodeInfo)
116116
if candidate == "" {
117117
// TODO(dperny): return structured error types, instead of

manager/scheduler/volumes_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ var _ = Describe("volumeSet", func() {
129129
Container: &api.ContainerSpec{
130130
Mounts: []api.Mount{
131131
{
132-
Type: api.MountTypeCSI,
132+
Type: api.MountTypeCluster,
133133
Source: v1.Spec.Group,
134134
Target: "/var/spool/mail",
135135
}, {
136136
Type: api.MountTypeBind,
137137
Source: "/var/run/docker.sock",
138138
Target: "/var/run/docker.sock",
139139
}, {
140-
Type: api.MountTypeCSI,
140+
Type: api.MountTypeCluster,
141141
Source: v2.Spec.Annotations.Name,
142142
Target: "/srv/www",
143143
ReadOnly: true,
@@ -444,7 +444,7 @@ var _ = Describe("volumeSet", func() {
444444

445445
It("should choose and return an available volume", func() {
446446
mount := &api.Mount{
447-
Type: api.MountTypeCSI,
447+
Type: api.MountTypeCluster,
448448
Source: "volumeName1",
449449
}
450450
volumeID := vs.isVolumeAvailableOnNode(mount, node)
@@ -453,7 +453,7 @@ var _ = Describe("volumeSet", func() {
453453

454454
It("should return an empty string if there are no available volumes", func() {
455455
mount := &api.Mount{
456-
Type: api.MountTypeCSI,
456+
Type: api.MountTypeCluster,
457457
Source: "volumeNameNotReal",
458458
}
459459
volumeID := vs.isVolumeAvailableOnNode(mount, node)
@@ -462,7 +462,7 @@ var _ = Describe("volumeSet", func() {
462462

463463
It("should specify one volume from a group, if the source is a group", func() {
464464
mount := &api.Mount{
465-
Type: api.MountTypeCSI,
465+
Type: api.MountTypeCluster,
466466
Source: "group:someVolumeGroup",
467467
}
468468
volumeID := vs.isVolumeAvailableOnNode(mount, node)
@@ -480,20 +480,20 @@ var _ = Describe("volumeSet", func() {
480480
vs.addOrUpdateVolume(v3)
481481
mounts := []api.Mount{
482482
{
483-
Type: api.MountTypeCSI,
483+
Type: api.MountTypeCluster,
484484
Source: "group:volumeGroup",
485485
Target: "/somedir",
486486
ReadOnly: true,
487487
}, {
488-
Type: api.MountTypeCSI,
488+
Type: api.MountTypeCluster,
489489
Source: v2.Spec.Annotations.Name,
490490
Target: "/someOtherDir",
491491
}, {
492492
Type: api.MountTypeBind,
493493
Source: "/some/subdir",
494494
Target: "/some/container/dir",
495495
}, {
496-
Type: api.MountTypeCSI,
496+
Type: api.MountTypeCluster,
497497
Source: v3.Spec.Annotations.Name,
498498
Target: "/some/third/dir",
499499
},
@@ -569,12 +569,12 @@ var _ = Describe("volumeSet", func() {
569569
Container: &api.ContainerSpec{
570570
Mounts: []api.Mount{
571571
{
572-
Type: api.MountTypeCSI,
572+
Type: api.MountTypeCluster,
573573
Source: volumes[i].Spec.Annotations.Name,
574574
Target: "bar",
575575
},
576576
{
577-
Type: api.MountTypeCSI,
577+
Type: api.MountTypeCluster,
578578
Source: allVolume.Spec.Annotations.Name,
579579
Target: "baz",
580580
},

0 commit comments

Comments
 (0)