Skip to content

Commit

Permalink
Fix accessMode getting exception (#1306)
Browse files Browse the repository at this point in the history
The result obtained in the old way is always the first ReadWriteOnce(RWO)
  • Loading branch information
muicoder authored Nov 17, 2021
1 parent 83b5fee commit 5d62fdc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions internal/render/pv.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ func (PersistentVolume) volumeMode(m *v1.PersistentVolumeMode) string {
func accessMode(aa []v1.PersistentVolumeAccessMode) string {
dd := accessDedup(aa)
s := make([]string, 0, len(dd))
for i := 0; i < len(aa); i++ {
for _, am := range dd {
switch {
case accessContains(dd, v1.ReadWriteOnce):
case am == v1.ReadWriteOnce:
s = append(s, "RWO")
case accessContains(dd, v1.ReadOnlyMany):
case am == v1.ReadOnlyMany:
s = append(s, "ROX")
case accessContains(dd, v1.ReadWriteMany):
case am == v1.ReadWriteMany:
s = append(s, "RWX")
case accessContains(dd, v1.ReadWriteOncePod):
case am == v1.ReadWriteOncePod:
s = append(s, "RWOP")
}
}
Expand Down

0 comments on commit 5d62fdc

Please sign in to comment.