1 // Copyright 2020 Datawire. All rights reserved 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 v1 16 17 import ( 18 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 19 20 ambv2 "github.com/emissary-ingress/emissary/v3/pkg/api/getambassador.io/v2" 21 ) 22 23 // A Module defines system-wide configuration. The type of module is 24 // controlled by the .metadata.name; valid names are "ambassador" or 25 // "tls". 26 // 27 // https://www.getambassador.io/docs/edge-stack/latest/topics/running/ambassador/#the-ambassador-module 28 // https://www.getambassador.io/docs/edge-stack/latest/topics/running/tls/#tls-module-deprecated 29 // 30 // +kubebuilder:object:root=true 31 type Module struct { 32 metav1.TypeMeta `json:""` 33 metav1.ObjectMeta `json:"metadata,omitempty"` 34 35 Spec ambv2.ModuleSpec `json:"spec,omitempty"` 36 37 // dumbWorkaround is a dumb workaround for a bug in conversion-gen that it doesn't pay 38 // attention to +k8s:conversion-fn=drop or +k8s:conversion-gen=false when checking if it can 39 // do the direct-assignment or direct-conversion optimizations, and therefore might disobey 40 // the +k8s:conversion-fn=drop on metav1.TypeMeta. 41 // 42 // +k8s:conversion-gen=false 43 dumbWorkaround byte `json:"-"` //nolint:unused // dumb workaround 44 } 45 46 // ModuleList contains a list of Modules. 47 // 48 // +kubebuilder:object:root=true 49 type ModuleList struct { 50 metav1.TypeMeta `json:""` 51 metav1.ListMeta `json:"metadata,omitempty"` 52 Items []Module `json:"items"` 53 } 54 55 func init() { 56 SchemeBuilder.Register(&Module{}, &ModuleList{}) 57 } 58