1
0
mirror of https://github.com/rancher/types.git synced 2025-09-16 14:59:16 +00:00

Merge pull request #323 from zionwu/fixstorage

Add description field to storage class and pv
This commit is contained in:
Alena Prokharchyk
2018-03-29 20:28:42 -07:00
committed by GitHub
3 changed files with 14 additions and 1 deletions

View File

@@ -41,15 +41,24 @@ func namespaceTypes(schemas *types.Schemas) *types.Schemas {
func persistentVolumeTypes(schemas *types.Schemas) *types.Schemas {
return schemas.
AddMapperForType(&Version, v1.PersistentVolume{},
&m.AnnotationField{Field: "description"},
).
MustImport(&Version, v1.PersistentVolumeSpec{}, struct {
StorageClassName *string `json:"storageClassName,omitempty" norman:"type=reference[storageClass]"`
}{}).
MustImport(&Version, v1.PersistentVolume{})
MustImport(&Version, v1.PersistentVolume{}, struct {
Description string `json:"description"`
}{})
}
func storageClassTypes(schemas *types.Schemas) *types.Schemas {
return schemas.
AddMapperForType(&Version, storagev1.StorageClass{},
&m.AnnotationField{Field: "description"},
).
MustImport(&Version, storagev1.StorageClass{}, struct {
Description string `json:"description"`
ReclaimPolicy string `json:"reclaimPolicy,omitempty" norman:"type=enum,options=Recycle|Delete|Retain"`
}{})
}