Skip to content

Commit

Permalink
Allow storage_class_name to be ""
Browse files Browse the repository at this point in the history
  • Loading branch information
lawliet89 committed Dec 2, 2019
1 parent 435fc18 commit 1bf47e4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ require (
k8s.io/client-go v12.0.0+incompatible
k8s.io/kube-aggregator v0.0.0-20191025230902-aa872b06629d
)

go 1.13
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX
github.com/Azure/go-autorest v11.1.2+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest v11.9.0+incompatible h1:oSgZM+lMfyzuJ5eQhK+UipIjoVkcxW5YycyWgQr9Vy0=
github.com/Azure/go-autorest v11.9.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs=
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
github.com/Azure/go-autorest/autorest/adal v0.5.0 h1:q2gDruN08/guU9vAjuPWff0+QIrpH6ediguzdAzXAUU=
github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/structure_persistent_volume_claim.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func expandPersistentVolumeClaimSpec(l []interface{}) (*v1.PersistentVolumeClaim
if v, ok := in["volume_name"].(string); ok {
obj.VolumeName = v
}
if v, ok := in["storage_class_name"].(string); ok && v != "" {
if v, ok := in["storage_class_name"].(string); ok {
obj.StorageClassName = ptrToString(v)
}
return obj, nil
Expand Down
6 changes: 3 additions & 3 deletions kubernetes/structure_persistent_volume_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ func flattenPersistentVolumeSpec(in v1.PersistentVolumeSpec) []interface{} {
if in.PersistentVolumeReclaimPolicy != "" {
att["persistent_volume_reclaim_policy"] = in.PersistentVolumeReclaimPolicy
}
if in.StorageClassName != "" {
att["storage_class_name"] = in.StorageClassName
}

att["storage_class_name"] = in.StorageClassName

if in.NodeAffinity != nil {
att["node_affinity"] = flattenVolumeNodeAffinity(in.NodeAffinity)
}
Expand Down

0 comments on commit 1bf47e4

Please sign in to comment.