mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
rebase: update to latest github.com/openshift/api version
Also vendor all dependencies. Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
committed by
mergify[bot]
parent
ab87045afb
commit
ce603fb47e
59
api/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.pb.go
generated
vendored
Normal file
59
api/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.pb.go
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.proto
|
||||
|
||||
package schema
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
|
||||
math "math"
|
||||
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
func init() {
|
||||
proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.proto", fileDescriptor_0462724132518e0d)
|
||||
}
|
||||
|
||||
var fileDescriptor_0462724132518e0d = []byte{
|
||||
// 186 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0xce, 0xad, 0x8e, 0xc3, 0x30,
|
||||
0x0c, 0xc0, 0xf1, 0x84, 0x1e, 0x3c, 0x78, 0xc0, 0xb0, 0xec, 0x62, 0x7a, 0xf8, 0xf0, 0xa4, 0xf1,
|
||||
0xb1, 0xb4, 0xf5, 0xd2, 0x28, 0xca, 0x87, 0xd2, 0x64, 0xd2, 0xd8, 0x1e, 0x61, 0x8f, 0x55, 0x58,
|
||||
0x58, 0xb8, 0x66, 0x2f, 0x32, 0x29, 0x2d, 0x18, 0x1c, 0xf3, 0x5f, 0xd6, 0xcf, 0xf2, 0xd7, 0xd1,
|
||||
0xfc, 0x8d, 0x42, 0x7b, 0x34, 0xb9, 0xa5, 0xe8, 0x28, 0xd1, 0x88, 0x17, 0x72, 0xbd, 0x8f, 0xb8,
|
||||
0x2f, 0x64, 0xd0, 0x56, 0x76, 0x83, 0x76, 0x14, 0xaf, 0x18, 0x8c, 0xc2, 0x98, 0x5d, 0xd2, 0x96,
|
||||
0x70, 0xec, 0x06, 0xb2, 0x12, 0x15, 0x39, 0x8a, 0x32, 0x51, 0x2f, 0x42, 0xf4, 0xc9, 0x7f, 0x37,
|
||||
0x9b, 0x13, 0xef, 0x4e, 0x04, 0xa3, 0xc4, 0xee, 0xc4, 0xe6, 0x7e, 0x7e, 0x95, 0x4e, 0x43, 0x6e,
|
||||
0x45, 0xe7, 0x2d, 0x2a, 0xaf, 0x3c, 0x56, 0xde, 0xe6, 0x73, 0xad, 0x1a, 0x75, 0xda, 0xce, 0xfe,
|
||||
0x1f, 0xa6, 0x15, 0xd8, 0xbc, 0x02, 0x5b, 0x56, 0x60, 0xb7, 0x02, 0x7c, 0x2a, 0xc0, 0xe7, 0x02,
|
||||
0x7c, 0x29, 0xc0, 0x1f, 0x05, 0xf8, 0xfd, 0x09, 0xec, 0xd4, 0x7c, 0xf6, 0xf4, 0x2b, 0x00, 0x00,
|
||||
0xff, 0xff, 0x12, 0xb4, 0xae, 0x48, 0xf6, 0x00, 0x00, 0x00,
|
||||
}
|
26
api/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.proto
generated
vendored
Normal file
26
api/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.proto
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
// This file was autogenerated by go-to-protobuf. Do not edit it manually!
|
||||
|
||||
syntax = "proto2";
|
||||
|
||||
package k8s.io.apimachinery.pkg.runtime.schema;
|
||||
|
||||
// Package-wide variables from generator "generated".
|
||||
option go_package = "k8s.io/apimachinery/pkg/runtime/schema";
|
||||
|
305
api/vendor/k8s.io/apimachinery/pkg/runtime/schema/group_version.go
generated
vendored
Normal file
305
api/vendor/k8s.io/apimachinery/pkg/runtime/schema/group_version.go
generated
vendored
Normal file
@ -0,0 +1,305 @@
|
||||
/*
|
||||
Copyright 2015 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package schema
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// ParseResourceArg takes the common style of string which may be either `resource.group.com` or `resource.version.group.com`
|
||||
// and parses it out into both possibilities. This code takes no responsibility for knowing which representation was intended
|
||||
// but with a knowledge of all GroupVersions, calling code can take a very good guess. If there are only two segments, then
|
||||
// `*GroupVersionResource` is nil.
|
||||
// `resource.group.com` -> `group=com, version=group, resource=resource` and `group=group.com, resource=resource`
|
||||
func ParseResourceArg(arg string) (*GroupVersionResource, GroupResource) {
|
||||
var gvr *GroupVersionResource
|
||||
if strings.Count(arg, ".") >= 2 {
|
||||
s := strings.SplitN(arg, ".", 3)
|
||||
gvr = &GroupVersionResource{Group: s[2], Version: s[1], Resource: s[0]}
|
||||
}
|
||||
|
||||
return gvr, ParseGroupResource(arg)
|
||||
}
|
||||
|
||||
// ParseKindArg takes the common style of string which may be either `Kind.group.com` or `Kind.version.group.com`
|
||||
// and parses it out into both possibilities. This code takes no responsibility for knowing which representation was intended
|
||||
// but with a knowledge of all GroupKinds, calling code can take a very good guess. If there are only two segments, then
|
||||
// `*GroupVersionKind` is nil.
|
||||
// `Kind.group.com` -> `group=com, version=group, kind=Kind` and `group=group.com, kind=Kind`
|
||||
func ParseKindArg(arg string) (*GroupVersionKind, GroupKind) {
|
||||
var gvk *GroupVersionKind
|
||||
if strings.Count(arg, ".") >= 2 {
|
||||
s := strings.SplitN(arg, ".", 3)
|
||||
gvk = &GroupVersionKind{Group: s[2], Version: s[1], Kind: s[0]}
|
||||
}
|
||||
|
||||
return gvk, ParseGroupKind(arg)
|
||||
}
|
||||
|
||||
// GroupResource specifies a Group and a Resource, but does not force a version. This is useful for identifying
|
||||
// concepts during lookup stages without having partially valid types
|
||||
type GroupResource struct {
|
||||
Group string
|
||||
Resource string
|
||||
}
|
||||
|
||||
func (gr GroupResource) WithVersion(version string) GroupVersionResource {
|
||||
return GroupVersionResource{Group: gr.Group, Version: version, Resource: gr.Resource}
|
||||
}
|
||||
|
||||
func (gr GroupResource) Empty() bool {
|
||||
return len(gr.Group) == 0 && len(gr.Resource) == 0
|
||||
}
|
||||
|
||||
func (gr GroupResource) String() string {
|
||||
if len(gr.Group) == 0 {
|
||||
return gr.Resource
|
||||
}
|
||||
return gr.Resource + "." + gr.Group
|
||||
}
|
||||
|
||||
func ParseGroupKind(gk string) GroupKind {
|
||||
i := strings.Index(gk, ".")
|
||||
if i == -1 {
|
||||
return GroupKind{Kind: gk}
|
||||
}
|
||||
|
||||
return GroupKind{Group: gk[i+1:], Kind: gk[:i]}
|
||||
}
|
||||
|
||||
// ParseGroupResource turns "resource.group" string into a GroupResource struct. Empty strings are allowed
|
||||
// for each field.
|
||||
func ParseGroupResource(gr string) GroupResource {
|
||||
if i := strings.Index(gr, "."); i >= 0 {
|
||||
return GroupResource{Group: gr[i+1:], Resource: gr[:i]}
|
||||
}
|
||||
return GroupResource{Resource: gr}
|
||||
}
|
||||
|
||||
// GroupVersionResource unambiguously identifies a resource. It doesn't anonymously include GroupVersion
|
||||
// to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling
|
||||
type GroupVersionResource struct {
|
||||
Group string
|
||||
Version string
|
||||
Resource string
|
||||
}
|
||||
|
||||
func (gvr GroupVersionResource) Empty() bool {
|
||||
return len(gvr.Group) == 0 && len(gvr.Version) == 0 && len(gvr.Resource) == 0
|
||||
}
|
||||
|
||||
func (gvr GroupVersionResource) GroupResource() GroupResource {
|
||||
return GroupResource{Group: gvr.Group, Resource: gvr.Resource}
|
||||
}
|
||||
|
||||
func (gvr GroupVersionResource) GroupVersion() GroupVersion {
|
||||
return GroupVersion{Group: gvr.Group, Version: gvr.Version}
|
||||
}
|
||||
|
||||
func (gvr GroupVersionResource) String() string {
|
||||
return strings.Join([]string{gvr.Group, "/", gvr.Version, ", Resource=", gvr.Resource}, "")
|
||||
}
|
||||
|
||||
// GroupKind specifies a Group and a Kind, but does not force a version. This is useful for identifying
|
||||
// concepts during lookup stages without having partially valid types
|
||||
type GroupKind struct {
|
||||
Group string
|
||||
Kind string
|
||||
}
|
||||
|
||||
func (gk GroupKind) Empty() bool {
|
||||
return len(gk.Group) == 0 && len(gk.Kind) == 0
|
||||
}
|
||||
|
||||
func (gk GroupKind) WithVersion(version string) GroupVersionKind {
|
||||
return GroupVersionKind{Group: gk.Group, Version: version, Kind: gk.Kind}
|
||||
}
|
||||
|
||||
func (gk GroupKind) String() string {
|
||||
if len(gk.Group) == 0 {
|
||||
return gk.Kind
|
||||
}
|
||||
return gk.Kind + "." + gk.Group
|
||||
}
|
||||
|
||||
// GroupVersionKind unambiguously identifies a kind. It doesn't anonymously include GroupVersion
|
||||
// to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling
|
||||
type GroupVersionKind struct {
|
||||
Group string
|
||||
Version string
|
||||
Kind string
|
||||
}
|
||||
|
||||
// Empty returns true if group, version, and kind are empty
|
||||
func (gvk GroupVersionKind) Empty() bool {
|
||||
return len(gvk.Group) == 0 && len(gvk.Version) == 0 && len(gvk.Kind) == 0
|
||||
}
|
||||
|
||||
func (gvk GroupVersionKind) GroupKind() GroupKind {
|
||||
return GroupKind{Group: gvk.Group, Kind: gvk.Kind}
|
||||
}
|
||||
|
||||
func (gvk GroupVersionKind) GroupVersion() GroupVersion {
|
||||
return GroupVersion{Group: gvk.Group, Version: gvk.Version}
|
||||
}
|
||||
|
||||
func (gvk GroupVersionKind) String() string {
|
||||
return gvk.Group + "/" + gvk.Version + ", Kind=" + gvk.Kind
|
||||
}
|
||||
|
||||
// GroupVersion contains the "group" and the "version", which uniquely identifies the API.
|
||||
type GroupVersion struct {
|
||||
Group string
|
||||
Version string
|
||||
}
|
||||
|
||||
// Empty returns true if group and version are empty
|
||||
func (gv GroupVersion) Empty() bool {
|
||||
return len(gv.Group) == 0 && len(gv.Version) == 0
|
||||
}
|
||||
|
||||
// String puts "group" and "version" into a single "group/version" string. For the legacy v1
|
||||
// it returns "v1".
|
||||
func (gv GroupVersion) String() string {
|
||||
if len(gv.Group) > 0 {
|
||||
return gv.Group + "/" + gv.Version
|
||||
}
|
||||
return gv.Version
|
||||
}
|
||||
|
||||
// Identifier implements runtime.GroupVersioner interface.
|
||||
func (gv GroupVersion) Identifier() string {
|
||||
return gv.String()
|
||||
}
|
||||
|
||||
// KindForGroupVersionKinds identifies the preferred GroupVersionKind out of a list. It returns ok false
|
||||
// if none of the options match the group. It prefers a match to group and version over just group.
|
||||
// TODO: Move GroupVersion to a package under pkg/runtime, since it's used by scheme.
|
||||
// TODO: Introduce an adapter type between GroupVersion and runtime.GroupVersioner, and use LegacyCodec(GroupVersion)
|
||||
// in fewer places.
|
||||
func (gv GroupVersion) KindForGroupVersionKinds(kinds []GroupVersionKind) (target GroupVersionKind, ok bool) {
|
||||
for _, gvk := range kinds {
|
||||
if gvk.Group == gv.Group && gvk.Version == gv.Version {
|
||||
return gvk, true
|
||||
}
|
||||
}
|
||||
for _, gvk := range kinds {
|
||||
if gvk.Group == gv.Group {
|
||||
return gv.WithKind(gvk.Kind), true
|
||||
}
|
||||
}
|
||||
return GroupVersionKind{}, false
|
||||
}
|
||||
|
||||
// ParseGroupVersion turns "group/version" string into a GroupVersion struct. It reports error
|
||||
// if it cannot parse the string.
|
||||
func ParseGroupVersion(gv string) (GroupVersion, error) {
|
||||
// this can be the internal version for the legacy kube types
|
||||
// TODO once we've cleared the last uses as strings, this special case should be removed.
|
||||
if (len(gv) == 0) || (gv == "/") {
|
||||
return GroupVersion{}, nil
|
||||
}
|
||||
|
||||
switch strings.Count(gv, "/") {
|
||||
case 0:
|
||||
return GroupVersion{"", gv}, nil
|
||||
case 1:
|
||||
i := strings.Index(gv, "/")
|
||||
return GroupVersion{gv[:i], gv[i+1:]}, nil
|
||||
default:
|
||||
return GroupVersion{}, fmt.Errorf("unexpected GroupVersion string: %v", gv)
|
||||
}
|
||||
}
|
||||
|
||||
// WithKind creates a GroupVersionKind based on the method receiver's GroupVersion and the passed Kind.
|
||||
func (gv GroupVersion) WithKind(kind string) GroupVersionKind {
|
||||
return GroupVersionKind{Group: gv.Group, Version: gv.Version, Kind: kind}
|
||||
}
|
||||
|
||||
// WithResource creates a GroupVersionResource based on the method receiver's GroupVersion and the passed Resource.
|
||||
func (gv GroupVersion) WithResource(resource string) GroupVersionResource {
|
||||
return GroupVersionResource{Group: gv.Group, Version: gv.Version, Resource: resource}
|
||||
}
|
||||
|
||||
// GroupVersions can be used to represent a set of desired group versions.
|
||||
// TODO: Move GroupVersions to a package under pkg/runtime, since it's used by scheme.
|
||||
// TODO: Introduce an adapter type between GroupVersions and runtime.GroupVersioner, and use LegacyCodec(GroupVersion)
|
||||
// in fewer places.
|
||||
type GroupVersions []GroupVersion
|
||||
|
||||
// Identifier implements runtime.GroupVersioner interface.
|
||||
func (gvs GroupVersions) Identifier() string {
|
||||
groupVersions := make([]string, 0, len(gvs))
|
||||
for i := range gvs {
|
||||
groupVersions = append(groupVersions, gvs[i].String())
|
||||
}
|
||||
return fmt.Sprintf("[%s]", strings.Join(groupVersions, ","))
|
||||
}
|
||||
|
||||
// KindForGroupVersionKinds identifies the preferred GroupVersionKind out of a list. It returns ok false
|
||||
// if none of the options match the group.
|
||||
func (gvs GroupVersions) KindForGroupVersionKinds(kinds []GroupVersionKind) (GroupVersionKind, bool) {
|
||||
var targets []GroupVersionKind
|
||||
for _, gv := range gvs {
|
||||
target, ok := gv.KindForGroupVersionKinds(kinds)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
targets = append(targets, target)
|
||||
}
|
||||
if len(targets) == 1 {
|
||||
return targets[0], true
|
||||
}
|
||||
if len(targets) > 1 {
|
||||
return bestMatch(kinds, targets), true
|
||||
}
|
||||
return GroupVersionKind{}, false
|
||||
}
|
||||
|
||||
// bestMatch tries to pick best matching GroupVersionKind and falls back to the first
|
||||
// found if no exact match exists.
|
||||
func bestMatch(kinds []GroupVersionKind, targets []GroupVersionKind) GroupVersionKind {
|
||||
for _, gvk := range targets {
|
||||
for _, k := range kinds {
|
||||
if k == gvk {
|
||||
return k
|
||||
}
|
||||
}
|
||||
}
|
||||
return targets[0]
|
||||
}
|
||||
|
||||
// ToAPIVersionAndKind is a convenience method for satisfying runtime.Object on types that
|
||||
// do not use TypeMeta.
|
||||
func (gvk GroupVersionKind) ToAPIVersionAndKind() (string, string) {
|
||||
if gvk.Empty() {
|
||||
return "", ""
|
||||
}
|
||||
return gvk.GroupVersion().String(), gvk.Kind
|
||||
}
|
||||
|
||||
// FromAPIVersionAndKind returns a GVK representing the provided fields for types that
|
||||
// do not use TypeMeta. This method exists to support test types and legacy serializations
|
||||
// that have a distinct group and kind.
|
||||
// TODO: further reduce usage of this method.
|
||||
func FromAPIVersionAndKind(apiVersion, kind string) GroupVersionKind {
|
||||
if gv, err := ParseGroupVersion(apiVersion); err == nil {
|
||||
return GroupVersionKind{Group: gv.Group, Version: gv.Version, Kind: kind}
|
||||
}
|
||||
return GroupVersionKind{Kind: kind}
|
||||
}
|
40
api/vendor/k8s.io/apimachinery/pkg/runtime/schema/interfaces.go
generated
vendored
Normal file
40
api/vendor/k8s.io/apimachinery/pkg/runtime/schema/interfaces.go
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package schema
|
||||
|
||||
// All objects that are serialized from a Scheme encode their type information. This interface is used
|
||||
// by serialization to set type information from the Scheme onto the serialized version of an object.
|
||||
// For objects that cannot be serialized or have unique requirements, this interface may be a no-op.
|
||||
type ObjectKind interface {
|
||||
// SetGroupVersionKind sets or clears the intended serialized kind of an object. Passing kind nil
|
||||
// should clear the current setting.
|
||||
SetGroupVersionKind(kind GroupVersionKind)
|
||||
// GroupVersionKind returns the stored group, version, and kind of an object, or an empty struct
|
||||
// if the object does not expose or provide these fields.
|
||||
GroupVersionKind() GroupVersionKind
|
||||
}
|
||||
|
||||
// EmptyObjectKind implements the ObjectKind interface as a noop
|
||||
var EmptyObjectKind = emptyObjectKind{}
|
||||
|
||||
type emptyObjectKind struct{}
|
||||
|
||||
// SetGroupVersionKind implements the ObjectKind interface
|
||||
func (emptyObjectKind) SetGroupVersionKind(gvk GroupVersionKind) {}
|
||||
|
||||
// GroupVersionKind implements the ObjectKind interface
|
||||
func (emptyObjectKind) GroupVersionKind() GroupVersionKind { return GroupVersionKind{} }
|
Reference in New Issue
Block a user