Vendor: Update k8s version

Signed-off-by: Michał Żyłowski <michal.zylowski@intel.com>
This commit is contained in:
Michał Żyłowski 2017-02-03 14:41:32 +01:00
parent dfa93414c5
commit 52baf68d50
3756 changed files with 113013 additions and 92675 deletions

View file

@ -17,7 +17,6 @@ go_library(
],
tags = ["automanaged"],
deps = [
"//pkg/api:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/conversion",
"//vendor:k8s.io/apimachinery/pkg/runtime",

View file

@ -12,9 +12,12 @@ go_library(
srcs = ["install.go"],
tags = ["automanaged"],
deps = [
"//pkg/apimachinery/announced:go_default_library",
"//pkg/api:go_default_library",
"//pkg/apis/storage:go_default_library",
"//pkg/apis/storage/v1beta1:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apimachinery/announced",
"//vendor:k8s.io/apimachinery/pkg/apimachinery/registered",
"//vendor:k8s.io/apimachinery/pkg/runtime",
"//vendor:k8s.io/apimachinery/pkg/util/sets",
],
)

View file

@ -19,13 +19,21 @@ limitations under the License.
package install
import (
"k8s.io/apimachinery/pkg/apimachinery/announced"
"k8s.io/apimachinery/pkg/apimachinery/registered"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/kubernetes/pkg/apimachinery/announced"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/storage"
"k8s.io/kubernetes/pkg/apis/storage/v1beta1"
)
func init() {
Install(api.GroupFactoryRegistry, api.Registry, api.Scheme)
}
// Install registers the API group and adds types to a scheme
func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) {
if err := announced.NewGroupMetaFactory(
&announced.GroupMetaFactoryArgs{
GroupName: storage.GroupName,
@ -37,7 +45,7 @@ func init() {
announced.VersionToSchemeFunc{
v1beta1.SchemeGroupVersion.Version: v1beta1.AddToScheme,
},
).Announce().RegisterAndEnable(); err != nil {
).Announce(groupFactoryRegistry).RegisterAndEnable(registry, scheme); err != nil {
panic(err)
}
}

View file

@ -17,10 +17,8 @@ limitations under the License.
package storage
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/kubernetes/pkg/api"
)
// GroupName is the group name use in this package
@ -46,11 +44,6 @@ var (
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&api.ListOptions{},
&api.DeleteOptions{},
&metav1.ExportOptions{},
&metav1.GetOptions{},
&StorageClass{},
&StorageClassList{},
)

View file

@ -16,10 +16,7 @@ limitations under the License.
package storage
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api"
)
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
// +genclient=true
// +nonNamespaced=true
@ -33,7 +30,7 @@ import (
type StorageClass struct {
metav1.TypeMeta
// +optional
api.ObjectMeta
metav1.ObjectMeta
// provisioner is the driver expected to handle this StorageClass.
// This is an optionally-prefixed name, like a label key.

View file

@ -11,7 +11,10 @@ go_library(
name = "go_default_library",
srcs = ["helpers.go"],
tags = ["automanaged"],
deps = ["//pkg/api:go_default_library"],
deps = [
"//pkg/api:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
],
)
filegroup(

View file

@ -17,6 +17,7 @@ limitations under the License.
package util
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api"
)
@ -75,7 +76,7 @@ func GetClaimStorageClass(claim *api.PersistentVolumeClaim) string {
// GetStorageClassAnnotation returns the StorageClass value
// if the annotation is set, empty string if not
// TODO: remove Alpha and Beta when no longer used or needed
func GetStorageClassAnnotation(obj api.ObjectMeta) string {
func GetStorageClassAnnotation(obj metav1.ObjectMeta) string {
if class, ok := obj.Annotations[StorageClassAnnotation]; ok {
return class
}
@ -92,7 +93,7 @@ func GetStorageClassAnnotation(obj api.ObjectMeta) string {
// HasStorageClassAnnotation returns a boolean
// if the annotation is set
// TODO: remove Alpha and Beta when no longer used or needed
func HasStorageClassAnnotation(obj api.ObjectMeta) bool {
func HasStorageClassAnnotation(obj metav1.ObjectMeta) bool {
if _, found := obj.Annotations[StorageClassAnnotation]; found {
return found
}
@ -110,7 +111,7 @@ func HasStorageClassAnnotation(obj api.ObjectMeta) bool {
// IsDefaultAnnotationText returns a pretty Yes/No String if
// the annotation is set
// TODO: remove Beta when no longer needed
func IsDefaultAnnotationText(obj api.ObjectMeta) string {
func IsDefaultAnnotationText(obj metav1.ObjectMeta) string {
if obj.Annotations[IsDefaultStorageClassAnnotation] == "true" {
return "Yes"
}
@ -124,7 +125,7 @@ func IsDefaultAnnotationText(obj api.ObjectMeta) string {
// IsDefaultAnnotation returns a boolean if
// the annotation is set
// TODO: remove Beta when no longer needed
func IsDefaultAnnotation(obj api.ObjectMeta) bool {
func IsDefaultAnnotation(obj metav1.ObjectMeta) bool {
if obj.Annotations[IsDefaultStorageClassAnnotation] == "true" {
return true
}

View file

@ -22,7 +22,6 @@ go_library(
],
tags = ["automanaged"],
deps = [
"//pkg/api/v1:go_default_library",
"//pkg/apis/storage:go_default_library",
"//vendor:github.com/gogo/protobuf/proto",
"//vendor:github.com/gogo/protobuf/sortkeys",

View file

@ -233,7 +233,7 @@ func (this *StorageClass) String() string {
}
mapStringForParameters += "}"
s := strings.Join([]string{`&StorageClass{`,
`ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_kubernetes_pkg_api_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
`ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`,
`Provisioner:` + fmt.Sprintf("%v", this.Provisioner) + `,`,
`Parameters:` + mapStringForParameters + `,`,
`}`,
@ -696,36 +696,36 @@ var (
)
var fileDescriptorGenerated = []byte{
// 483 bytes of a gzipped FileDescriptorProto
// 481 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x92, 0xcf, 0x8b, 0xd3, 0x40,
0x14, 0xc7, 0x93, 0x96, 0xe2, 0xee, 0x54, 0xb1, 0x44, 0x0f, 0xa5, 0x87, 0x6c, 0xd9, 0x53, 0x15,
0x9d, 0xa1, 0x45, 0xa5, 0x2c, 0x78, 0xa9, 0x08, 0x0a, 0x8a, 0x4b, 0xbc, 0x88, 0xe8, 0x61, 0x92,
0x7d, 0xa6, 0x63, 0x9a, 0x4c, 0x98, 0x79, 0x09, 0x14, 0x3c, 0xf8, 0x27, 0xf8, 0x67, 0xf5, 0xe6,
0x1e, 0x3d, 0xc8, 0x62, 0xe3, 0x3f, 0x22, 0xf9, 0xb1, 0x9b, 0xb0, 0x69, 0x51, 0xbc, 0xe5, 0xcd,
0xbc, 0xcf, 0xf7, 0xbd, 0xef, 0x37, 0x43, 0x4e, 0x82, 0xb9, 0xa6, 0x42, 0xb2, 0x20, 0x71, 0x41,
0x45, 0x80, 0xa0, 0x59, 0x1c, 0xf8, 0x8c, 0xc7, 0x42, 0x33, 0x8d, 0x52, 0x71, 0x1f, 0x58, 0x3a,
0x75, 0x01, 0xf9, 0x94, 0xf9, 0x10, 0x81, 0xe2, 0x08, 0x67, 0x34, 0x56, 0x12, 0xa5, 0x75, 0xbf,
0x64, 0x69, 0xcd, 0xd2, 0x38, 0xf0, 0x69, 0xce, 0xd2, 0x8a, 0xa5, 0x15, 0x3b, 0x7a, 0xe8, 0x0b,
0x5c, 0x26, 0x2e, 0xf5, 0x64, 0xc8, 0x7c, 0xe9, 0x4b, 0x56, 0x48, 0xb8, 0xc9, 0xa7, 0xa2, 0x2a,
0x8a, 0xe2, 0xab, 0x94, 0x1e, 0x3d, 0xaa, 0xd6, 0xe2, 0xb1, 0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f3, 0x34, 0xb3, 0xcd, 0x5f, 0x99, 0x6d, 0x7e, 0xff, 0x6d, 0x1b, 0xef,
0x6f, 0x54, 0x6a, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xfe, 0xb6, 0x02, 0x5f, 0x2f, 0x04, 0x00,
0x00,
}

View file

@ -40,7 +40,7 @@ message StorageClass {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Provisioner indicates the type of the provisioner.
optional string provisioner = 2;

View file

@ -20,7 +20,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/kubernetes/pkg/api/v1"
)
// GroupName is the group name use in this package
@ -42,11 +41,6 @@ var (
// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&v1.ListOptions{},
&v1.DeleteOptions{},
&metav1.ExportOptions{},
&metav1.GetOptions{},
&StorageClass{},
&StorageClassList{},
)

View file

@ -26,8 +26,7 @@ import (
"fmt"
codec1978 "github.com/ugorji/go/codec"
pkg1_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
pkg3_types "k8s.io/apimachinery/pkg/types"
pkg2_v1 "k8s.io/kubernetes/pkg/api/v1"
pkg2_types "k8s.io/apimachinery/pkg/types"
"reflect"
"runtime"
time "time"
@ -64,10 +63,9 @@ func init() {
}
if false { // reference the types, but skip this branch at build/run time
var v0 pkg1_v1.TypeMeta
var v1 pkg3_types.UID
var v2 pkg2_v1.ObjectMeta
var v3 time.Time
_, _, _, _ = v0, v1, v2, v3
var v1 pkg2_types.UID
var v2 time.Time
_, _, _ = v0, v1, v2
}
}
@ -159,7 +157,13 @@ func (x *StorageClass) CodecEncodeSelf(e *codec1978.Encoder) {
z.EncSendContainerState(codecSelfer_containerArrayElem1234)
if yyq2[2] {
yy10 := &x.ObjectMeta
yy10.CodecEncodeSelf(e)
yym11 := z.EncBinary()
_ = yym11
if false {
} else if z.HasExtensions() && z.EncExt(yy10) {
} else {
z.EncFallback(yy10)
}
} else {
r.EncodeNil()
}
@ -169,7 +173,13 @@ func (x *StorageClass) CodecEncodeSelf(e *codec1978.Encoder) {
r.EncodeString(codecSelferC_UTF81234, string("metadata"))
z.EncSendContainerState(codecSelfer_containerMapValue1234)
yy12 := &x.ObjectMeta
yy12.CodecEncodeSelf(e)
yym13 := z.EncBinary()
_ = yym13
if false {
} else if z.HasExtensions() && z.EncExt(yy12) {
} else {
z.EncFallback(yy12)
}
}
}
if yyr2 || yy2arr2 {
@ -311,33 +321,39 @@ func (x *StorageClass) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
}
case "metadata":
if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_v1.ObjectMeta{}
x.ObjectMeta = pkg1_v1.ObjectMeta{}
} else {
yyv8 := &x.ObjectMeta
yyv8.CodecDecodeSelf(d)
yym9 := z.DecBinary()
_ = yym9
if false {
} else if z.HasExtensions() && z.DecExt(yyv8) {
} else {
z.DecFallback(yyv8, false)
}
}
case "provisioner":
if r.TryDecodeAsNil() {
x.Provisioner = ""
} else {
yyv9 := &x.Provisioner
yym10 := z.DecBinary()
_ = yym10
yyv10 := &x.Provisioner
yym11 := z.DecBinary()
_ = yym11
if false {
} else {
*((*string)(yyv9)) = r.DecodeString()
*((*string)(yyv10)) = r.DecodeString()
}
}
case "parameters":
if r.TryDecodeAsNil() {
x.Parameters = nil
} else {
yyv11 := &x.Parameters
yym12 := z.DecBinary()
_ = yym12
yyv12 := &x.Parameters
yym13 := z.DecBinary()
_ = yym13
if false {
} else {
z.F.DecMapStringStringX(yyv11, false, d)
z.F.DecMapStringStringX(yyv12, false, d)
}
}
default:
@ -351,16 +367,16 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r
var yyj13 int
var yyb13 bool
var yyhl13 bool = l >= 0
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
var yyj14 int
var yyb14 bool
var yyhl14 bool = l >= 0
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -368,21 +384,21 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Kind = ""
} else {
yyv14 := &x.Kind
yym15 := z.DecBinary()
_ = yym15
yyv15 := &x.Kind
yym16 := z.DecBinary()
_ = yym16
if false {
} else {
*((*string)(yyv14)) = r.DecodeString()
*((*string)(yyv15)) = r.DecodeString()
}
}
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -390,38 +406,44 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.APIVersion = ""
} else {
yyv16 := &x.APIVersion
yym17 := z.DecBinary()
_ = yym17
yyv17 := &x.APIVersion
yym18 := z.DecBinary()
_ = yym18
if false {
} else {
*((*string)(yyv16)) = r.DecodeString()
*((*string)(yyv17)) = r.DecodeString()
}
}
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
if r.TryDecodeAsNil() {
x.ObjectMeta = pkg2_v1.ObjectMeta{}
x.ObjectMeta = pkg1_v1.ObjectMeta{}
} else {
yyv18 := &x.ObjectMeta
yyv18.CodecDecodeSelf(d)
yyv19 := &x.ObjectMeta
yym20 := z.DecBinary()
_ = yym20
if false {
} else if z.HasExtensions() && z.DecExt(yyv19) {
} else {
z.DecFallback(yyv19, false)
}
}
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -429,21 +451,21 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Provisioner = ""
} else {
yyv19 := &x.Provisioner
yym20 := z.DecBinary()
_ = yym20
yyv21 := &x.Provisioner
yym22 := z.DecBinary()
_ = yym22
if false {
} else {
*((*string)(yyv19)) = r.DecodeString()
*((*string)(yyv21)) = r.DecodeString()
}
}
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
return
}
@ -451,26 +473,26 @@ func (x *StorageClass) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
if r.TryDecodeAsNil() {
x.Parameters = nil
} else {
yyv21 := &x.Parameters
yym22 := z.DecBinary()
_ = yym22
yyv23 := &x.Parameters
yym24 := z.DecBinary()
_ = yym24
if false {
} else {
z.F.DecMapStringStringX(yyv21, false, d)
z.F.DecMapStringStringX(yyv23, false, d)
}
}
for {
yyj13++
if yyhl13 {
yyb13 = yyj13 > l
yyj14++
if yyhl14 {
yyb14 = yyj14 > l
} else {
yyb13 = r.CheckBreak()
yyb14 = r.CheckBreak()
}
if yyb13 {
if yyb14 {
break
}
z.DecSendContainerState(codecSelfer_containerArrayElem1234)
z.DecStructFieldNotFound(yyj13-1, "")
z.DecStructFieldNotFound(yyj14-1, "")
}
z.DecSendContainerState(codecSelfer_containerArrayEnd1234)
}

View file

@ -18,7 +18,6 @@ package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1"
)
// +genclient=true
@ -34,7 +33,7 @@ type StorageClass struct {
// Standard object's metadata.
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
// +optional
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Provisioner indicates the type of the provisioner.
Provisioner string `json:"provisioner" protobuf:"bytes,2,opt,name=provisioner"`

View file

@ -11,7 +11,10 @@ go_library(
name = "go_default_library",
srcs = ["helpers.go"],
tags = ["automanaged"],
deps = ["//pkg/api/v1:go_default_library"],
deps = [
"//pkg/api/v1:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
],
)
filegroup(

View file

@ -16,7 +16,10 @@ limitations under the License.
package util
import "k8s.io/kubernetes/pkg/api/v1"
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/api/v1"
)
// IsDefaultStorageClassAnnotation represents a StorageClass annotation that
// marks a class as the default StorageClass
@ -73,7 +76,7 @@ func GetClaimStorageClass(claim *v1.PersistentVolumeClaim) string {
// GetStorageClassAnnotation returns the StorageClass value
// if the annotation is set, empty string if not
// TODO: remove Alpha and Beta when no longer used or needed
func GetStorageClassAnnotation(obj v1.ObjectMeta) string {
func GetStorageClassAnnotation(obj metav1.ObjectMeta) string {
if class, ok := obj.Annotations[StorageClassAnnotation]; ok {
return class
}
@ -90,7 +93,7 @@ func GetStorageClassAnnotation(obj v1.ObjectMeta) string {
// HasStorageClassAnnotation returns a boolean
// if the annotation is set
// TODO: remove Alpha and Beta when no longer used or needed
func HasStorageClassAnnotation(obj v1.ObjectMeta) bool {
func HasStorageClassAnnotation(obj metav1.ObjectMeta) bool {
if _, found := obj.Annotations[StorageClassAnnotation]; found {
return found
}
@ -108,7 +111,7 @@ func HasStorageClassAnnotation(obj v1.ObjectMeta) bool {
// IsDefaultAnnotationText returns a pretty Yes/No String if
// the annotation is set
// TODO: remove Beta when no longer needed
func IsDefaultAnnotationText(obj v1.ObjectMeta) string {
func IsDefaultAnnotationText(obj metav1.ObjectMeta) string {
if obj.Annotations[IsDefaultStorageClassAnnotation] == "true" {
return "Yes"
}
@ -122,7 +125,7 @@ func IsDefaultAnnotationText(obj v1.ObjectMeta) string {
// IsDefaultAnnotation returns a boolean if
// the annotation is set
// TODO: remove Beta when no longer needed
func IsDefaultAnnotation(obj v1.ObjectMeta) bool {
func IsDefaultAnnotation(obj metav1.ObjectMeta) bool {
if obj.Annotations[IsDefaultStorageClassAnnotation] == "true" {
return true
}

View file

@ -43,10 +43,7 @@ func RegisterConversions(scheme *runtime.Scheme) error {
}
func autoConvert_v1beta1_StorageClass_To_storage_StorageClass(in *StorageClass, out *storage.StorageClass, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
out.Provisioner = in.Provisioner
out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters))
return nil
@ -57,10 +54,7 @@ func Convert_v1beta1_StorageClass_To_storage_StorageClass(in *StorageClass, out
}
func autoConvert_storage_StorageClass_To_v1beta1_StorageClass(in *storage.StorageClass, out *StorageClass, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
return err
}
out.ObjectMeta = in.ObjectMeta
out.Provisioner = in.Provisioner
out.Parameters = *(*map[string]string)(unsafe.Pointer(&in.Parameters))
return nil

View file

@ -21,9 +21,9 @@ limitations under the License.
package v1beta1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
v1 "k8s.io/kubernetes/pkg/api/v1"
reflect "reflect"
)
@ -45,8 +45,10 @@ func DeepCopy_v1beta1_StorageClass(in interface{}, out interface{}, c *conversio
in := in.(*StorageClass)
out := out.(*StorageClass)
*out = *in
if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*v1.ObjectMeta)
}
if in.Parameters != nil {
in, out := &in.Parameters, &out.Parameters

View file

@ -26,8 +26,8 @@ go_test(
library = ":go_default_library",
tags = ["automanaged"],
deps = [
"//pkg/api:go_default_library",
"//pkg/apis/storage:go_default_library",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
],
)

View file

@ -20,7 +20,7 @@ import (
"fmt"
"testing"
"k8s.io/kubernetes/pkg/api"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/apis/storage"
)
@ -28,18 +28,18 @@ func TestValidateStorageClass(t *testing.T) {
successCases := []storage.StorageClass{
{
// empty parameters
ObjectMeta: api.ObjectMeta{Name: "foo"},
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Provisioner: "kubernetes.io/foo-provisioner",
Parameters: map[string]string{},
},
{
// nil parameters
ObjectMeta: api.ObjectMeta{Name: "foo"},
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Provisioner: "kubernetes.io/foo-provisioner",
},
{
// some parameters
ObjectMeta: api.ObjectMeta{Name: "foo"},
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Provisioner: "kubernetes.io/foo-provisioner",
Parameters: map[string]string{
"kubernetes.io/foo-parameter": "free/form/string",
@ -68,26 +68,26 @@ func TestValidateStorageClass(t *testing.T) {
errorCases := map[string]storage.StorageClass{
"namespace is present": {
ObjectMeta: api.ObjectMeta{Name: "foo", Namespace: "bar"},
ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "bar"},
Provisioner: "kubernetes.io/foo-provisioner",
},
"invalid provisioner": {
ObjectMeta: api.ObjectMeta{Name: "foo"},
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Provisioner: "kubernetes.io/invalid/provisioner",
},
"invalid empty parameter name": {
ObjectMeta: api.ObjectMeta{Name: "foo"},
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Provisioner: "kubernetes.io/foo",
Parameters: map[string]string{
"": "value",
},
},
"provisioner: Required value": {
ObjectMeta: api.ObjectMeta{Name: "foo"},
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Provisioner: "",
},
"too long parameters": {
ObjectMeta: api.ObjectMeta{Name: "foo"},
ObjectMeta: metav1.ObjectMeta{Name: "foo"},
Provisioner: "kubernetes.io/foo",
Parameters: longParameters,
},

View file

@ -21,9 +21,9 @@ limitations under the License.
package storage
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
api "k8s.io/kubernetes/pkg/api"
reflect "reflect"
)
@ -45,8 +45,10 @@ func DeepCopy_storage_StorageClass(in interface{}, out interface{}, c *conversio
in := in.(*StorageClass)
out := out.(*StorageClass)
*out = *in
if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
if newVal, err := c.DeepCopy(&in.ObjectMeta); err != nil {
return err
} else {
out.ObjectMeta = *newVal.(*v1.ObjectMeta)
}
if in.Parameters != nil {
in, out := &in.Parameters, &out.Parameters