Unverified Commit f5115f51 authored by Menna Elmasry's avatar Menna Elmasry Committed by GitHub

Merge pull request #2272 from MonzElmasry/v1.19.2-k3s1

Update k3s to v1.19.2+k3s1
parents b66760fc 36beb715
...@@ -31,31 +31,31 @@ replace ( ...@@ -31,31 +31,31 @@ replace (
google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63
google.golang.org/grpc => google.golang.org/grpc v1.26.0 google.golang.org/grpc => google.golang.org/grpc v1.26.0
gopkg.in/square/go-jose.v2 => gopkg.in/square/go-jose.v2 v2.2.2 gopkg.in/square/go-jose.v2 => gopkg.in/square/go-jose.v2 v2.2.2
k8s.io/api => github.com/rancher/kubernetes/staging/src/k8s.io/api v1.19.1-k3s1 k8s.io/api => github.com/rancher/kubernetes/staging/src/k8s.io/api v1.19.2-k3s1
k8s.io/apiextensions-apiserver => github.com/rancher/kubernetes/staging/src/k8s.io/apiextensions-apiserver v1.19.1-k3s1 k8s.io/apiextensions-apiserver => github.com/rancher/kubernetes/staging/src/k8s.io/apiextensions-apiserver v1.19.2-k3s1
k8s.io/apimachinery => github.com/rancher/kubernetes/staging/src/k8s.io/apimachinery v1.19.1-k3s1 k8s.io/apimachinery => github.com/rancher/kubernetes/staging/src/k8s.io/apimachinery v1.19.2-k3s1
k8s.io/apiserver => github.com/rancher/kubernetes/staging/src/k8s.io/apiserver v1.19.1-k3s1 k8s.io/apiserver => github.com/rancher/kubernetes/staging/src/k8s.io/apiserver v1.19.2-k3s1
k8s.io/cli-runtime => github.com/rancher/kubernetes/staging/src/k8s.io/cli-runtime v1.19.1-k3s1 k8s.io/cli-runtime => github.com/rancher/kubernetes/staging/src/k8s.io/cli-runtime v1.19.2-k3s1
k8s.io/client-go => github.com/rancher/kubernetes/staging/src/k8s.io/client-go v1.19.1-k3s1 k8s.io/client-go => github.com/rancher/kubernetes/staging/src/k8s.io/client-go v1.19.2-k3s1
k8s.io/cloud-provider => github.com/rancher/kubernetes/staging/src/k8s.io/cloud-provider v1.19.1-k3s1 k8s.io/cloud-provider => github.com/rancher/kubernetes/staging/src/k8s.io/cloud-provider v1.19.2-k3s1
k8s.io/cluster-bootstrap => github.com/rancher/kubernetes/staging/src/k8s.io/cluster-bootstrap v1.19.1-k3s1 k8s.io/cluster-bootstrap => github.com/rancher/kubernetes/staging/src/k8s.io/cluster-bootstrap v1.19.2-k3s1
k8s.io/code-generator => github.com/rancher/kubernetes/staging/src/k8s.io/code-generator v1.19.1-k3s1 k8s.io/code-generator => github.com/rancher/kubernetes/staging/src/k8s.io/code-generator v1.19.2-k3s1
k8s.io/component-base => github.com/rancher/kubernetes/staging/src/k8s.io/component-base v1.19.1-k3s1 k8s.io/component-base => github.com/rancher/kubernetes/staging/src/k8s.io/component-base v1.19.2-k3s1
k8s.io/cri-api => github.com/rancher/kubernetes/staging/src/k8s.io/cri-api v1.19.1-k3s1 k8s.io/cri-api => github.com/rancher/kubernetes/staging/src/k8s.io/cri-api v1.19.2-k3s1
k8s.io/csi-translation-lib => github.com/rancher/kubernetes/staging/src/k8s.io/csi-translation-lib v1.19.1-k3s1 k8s.io/csi-translation-lib => github.com/rancher/kubernetes/staging/src/k8s.io/csi-translation-lib v1.19.2-k3s1
k8s.io/kube-aggregator => github.com/rancher/kubernetes/staging/src/k8s.io/kube-aggregator v1.19.1-k3s1 k8s.io/kube-aggregator => github.com/rancher/kubernetes/staging/src/k8s.io/kube-aggregator v1.19.2-k3s1
k8s.io/kube-controller-manager => github.com/rancher/kubernetes/staging/src/k8s.io/kube-controller-manager v1.19.1-k3s1 k8s.io/kube-controller-manager => github.com/rancher/kubernetes/staging/src/k8s.io/kube-controller-manager v1.19.2-k3s1
k8s.io/kube-proxy => github.com/rancher/kubernetes/staging/src/k8s.io/kube-proxy v1.19.1-k3s1 k8s.io/kube-proxy => github.com/rancher/kubernetes/staging/src/k8s.io/kube-proxy v1.19.2-k3s1
k8s.io/kube-scheduler => github.com/rancher/kubernetes/staging/src/k8s.io/kube-scheduler v1.19.1-k3s1 k8s.io/kube-scheduler => github.com/rancher/kubernetes/staging/src/k8s.io/kube-scheduler v1.19.2-k3s1
k8s.io/kubectl => github.com/rancher/kubernetes/staging/src/k8s.io/kubectl v1.19.1-k3s1 k8s.io/kubectl => github.com/rancher/kubernetes/staging/src/k8s.io/kubectl v1.19.2-k3s1
k8s.io/kubelet => github.com/rancher/kubernetes/staging/src/k8s.io/kubelet v1.19.1-k3s1 k8s.io/kubelet => github.com/rancher/kubernetes/staging/src/k8s.io/kubelet v1.19.2-k3s1
k8s.io/kubernetes => github.com/rancher/kubernetes v1.19.1-k3s1 k8s.io/kubernetes => github.com/rancher/kubernetes v1.19.2-k3s1
k8s.io/legacy-cloud-providers => github.com/rancher/kubernetes/staging/src/k8s.io/legacy-cloud-providers v1.19.1-k3s1 k8s.io/legacy-cloud-providers => github.com/rancher/kubernetes/staging/src/k8s.io/legacy-cloud-providers v1.19.2-k3s1
k8s.io/metrics => github.com/rancher/kubernetes/staging/src/k8s.io/metrics v1.19.1-k3s1 k8s.io/metrics => github.com/rancher/kubernetes/staging/src/k8s.io/metrics v1.19.2-k3s1
k8s.io/node-api => github.com/rancher/kubernetes/staging/src/k8s.io/node-api v1.19.1-k3s1 k8s.io/node-api => github.com/rancher/kubernetes/staging/src/k8s.io/node-api v1.19.2-k3s1
k8s.io/sample-apiserver => github.com/rancher/kubernetes/staging/src/k8s.io/sample-apiserver v1.19.1-k3s1 k8s.io/sample-apiserver => github.com/rancher/kubernetes/staging/src/k8s.io/sample-apiserver v1.19.2-k3s1
k8s.io/sample-cli-plugin => github.com/rancher/kubernetes/staging/src/k8s.io/sample-cli-plugin v1.19.1-k3s1 k8s.io/sample-cli-plugin => github.com/rancher/kubernetes/staging/src/k8s.io/sample-cli-plugin v1.19.2-k3s1
k8s.io/sample-controller => github.com/rancher/kubernetes/staging/src/k8s.io/sample-controller v1.19.1-k3s1 k8s.io/sample-controller => github.com/rancher/kubernetes/staging/src/k8s.io/sample-controller v1.19.2-k3s1
mvdan.cc/unparam => mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34 mvdan.cc/unparam => mvdan.cc/unparam v0.0.0-20190209190245-fbb59629db34
) )
......
...@@ -3,8 +3,8 @@ package version ...@@ -3,8 +3,8 @@ package version
var ( var (
gitMajor = "1" gitMajor = "1"
gitMinor = "19" gitMinor = "19"
gitVersion = "v1.19.1-k3s1" gitVersion = "v1.19.2-k3s1"
gitCommit = "bd7c377ec90a6d31417b70e58c4eaea74ea671ef" gitCommit = "fea2193171edbfb530d85448c11f58591ad7825c"
gitTreeState = "clean" gitTreeState = "clean"
buildDate = "2020-09-09T17:25:04Z" buildDate = "2020-09-17T19:22:02Z"
) )
...@@ -18,6 +18,7 @@ package logs ...@@ -18,6 +18,7 @@ package logs
import ( import (
"fmt" "fmt"
"sort"
"github.com/go-logr/logr" "github.com/go-logr/logr"
json "k8s.io/component-base/logs/json" json "k8s.io/component-base/logs/json"
...@@ -84,12 +85,13 @@ func (lfr *LogFormatRegistry) Delete(name string) error { ...@@ -84,12 +85,13 @@ func (lfr *LogFormatRegistry) Delete(name string) error {
return nil return nil
} }
// List names of registered log formats // List names of registered log formats (sorted)
func (lfr *LogFormatRegistry) List() []string { func (lfr *LogFormatRegistry) List() []string {
formats := make([]string, 0, len(lfr.registry)) formats := make([]string, 0, len(lfr.registry))
for f := range lfr.registry { for f := range lfr.registry {
formats = append(formats, f) formats = append(formats, f)
} }
sort.Strings(formats)
return formats return formats
} }
......
...@@ -3,8 +3,8 @@ package version ...@@ -3,8 +3,8 @@ package version
var ( var (
gitMajor = "1" gitMajor = "1"
gitMinor = "19" gitMinor = "19"
gitVersion = "v1.19.1-k3s1" gitVersion = "v1.19.2-k3s1"
gitCommit = "bd7c377ec90a6d31417b70e58c4eaea74ea671ef" gitCommit = "fea2193171edbfb530d85448c11f58591ad7825c"
gitTreeState = "clean" gitTreeState = "clean"
buildDate = "2020-09-09T17:25:04Z" buildDate = "2020-09-17T19:22:02Z"
) )
...@@ -485,6 +485,8 @@ func (o *DebugOptions) generatePodCopyWithDebugContainer(pod *corev1.Pod) (*core ...@@ -485,6 +485,8 @@ func (o *DebugOptions) generatePodCopyWithDebugContainer(pod *corev1.Pod) (*core
}, },
Spec: *pod.Spec.DeepCopy(), Spec: *pod.Spec.DeepCopy(),
} }
// set EphemeralContainers to nil so that the copy of pod can be created
copied.Spec.EphemeralContainers = nil
// change ShareProcessNamespace configuration only when commanded explicitly // change ShareProcessNamespace configuration only when commanded explicitly
if o.shareProcessedChanged { if o.shareProcessedChanged {
copied.Spec.ShareProcessNamespace = pointer.BoolPtr(o.ShareProcesses) copied.Spec.ShareProcessNamespace = pointer.BoolPtr(o.ShareProcesses)
...@@ -544,11 +546,11 @@ func containerNameToRef(pod *corev1.Pod) map[string]*corev1.Container { ...@@ -544,11 +546,11 @@ func containerNameToRef(pod *corev1.Pod) map[string]*corev1.Container {
names[ref.Name] = ref names[ref.Name] = ref
} }
for i := range pod.Spec.InitContainers { for i := range pod.Spec.InitContainers {
ref := &pod.Spec.Containers[i] ref := &pod.Spec.InitContainers[i]
names[ref.Name] = ref names[ref.Name] = ref
} }
for i := range pod.Spec.EphemeralContainers { for i := range pod.Spec.EphemeralContainers {
ref := &pod.Spec.Containers[i] ref := (*corev1.Container)(&pod.Spec.EphemeralContainers[i].EphemeralContainerCommon)
names[ref.Name] = ref names[ref.Name] = ref
} }
return names return names
......
...@@ -3873,11 +3873,15 @@ func DescribeEvents(el *corev1.EventList, w PrefixWriter) { ...@@ -3873,11 +3873,15 @@ func DescribeEvents(el *corev1.EventList, w PrefixWriter) {
interval = translateMicroTimestampSince(e.EventTime) interval = translateMicroTimestampSince(e.EventTime)
} }
} }
source := e.Source.Component
if source == "" {
source = e.ReportingController
}
w.Write(LEVEL_1, "%v\t%v\t%s\t%v\t%v\n", w.Write(LEVEL_1, "%v\t%v\t%s\t%v\t%v\n",
e.Type, e.Type,
e.Reason, e.Reason,
interval, interval,
formatEventSource(e.Source), source,
strings.TrimSpace(e.Message), strings.TrimSpace(e.Message),
) )
} }
...@@ -5001,15 +5005,6 @@ func translateTimestampSince(timestamp metav1.Time) string { ...@@ -5001,15 +5005,6 @@ func translateTimestampSince(timestamp metav1.Time) string {
return duration.HumanDuration(time.Since(timestamp.Time)) return duration.HumanDuration(time.Since(timestamp.Time))
} }
// formatEventSource formats EventSource as a comma separated string excluding Host when empty
func formatEventSource(es corev1.EventSource) string {
EventSourceString := []string{es.Component}
if len(es.Host) > 0 {
EventSourceString = append(EventSourceString, es.Host)
}
return strings.Join(EventSourceString, ", ")
}
// Pass ports=nil for all ports. // Pass ports=nil for all ports.
func formatEndpoints(endpoints *corev1.Endpoints, ports sets.String) string { func formatEndpoints(endpoints *corev1.Endpoints, ports sets.String) string {
if len(endpoints.Subsets) == 0 { if len(endpoints.Subsets) == 0 {
......
...@@ -8,6 +8,7 @@ load( ...@@ -8,6 +8,7 @@ load(
go_library( go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = [
"conversion.go",
"doc.go", "doc.go",
"register.go", "register.go",
"types.go", "types.go",
...@@ -16,8 +17,10 @@ go_library( ...@@ -16,8 +17,10 @@ go_library(
importmap = "k8s.io/kubernetes/vendor/k8s.io/metrics/pkg/apis/custom_metrics", importmap = "k8s.io/kubernetes/vendor/k8s.io/metrics/pkg/apis/custom_metrics",
importpath = "k8s.io/metrics/pkg/apis/custom_metrics", importpath = "k8s.io/metrics/pkg/apis/custom_metrics",
deps = [ deps = [
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
......
/*
Copyright 2020 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 custom_metrics
import (
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/conversion"
)
func Convert_v1_ObjectReference_To_custom_metrics_ObjectReference(in *v1.ObjectReference, out *ObjectReference, s conversion.Scope) error {
out.APIVersion = in.APIVersion
out.Kind = in.Kind
out.Namespace = in.Namespace
out.Name = in.Name
out.UID = in.UID
out.ResourceVersion = in.ResourceVersion
out.FieldPath = in.FieldPath
return nil
}
func Convert_custom_metrics_ObjectReference_To_v1_ObjectReference(in *ObjectReference, out *v1.ObjectReference, s conversion.Scope) error {
out.APIVersion = in.APIVersion
out.Kind = in.Kind
out.Namespace = in.Namespace
out.Name = in.Name
out.UID = in.UID
out.ResourceVersion = in.ResourceVersion
out.FieldPath = in.FieldPath
return nil
}
...@@ -47,24 +47,24 @@ type MetricValueList struct { ...@@ -47,24 +47,24 @@ type MetricValueList struct {
// a metric value for some object // a metric value for some object
type MetricValue struct { type MetricValue struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// a reference to the described object // a reference to the described object
DescribedObject ObjectReference `json:"describedObject"` DescribedObject ObjectReference
Metric MetricIdentifier Metric MetricIdentifier
// indicates the time at which the metrics were produced // indicates the time at which the metrics were produced
Timestamp metav1.Time `json:"timestamp"` Timestamp metav1.Time
// indicates the window ([Timestamp-Window, Timestamp]) from // indicates the window ([Timestamp-Window, Timestamp]) from
// which these metrics were calculated, when returning rate // which these metrics were calculated, when returning rate
// metrics calculated from cumulative metrics (or zero for // metrics calculated from cumulative metrics (or zero for
// non-calculated instantaneous metrics). // non-calculated instantaneous metrics).
WindowSeconds *int64 `json:"window,omitempty"` WindowSeconds *int64
// the value of the metric for this // the value of the metric for this
Value resource.Quantity `json:"value"` Value resource.Quantity
} }
// allObjects is a wildcard used to select metrics // allObjects is a wildcard used to select metrics
...@@ -75,16 +75,16 @@ const AllObjects = "*" ...@@ -75,16 +75,16 @@ const AllObjects = "*"
// MetricListOptions is used to select metrics by their label selectors // MetricListOptions is used to select metrics by their label selectors
type MetricListOptions struct { type MetricListOptions struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta
// A selector to restrict the list of returned objects by their labels. // A selector to restrict the list of returned objects by their labels.
// Defaults to everything. // Defaults to everything.
// +optional // +optional
LabelSelector string `json:"labelSelector,omitempty" protobuf:"bytes,1,opt,name=labelSelector"` LabelSelector string
// A selector to restrict the list of returned metrics by their labels // A selector to restrict the list of returned metrics by their labels
// +optional // +optional
MetricLabelSelector string `json:"metricLabelSelector,omitempty" protobuf:"bytes,2,opt,name=metricLabelSelector"` MetricLabelSelector string
} }
// NOTE: ObjectReference is copied from k8s.io/kubernetes/pkg/api/types.go. We // NOTE: ObjectReference is copied from k8s.io/kubernetes/pkg/api/types.go. We
......
...@@ -17,44 +17,23 @@ limitations under the License. ...@@ -17,44 +17,23 @@ limitations under the License.
package v1beta1 package v1beta1
import ( import (
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/conversion" "k8s.io/apimachinery/pkg/conversion"
"k8s.io/metrics/pkg/apis/custom_metrics" "k8s.io/metrics/pkg/apis/custom_metrics"
) )
func Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custom_metrics.MetricValue, s conversion.Scope) error { func Convert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custom_metrics.MetricValue, s conversion.Scope) error {
out.TypeMeta = in.TypeMeta if err := autoConvert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in, out, s); err != nil {
out.DescribedObject = custom_metrics.ObjectReference{ return err
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.Name = in.MetricName
out.Metric.Selector = in.Selector out.Metric.Selector = in.Selector
return nil return nil
} }
func Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue(in *custom_metrics.MetricValue, out *MetricValue, s conversion.Scope) error { func Convert_custom_metrics_MetricValue_To_v1beta1_MetricValue(in *custom_metrics.MetricValue, out *MetricValue, s conversion.Scope) error {
out.TypeMeta = in.TypeMeta if err := autoConvert_custom_metrics_MetricValue_To_v1beta1_MetricValue(in, out, s); err != nil {
out.DescribedObject = v1.ObjectReference{ return err
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.MetricName = in.Metric.Name
out.Selector = in.Metric.Selector out.Selector = in.Metric.Selector
return nil return nil
......
...@@ -91,8 +91,7 @@ func Convert_custom_metrics_MetricListOptions_To_v1beta1_MetricListOptions(in *c ...@@ -91,8 +91,7 @@ func Convert_custom_metrics_MetricListOptions_To_v1beta1_MetricListOptions(in *c
} }
func autoConvert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custommetrics.MetricValue, s conversion.Scope) error { 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 := custommetrics.Convert_v1_ObjectReference_To_custom_metrics_ObjectReference(&in.DescribedObject, &out.DescribedObject, s); err != nil {
if err := s.Convert(&in.DescribedObject, &out.DescribedObject, 0); err != nil {
return err return err
} }
// WARNING: in.MetricName requires manual conversion: does not exist in peer-type // WARNING: in.MetricName requires manual conversion: does not exist in peer-type
...@@ -104,8 +103,7 @@ func autoConvert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in *MetricVal ...@@ -104,8 +103,7 @@ func autoConvert_v1beta1_MetricValue_To_custom_metrics_MetricValue(in *MetricVal
} }
func autoConvert_custom_metrics_MetricValue_To_v1beta1_MetricValue(in *custommetrics.MetricValue, out *MetricValue, s conversion.Scope) error { 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 := custommetrics.Convert_custom_metrics_ObjectReference_To_v1_ObjectReference(&in.DescribedObject, &out.DescribedObject, s); err != nil {
if err := s.Convert(&in.DescribedObject, &out.DescribedObject, 0); err != nil {
return err return err
} }
// WARNING: in.Metric requires manual conversion: does not exist in peer-type // WARNING: in.Metric requires manual conversion: does not exist in peer-type
......
...@@ -124,8 +124,7 @@ func Convert_custom_metrics_MetricListOptions_To_v1beta2_MetricListOptions(in *c ...@@ -124,8 +124,7 @@ func Convert_custom_metrics_MetricListOptions_To_v1beta2_MetricListOptions(in *c
} }
func autoConvert_v1beta2_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custommetrics.MetricValue, s conversion.Scope) error { func autoConvert_v1beta2_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, out *custommetrics.MetricValue, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it? if err := custommetrics.Convert_v1_ObjectReference_To_custom_metrics_ObjectReference(&in.DescribedObject, &out.DescribedObject, s); err != nil {
if err := s.Convert(&in.DescribedObject, &out.DescribedObject, 0); err != nil {
return err return err
} }
if err := Convert_v1beta2_MetricIdentifier_To_custom_metrics_MetricIdentifier(&in.Metric, &out.Metric, s); err != nil { if err := Convert_v1beta2_MetricIdentifier_To_custom_metrics_MetricIdentifier(&in.Metric, &out.Metric, s); err != nil {
...@@ -143,8 +142,7 @@ func Convert_v1beta2_MetricValue_To_custom_metrics_MetricValue(in *MetricValue, ...@@ -143,8 +142,7 @@ func Convert_v1beta2_MetricValue_To_custom_metrics_MetricValue(in *MetricValue,
} }
func autoConvert_custom_metrics_MetricValue_To_v1beta2_MetricValue(in *custommetrics.MetricValue, out *MetricValue, s conversion.Scope) error { func autoConvert_custom_metrics_MetricValue_To_v1beta2_MetricValue(in *custommetrics.MetricValue, out *MetricValue, s conversion.Scope) error {
// TODO: Inefficient conversion - can we improve it? if err := custommetrics.Convert_custom_metrics_ObjectReference_To_v1_ObjectReference(&in.DescribedObject, &out.DescribedObject, s); err != nil {
if err := s.Convert(&in.DescribedObject, &out.DescribedObject, 0); err != nil {
return err return err
} }
if err := Convert_custom_metrics_MetricIdentifier_To_v1beta2_MetricIdentifier(&in.Metric, &out.Metric, s); err != nil { if err := Convert_custom_metrics_MetricIdentifier_To_v1beta2_MetricIdentifier(&in.Metric, &out.Metric, s); err != nil {
...@@ -163,7 +161,17 @@ func Convert_custom_metrics_MetricValue_To_v1beta2_MetricValue(in *custommetrics ...@@ -163,7 +161,17 @@ func Convert_custom_metrics_MetricValue_To_v1beta2_MetricValue(in *custommetrics
func autoConvert_v1beta2_MetricValueList_To_custom_metrics_MetricValueList(in *MetricValueList, out *custommetrics.MetricValueList, s conversion.Scope) error { func autoConvert_v1beta2_MetricValueList_To_custom_metrics_MetricValueList(in *MetricValueList, out *custommetrics.MetricValueList, s conversion.Scope) error {
out.ListMeta = in.ListMeta out.ListMeta = in.ListMeta
out.Items = *(*[]custommetrics.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_v1beta2_MetricValue_To_custom_metrics_MetricValue(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil return nil
} }
...@@ -174,7 +182,17 @@ func Convert_v1beta2_MetricValueList_To_custom_metrics_MetricValueList(in *Metri ...@@ -174,7 +182,17 @@ func Convert_v1beta2_MetricValueList_To_custom_metrics_MetricValueList(in *Metri
func autoConvert_custom_metrics_MetricValueList_To_v1beta2_MetricValueList(in *custommetrics.MetricValueList, out *MetricValueList, s conversion.Scope) error { func autoConvert_custom_metrics_MetricValueList_To_v1beta2_MetricValueList(in *custommetrics.MetricValueList, out *MetricValueList, s conversion.Scope) error {
out.ListMeta = in.ListMeta 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_v1beta2_MetricValue(&(*in)[i], &(*out)[i], s); err != nil {
return err
}
}
} else {
out.Items = nil
}
return nil return nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment