diff --git a/api/tunnel-endpoint/v1/groupversion_info.go b/api/liqonet/v1/groupversion_info.go similarity index 98% rename from api/tunnel-endpoint/v1/groupversion_info.go rename to api/liqonet/v1/groupversion_info.go index 4d83f81341..94a2a61338 100644 --- a/api/tunnel-endpoint/v1/groupversion_info.go +++ b/api/liqonet/v1/groupversion_info.go @@ -26,7 +26,7 @@ import ( var ( // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "liqonet.liqo.io", Version: "v1"} + GroupVersion = schema.GroupVersion{Group: "liqonet.liqo.io", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} diff --git a/api/tunnel-endpoint/v1/tunnel_endpoint_types.go b/api/liqonet/v1/tunnel_endpoint_types.go similarity index 100% rename from api/tunnel-endpoint/v1/tunnel_endpoint_types.go rename to api/liqonet/v1/tunnel_endpoint_types.go diff --git a/api/tunnel-endpoint/v1/zz_generated.deepcopy.go b/api/liqonet/v1/zz_generated.deepcopy.go similarity index 100% rename from api/tunnel-endpoint/v1/zz_generated.deepcopy.go rename to api/liqonet/v1/zz_generated.deepcopy.go diff --git a/api/liqonet/v1alpha1/groupversion_info.go b/api/liqonet/v1alpha1/groupversion_info.go new file mode 100644 index 0000000000..64d7ed11a4 --- /dev/null +++ b/api/liqonet/v1alpha1/groupversion_info.go @@ -0,0 +1,35 @@ +/* + +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 v1alpha1 contains API Schema definitions for the liqonetliqoio v1alpha1 API group +// +kubebuilder:object:generate=true +// +groupName=liqonet.liqo.io +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "liqonet.liqo.io", Version: "v1alpha1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/api/liqonet/v1alpha1/networkconfig_types.go b/api/liqonet/v1alpha1/networkconfig_types.go new file mode 100644 index 0000000000..db980345ba --- /dev/null +++ b/api/liqonet/v1alpha1/networkconfig_types.go @@ -0,0 +1,73 @@ +/* + +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 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. + +// NetworkConfigSpec defines the desired state of NetworkConfig +type NetworkConfigSpec struct { + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + // Important: Run "make" to regenerate code after modifying this file + //the ID of the remote cluster that will receive this CRD + ClusterID string `json:"clusterID"` + //network subnet used in the local cluster for the pod IPs + PodCIDR string `json:"podCIDR"` + //public IP of the node where the VPN tunnel is created + TunnelPublicIP string `json:"tunnelPublicIP"` + //the IP address of the node in the private VPN subnet + TunnelPrivateIP string `json:"tunnelPrivateIP"` +} + +// NetworkConfigStatus defines the observed state of NetworkConfig +type NetworkConfigStatus struct { + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + // Important: Run "make" to regenerate code after modifying this file + //indicates if the NAT is enabled for the remote cluster + NATEnabled bool `json:"natEnabled,omitempty"` + //the new subnet used to NAT the pods' subnet of the remote cluster + PodCIDRNAT string `json:"podCIDRNAT,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster + +// NetworkConfig is the Schema for the networkconfigs API +type NetworkConfig struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec NetworkConfigSpec `json:"spec,omitempty"` + Status NetworkConfigStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// NetworkConfigList contains a list of NetworkConfig +type NetworkConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NetworkConfig `json:"items"` +} + +func init() { + SchemeBuilder.Register(&NetworkConfig{}, &NetworkConfigList{}) +} diff --git a/api/liqonet/v1alpha1/zz_generated.deepcopy.go b/api/liqonet/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..503515b839 --- /dev/null +++ b/api/liqonet/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,113 @@ +// +build !ignore_autogenerated + +/* + +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 controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + 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 *NetworkConfig) DeepCopyInto(out *NetworkConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConfig. +func (in *NetworkConfig) DeepCopy() *NetworkConfig { + if in == nil { + return nil + } + out := new(NetworkConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkConfig) 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 *NetworkConfigList) DeepCopyInto(out *NetworkConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NetworkConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConfigList. +func (in *NetworkConfigList) DeepCopy() *NetworkConfigList { + if in == nil { + return nil + } + out := new(NetworkConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkConfigList) 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 *NetworkConfigSpec) DeepCopyInto(out *NetworkConfigSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConfigSpec. +func (in *NetworkConfigSpec) DeepCopy() *NetworkConfigSpec { + if in == nil { + return nil + } + out := new(NetworkConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkConfigStatus) DeepCopyInto(out *NetworkConfigStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConfigStatus. +func (in *NetworkConfigStatus) DeepCopy() *NetworkConfigStatus { + if in == nil { + return nil + } + out := new(NetworkConfigStatus) + in.DeepCopyInto(out) + return out +} diff --git a/cmd/advertisement-operator/main.go b/cmd/advertisement-operator/main.go index f190b2d885..974f302bd2 100644 --- a/cmd/advertisement-operator/main.go +++ b/cmd/advertisement-operator/main.go @@ -29,7 +29,7 @@ import ( "time" protocolv1 "github.com/liqoTech/liqo/api/advertisement-operator/v1" - liqonetv1 "github.com/liqoTech/liqo/api/tunnel-endpoint/v1" + liqonetv1 "github.com/liqoTech/liqo/api/liqonet/v1" "github.com/liqoTech/liqo/internal/advertisement-operator" "github.com/liqoTech/liqo/pkg/csrApprover" ctrl "sigs.k8s.io/controller-runtime" diff --git a/cmd/liqonet/main.go b/cmd/liqonet/main.go index 0b5148f103..7fc1fc195a 100644 --- a/cmd/liqonet/main.go +++ b/cmd/liqonet/main.go @@ -20,7 +20,7 @@ import ( "github.com/coreos/go-iptables/iptables" protocolv1 "github.com/liqoTech/liqo/api/advertisement-operator/v1" clusterConfig "github.com/liqoTech/liqo/api/cluster-config/v1" - "github.com/liqoTech/liqo/api/tunnel-endpoint/v1" + "github.com/liqoTech/liqo/api/liqonet/v1" "github.com/liqoTech/liqo/internal/liqonet" "github.com/liqoTech/liqo/pkg/liqonet" "github.com/vishvananda/netlink" diff --git a/config/liqonet/crd/bases/liqonet.liqo.io_networkconfigs.yaml b/config/liqonet/crd/bases/liqonet.liqo.io_networkconfigs.yaml new file mode 100644 index 0000000000..e930160194 --- /dev/null +++ b/config/liqonet/crd/bases/liqonet.liqo.io_networkconfigs.yaml @@ -0,0 +1,83 @@ + +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.2.5 + creationTimestamp: null + name: networkconfigs.liqonet.liqo.io +spec: + group: liqonet.liqo.io + names: + kind: NetworkConfig + listKind: NetworkConfigList + plural: networkconfigs + singular: networkconfig + scope: Cluster + subresources: + status: {} + validation: + openAPIV3Schema: + description: NetworkConfig is the Schema for the networkconfigs API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: NetworkConfigSpec defines the desired state of NetworkConfig + properties: + clusterID: + description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + Important: Run "make" to regenerate code after modifying this file + the ID of the remote cluster that will receive this CRD' + type: string + podCIDR: + description: network subnet used in the local cluster for the pod IPs + type: string + tunnelPrivateIP: + description: the IP address of the node in the private VPN subnet + type: string + tunnelPublicIP: + description: public IP of the node where the VPN tunnel is created + type: string + required: + - clusterID + - podCIDR + - tunnelPrivateIP + - tunnelPublicIP + type: object + status: + description: NetworkConfigStatus defines the observed state of NetworkConfig + properties: + natEnabled: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed state + of cluster Important: Run "make" to regenerate code after modifying + this file indicates if the NAT is enabled for the remote cluster' + type: boolean + podCIDRNAT: + description: the new subnet used to NAT the pods' subnet of the remote + cluster + type: string + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/config/liqonet/crd/bases/liqonet.liqo.io_tunnelendpoints.yaml b/config/liqonet/crd/bases/liqonet.liqo.io_tunnelendpoints.yaml index e8a4602a73..6aa06e1607 100644 --- a/config/liqonet/crd/bases/liqonet.liqo.io_tunnelendpoints.yaml +++ b/config/liqonet/crd/bases/liqonet.liqo.io_tunnelendpoints.yaml @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.2.5 + controller-gen.kubebuilder.io/version: v0.2.4 creationTimestamp: null name: tunnelendpoints.liqonet.liqo.io spec: diff --git a/deployments/liqo_chart/crds/liqonet.liqo.io_networkconfigs.yaml b/deployments/liqo_chart/crds/liqonet.liqo.io_networkconfigs.yaml new file mode 100644 index 0000000000..e930160194 --- /dev/null +++ b/deployments/liqo_chart/crds/liqonet.liqo.io_networkconfigs.yaml @@ -0,0 +1,83 @@ + +--- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.2.5 + creationTimestamp: null + name: networkconfigs.liqonet.liqo.io +spec: + group: liqonet.liqo.io + names: + kind: NetworkConfig + listKind: NetworkConfigList + plural: networkconfigs + singular: networkconfig + scope: Cluster + subresources: + status: {} + validation: + openAPIV3Schema: + description: NetworkConfig is the Schema for the networkconfigs API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: NetworkConfigSpec defines the desired state of NetworkConfig + properties: + clusterID: + description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster + Important: Run "make" to regenerate code after modifying this file + the ID of the remote cluster that will receive this CRD' + type: string + podCIDR: + description: network subnet used in the local cluster for the pod IPs + type: string + tunnelPrivateIP: + description: the IP address of the node in the private VPN subnet + type: string + tunnelPublicIP: + description: public IP of the node where the VPN tunnel is created + type: string + required: + - clusterID + - podCIDR + - tunnelPrivateIP + - tunnelPublicIP + type: object + status: + description: NetworkConfigStatus defines the observed state of NetworkConfig + properties: + natEnabled: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed state + of cluster Important: Run "make" to regenerate code after modifying + this file indicates if the NAT is enabled for the remote cluster' + type: boolean + podCIDRNAT: + description: the new subnet used to NAT the pods' subnet of the remote + cluster + type: string + type: object + type: object + version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/go.sum b/go.sum index 021ebd264e..96602ee9cb 100644 --- a/go.sum +++ b/go.sum @@ -87,6 +87,7 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4 h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= diff --git a/internal/liqonet/route-operator.go b/internal/liqonet/route-operator.go index 01383a3bdc..92b4255115 100644 --- a/internal/liqonet/route-operator.go +++ b/internal/liqonet/route-operator.go @@ -19,7 +19,7 @@ import ( "fmt" "github.com/coreos/go-iptables/iptables" "github.com/go-logr/logr" - "github.com/liqoTech/liqo/api/tunnel-endpoint/v1" + "github.com/liqoTech/liqo/api/liqonet/v1" liqonetOperator "github.com/liqoTech/liqo/pkg/liqonet" "github.com/vishvananda/netlink" k8sApiErrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/internal/liqonet/route-operator_test.go b/internal/liqonet/route-operator_test.go index 2887dd1306..e996334339 100644 --- a/internal/liqonet/route-operator_test.go +++ b/internal/liqonet/route-operator_test.go @@ -1,7 +1,7 @@ package controllers import ( - v1 "github.com/liqoTech/liqo/api/tunnel-endpoint/v1" + v1 "github.com/liqoTech/liqo/api/liqonet/v1" "github.com/liqoTech/liqo/pkg/liqonet" "github.com/stretchr/testify/assert" "github.com/vishvananda/netlink" diff --git a/internal/liqonet/tunnel-operator.go b/internal/liqonet/tunnel-operator.go index c27e0926e0..72535a6cdb 100644 --- a/internal/liqonet/tunnel-operator.go +++ b/internal/liqonet/tunnel-operator.go @@ -17,7 +17,7 @@ package controllers import ( "context" "github.com/go-logr/logr" - "github.com/liqoTech/liqo/api/tunnel-endpoint/v1" + "github.com/liqoTech/liqo/api/liqonet/v1" liqonetOperator "github.com/liqoTech/liqo/pkg/liqonet" "github.com/vishvananda/netlink" "k8s.io/apimachinery/pkg/runtime" diff --git a/internal/liqonet/tunnelEndpointCreator-config.go b/internal/liqonet/tunnelEndpointCreator-config.go index b1014d9721..9a8b7f6ec1 100644 --- a/internal/liqonet/tunnelEndpointCreator-config.go +++ b/internal/liqonet/tunnelEndpointCreator-config.go @@ -4,7 +4,7 @@ import ( "context" "fmt" policyv1 "github.com/liqoTech/liqo/api/cluster-config/v1" - liqonetv1 "github.com/liqoTech/liqo/api/tunnel-endpoint/v1" + liqonetv1 "github.com/liqoTech/liqo/api/liqonet/v1" "github.com/liqoTech/liqo/pkg/clusterConfig" "github.com/liqoTech/liqo/pkg/crdClient" liqonetOperator "github.com/liqoTech/liqo/pkg/liqonet" diff --git a/internal/liqonet/tunnelEndpointCreator-operator.go b/internal/liqonet/tunnelEndpointCreator-operator.go index c548152c5d..5d5205744e 100644 --- a/internal/liqonet/tunnelEndpointCreator-operator.go +++ b/internal/liqonet/tunnelEndpointCreator-operator.go @@ -32,7 +32,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" protocolv1 "github.com/liqoTech/liqo/api/advertisement-operator/v1" - liqonetv1 "github.com/liqoTech/liqo/api/tunnel-endpoint/v1" + liqonetv1 "github.com/liqoTech/liqo/api/liqonet/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" ) diff --git a/pkg/liqonet/tunnel.go b/pkg/liqonet/tunnel.go index e53b848054..5166e06570 100644 --- a/pkg/liqonet/tunnel.go +++ b/pkg/liqonet/tunnel.go @@ -2,7 +2,7 @@ package liqonet import ( "errors" - "github.com/liqoTech/liqo/api/tunnel-endpoint/v1" + "github.com/liqoTech/liqo/api/liqonet/v1" "github.com/liqoTech/liqo/internal/errdefs" "github.com/prometheus/common/log" "github.com/vishvananda/netlink" diff --git a/scripts/liqonet/Makefile b/scripts/liqonet/Makefile index ccf3c60993..33e0904cf1 100644 --- a/scripts/liqonet/Makefile +++ b/scripts/liqonet/Makefile @@ -42,8 +42,18 @@ deploy: manifests manifests: controller-gen #$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/liqonet/crd/bases output:rbac:artifacts:config=config/liqonet/rbac #$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./internal/liqonet/route-operator.go" rbac:roleName=manager-role crd:crdVersions=v1beta1 crd:trivialVersions=false output:crd:artifacts:config=config/liqonet/crd/bases output:rbac:artifacts:config=config/liqonet/rbac - $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./api/tunnel-endpoint/v1" rbac:roleName=manager-role crd:crdVersions=v1beta1 crd:trivialVersions=false output:crd:artifacts:config=config/liqonet/crd/bases output:rbac:artifacts:config=config/liqonet/rbac + $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./api/liqonet/v1" rbac:roleName=manager-role crd:crdVersions=v1beta1 crd:trivialVersions=false output:crd:artifacts:config=config/liqonet/crd/bases output:rbac:artifacts:config=config/liqonet/rbac rm config/liqonet.liqo.io_tunnelendpoints.yaml + cp config/liqonet/crd/bases/liqonet.liqo.io_networkconfigs.yaml deployments/liqo_chart/crds + #rm config/liqonet.liqo.io_networkconfigs.yaml + +# Generate manifests e.g. CRD, RBAC etc. +manifestsv1alpha1: controller-gen + #$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/liqonet/crd/bases output:rbac:artifacts:config=config/liqonet/rbac + #$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./internal/liqonet/route-operator.go" rbac:roleName=manager-role crd:crdVersions=v1beta1 crd:trivialVersions=false output:crd:artifacts:config=config/liqonet/crd/bases output:rbac:artifacts:config=config/liqonet/rbac + $(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./api/liqonet/v1alpha1" rbac:roleName=manager-role crd:crdVersions=v1beta1 crd:trivialVersions=false output:crd:artifacts:config=config/liqonet/crd/bases + + #rm config/liqonet.liqo.io_networkconfigs.yaml # Run go fmt against code fmt: @@ -55,7 +65,7 @@ vet: # Generate code generate: controller-gen - $(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths="./..." + $(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths="./api/liqonet/v1" # Build the docker image docker-build: diff --git a/test/unit/liqonet/env_test.go b/test/unit/liqonet/env_test.go index 95eab37924..02bc65cb8f 100644 --- a/test/unit/liqonet/env_test.go +++ b/test/unit/liqonet/env_test.go @@ -4,7 +4,7 @@ import ( "context" protocolv1 "github.com/liqoTech/liqo/api/advertisement-operator/v1" policyv1 "github.com/liqoTech/liqo/api/cluster-config/v1" - liqonetv1 "github.com/liqoTech/liqo/api/tunnel-endpoint/v1" + liqonetv1 "github.com/liqoTech/liqo/api/liqonet/v1" controllers "github.com/liqoTech/liqo/internal/liqonet" "github.com/liqoTech/liqo/pkg/crdClient" "github.com/liqoTech/liqo/pkg/liqonet" diff --git a/test/unit/liqonet/route-operator_test.go b/test/unit/liqonet/route-operator_test.go index 41c334609a..4659e369ba 100644 --- a/test/unit/liqonet/route-operator_test.go +++ b/test/unit/liqonet/route-operator_test.go @@ -1,7 +1,7 @@ package liqonet import ( - v1 "github.com/liqoTech/liqo/api/tunnel-endpoint/v1" + v1 "github.com/liqoTech/liqo/api/liqonet/v1" controller "github.com/liqoTech/liqo/internal/liqonet" "github.com/liqoTech/liqo/pkg/liqonet" utils "github.com/liqoTech/liqo/pkg/liqonet" diff --git a/test/unit/liqonet/tunnelEndpointCreator_test.go b/test/unit/liqonet/tunnelEndpointCreator_test.go index c6016769f0..ee1adcee8a 100644 --- a/test/unit/liqonet/tunnelEndpointCreator_test.go +++ b/test/unit/liqonet/tunnelEndpointCreator_test.go @@ -2,7 +2,7 @@ package liqonet import ( policyv1 "github.com/liqoTech/liqo/api/cluster-config/v1" - v1 "github.com/liqoTech/liqo/api/tunnel-endpoint/v1" + v1 "github.com/liqoTech/liqo/api/liqonet/v1" controller "github.com/liqoTech/liqo/internal/liqonet" "github.com/liqoTech/liqo/pkg/liqonet" liqonetOperator "github.com/liqoTech/liqo/pkg/liqonet"