...

Source file src/github.com/kvaps/dnsmasq-controller/api/v1beta1/dhcpoptions_types.go

Documentation: github.com/kvaps/dnsmasq-controller/api/v1beta1

     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  // DhcpOption defines dhcp-option for dnsmasq
    24  type DhcpOption struct {
    25  	// +kubebuilder:validation:Pattern="^([0-9]+|option:.+|option6:.+)$"
    26  	Key     string   `json:"key"`
    27  	Values  []string `json:"values"`
    28  	Tags    []string `json:"tags,omitempty"`
    29  	Encap   string   `json:"encap,omitempty"`
    30  	ViEncap string   `json:"viEncap,omitempty"`
    31  	Vendor  string   `json:"leaseTime,omitempty"`
    32  }
    33  
    34  // DhcpOptionsSpec defines the desired state of DhcpOptions
    35  type DhcpOptionsSpec struct {
    36  	Controller string       `json:"controller,omitempty"`
    37  	Options    []DhcpOption `json:"options,omitempty"`
    38  }
    39  
    40  // DhcpOptionsStatus defines the observed state of DhcpOptions
    41  type DhcpOptionsStatus struct {
    42  	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
    43  	// Important: Run "make" to regenerate code after modifying this file
    44  }
    45  
    46  // +kubebuilder:object:root=true
    47  // +kubebuilder:printcolumn:name="Controller",type="string",JSONPath=".spec.controller"
    48  // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
    49  
    50  // DhcpOptions is the Schema for the dhcpoptions API
    51  type DhcpOptions struct {
    52  	metav1.TypeMeta   `json:",inline"`
    53  	metav1.ObjectMeta `json:"metadata,omitempty"`
    54  
    55  	Spec   DhcpOptionsSpec   `json:"spec,omitempty"`
    56  	Status DhcpOptionsStatus `json:"status,omitempty"`
    57  }
    58  
    59  // +kubebuilder:object:root=true
    60  
    61  // DhcpOptionsList contains a list of DhcpOptions
    62  type DhcpOptionsList struct {
    63  	metav1.TypeMeta `json:",inline"`
    64  	metav1.ListMeta `json:"metadata,omitempty"`
    65  	Items           []DhcpOptions `json:"items"`
    66  }
    67  
    68  func init() {
    69  	SchemeBuilder.Register(&DhcpOptions{}, &DhcpOptionsList{})
    70  }
    71  

View as plain text