vendor dependencies

This commit is contained in:
Sergiusz Urbaniak 2019-04-24 11:06:03 +02:00
parent 604208ef4f
commit 72abf135d6
1156 changed files with 78178 additions and 105799 deletions

View file

@ -0,0 +1,75 @@
/*
Copyright 2018 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 v1beta1
import (
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/conversion"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/metrics/pkg/apis/custom_metrics"
)
func addConversionFuncs(scheme *runtime.Scheme) error {
// Add non-generated conversion functions
err := scheme.AddConversionFuncs(
Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue,
Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue,
)
if err != nil {
return err
}
return nil
}
func Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custom_metrics.MetricValue, s conversion.Scope) error {
out.TypeMeta = in.TypeMeta
out.DescribedObject = custom_metrics.ObjectReference{
Kind: in.DescribedObject.Kind,
Namespace: in.DescribedObject.Namespace,
Name: in.DescribedObject.Name,
UID: in.DescribedObject.UID,
APIVersion: in.DescribedObject.APIVersion,
ResourceVersion: in.DescribedObject.ResourceVersion,
FieldPath: in.DescribedObject.FieldPath,
}
out.Timestamp = in.Timestamp
out.WindowSeconds = in.WindowSeconds
out.Value = in.Value
out.Metric.Name = in.MetricName
out.Metric.Selector = in.Selector
return nil
}
func Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue(in *custom_metrics.MetricValue, out *MetricValue, s conversion.Scope) error {
out.TypeMeta = in.TypeMeta
out.DescribedObject = v1.ObjectReference{
Kind: in.DescribedObject.Kind,
Namespace: in.DescribedObject.Namespace,
Name: in.DescribedObject.Name,
UID: in.DescribedObject.UID,
APIVersion: in.DescribedObject.APIVersion,
ResourceVersion: in.DescribedObject.ResourceVersion,
FieldPath: in.DescribedObject.FieldPath,
}
out.Timestamp = in.Timestamp
out.WindowSeconds = in.WindowSeconds
out.Value = in.Value
out.MetricName = in.Metric.Name
out.Selector = in.Metric.Selector
return nil
}

View file

@ -15,6 +15,7 @@ limitations under the License.
*/
// +k8s:deepcopy-gen=package
// +k8s:protobuf-gen=package
// +k8s:conversion-gen=k8s.io/metrics/pkg/apis/custom_metrics
// +k8s:openapi-gen=true

View file

@ -14,9 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by protoc-gen-gogo.
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: k8s.io/kubernetes/vendor/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/generated.proto
// DO NOT EDIT!
/*
Package v1beta1 is a generated protocol buffer package.
@ -25,6 +24,7 @@ limitations under the License.
k8s.io/kubernetes/vendor/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1/generated.proto
It has these top-level messages:
MetricListOptions
MetricValue
MetricValueList
*/
@ -34,6 +34,8 @@ import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import k8s_io_apimachinery_pkg_apis_meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
import strings "strings"
import reflect "reflect"
@ -50,18 +52,49 @@ var _ = math.Inf
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
func (m *MetricListOptions) Reset() { *m = MetricListOptions{} }
func (*MetricListOptions) ProtoMessage() {}
func (*MetricListOptions) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} }
func (m *MetricValue) Reset() { *m = MetricValue{} }
func (*MetricValue) ProtoMessage() {}
func (*MetricValue) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} }
func (*MetricValue) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} }
func (m *MetricValueList) Reset() { *m = MetricValueList{} }
func (*MetricValueList) ProtoMessage() {}
func (*MetricValueList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} }
func (*MetricValueList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} }
func init() {
proto.RegisterType((*MetricListOptions)(nil), "k8s.io.metrics.pkg.apis.custom_metrics.v1beta1.MetricListOptions")
proto.RegisterType((*MetricValue)(nil), "k8s.io.metrics.pkg.apis.custom_metrics.v1beta1.MetricValue")
proto.RegisterType((*MetricValueList)(nil), "k8s.io.metrics.pkg.apis.custom_metrics.v1beta1.MetricValueList")
}
func (m *MetricListOptions) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *MetricListOptions) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintGenerated(dAtA, i, uint64(len(m.LabelSelector)))
i += copy(dAtA[i:], m.LabelSelector)
dAtA[i] = 0x12
i++
i = encodeVarintGenerated(dAtA, i, uint64(len(m.MetricLabelSelector)))
i += copy(dAtA[i:], m.MetricLabelSelector)
return i, nil
}
func (m *MetricValue) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@ -110,6 +143,16 @@ func (m *MetricValue) MarshalTo(dAtA []byte) (int, error) {
return 0, err
}
i += n3
if m.Selector != nil {
dAtA[i] = 0x32
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.Selector.Size()))
n4, err := m.Selector.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n4
}
return i, nil
}
@ -131,11 +174,11 @@ func (m *MetricValueList) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0xa
i++
i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size()))
n4, err := m.ListMeta.MarshalTo(dAtA[i:])
n5, err := m.ListMeta.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n4
i += n5
if len(m.Items) > 0 {
for _, msg := range m.Items {
dAtA[i] = 0x12
@ -151,24 +194,6 @@ func (m *MetricValueList) MarshalTo(dAtA []byte) (int, error) {
return i, nil
}
func encodeFixed64Generated(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Generated(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
@ -178,6 +203,16 @@ func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *MetricListOptions) Size() (n int) {
var l int
_ = l
l = len(m.LabelSelector)
n += 1 + l + sovGenerated(uint64(l))
l = len(m.MetricLabelSelector)
n += 1 + l + sovGenerated(uint64(l))
return n
}
func (m *MetricValue) Size() (n int) {
var l int
_ = l
@ -192,6 +227,10 @@ func (m *MetricValue) Size() (n int) {
}
l = m.Value.Size()
n += 1 + l + sovGenerated(uint64(l))
if m.Selector != nil {
l = m.Selector.Size()
n += 1 + l + sovGenerated(uint64(l))
}
return n
}
@ -222,6 +261,17 @@ func sovGenerated(x uint64) (n int) {
func sozGenerated(x uint64) (n int) {
return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *MetricListOptions) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&MetricListOptions{`,
`LabelSelector:` + fmt.Sprintf("%v", this.LabelSelector) + `,`,
`MetricLabelSelector:` + fmt.Sprintf("%v", this.MetricLabelSelector) + `,`,
`}`,
}, "")
return s
}
func (this *MetricValue) String() string {
if this == nil {
return "nil"
@ -232,6 +282,7 @@ func (this *MetricValue) String() string {
`Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1), `&`, ``, 1) + `,`,
`WindowSeconds:` + valueToStringGenerated(this.WindowSeconds) + `,`,
`Value:` + strings.Replace(strings.Replace(this.Value.String(), "Quantity", "k8s_io_apimachinery_pkg_api_resource.Quantity", 1), `&`, ``, 1) + `,`,
`Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector", 1) + `,`,
`}`,
}, "")
return s
@ -255,6 +306,114 @@ func valueToStringGenerated(v interface{}) string {
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *MetricListOptions) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: MetricListOptions: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: MetricListOptions: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field LabelSelector", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.LabelSelector = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field MetricLabelSelector", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.MetricLabelSelector = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthGenerated
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func (m *MetricValue) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@ -423,6 +582,39 @@ func (m *MetricValue) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowGenerated
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthGenerated
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Selector == nil {
m.Selector = &k8s_io_apimachinery_pkg_apis_meta_v1.LabelSelector{}
}
if err := m.Selector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipGenerated(dAtA[iNdEx:])
@ -665,39 +857,44 @@ func init() {
}
var fileDescriptorGenerated = []byte{
// 531 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x4f, 0x6f, 0xd3, 0x30,
0x18, 0xc6, 0x9b, 0x95, 0xc2, 0xe6, 0x69, 0x1a, 0xcb, 0x85, 0xa8, 0x87, 0xb4, 0x2a, 0x97, 0x82,
0x34, 0x5b, 0xad, 0x10, 0x42, 0xe2, 0x16, 0x71, 0x41, 0xa2, 0x20, 0xb2, 0x89, 0x49, 0x80, 0x04,
0x8e, 0xf3, 0x36, 0x35, 0x25, 0x71, 0x64, 0x3b, 0x9d, 0x76, 0xe3, 0xc4, 0x99, 0x8f, 0xd5, 0xe3,
0xb8, 0xed, 0x54, 0xd1, 0xf0, 0x45, 0x50, 0x12, 0xa7, 0xed, 0x36, 0xfe, 0xed, 0x16, 0xdb, 0xef,
0xf3, 0xf3, 0xf3, 0x3e, 0xaf, 0x83, 0x4e, 0xa6, 0x4f, 0x14, 0xe6, 0x82, 0x4c, 0xb3, 0x00, 0x64,
0x02, 0x1a, 0x14, 0x99, 0x41, 0x12, 0x0a, 0x49, 0xcc, 0x41, 0x0c, 0x5a, 0x72, 0xa6, 0x48, 0x3a,
0x8d, 0x08, 0x4d, 0xb9, 0x22, 0x2c, 0x53, 0x5a, 0xc4, 0x1f, 0xea, 0xfd, 0xd9, 0x20, 0x00, 0x4d,
0x07, 0x24, 0x82, 0x04, 0x24, 0xd5, 0x10, 0xe2, 0x54, 0x0a, 0x2d, 0x6c, 0x5c, 0xe9, 0xb1, 0xa9,
0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, 0xe3, 0xed, 0x1d, 0x03, 0xfc, 0x15, 0x00, 0x00, 0xff, 0xff, 0x7d, 0xe5, 0xb6, 0x67, 0x3d,
0x04, 0x00, 0x00,
// 616 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4f, 0x4f, 0x14, 0x3f,
0x1c, 0xc6, 0x77, 0xd8, 0xdf, 0xf2, 0x5b, 0x8a, 0x04, 0x19, 0x62, 0xdc, 0x60, 0x32, 0x90, 0xf5,
0x82, 0x26, 0xb4, 0x01, 0x8d, 0x31, 0xe1, 0x36, 0xf1, 0x62, 0xc2, 0x4a, 0x1c, 0x88, 0x24, 0xfe,
0x89, 0x76, 0x3a, 0x5f, 0x96, 0xba, 0x3b, 0xd3, 0x49, 0xdb, 0x59, 0xc2, 0xcd, 0x97, 0xe0, 0x3b,
0xf0, 0xed, 0x70, 0xc4, 0x1b, 0x27, 0x22, 0x63, 0x7c, 0x1f, 0x66, 0x3a, 0x9d, 0xfd, 0xc3, 0xa2,
0xc2, 0x6d, 0xa7, 0x7d, 0x9e, 0x4f, 0x9f, 0x7e, 0x9f, 0x66, 0xd1, 0x41, 0xef, 0xb9, 0xc2, 0x5c,
0x90, 0x5e, 0x16, 0x82, 0x4c, 0x40, 0x83, 0x22, 0x03, 0x48, 0x22, 0x21, 0x89, 0xdd, 0x88, 0x41,
0x4b, 0xce, 0x14, 0x49, 0x7b, 0x5d, 0x42, 0x53, 0xae, 0x08, 0xcb, 0x94, 0x16, 0xf1, 0xc7, 0x6a,
0x7d, 0xb0, 0x19, 0x82, 0xa6, 0x9b, 0xa4, 0x0b, 0x09, 0x48, 0xaa, 0x21, 0xc2, 0xa9, 0x14, 0x5a,
0xb8, 0xb8, 0xf4, 0x63, 0xab, 0xc3, 0x69, 0xaf, 0x8b, 0x0b, 0x3f, 0x9e, 0xf4, 0x63, 0xeb, 0x5f,
0xd9, 0xe8, 0x72,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, 0x4a, 0xb3, 0x5a, 0x09, 0x86, 0x44, 0xf7, 0x13, 0x6a, 0x70, 0x0d, 0xb1,
0x6a, 0xcd, 0xac, 0xd5, 0xd7, 0xe7, 0xb7, 0xb6, 0x6f, 0xf9, 0x1f, 0x83, 0xc7, 0xd2, 0x8e, 0x46,
0xf6, 0xb2, 0x20, 0x06, 0x25, 0xd8, 0xdf, 0x38, 0xbd, 0xf4, 0x6a, 0x67, 0x97, 0x5e, 0xed, 0xfc,
0xd2, 0xab, 0x7d, 0xc9, 0x3d, 0xe7, 0x34, 0xf7, 0x9c, 0xb3, 0xdc, 0x73, 0xce, 0x73, 0xcf, 0xf9,
0x91, 0x7b, 0xce, 0xd7, 0x9f, 0x5e, 0xed, 0xed, 0xff, 0x16, 0xf8, 0x3b, 0x00, 0x00, 0xff, 0xff,
0xf5, 0x23, 0xb5, 0xdc, 0x3e, 0x05, 0x00, 0x00,
}

View file

@ -30,7 +30,19 @@ import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
// Package-wide variables from generator "generated".
option go_package = "v1beta1";
// a metric value for some object
// MetricListOptions is used to select metrics by their label selectors
message MetricListOptions {
// A selector to restrict the list of returned objects by their labels.
// Defaults to everything.
// +optional
optional string labelSelector = 1;
// A selector to restrict the list of returned metrics by their labels
// +optional
optional string metricLabelSelector = 2;
}
// MetricValue is a metric value for some object
message MetricValue {
// a reference to the described object
optional k8s.io.api.core.v1.ObjectReference describedObject = 1;
@ -49,9 +61,16 @@ message MetricValue {
// the value of the metric for this
optional k8s.io.apimachinery.pkg.api.resource.Quantity value = 5;
// selector represents the label selector that could be used to select
// this metric, and will generally just be the selector passed in to
// the query used to fetch this metric.
// When left blank, only the metric's Name will be used to gather metrics.
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 6;
}
// a list of values for a given metric for some set of objects
// MetricValueList is a list of values for a given metric for some set of objects
message MetricValueList {
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;

View file

@ -34,15 +34,18 @@ func Resource(resource string) schema.GroupResource {
}
var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
// SchemeBuilder points to a list of functions added to Scheme.
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs)
localSchemeBuilder = &SchemeBuilder
AddToScheme = localSchemeBuilder.AddToScheme
// AddToScheme applies all the stored functions to the scheme.
AddToScheme = localSchemeBuilder.AddToScheme
)
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&MetricValue{},
&MetricValueList{},
&MetricListOptions{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil

View file

@ -24,7 +24,7 @@ import (
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// a list of values for a given metric for some set of objects
// MetricValueList is a list of values for a given metric for some set of objects
type MetricValueList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
@ -35,7 +35,7 @@ type MetricValueList struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// a metric value for some object
// MetricValue is a metric value for some object
type MetricValue struct {
metav1.TypeMeta `json:",inline"`
@ -56,8 +56,31 @@ type MetricValue struct {
// the value of the metric for this
Value resource.Quantity `json:"value" protobuf:"bytes,5,name=value"`
// selector represents the label selector that could be used to select
// this metric, and will generally just be the selector passed in to
// the query used to fetch this metric.
// When left blank, only the metric's Name will be used to gather metrics.
// +optional
Selector *metav1.LabelSelector `json:"selector" protobuf:"bytes,6,opt,name=selector"`
}
// allObjects is a wildcard used to select metrics
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// MetricListOptions is used to select metrics by their label selectors
type MetricListOptions struct {
metav1.TypeMeta `json:",inline"`
// A selector to restrict the list of returned objects by their labels.
// Defaults to everything.
// +optional
LabelSelector string `json:"labelSelector,omitempty" protobuf:"bytes,1,opt,name=labelSelector"`
// A selector to restrict the list of returned metrics by their labels
// +optional
MetricLabelSelector string `json:"metricLabelSelector,omitempty" protobuf:"bytes,2,opt,name=metricLabelSelector"`
}
// AllObjects is a wildcard used to select metrics
// for all objects matching the given label selector
const AllObjects = "*"

View file

@ -25,7 +25,7 @@ import (
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
custom_metrics "k8s.io/metrics/pkg/apis/custom_metrics"
custommetrics "k8s.io/metrics/pkg/apis/custom_metrics"
)
func init() {
@ -34,67 +34,135 @@ func init() {
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(scheme *runtime.Scheme) error {
return scheme.AddGeneratedConversionFuncs(
Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue,
Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue,
Convert_v1beta1_MetricValueList_To_custom_metrics_MetricValueList,
Convert_custom_metrics_MetricValueList_To_v1beta1_MetricValueList,
)
func RegisterConversions(s *runtime.Scheme) error {
if err := s.AddGeneratedConversionFunc((*MetricListOptions)(nil), (*custommetrics.MetricListOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_MetricListOptions_To_custom_metrics_MetricListOptions(a.(*MetricListOptions), b.(*custommetrics.MetricListOptions), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*custommetrics.MetricListOptions)(nil), (*MetricListOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_custom_metrics_MetricListOptions_To_v1beta1_MetricListOptions(a.(*custommetrics.MetricListOptions), b.(*MetricListOptions), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*MetricValue)(nil), (*custommetrics.MetricValue)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue(a.(*MetricValue), b.(*custommetrics.MetricValue), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*custommetrics.MetricValue)(nil), (*MetricValue)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue(a.(*custommetrics.MetricValue), b.(*MetricValue), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*MetricValueList)(nil), (*custommetrics.MetricValueList)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_MetricValueList_To_custom_metrics_MetricValueList(a.(*MetricValueList), b.(*custommetrics.MetricValueList), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*custommetrics.MetricValueList)(nil), (*MetricValueList)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_custom_metrics_MetricValueList_To_v1beta1_MetricValueList(a.(*custommetrics.MetricValueList), b.(*MetricValueList), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*custommetrics.MetricValue)(nil), (*MetricValue)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue(a.(*custommetrics.MetricValue), b.(*MetricValue), scope)
}); err != nil {
return err
}
if err := s.AddConversionFunc((*MetricValue)(nil), (*custommetrics.MetricValue)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue(a.(*MetricValue), b.(*custommetrics.MetricValue), scope)
}); err != nil {
return err
}
return nil
}
func autoConvert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custom_metrics.MetricValue, s conversion.Scope) error {
func autoConvert_v1beta1_MetricListOptions_To_custom_metrics_MetricListOptions(in *MetricListOptions, out *custommetrics.MetricListOptions, s conversion.Scope) error {
out.LabelSelector = in.LabelSelector
out.MetricLabelSelector = in.MetricLabelSelector
return nil
}
// Convert_v1beta1_MetricListOptions_To_custom_metrics_MetricListOptions is an autogenerated conversion function.
func Convert_v1beta1_MetricListOptions_To_custom_metrics_MetricListOptions(in *MetricListOptions, out *custommetrics.MetricListOptions, s conversion.Scope) error {
return autoConvert_v1beta1_MetricListOptions_To_custom_metrics_MetricListOptions(in, out, s)
}
func autoConvert_custom_metrics_MetricListOptions_To_v1beta1_MetricListOptions(in *custommetrics.MetricListOptions, out *MetricListOptions, s conversion.Scope) error {
out.LabelSelector = in.LabelSelector
out.MetricLabelSelector = in.MetricLabelSelector
return nil
}
// Convert_custom_metrics_MetricListOptions_To_v1beta1_MetricListOptions is an autogenerated conversion function.
func Convert_custom_metrics_MetricListOptions_To_v1beta1_MetricListOptions(in *custommetrics.MetricListOptions, out *MetricListOptions, s conversion.Scope) error {
return autoConvert_custom_metrics_MetricListOptions_To_v1beta1_MetricListOptions(in, out, s)
}
func autoConvert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custommetrics.MetricValue, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.DescribedObject, &out.DescribedObject, 0); err != nil {
return err
}
out.MetricName = in.MetricName
// WARNING: in.MetricName requires manual conversion: does not exist in peer-type
out.Timestamp = in.Timestamp
out.WindowSeconds = (*int64)(unsafe.Pointer(in.WindowSeconds))
out.Value = in.Value
// WARNING: in.Selector requires manual conversion: does not exist in peer-type
return nil
}
func autoConvert_custom_metrics_MetricValue_To_v1beta1_MetricValue(in *custommetrics.MetricValue, out *MetricValue, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.DescribedObject, &out.DescribedObject, 0); err != nil {
return err
}
// WARNING: in.Metric requires manual conversion: does not exist in peer-type
out.Timestamp = in.Timestamp
out.WindowSeconds = (*int64)(unsafe.Pointer(in.WindowSeconds))
out.Value = in.Value
return nil
}
// Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue is an autogenerated conversion function.
func Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custom_metrics.MetricValue, s conversion.Scope) error {
return autoConvert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in, out, s)
}
func autoConvert_custom_metrics_MetricValue_To_v1beta1_MetricValue(in *custom_metrics.MetricValue, out *MetricValue, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it?
if err := s.Convert(&in.DescribedObject, &out.DescribedObject, 0); err != nil {
return err
}
out.MetricName = in.MetricName
out.Timestamp = in.Timestamp
out.WindowSeconds = (*int64)(unsafe.Pointer(in.WindowSeconds))
out.Value = in.Value
return nil
}
// Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue is an autogenerated conversion function.
func Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue(in *custom_metrics.MetricValue, out *MetricValue, s conversion.Scope) error {
return autoConvert_custom_metrics_MetricValue_To_v1beta1_MetricValue(in, out, s)
}
func autoConvert_v1beta1_MetricValueList_To_custom_metrics_MetricValueList(in *MetricValueList, out *custom_metrics.MetricValueList, s conversion.Scope) error {
func autoConvert_v1beta1_MetricValueList_To_custom_metrics_MetricValueList(in *MetricValueList, out *custommetrics.MetricValueList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
out.Items = *(*[]custom_metrics.MetricValue)(unsafe.Pointer(&in.Items))
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]custommetrics.MetricValue, len(*in))
for i := range *in {
if err := Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
// Convert_v1beta1_MetricValueList_To_custom_metrics_MetricValueList is an autogenerated conversion function.
func Convert_v1beta1_MetricValueList_To_custom_metrics_MetricValueList(in *MetricValueList, out *custom_metrics.MetricValueList, s conversion.Scope) error {
func Convert_v1beta1_MetricValueList_To_custom_metrics_MetricValueList(in *MetricValueList, out *custommetrics.MetricValueList, s conversion.Scope) error {
return autoConvert_v1beta1_MetricValueList_To_custom_metrics_MetricValueList(in, out, s)
}
func autoConvert_custom_metrics_MetricValueList_To_v1beta1_MetricValueList(in *custom_metrics.MetricValueList, out *MetricValueList, s conversion.Scope) error {
func autoConvert_custom_metrics_MetricValueList_To_v1beta1_MetricValueList(in *custommetrics.MetricValueList, out *MetricValueList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
out.Items = *(*[]MetricValue)(unsafe.Pointer(&in.Items))
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]MetricValue, len(*in))
for i := range *in {
if err := Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil
}
// Convert_custom_metrics_MetricValueList_To_v1beta1_MetricValueList is an autogenerated conversion function.
func Convert_custom_metrics_MetricValueList_To_v1beta1_MetricValueList(in *custom_metrics.MetricValueList, out *MetricValueList, s conversion.Scope) error {
func Convert_custom_metrics_MetricValueList_To_v1beta1_MetricValueList(in *custommetrics.MetricValueList, out *MetricValueList, s conversion.Scope) error {
return autoConvert_custom_metrics_MetricValueList_To_v1beta1_MetricValueList(in, out, s)
}

View file

@ -21,9 +21,35 @@ limitations under the License.
package v1beta1
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MetricListOptions) DeepCopyInto(out *MetricListOptions) {
*out = *in
out.TypeMeta = in.TypeMeta
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricListOptions.
func (in *MetricListOptions) DeepCopy() *MetricListOptions {
if in == nil {
return nil
}
out := new(MetricListOptions)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *MetricListOptions) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MetricValue) DeepCopyInto(out *MetricValue) {
*out = *in
@ -32,14 +58,15 @@ func (in *MetricValue) DeepCopyInto(out *MetricValue) {
in.Timestamp.DeepCopyInto(&out.Timestamp)
if in.WindowSeconds != nil {
in, out := &in.WindowSeconds, &out.WindowSeconds
if *in == nil {
*out = nil
} else {
*out = new(int64)
**out = **in
}
*out = new(int64)
**out = **in
}
out.Value = in.Value.DeepCopy()
if in.Selector != nil {
in, out := &in.Selector, &out.Selector
*out = new(v1.LabelSelector)
(*in).DeepCopyInto(*out)
}
return
}