retrive pods and logs by gateway

Signed-off-by: Roland.Ma <rolandma@kubesphere.io>
This commit is contained in:
Roland.Ma
2021-09-15 07:55:58 +00:00
parent 81c19701ef
commit e3a14ca299
5 changed files with 247 additions and 13 deletions

View File

@@ -0,0 +1,113 @@
/*
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 conversion-gen. DO NOT EDIT.
package v1
import (
url "net/url"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// refer to https://github.com/kubernetes/kubernetes/issues/94688
// conversions must be registered.
func RegisterConversions(s *runtime.Scheme) error {
if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.PodLogOptions)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_url_Values_To_v1_PodLogOptions(a.(*url.Values), b.(*v1.PodLogOptions), scope)
}); err != nil {
return err
}
return nil
}
func autoConvert_url_Values_To_v1_PodLogOptions(in *url.Values, out *v1.PodLogOptions, s conversion.Scope) error {
// WARNING: Field TypeMeta does not have json tag, skipping.
if values, ok := map[string][]string(*in)["container"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_string(&values, &out.Container, s); err != nil {
return err
}
} else {
out.Container = ""
}
if values, ok := map[string][]string(*in)["follow"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_bool(&values, &out.Follow, s); err != nil {
return err
}
} else {
out.Follow = false
}
if values, ok := map[string][]string(*in)["previous"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_bool(&values, &out.Previous, s); err != nil {
return err
}
} else {
out.Previous = false
}
if values, ok := map[string][]string(*in)["sinceSeconds"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_Pointer_int64(&values, &out.SinceSeconds, s); err != nil {
return err
}
} else {
out.SinceSeconds = nil
}
if values, ok := map[string][]string(*in)["sinceTime"]; ok && len(values) > 0 {
if err := metav1.Convert_Slice_string_To_Pointer_v1_Time(&values, &out.SinceTime, s); err != nil {
return err
}
} else {
out.SinceTime = nil
}
if values, ok := map[string][]string(*in)["timestamps"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_bool(&values, &out.Timestamps, s); err != nil {
return err
}
} else {
out.Timestamps = false
}
if values, ok := map[string][]string(*in)["tailLines"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_Pointer_int64(&values, &out.TailLines, s); err != nil {
return err
}
} else {
out.TailLines = nil
}
if values, ok := map[string][]string(*in)["limitBytes"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_Pointer_int64(&values, &out.LimitBytes, s); err != nil {
return err
}
} else {
out.LimitBytes = nil
}
if values, ok := map[string][]string(*in)["insecureSkipTLSVerifyBackend"]; ok && len(values) > 0 {
if err := runtime.Convert_Slice_string_To_bool(&values, &out.InsecureSkipTLSVerifyBackend, s); err != nil {
return err
}
} else {
out.InsecureSkipTLSVerifyBackend = false
}
return nil
}
// Convert_url_Values_To_v1_PodLogOptions is an autogenerated conversion function.
func Convert_url_Values_To_v1_PodLogOptions(in *url.Values, out *v1.PodLogOptions, s conversion.Scope) error {
return autoConvert_url_Values_To_v1_PodLogOptions(in, out, s)
}