mirror of
https://github.com/rancher/types.git
synced 2025-09-20 01:22:31 +00:00
Fix some PV types
This commit is contained in:
@@ -41,6 +41,9 @@ func namespaceTypes(schemas *types.Schemas) *types.Schemas {
|
||||
|
||||
func persistentVolumeTypes(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
MustImport(&Version, v1.PersistentVolumeSpec{}, struct {
|
||||
StorageClassName *string `json:"storageClassName,omitempty" norman:"type=reference[storageClass]"`
|
||||
}{}).
|
||||
MustImport(&Version, v1.PersistentVolume{})
|
||||
}
|
||||
|
||||
|
@@ -625,6 +625,21 @@ func ingressTypes(schemas *types.Schemas) *types.Schemas {
|
||||
|
||||
func volumeTypes(schemas *types.Schemas) *types.Schemas {
|
||||
return schemas.
|
||||
AddMapperForType(&Version, v1.HostPathVolumeSource{},
|
||||
m.Move{From: "type", To: "kind"},
|
||||
m.Enum{
|
||||
Options: []string{
|
||||
"DirectoryOrCreate",
|
||||
"Directory",
|
||||
"FileOrCreate",
|
||||
"File",
|
||||
"Socket",
|
||||
"CharDevice",
|
||||
"BlockDevice",
|
||||
},
|
||||
Field: "kind",
|
||||
},
|
||||
).
|
||||
AddMapperForType(&Version, v1.ResourceRequirements{},
|
||||
mapper.PivotMapper{Plural: true},
|
||||
).
|
||||
@@ -639,6 +654,9 @@ func volumeTypes(schemas *types.Schemas) *types.Schemas {
|
||||
}{}).
|
||||
MustImport(&Version, v1.Volume{}, struct {
|
||||
}{}).
|
||||
MustImport(&Version, v1.PersistentVolumeSpec{}, struct {
|
||||
StorageClassName *string `json:"storageClassName,omitempty" norman:"type=reference[/v3/cluster/storageClass]"`
|
||||
}{}).
|
||||
MustImport(&Version, v1.PersistentVolumeClaimSpec{}, struct {
|
||||
AccessModes []string `json:"accessModes,omitempty" norman:"type=array[enum],options=ReadWriteOnce|ReadOnlyMany|ReadWriteMany"`
|
||||
VolumeName string `json:"volumeName,omitempty" norman:"type=reference[/v3/cluster/persistentVolume]"`
|
||||
|
Reference in New Issue
Block a user