diff --git a/Makefile b/Makefile index 606d361..bed7738 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # To re-generate a bundle for another specific version without changing the standard setup, you can: # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2) # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) -VERSION ?= 1.1.0 +VERSION ?= 2.0.1 # Image URL to use all building/pushing image targets IMG ?= ghcr.io/aristanetworks/arista-ceoslab-operator diff --git a/api/v1alpha1/ceoslabdevice_types.go b/api/v1alpha1/ceoslabdevice_types.go index 75753db..1914aae 100644 --- a/api/v1alpha1/ceoslabdevice_types.go +++ b/api/v1alpha1/ceoslabdevice_types.go @@ -41,9 +41,9 @@ type CEosLabDeviceSpec struct { // Init container image name. Default: networkop/init-wait:latest InitContainerImage string `json:"initcontainerimage,omitempty"` // Number of data interfaces to create. An additional interface (eth0) is created for pod connectivity. Default: 0 interfaces - NumInterfaces uint32 `json:"numinterfaces,omitempty"` + NumInterfaces int32 `json:"numinterfaces,omitempty"` // Time (in seconds) to wait before starting the device. Default: 0 seconds - Sleep uint32 `json:"sleep,omitempty"` + Sleep int32 `json:"sleep,omitempty"` // X.509 certificate configuration. CertConfig CertConfig `json:"certconfig,omitempty"` // Explicit interface mapping between kernel devices and interface names. If this is defined, any unmapped devices are ignored. @@ -61,9 +61,9 @@ type ServiceConfig struct { type PortConfig struct { // Port inside the container. - In uint32 `json:"in,omitempty"` + In int32 `json:"in,omitempty"` // Port outside the container. Defaults to the same as in. - Out uint32 `json:"out,omitempty"` + Out int32 `json:"out,omitempty"` } type CertConfig struct { @@ -77,7 +77,7 @@ type SelfSignedCertConfig struct { // Key name on the node. KeyName string `json:"keyname,omitempty"` // RSA keysize to use for key generation. - KeySize uint32 `json:"keysize,omitempty"` + KeySize int32 `json:"keysize,omitempty"` // Common name to set in the cert. CommonName string `json:"commonname,omitempty"` } diff --git a/api/v1alpha1/client/interface.go b/api/v1alpha1/client/interface.go index a9d5684..572008e 100644 --- a/api/v1alpha1/client/interface.go +++ b/api/v1alpha1/client/interface.go @@ -19,7 +19,7 @@ package client import ( "context" - "github.com/aristanetworks/arista-ceoslab-operator/api/v1alpha1" + "github.com/aristanetworks/arista-ceoslab-operator/v2/api/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" diff --git a/api/v1alpha1/clientset/client.go b/api/v1alpha1/clientset/client.go index 6c50143..54d42a7 100644 --- a/api/v1alpha1/clientset/client.go +++ b/api/v1alpha1/clientset/client.go @@ -19,8 +19,8 @@ package clientset import ( "context" - "github.com/aristanetworks/arista-ceoslab-operator/api/v1alpha1" - intf "github.com/aristanetworks/arista-ceoslab-operator/api/v1alpha1/client" + "github.com/aristanetworks/arista-ceoslab-operator/v2/api/v1alpha1" + intf "github.com/aristanetworks/arista-ceoslab-operator/v2/api/v1alpha1/client" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" diff --git a/api/v1alpha1/dynamic/client.go b/api/v1alpha1/dynamic/client.go index d8c2713..391e671 100644 --- a/api/v1alpha1/dynamic/client.go +++ b/api/v1alpha1/dynamic/client.go @@ -20,8 +20,8 @@ import ( "context" "fmt" - "github.com/aristanetworks/arista-ceoslab-operator/api/v1alpha1" - intf "github.com/aristanetworks/arista-ceoslab-operator/api/v1alpha1/client" + "github.com/aristanetworks/arista-ceoslab-operator/v2/api/v1alpha1" + intf "github.com/aristanetworks/arista-ceoslab-operator/v2/api/v1alpha1/client" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" diff --git a/api/v1alpha1/dynamic/fake/client.go b/api/v1alpha1/dynamic/fake/client.go index 98c9e8f..62047cb 100644 --- a/api/v1alpha1/dynamic/fake/client.go +++ b/api/v1alpha1/dynamic/fake/client.go @@ -17,8 +17,8 @@ limitations under the License. package fake import ( - "github.com/aristanetworks/arista-ceoslab-operator/api/v1alpha1" - "github.com/aristanetworks/arista-ceoslab-operator/api/v1alpha1/dynamic" + "github.com/aristanetworks/arista-ceoslab-operator/v2/api/v1alpha1" + "github.com/aristanetworks/arista-ceoslab-operator/v2/api/v1alpha1/dynamic" "k8s.io/apimachinery/pkg/runtime" fakeclient "k8s.io/client-go/dynamic/fake" "k8s.io/client-go/rest" diff --git a/api/v1alpha1/groupversion_info.go b/api/v1alpha1/groupversion_info.go index c1547cc..984aba0 100644 --- a/api/v1alpha1/groupversion_info.go +++ b/api/v1alpha1/groupversion_info.go @@ -54,6 +54,7 @@ func addKnownTypes(scheme *runtime.Scheme) error { &CEosLabDeviceList{}, ) metav1.AddToGroupVersion(scheme, GroupVersion) + metav1.AddMetaToScheme(scheme) return nil } diff --git a/config/kustomized/manifest.yaml b/config/kustomized/manifest.yaml index cb165c0..8d1155c 100644 --- a/config/kustomized/manifest.yaml +++ b/config/kustomized/manifest.yaml @@ -487,7 +487,7 @@ spec: - --leader-elect command: - /manager - image: ghcr.io/aristanetworks/arista-ceoslab-operator:v1.1.0 + image: ghcr.io/aristanetworks/arista-ceoslab-operator:v2.0.1 livenessProbe: httpGet: path: /healthz diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 9b92a43..c67106b 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -13,4 +13,4 @@ kind: Kustomization images: - name: controller newName: ghcr.io/aristanetworks/arista-ceoslab-operator - newTag: v1.1.0 + newTag: v2.0.1 diff --git a/controllers/ceoslabdevice_controller.go b/controllers/ceoslabdevice_controller.go index 68e0373..62f5c0c 100644 --- a/controllers/ceoslabdevice_controller.go +++ b/controllers/ceoslabdevice_controller.go @@ -34,7 +34,7 @@ import ( "strings" "time" - ceoslabv1alpha1 "github.com/aristanetworks/arista-ceoslab-operator/api/v1alpha1" + ceoslabv1alpha1 "github.com/aristanetworks/arista-ceoslab-operator/v2/api/v1alpha1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -1077,8 +1077,8 @@ func getStartupProbeAPI(device *ceoslabv1alpha1.CEosLabDevice) *corev1.Probe { }, }, // Try to boot for up to two minutes - TimeoutSeconds: 5, - PeriodSeconds: 5, + TimeoutSeconds: 5, + PeriodSeconds: 5, FailureThreshold: 24, } } @@ -1127,8 +1127,8 @@ func getServiceMapFromK8sAPI(service *corev1.Service) map[string]ceoslabv1alpha1 serviceMap[v.Name] = ceoslabv1alpha1.PortConfig{ // We always set TargetPort and Port (see getServiceMap) so we can pull // out these values naively. - In: uint32(v.TargetPort.IntValue()), - Out: uint32(v.Port), + In: int32(v.TargetPort.IntValue()), + Out: int32(v.Port), } } return serviceMap diff --git a/controllers/suite_test.go b/controllers/suite_test.go index 991b94d..de07317 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -30,7 +30,7 @@ import ( logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" - ceoslabv1alpha1 "github.com/aristanetworks/arista-ceoslab-operator/api/v1alpha1" + ceoslabv1alpha1 "github.com/aristanetworks/arista-ceoslab-operator/v2/api/v1alpha1" //+kubebuilder:scaffold:imports ) diff --git a/go.mod b/go.mod index abd814a..734c962 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/aristanetworks/arista-ceoslab-operator +module github.com/aristanetworks/arista-ceoslab-operator/v2 go 1.17 diff --git a/kuttl-test.yaml b/kuttl-test.yaml index bf3144a..2c11c67 100644 --- a/kuttl-test.yaml +++ b/kuttl-test.yaml @@ -7,7 +7,7 @@ testDirs: manifestDirs: - config/kustomized kindContainers: -- ghcr.io/aristanetworks/arista-ceoslab-operator:v1.1.0 +- ghcr.io/aristanetworks/arista-ceoslab-operator:v2.0.1 - ceos:latest - ceos-2:latest - networkop/init-wait:latest diff --git a/main.go b/main.go index 41d6b10..01ceec9 100644 --- a/main.go +++ b/main.go @@ -31,8 +31,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/log/zap" - ceoslabv1alpha1 "github.com/aristanetworks/arista-ceoslab-operator/api/v1alpha1" - "github.com/aristanetworks/arista-ceoslab-operator/controllers" + ceoslabv1alpha1 "github.com/aristanetworks/arista-ceoslab-operator/v2/api/v1alpha1" + "github.com/aristanetworks/arista-ceoslab-operator/v2/controllers" //+kubebuilder:scaffold:imports )