...

Source file src/github.com/emissary-ingress/emissary/v3/pkg/api/getambassador.io/v2/crd_tcpmapping.go

Documentation: github.com/emissary-ingress/emissary/v3/pkg/api/getambassador.io/v2

     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  ///////////////////////////////////////////////////////////////////////////
    16  // Important: Run "make update-yaml" to regenerate code after modifying
    17  // this file.
    18  ///////////////////////////////////////////////////////////////////////////
    19  
    20  package v2
    21  
    22  import (
    23  	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    24  )
    25  
    26  // TCPMappingSpec defines the desired state of TCPMapping
    27  type TCPMappingSpec struct {
    28  	AmbassadorID AmbassadorID `json:"ambassador_id,omitempty"`
    29  
    30  	// Port isn't a pointer because it's required.
    31  	// +kubebuilder:validation:Required
    32  	Port    int    `json:"port,omitempty"`
    33  	Host    string `json:"host,omitempty"`
    34  	Address string `json:"address,omitempty"`
    35  	// +kubebuilder:validation:Required
    36  	Service         string           `json:"service,omitempty"`
    37  	EnableIPv4      *bool            `json:"enable_ipv4,omitempty"`
    38  	EnableIPv6      *bool            `json:"enable_ipv6,omitempty"`
    39  	CircuitBreakers []CircuitBreaker `json:"circuit_breakers,omitempty"`
    40  
    41  	// FIXME(lukeshu): Surely this should be an 'int'?
    42  	IdleTimeoutMs string `json:"idle_timeout_ms,omitempty"`
    43  
    44  	Resolver string `json:"resolver,omitempty"`
    45  	// +k8s:conversion-gen=false
    46  	TLS        *BoolOrString `json:"tls,omitempty"`
    47  	Weight     *int          `json:"weight,omitempty"`
    48  	ClusterTag string        `json:"cluster_tag,omitempty"`
    49  
    50  	// +k8s:conversion-gen:rename=StatsName
    51  	V3StatsName string `json:"v3StatsName,omitempty"`
    52  }
    53  
    54  // TCPMapping is the Schema for the tcpmappings API
    55  //
    56  // +kubebuilder:object:root=true
    57  // +kubebuilder:storageversion
    58  type TCPMapping struct {
    59  	metav1.TypeMeta   `json:""`
    60  	metav1.ObjectMeta `json:"metadata,omitempty"`
    61  
    62  	Spec TCPMappingSpec `json:"spec,omitempty"`
    63  }
    64  
    65  // TCPMappingList contains a list of TCPMappings.
    66  //
    67  // +kubebuilder:object:root=true
    68  type TCPMappingList struct {
    69  	metav1.TypeMeta `json:""`
    70  	metav1.ListMeta `json:"metadata,omitempty"`
    71  	Items           []TCPMapping `json:"items"`
    72  }
    73  
    74  func init() {
    75  	SchemeBuilder.Register(&TCPMapping{}, &TCPMappingList{})
    76  }
    77  

View as plain text