istio

Форк
0
79 строк · 2.2 Кб
1
// Copyright Istio Authors
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//     http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15
package crd
16

17
import (
18
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
19
	"k8s.io/apimachinery/pkg/runtime"
20
)
21

22
// IstioKind is the generic Kubernetes API object wrapper
23
type IstioKind struct {
24
	metav1.TypeMeta
25
	metav1.ObjectMeta `json:"metadata"`
26
	Spec              map[string]any `json:"spec"`
27
	Status            map[string]any `json:"status,omitempty"`
28
}
29

30
// GetSpec from a wrapper
31
func (in *IstioKind) GetSpec() map[string]any {
32
	return in.Spec
33
}
34

35
// GetStatus from a wrapper
36
func (in *IstioKind) GetStatus() map[string]any {
37
	return in.Status
38
}
39

40
// GetObjectMeta from a wrapper
41
func (in *IstioKind) GetObjectMeta() metav1.ObjectMeta {
42
	return in.ObjectMeta
43
}
44

45
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
46
func (in *IstioKind) DeepCopyInto(out *IstioKind) {
47
	*out = *in
48
	out.TypeMeta = in.TypeMeta
49
	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
50
	out.Spec = in.Spec
51
	out.Status = in.Status
52
}
53

54
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IstioKind.
55
func (in *IstioKind) DeepCopy() *IstioKind {
56
	if in == nil {
57
		return nil
58
	}
59
	out := new(IstioKind)
60
	in.DeepCopyInto(out)
61
	return out
62
}
63

64
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
65
func (in *IstioKind) DeepCopyObject() runtime.Object {
66
	if c := in.DeepCopy(); c != nil {
67
		return c
68
	}
69

70
	return nil
71
}
72

73
// IstioObject is a k8s wrapper interface for config objects
74
type IstioObject interface {
75
	runtime.Object
76
	GetSpec() map[string]any
77
	GetStatus() map[string]any
78
	GetObjectMeta() metav1.ObjectMeta
79
}
80

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.