...

Source file src/github.com/kvaps/dnsmasq-controller/api/v1beta1/dhcphosts_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  // DnsmasqDhcpHost holds the mapping between Macs and IP that will be added to dnsmasq dhcp-hosts file.
    24  type DhcpHost struct {
    25  	Macs      []string `json:"macs,omitempty"`
    26  	ClientID  string   `json:"clientID,omitempty"`
    27  	SetTags   []string `json:"setTags,omitempty"`
    28  	Tags      []string `json:"tags,omitempty"`
    29  	IP        string   `json:"ip,omitempty"`
    30  	Hostname  string   `json:"hostname,omitempty"`
    31  	LeaseTime string   `json:"leaseTime,omitempty"`
    32  	Ignore    bool     `json:"ignore,omitempty"`
    33  }
    34  
    35  // DhcpHostsSpec defines the desired state of DhcpHosts
    36  type DhcpHostsSpec struct {
    37  	Controller string     `json:"controller,omitempty"`
    38  	Hosts      []DhcpHost `json:"hosts,omitempty"`
    39  }
    40  
    41  // DhcpHostsStatus defines the observed state of DhcpHosts
    42  type DhcpHostsStatus struct {
    43  	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
    44  	// Important: Run "make" to regenerate code after modifying this file
    45  }
    46  
    47  // +kubebuilder:object:root=true
    48  // +kubebuilder:printcolumn:name="Controller",type="string",JSONPath=".spec.controller"
    49  // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
    50  
    51  // DhcpHosts is the Schema for the dhcphosts API
    52  type DhcpHosts struct {
    53  	metav1.TypeMeta   `json:",inline"`
    54  	metav1.ObjectMeta `json:"metadata,omitempty"`
    55  
    56  	Spec   DhcpHostsSpec   `json:"spec,omitempty"`
    57  	Status DhcpHostsStatus `json:"status,omitempty"`
    58  }
    59  
    60  // +kubebuilder:object:root=true
    61  
    62  // DhcpHostsList contains a list of DhcpHosts
    63  type DhcpHostsList struct {
    64  	metav1.TypeMeta `json:",inline"`
    65  	metav1.ListMeta `json:"metadata,omitempty"`
    66  	Items           []DhcpHosts `json:"items"`
    67  }
    68  
    69  func init() {
    70  	SchemeBuilder.Register(&DhcpHosts{}, &DhcpHostsList{})
    71  }
    72  

View as plain text