Skip to content

Commit

Permalink
csi: minimal change to make test case pass
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Oct 30, 2020
1 parent 201dd9d commit 849754c
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions nomad/structs/csi.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ func (v *CSIVolume) newStructs() {
if v.Parameters == nil {
v.Parameters = map[string]string{}
}
if v.MountOptions == nil {
v.MountOptions = &CSIMountOptions{}
}
if v.Secrets == nil {
v.Secrets = CSISecrets{}
}
Expand Down Expand Up @@ -416,13 +419,26 @@ func (v *CSIVolume) Copy() *CSIVolume {
for k, v := range v.Secrets {
out.Secrets[k] = v
}
mo := *v.MountOptions
out.MountOptions = &mo

for k, v := range v.ReadAllocs {
out.ReadAllocs[k] = v
if v != nil {
a := *v
out.ReadAllocs[k] = &a
} else {
out.ReadAllocs[k] = nil
}
}

for k, v := range v.WriteAllocs {
out.WriteAllocs[k] = v
if v != nil {
a := *v
out.WriteAllocs[k] = &a
} else {
out.WriteAllocs[k] = nil
}

}

for k, v := range v.ReadClaims {
Expand Down

0 comments on commit 849754c

Please sign in to comment.