mirror of
https://github.com/rancher/types.git
synced 2025-07-30 20:44:34 +00:00
convert default storageCLassName to empty
This commit is contained in:
parent
bb03350a4e
commit
7d8da4b6ef
@ -669,6 +669,9 @@ func volumeTypes(schemas *types.Schemas) *types.Schemas {
|
||||
"name",
|
||||
}},
|
||||
).
|
||||
AddMapperForType(&Version, v1.PersistentVolumeClaim{},
|
||||
mapper.PersistVolumeClaim{},
|
||||
).
|
||||
MustImport(&Version, v1.PersistentVolumeClaimVolumeSource{}, struct {
|
||||
ClaimName string `norman:"type=reference[persistentVolumeClaim]"`
|
||||
}{}).
|
||||
|
22
mapper/persistvolumeclaim.go
Normal file
22
mapper/persistvolumeclaim.go
Normal file
@ -0,0 +1,22 @@
|
||||
package mapper
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
"github.com/rancher/norman/types/values"
|
||||
)
|
||||
|
||||
type PersistVolumeClaim struct {
|
||||
}
|
||||
|
||||
func (p PersistVolumeClaim) FromInternal(data map[string]interface{}) {
|
||||
}
|
||||
|
||||
func (p PersistVolumeClaim) ToInternal(data map[string]interface{}) {
|
||||
if v, ok := values.GetValue(data, "storageClassId"); ok && v == nil {
|
||||
values.PutValue(data, "", "storageClassId")
|
||||
}
|
||||
}
|
||||
|
||||
func (p PersistVolumeClaim) ModifySchema(schema *types.Schema, schemas *types.Schemas) error {
|
||||
return nil
|
||||
}
|
Loading…
Reference in New Issue
Block a user