1 /* 2 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package v1beta1 18 19 import ( 20 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 21 ) 22 23 // DnsHost holds the mapping between IP and hostnames that will be added to dnsmasq hosts file. 24 type DnsHost struct { 25 // IP address of the host file entry. 26 IP string `json:"ip" protobuf:"bytes,1,opt,name=ip"` 27 // Hostnames for the above IP address. 28 Hostnames []string `json:"hostnames,omitempty" protobuf:"bytes,2,rep,name=hostnames"` 29 } 30 31 // DnsHostsSpec defines the desired state of DnsHosts 32 type DnsHostsSpec struct { 33 Controller string `json:"controller,omitempty"` 34 Hosts []DnsHost `json:"hosts,omitempty"` 35 } 36 37 // DnsHostsStatus defines the observed state of DnsHosts 38 type DnsHostsStatus struct { 39 // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster 40 // Important: Run "make" to regenerate code after modifying this file 41 } 42 43 // +kubebuilder:object:root=true 44 // +kubebuilder:printcolumn:name="Controller",type="string",JSONPath=".spec.controller" 45 // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" 46 47 // DnsHosts is the Schema for the dnshosts API 48 type DnsHosts struct { 49 metav1.TypeMeta `json:",inline"` 50 metav1.ObjectMeta `json:"metadata,omitempty"` 51 52 Spec DnsHostsSpec `json:"spec,omitempty"` 53 Status DnsHostsStatus `json:"status,omitempty"` 54 } 55 56 // +kubebuilder:object:root=true 57 58 // DnsHostsList contains a list of DnsHosts 59 type DnsHostsList struct { 60 metav1.TypeMeta `json:",inline"` 61 metav1.ListMeta `json:"metadata,omitempty"` 62 Items []DnsHosts `json:"items"` 63 } 64 65 func init() { 66 SchemeBuilder.Register(&DnsHosts{}, &DnsHostsList{}) 67 } 68