diff options
author | Ritu Sood <ritu.sood@intel.com> | 2019-12-29 10:52:06 -0800 |
---|---|---|
committer | Ritu Sood <ritu.sood@intel.com> | 2019-12-29 10:52:06 -0800 |
commit | c23ec42c2c25ecfa16a65e3b108aaec945760eba (patch) | |
tree | d69d09ed9653a8458820f72ba345791232e5998c /pkg/apis/k8s | |
parent | 52123c4bdcfad323f8fb57742400be993167ae2d (diff) |
Adding generated code for service chaining
API and generated code for route based
chaining CRD
Change-Id: I631ec38c08c76059f6e742c5c241763b33597bd4
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
Diffstat (limited to 'pkg/apis/k8s')
-rw-r--r-- | pkg/apis/k8s/v1alpha1/network_types.go | 2 | ||||
-rw-r--r-- | pkg/apis/k8s/v1alpha1/networkchaining_types.go | 66 | ||||
-rw-r--r-- | pkg/apis/k8s/v1alpha1/providernetwork_types.go | 1 | ||||
-rw-r--r-- | pkg/apis/k8s/v1alpha1/zz_generated.deepcopy.go | 136 |
4 files changed, 204 insertions, 1 deletions
diff --git a/pkg/apis/k8s/v1alpha1/network_types.go b/pkg/apis/k8s/v1alpha1/network_types.go index a606dbb..0372eb4 100644 --- a/pkg/apis/k8s/v1alpha1/network_types.go +++ b/pkg/apis/k8s/v1alpha1/network_types.go @@ -58,7 +58,7 @@ type NetworkStatus struct { } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - +// +genclient // Network is the Schema for the networks API // +k8s:openapi-gen=true // +kubebuilder:subresource:status diff --git a/pkg/apis/k8s/v1alpha1/networkchaining_types.go b/pkg/apis/k8s/v1alpha1/networkchaining_types.go new file mode 100644 index 0000000..59a3816 --- /dev/null +++ b/pkg/apis/k8s/v1alpha1/networkchaining_types.go @@ -0,0 +1,66 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// NetworkChainingSpec defines the desired state of NetworkChaining +// +k8s:openapi-gen=true +type NetworkChainingSpec struct { + ChainType string `json:"chainType"` // Currently only Routing type is supported + RoutingSpec RouteSpec `json:"routingSpec"` // Spec for Routing type + // Add other Chanining mechanisms here +} + +type RouteSpec struct { + LeftNetwork []RoutingNetwork `json:"leftNetwork"` // Info on Network on the left side + RightNetwork []RoutingNetwork `json:"rightNetwork"`// Info on Network on the right side + NetworkChain string `json:"networkChain"`// NetworkChain is a comma seprated list with format DeploymentName, middle Network Name, DeploymentName, ... + Namespace string `json:"namespace"` // Kubernetes namespace + } + + type RoutingNetwork struct { + NetworkName string `json:"networkName"` // Name of the network + GatewayIP string `json:"gatewayIp"` // Gateway IP Address + Subnet string `json:"subnet"` // Subnet + } + +// NetworkChainingStatus defines the observed state of NetworkChaining +// +k8s:openapi-gen=true +type NetworkChainingStatus struct { + State string `json:"state"` // Indicates if Network Chain is in "created" state +} + + +// NetworkChaining is the Schema for the networkchainings API +// +k8s:openapi-gen=true +// +kubebuilder:subresource:status +// +kubebuilder:resource:path=networkchainings,scope=Namespaced +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +type NetworkChaining struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec NetworkChainingSpec `json:"spec,omitempty"` + Status NetworkChainingStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// NetworkChainingList contains a list of NetworkChaining +type NetworkChainingList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NetworkChaining `json:"items"` +} + +func init() { + SchemeBuilder.Register(&NetworkChaining{}, &NetworkChainingList{}) +} + + + diff --git a/pkg/apis/k8s/v1alpha1/providernetwork_types.go b/pkg/apis/k8s/v1alpha1/providernetwork_types.go index 3f8444f..573a107 100644 --- a/pkg/apis/k8s/v1alpha1/providernetwork_types.go +++ b/pkg/apis/k8s/v1alpha1/providernetwork_types.go @@ -44,6 +44,7 @@ type ProviderNetworkStatus struct { // ProviderNetwork is the Schema for the providernetworks API // +k8s:openapi-gen=true // +kubebuilder:subresource:status +// +genclient type ProviderNetwork struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/pkg/apis/k8s/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/k8s/v1alpha1/zz_generated.deepcopy.go index 69f190e..cf716cd 100644 --- a/pkg/apis/k8s/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/k8s/v1alpha1/zz_generated.deepcopy.go @@ -100,6 +100,100 @@ func (in *Network) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkChaining) DeepCopyInto(out *NetworkChaining) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkChaining. +func (in *NetworkChaining) DeepCopy() *NetworkChaining { + if in == nil { + return nil + } + out := new(NetworkChaining) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkChaining) 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 *NetworkChainingList) DeepCopyInto(out *NetworkChainingList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NetworkChaining, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkChainingList. +func (in *NetworkChainingList) DeepCopy() *NetworkChainingList { + if in == nil { + return nil + } + out := new(NetworkChainingList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkChainingList) 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 *NetworkChainingSpec) DeepCopyInto(out *NetworkChainingSpec) { + *out = *in + in.RoutingSpec.DeepCopyInto(&out.RoutingSpec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkChainingSpec. +func (in *NetworkChainingSpec) DeepCopy() *NetworkChainingSpec { + if in == nil { + return nil + } + out := new(NetworkChainingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkChainingStatus) DeepCopyInto(out *NetworkChainingStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkChainingStatus. +func (in *NetworkChainingStatus) DeepCopy() *NetworkChainingStatus { + if in == nil { + return nil + } + out := new(NetworkChainingStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NetworkList) DeepCopyInto(out *NetworkList) { *out = *in out.TypeMeta = in.TypeMeta @@ -307,6 +401,48 @@ func (in *Route) DeepCopy() *Route { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RouteSpec) DeepCopyInto(out *RouteSpec) { + *out = *in + if in.LeftNetwork != nil { + in, out := &in.LeftNetwork, &out.LeftNetwork + *out = make([]RoutingNetwork, len(*in)) + copy(*out, *in) + } + if in.RightNetwork != nil { + in, out := &in.RightNetwork, &out.RightNetwork + *out = make([]RoutingNetwork, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteSpec. +func (in *RouteSpec) DeepCopy() *RouteSpec { + if in == nil { + return nil + } + out := new(RouteSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoutingNetwork) DeepCopyInto(out *RoutingNetwork) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoutingNetwork. +func (in *RoutingNetwork) DeepCopy() *RoutingNetwork { + if in == nil { + return nil + } + out := new(RoutingNetwork) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VlanSpec) DeepCopyInto(out *VlanSpec) { *out = *in if in.NodeLabelList != nil { |