Skip to content

Commit

Permalink
change CSI to Cluster in API
Browse files Browse the repository at this point in the history
Signed-off-by: Drew Erny <[email protected]>
  • Loading branch information
dperny committed Jul 19, 2022
1 parent 62ffb2b commit a5f27e4
Show file tree
Hide file tree
Showing 8 changed files with 424 additions and 424 deletions.
4 changes: 2 additions & 2 deletions api/api.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2779,10 +2779,10 @@ file {
}
}
value {
name: "CSI"
name: "CLUSTER"
number: 4
options {
66001: "MountTypeCSI"
66001: "MountTypeCluster"
}
}
options {
Expand Down
804 changes: 402 additions & 402 deletions api/types.pb.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion api/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ message Mount {
VOLUME = 1 [(gogoproto.enumvalue_customname) = "MountTypeVolume"]; // Remote storage volumes
TMPFS = 2 [(gogoproto.enumvalue_customname) = "MountTypeTmpfs"]; // Mount a tmpfs
NPIPE = 3 [(gogoproto.enumvalue_customname) = "MountTypeNamedPipe"]; // Windows named pipes
CSI = 4 [(gogoproto.enumvalue_customname) = "MountTypeCSI"]; // CSI volume
CLUSTER = 4 [(gogoproto.enumvalue_customname) = "MountTypeCluster"]; // CSI volume
}

// Type defines the nature of the mount.
Expand Down
4 changes: 2 additions & 2 deletions manager/dispatcher/dispatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,11 +655,11 @@ func TestAssignmentsWithVolume(t *testing.T) {
Container: &api.ContainerSpec{
Mounts: []api.Mount{
{
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: "volumeName",
Target: "/foo",
}, {
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: "group:volumeGroup",
Target: "/bar",
},
Expand Down
2 changes: 1 addition & 1 deletion manager/scheduler/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ func (f *VolumesFilter) SetTask(t *api.Task) bool {
// hasCSI will be set true if one of the mounts is a CSI-type mount.
hasCSI := false
for _, mount := range c.Mounts {
if mount.Type == api.MountTypeCSI {
if mount.Type == api.MountTypeCluster {
hasCSI = true
f.requestedVolumes = append(f.requestedVolumes, &mount)
}
Expand Down
10 changes: 5 additions & 5 deletions manager/scheduler/scheduler_ginkgo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ var _ = Describe("Scheduler", func() {
Container: &api.ContainerSpec{
Mounts: []api.Mount{
{
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: "volume1",
Target: "/var/",
},
Expand Down Expand Up @@ -474,12 +474,12 @@ var _ = Describe("Scheduler", func() {
Container: &api.ContainerSpec{
Mounts: []api.Mount{
{
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: "volume1",
Target: "/var/",
},
{
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: "group:group2",
Target: "/home/",
},
Expand Down Expand Up @@ -511,7 +511,7 @@ var _ = Describe("Scheduler", func() {
Container: &api.ContainerSpec{
Mounts: []api.Mount{
{
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: "volume1",
Target: "/foo/",
},
Expand Down Expand Up @@ -539,7 +539,7 @@ var _ = Describe("Scheduler", func() {
Container: &api.ContainerSpec{
Mounts: []api.Mount{
{
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: "group:group2",
Target: "/foo/",
},
Expand Down
2 changes: 1 addition & 1 deletion manager/scheduler/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (vs *volumeSet) chooseTaskVolumes(task *api.Task, nodeInfo *NodeInfo) ([]*a
return nil, nil
}
for _, mount := range task.Spec.GetContainer().Mounts {
if mount.Type == api.MountTypeCSI {
if mount.Type == api.MountTypeCluster {
candidate := vs.isVolumeAvailableOnNode(&mount, nodeInfo)
if candidate == "" {
// TODO(dperny): return structured error types, instead of
Expand Down
20 changes: 10 additions & 10 deletions manager/scheduler/volumes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ var _ = Describe("volumeSet", func() {
Container: &api.ContainerSpec{
Mounts: []api.Mount{
{
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: v1.Spec.Group,
Target: "/var/spool/mail",
}, {
Type: api.MountTypeBind,
Source: "/var/run/docker.sock",
Target: "/var/run/docker.sock",
}, {
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: v2.Spec.Annotations.Name,
Target: "/srv/www",
ReadOnly: true,
Expand Down Expand Up @@ -444,7 +444,7 @@ var _ = Describe("volumeSet", func() {

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

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

It("should specify one volume from a group, if the source is a group", func() {
mount := &api.Mount{
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: "group:someVolumeGroup",
}
volumeID := vs.isVolumeAvailableOnNode(mount, node)
Expand All @@ -480,20 +480,20 @@ var _ = Describe("volumeSet", func() {
vs.addOrUpdateVolume(v3)
mounts := []api.Mount{
{
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: "group:volumeGroup",
Target: "/somedir",
ReadOnly: true,
}, {
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: v2.Spec.Annotations.Name,
Target: "/someOtherDir",
}, {
Type: api.MountTypeBind,
Source: "/some/subdir",
Target: "/some/container/dir",
}, {
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: v3.Spec.Annotations.Name,
Target: "/some/third/dir",
},
Expand Down Expand Up @@ -569,12 +569,12 @@ var _ = Describe("volumeSet", func() {
Container: &api.ContainerSpec{
Mounts: []api.Mount{
{
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: volumes[i].Spec.Annotations.Name,
Target: "bar",
},
{
Type: api.MountTypeCSI,
Type: api.MountTypeCluster,
Source: allVolume.Spec.Annotations.Name,
Target: "baz",
},
Expand Down

0 comments on commit a5f27e4

Please sign in to comment.