chore: add apisix.apache.org v2 crd

This commit is contained in:
fatpa 2022-12-20 18:01:24 +08:00
parent c0b1fea7f8
commit 069626130e
No known key found for this signature in database
5 changed files with 773 additions and 0 deletions

View File

@ -0,0 +1,21 @@
/*
Copyright 2022 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package apisix
const (
GroupName = "apisix.apache.org"
)

21
pkg/apis/apisix/v2/doc.go Normal file
View File

@ -0,0 +1,21 @@
/*
Copyright 2022 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// +k8s:deepcopy-gen=package
// Package v2 is the v2 version of the API.
// +groupName=apisix.apache.org
package v2

View File

@ -0,0 +1,52 @@
/*
Copyright 2022 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v2
import (
"github.com/openkruise/rollouts/pkg/apis/apisix"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: apisix.GroupName, Version: "v2"}
// Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind()
}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
)
// Adds the list of known types to Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&ApisixRoute{},
&ApisixRouteList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}

245
pkg/apis/apisix/v2/types.go Normal file
View File

@ -0,0 +1,245 @@
/*
Copyright 2022 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v2
import (
"encoding/json"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:subresource:status
// ApisixRoute is used to define the route rules and upstreams for Apache APISIX.
type ApisixRoute struct {
metav1.TypeMeta `json:",inline" yaml:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty" yaml:"metadata,omitempty"`
Spec ApisixRouteSpec `json:"spec,omitempty" yaml:"spec,omitempty"`
Status ApisixStatus `json:"status,omitempty" yaml:"status,omitempty"`
}
// ApisixStatus is the status report for Apisix ingress Resources
type ApisixStatus struct {
Conditions []metav1.Condition `json:"conditions,omitempty" yaml:"conditions,omitempty"`
}
// ApisixRouteSpec is the spec definition for ApisixRouteSpec.
type ApisixRouteSpec struct {
HTTP []ApisixRouteHTTP `json:"http,omitempty" yaml:"http,omitempty"`
Stream []ApisixRouteStream `json:"stream,omitempty" yaml:"stream,omitempty"`
}
// ApisixRouteHTTP represents a single route in for HTTP traffic.
type ApisixRouteHTTP struct {
// The rule name, cannot be empty.
Name string `json:"name" yaml:"name"`
// Route priority, when multiple routes contains
// same URI path (for path matching), route with
// higher priority will take effect.
Priority int `json:"priority,omitempty" yaml:"priority,omitempty"`
Timeout *UpstreamTimeout `json:"timeout,omitempty" yaml:"timeout,omitempty"`
Match ApisixRouteHTTPMatch `json:"match,omitempty" yaml:"match,omitempty"`
// Backends represents potential backends to proxy after the route
// rule matched. When number of backends are more than one, traffic-split
// plugin in APISIX will be used to split traffic based on the backend weight.
Backends []ApisixRouteHTTPBackend `json:"backends,omitempty" yaml:"backends,omitempty"`
Websocket bool `json:"websocket" yaml:"websocket"`
PluginConfigName string `json:"plugin_config_name,omitempty" yaml:"plugin_config_name,omitempty"`
Plugins []ApisixRoutePlugin `json:"plugins,omitempty" yaml:"plugins,omitempty"`
Authentication *ApisixRouteAuthentication `json:"authentication,omitempty" yaml:"authentication,omitempty"`
}
// UpstreamTimeout is settings for the read, send and connect to the upstream.
type UpstreamTimeout struct {
Connect metav1.Duration `json:"connect,omitempty" yaml:"connect,omitempty"`
Send metav1.Duration `json:"send,omitempty" yaml:"send,omitempty"`
Read metav1.Duration `json:"read,omitempty" yaml:"read,omitempty"`
}
// ApisixRouteHTTPBackend represents a HTTP backend (a Kuberentes Service).
type ApisixRouteHTTPBackend struct {
// The name (short) of the service, note cross namespace is forbidden,
// so be sure the ApisixRoute and Service are in the same namespace.
ServiceName string `json:"serviceName" yaml:"serviceName"`
// The service port, could be the name or the port number.
ServicePort intstr.IntOrString `json:"servicePort" yaml:"servicePort"`
// The resolve granularity, can be "endpoints" or "service",
// when set to "endpoints", the pod ips will be used; other
// wise, the service ClusterIP or ExternalIP will be used,
// default is endpoints.
ResolveGranularity string `json:"resolveGranularity,omitempty" yaml:"resolveGranularity,omitempty"`
// Weight of this backend.
Weight *int `json:"weight" yaml:"weight"`
// Subset specifies a subset for the target Service. The subset should be pre-defined
// in ApisixUpstream about this service.
Subset string `json:"subset,omitempty" yaml:"subset,omitempty"`
}
// ApisixRouteHTTPMatch represents the match condition for hitting this route.
type ApisixRouteHTTPMatch struct {
// URI path predicates, at least one path should be
// configured, path could be exact or prefix, for prefix path,
// append "*" after it, for instance, "/foo*".
Paths []string `json:"paths" yaml:"paths"`
// HTTP request method predicates.
Methods []string `json:"methods,omitempty" yaml:"methods,omitempty"`
// HTTP Host predicates, host can be a wildcard domain or
// an exact domain. For wildcard domain, only one generic
// level is allowed, for instance, "*.foo.com" is valid but
// "*.*.foo.com" is not.
Hosts []string `json:"hosts,omitempty" yaml:"hosts,omitempty"`
// Remote address predicates, items can be valid IPv4 address
// or IPv6 address or CIDR.
RemoteAddrs []string `json:"remoteAddrs,omitempty" yaml:"remoteAddrs,omitempty"`
// NginxVars represents generic match predicates,
// it uses Nginx variable systems, so any predicate
// like headers, querystring and etc can be leveraged
// here to match the route.
// For instance, it can be:
// nginxVars:
// - subject: "$remote_addr"
// op: in
// value:
// - "127.0.0.1"
// - "10.0.5.11"
NginxVars []ApisixRouteHTTPMatchExpr `json:"exprs,omitempty" yaml:"exprs,omitempty"`
}
// ApisixRouteHTTPMatchExpr represents a binary route match expression .
type ApisixRouteHTTPMatchExpr struct {
// Subject is the expression subject, it can
// be any string composed by literals and nginx
// vars.
Subject ApisixRouteHTTPMatchExprSubject `json:"subject" yaml:"subject"`
// Op is the operator.
Op string `json:"op" yaml:"op"`
// Set is an array type object of the expression.
// It should be used when the Op is "in" or "not_in";
Set []string `json:"set" yaml:"set"`
// Value is the normal type object for the expression,
// it should be used when the Op is not "in" and "not_in".
// Set and Value are exclusive so only of them can be set
// in the same time.
Value *string `json:"value" yaml:"value"`
}
// ApisixRouteHTTPMatchExprSubject describes the route match expression subject.
type ApisixRouteHTTPMatchExprSubject struct {
// The subject scope, can be:
// ScopeQuery, ScopeHeader, ScopePath
// when subject is ScopePath, Name field
// will be ignored.
Scope string `json:"scope" yaml:"scope"`
// The name of subject.
Name string `json:"name" yaml:"name"`
}
// ApisixRoutePlugin represents an APISIX plugin.
type ApisixRoutePlugin struct {
// The plugin name.
Name string `json:"name" yaml:"name"`
// Whether this plugin is in use, default is true.
Enable bool `json:"enable" yaml:"enable"`
// Plugin configuration.
Config ApisixRoutePluginConfig `json:"config" yaml:"config"`
}
// ApisixRoutePluginConfig is the configuration for
// any plugins.
type ApisixRoutePluginConfig map[string]interface{}
// ApisixRouteAuthentication is the authentication-related
// configuration in ApisixRoute.
type ApisixRouteAuthentication struct {
Enable bool `json:"enable" yaml:"enable"`
Type string `json:"type" yaml:"type"`
KeyAuth ApisixRouteAuthenticationKeyAuth `json:"keyAuth,omitempty" yaml:"keyAuth,omitempty"`
JwtAuth ApisixRouteAuthenticationJwtAuth `json:"jwtAuth,omitempty" yaml:"jwtAuth,omitempty"`
}
// ApisixRouteAuthenticationKeyAuth is the keyAuth-related
// configuration in ApisixRouteAuthentication.
type ApisixRouteAuthenticationKeyAuth struct {
Header string `json:"header,omitempty" yaml:"header,omitempty"`
}
// ApisixRouteAuthenticationJwtAuth is the jwt auth related
// configuration in ApisixRouteAuthentication.
type ApisixRouteAuthenticationJwtAuth struct {
Header string `json:"header,omitempty" yaml:"header,omitempty"`
Query string `json:"query,omitempty" yaml:"query,omitempty"`
Cookie string `json:"cookie,omitempty" yaml:"cookie,omitempty"`
}
func (p ApisixRoutePluginConfig) DeepCopyInto(out *ApisixRoutePluginConfig) {
b, _ := json.Marshal(&p)
_ = json.Unmarshal(b, out)
}
func (p *ApisixRoutePluginConfig) DeepCopy() *ApisixRoutePluginConfig {
if p == nil {
return nil
}
out := new(ApisixRoutePluginConfig)
p.DeepCopyInto(out)
return out
}
// ApisixRouteStream is the configuration for level 4 route
type ApisixRouteStream struct {
// The rule name, cannot be empty.
Name string `json:"name" yaml:"name"`
Protocol string `json:"protocol" yaml:"protocol"`
Match ApisixRouteStreamMatch `json:"match" yaml:"match"`
Backend ApisixRouteStreamBackend `json:"backend" yaml:"backend"`
Plugins []ApisixRoutePlugin `json:"plugins,omitempty" yaml:"plugins,omitempty"`
}
// ApisixRouteStreamMatch represents the match conditions of stream route.
type ApisixRouteStreamMatch struct {
// IngressPort represents the port listening on the Ingress proxy server.
// It should be pre-defined as APISIX doesn't support dynamic listening.
IngressPort int32 `json:"ingressPort" yaml:"ingressPort"`
}
// ApisixRouteStreamBackend represents a TCP backend (a Kubernetes Service).
type ApisixRouteStreamBackend struct {
// The name (short) of the service, note cross namespace is forbidden,
// so be sure the ApisixRoute and Service are in the same namespace.
ServiceName string `json:"serviceName" yaml:"serviceName"`
// The service port, could be the name or the port number.
ServicePort intstr.IntOrString `json:"servicePort" yaml:"servicePort"`
// The resolve granularity, can be "endpoints" or "service",
// when set to "endpoints", the pod ips will be used; other
// wise, the service ClusterIP or ExternalIP will be used,
// default is endpoints.
ResolveGranularity string `json:"resolveGranularity,omitempty" yaml:"resolveGranularity,omitempty"`
// Subset specifies a subset for the target Service. The subset should be pre-defined
// in ApisixUpstream about this service.
Subset string `json:"subset,omitempty" yaml:"subset,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// ApisixRouteList contains a list of ApisixRoute.
type ApisixRouteList struct {
metav1.TypeMeta `json:",inline" yaml:",inline"`
metav1.ListMeta `json:"metadata" yaml:"metadata"`
Items []ApisixRoute `json:"items,omitempty" yaml:"items,omitempty"`
}

View File

@ -0,0 +1,434 @@
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
Copyright 2020 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
package v2
import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRoute) DeepCopyInto(out *ApisixRoute) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRoute.
func (in *ApisixRoute) DeepCopy() *ApisixRoute {
if in == nil {
return nil
}
out := new(ApisixRoute)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ApisixRoute) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRouteAuthentication) DeepCopyInto(out *ApisixRouteAuthentication) {
*out = *in
out.KeyAuth = in.KeyAuth
out.JwtAuth = in.JwtAuth
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRouteAuthentication.
func (in *ApisixRouteAuthentication) DeepCopy() *ApisixRouteAuthentication {
if in == nil {
return nil
}
out := new(ApisixRouteAuthentication)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRouteAuthenticationJwtAuth) DeepCopyInto(out *ApisixRouteAuthenticationJwtAuth) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRouteAuthenticationJwtAuth.
func (in *ApisixRouteAuthenticationJwtAuth) DeepCopy() *ApisixRouteAuthenticationJwtAuth {
if in == nil {
return nil
}
out := new(ApisixRouteAuthenticationJwtAuth)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRouteAuthenticationKeyAuth) DeepCopyInto(out *ApisixRouteAuthenticationKeyAuth) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRouteAuthenticationKeyAuth.
func (in *ApisixRouteAuthenticationKeyAuth) DeepCopy() *ApisixRouteAuthenticationKeyAuth {
if in == nil {
return nil
}
out := new(ApisixRouteAuthenticationKeyAuth)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRouteHTTP) DeepCopyInto(out *ApisixRouteHTTP) {
*out = *in
if in.Timeout != nil {
in, out := &in.Timeout, &out.Timeout
*out = new(UpstreamTimeout)
**out = **in
}
in.Match.DeepCopyInto(&out.Match)
if in.Backends != nil {
in, out := &in.Backends, &out.Backends
*out = make([]ApisixRouteHTTPBackend, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Plugins != nil {
in, out := &in.Plugins, &out.Plugins
*out = make([]ApisixRoutePlugin, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Authentication != nil {
in, out := &in.Authentication, &out.Authentication
*out = new(ApisixRouteAuthentication)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRouteHTTP.
func (in *ApisixRouteHTTP) DeepCopy() *ApisixRouteHTTP {
if in == nil {
return nil
}
out := new(ApisixRouteHTTP)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRouteHTTPBackend) DeepCopyInto(out *ApisixRouteHTTPBackend) {
*out = *in
out.ServicePort = in.ServicePort
if in.Weight != nil {
in, out := &in.Weight, &out.Weight
*out = new(int)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRouteHTTPBackend.
func (in *ApisixRouteHTTPBackend) DeepCopy() *ApisixRouteHTTPBackend {
if in == nil {
return nil
}
out := new(ApisixRouteHTTPBackend)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRouteHTTPMatch) DeepCopyInto(out *ApisixRouteHTTPMatch) {
*out = *in
if in.Paths != nil {
in, out := &in.Paths, &out.Paths
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Methods != nil {
in, out := &in.Methods, &out.Methods
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Hosts != nil {
in, out := &in.Hosts, &out.Hosts
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.RemoteAddrs != nil {
in, out := &in.RemoteAddrs, &out.RemoteAddrs
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.NginxVars != nil {
in, out := &in.NginxVars, &out.NginxVars
*out = make([]ApisixRouteHTTPMatchExpr, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRouteHTTPMatch.
func (in *ApisixRouteHTTPMatch) DeepCopy() *ApisixRouteHTTPMatch {
if in == nil {
return nil
}
out := new(ApisixRouteHTTPMatch)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRouteHTTPMatchExpr) DeepCopyInto(out *ApisixRouteHTTPMatchExpr) {
*out = *in
out.Subject = in.Subject
if in.Set != nil {
in, out := &in.Set, &out.Set
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.Value != nil {
in, out := &in.Value, &out.Value
*out = new(string)
**out = **in
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRouteHTTPMatchExpr.
func (in *ApisixRouteHTTPMatchExpr) DeepCopy() *ApisixRouteHTTPMatchExpr {
if in == nil {
return nil
}
out := new(ApisixRouteHTTPMatchExpr)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRouteHTTPMatchExprSubject) DeepCopyInto(out *ApisixRouteHTTPMatchExprSubject) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRouteHTTPMatchExprSubject.
func (in *ApisixRouteHTTPMatchExprSubject) DeepCopy() *ApisixRouteHTTPMatchExprSubject {
if in == nil {
return nil
}
out := new(ApisixRouteHTTPMatchExprSubject)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRouteList) DeepCopyInto(out *ApisixRouteList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ApisixRoute, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRouteList.
func (in *ApisixRouteList) DeepCopy() *ApisixRouteList {
if in == nil {
return nil
}
out := new(ApisixRouteList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ApisixRouteList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRoutePlugin) DeepCopyInto(out *ApisixRoutePlugin) {
*out = *in
in.Config.DeepCopyInto(&out.Config)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRoutePlugin.
func (in *ApisixRoutePlugin) DeepCopy() *ApisixRoutePlugin {
if in == nil {
return nil
}
out := new(ApisixRoutePlugin)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRouteSpec) DeepCopyInto(out *ApisixRouteSpec) {
*out = *in
if in.HTTP != nil {
in, out := &in.HTTP, &out.HTTP
*out = make([]ApisixRouteHTTP, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Stream != nil {
in, out := &in.Stream, &out.Stream
*out = make([]ApisixRouteStream, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRouteSpec.
func (in *ApisixRouteSpec) DeepCopy() *ApisixRouteSpec {
if in == nil {
return nil
}
out := new(ApisixRouteSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRouteStream) DeepCopyInto(out *ApisixRouteStream) {
*out = *in
out.Match = in.Match
out.Backend = in.Backend
if in.Plugins != nil {
in, out := &in.Plugins, &out.Plugins
*out = make([]ApisixRoutePlugin, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRouteStream.
func (in *ApisixRouteStream) DeepCopy() *ApisixRouteStream {
if in == nil {
return nil
}
out := new(ApisixRouteStream)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRouteStreamBackend) DeepCopyInto(out *ApisixRouteStreamBackend) {
*out = *in
out.ServicePort = in.ServicePort
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRouteStreamBackend.
func (in *ApisixRouteStreamBackend) DeepCopy() *ApisixRouteStreamBackend {
if in == nil {
return nil
}
out := new(ApisixRouteStreamBackend)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixRouteStreamMatch) DeepCopyInto(out *ApisixRouteStreamMatch) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixRouteStreamMatch.
func (in *ApisixRouteStreamMatch) DeepCopy() *ApisixRouteStreamMatch {
if in == nil {
return nil
}
out := new(ApisixRouteStreamMatch)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ApisixStatus) DeepCopyInto(out *ApisixStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]v1.Condition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApisixStatus.
func (in *ApisixStatus) DeepCopy() *ApisixStatus {
if in == nil {
return nil
}
out := new(ApisixStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *UpstreamTimeout) DeepCopyInto(out *UpstreamTimeout) {
*out = *in
out.Connect = in.Connect
out.Send = in.Send
out.Read = in.Read
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpstreamTimeout.
func (in *UpstreamTimeout) DeepCopy() *UpstreamTimeout {
if in == nil {
return nil
}
out := new(UpstreamTimeout)
in.DeepCopyInto(out)
return out
}