diff --git a/internal/controller/natgateway_controller_test.go b/internal/controller/natgateway_controller_test.go index b69dd72..3ec5d81 100644 --- a/internal/controller/natgateway_controller_test.go +++ b/internal/controller/natgateway_controller_test.go @@ -1,68 +1,7 @@ package controller import ( - "context" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - otcv1alpha1 "github.com/peertech.de/otc-operator/api/v1alpha1" ) -var _ = Describe("NATGateway Controller", func() { - Context("When reconciling a resource", func() { - const resourceName = "test-resource" - - ctx := context.Background() - - typeNamespacedName := types.NamespacedName{ - Name: resourceName, - Namespace: "default", // TODO(user):Modify as needed - } - natgateway := &otcv1alpha1.NATGateway{} - - BeforeEach(func() { - By("creating the custom resource for the Kind NATGateway") - err := k8sClient.Get(ctx, typeNamespacedName, natgateway) - if err != nil && errors.IsNotFound(err) { - resource := &otcv1alpha1.NATGateway{ - ObjectMeta: metav1.ObjectMeta{ - Name: resourceName, - Namespace: "default", - }, - // TODO(user): Specify other spec details if needed. - } - Expect(k8sClient.Create(ctx, resource)).To(Succeed()) - } - }) - - AfterEach(func() { - // TODO(user): Cleanup logic after each test, like removing the resource instance. - resource := &otcv1alpha1.NATGateway{} - err := k8sClient.Get(ctx, typeNamespacedName, resource) - Expect(err).NotTo(HaveOccurred()) - - By("Cleanup the specific resource instance NATGateway") - Expect(k8sClient.Delete(ctx, resource)).To(Succeed()) - }) - It("should successfully reconcile the resource", func() { - By("Reconciling the created resource") - controllerReconciler := &NATGatewayReconciler{ - Client: k8sClient, - Scheme: k8sClient.Scheme(), - } - - _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{ - NamespacedName: typeNamespacedName, - }) - Expect(err).NotTo(HaveOccurred()) - // TODO(user): Add more specific assertions depending on your controller's reconciliation logic. - // Example: If you expect a certain status condition after reconciliation, verify it here. - }) - }) -}) +var _ = Describe("NATGateway Controller", func() {}) diff --git a/internal/controller/network_controller_test.go b/internal/controller/network_controller_test.go index 1fbcd57..bc3070e 100644 --- a/internal/controller/network_controller_test.go +++ b/internal/controller/network_controller_test.go @@ -1,68 +1,7 @@ package controller import ( - "context" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - otcv1alpha1 "github.com/peertech.de/otc-operator/api/v1alpha1" ) -var _ = Describe("Network Controller", func() { - Context("When reconciling a resource", func() { - const resourceName = "test-resource" - - ctx := context.Background() - - typeNamespacedName := types.NamespacedName{ - Name: resourceName, - Namespace: "default", // TODO(user):Modify as needed - } - network := &otcv1alpha1.Network{} - - BeforeEach(func() { - By("creating the custom resource for the Kind Network") - err := k8sClient.Get(ctx, typeNamespacedName, network) - if err != nil && errors.IsNotFound(err) { - resource := &otcv1alpha1.Network{ - ObjectMeta: metav1.ObjectMeta{ - Name: resourceName, - Namespace: "default", - }, - // TODO(user): Specify other spec details if needed. - } - Expect(k8sClient.Create(ctx, resource)).To(Succeed()) - } - }) - - AfterEach(func() { - // TODO(user): Cleanup logic after each test, like removing the resource instance. - resource := &otcv1alpha1.Network{} - err := k8sClient.Get(ctx, typeNamespacedName, resource) - Expect(err).NotTo(HaveOccurred()) - - By("Cleanup the specific resource instance Network") - Expect(k8sClient.Delete(ctx, resource)).To(Succeed()) - }) - It("should successfully reconcile the resource", func() { - By("Reconciling the created resource") - controllerReconciler := &NetworkReconciler{ - Client: k8sClient, - Scheme: k8sClient.Scheme(), - } - - _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{ - NamespacedName: typeNamespacedName, - }) - Expect(err).NotTo(HaveOccurred()) - // TODO(user): Add more specific assertions depending on your controller's reconciliation logic. - // Example: If you expect a certain status condition after reconciliation, verify it here. - }) - }) -}) +var _ = Describe("Network Controller", func() {}) diff --git a/internal/controller/providerconfig_controller_test.go b/internal/controller/providerconfig_controller_test.go index ca224eb..5f6f43b 100644 --- a/internal/controller/providerconfig_controller_test.go +++ b/internal/controller/providerconfig_controller_test.go @@ -1,68 +1,7 @@ package controller import ( - "context" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - otcv1alpha1 "github.com/peertech.de/otc-operator/api/v1alpha1" ) -var _ = Describe("ProviderConfig Controller", func() { - Context("When reconciling a resource", func() { - const resourceName = "test-resource" - - ctx := context.Background() - - typeNamespacedName := types.NamespacedName{ - Name: resourceName, - Namespace: "default", // TODO(user):Modify as needed - } - providerconfig := &otcv1alpha1.ProviderConfig{} - - BeforeEach(func() { - By("creating the custom resource for the Kind ProviderConfig") - err := k8sClient.Get(ctx, typeNamespacedName, providerconfig) - if err != nil && errors.IsNotFound(err) { - resource := &otcv1alpha1.ProviderConfig{ - ObjectMeta: metav1.ObjectMeta{ - Name: resourceName, - Namespace: "default", - }, - // TODO(user): Specify other spec details if needed. - } - Expect(k8sClient.Create(ctx, resource)).To(Succeed()) - } - }) - - AfterEach(func() { - // TODO(user): Cleanup logic after each test, like removing the resource instance. - resource := &otcv1alpha1.ProviderConfig{} - err := k8sClient.Get(ctx, typeNamespacedName, resource) - Expect(err).NotTo(HaveOccurred()) - - By("Cleanup the specific resource instance ProviderConfig") - Expect(k8sClient.Delete(ctx, resource)).To(Succeed()) - }) - It("should successfully reconcile the resource", func() { - By("Reconciling the created resource") - controllerReconciler := &ProviderConfigReconciler{ - Client: k8sClient, - Scheme: k8sClient.Scheme(), - } - - _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{ - NamespacedName: typeNamespacedName, - }) - Expect(err).NotTo(HaveOccurred()) - // TODO(user): Add more specific assertions depending on your controller's reconciliation logic. - // Example: If you expect a certain status condition after reconciliation, verify it here. - }) - }) -}) +var _ = Describe("ProviderConfig Controller", func() {}) diff --git a/internal/controller/publicip_controller_test.go b/internal/controller/publicip_controller_test.go index 93c86bb..7f275b6 100644 --- a/internal/controller/publicip_controller_test.go +++ b/internal/controller/publicip_controller_test.go @@ -1,68 +1,7 @@ package controller import ( - "context" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - otcv1alpha1 "github.com/peertech.de/otc-operator/api/v1alpha1" ) -var _ = Describe("PublicIP Controller", func() { - Context("When reconciling a resource", func() { - const resourceName = "test-resource" - - ctx := context.Background() - - typeNamespacedName := types.NamespacedName{ - Name: resourceName, - Namespace: "default", // TODO(user):Modify as needed - } - publicip := &otcv1alpha1.PublicIP{} - - BeforeEach(func() { - By("creating the custom resource for the Kind PublicIP") - err := k8sClient.Get(ctx, typeNamespacedName, publicip) - if err != nil && errors.IsNotFound(err) { - resource := &otcv1alpha1.PublicIP{ - ObjectMeta: metav1.ObjectMeta{ - Name: resourceName, - Namespace: "default", - }, - // TODO(user): Specify other spec details if needed. - } - Expect(k8sClient.Create(ctx, resource)).To(Succeed()) - } - }) - - AfterEach(func() { - // TODO(user): Cleanup logic after each test, like removing the resource instance. - resource := &otcv1alpha1.PublicIP{} - err := k8sClient.Get(ctx, typeNamespacedName, resource) - Expect(err).NotTo(HaveOccurred()) - - By("Cleanup the specific resource instance PublicIP") - Expect(k8sClient.Delete(ctx, resource)).To(Succeed()) - }) - It("should successfully reconcile the resource", func() { - By("Reconciling the created resource") - controllerReconciler := &PublicIPReconciler{ - Client: k8sClient, - Scheme: k8sClient.Scheme(), - } - - _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{ - NamespacedName: typeNamespacedName, - }) - Expect(err).NotTo(HaveOccurred()) - // TODO(user): Add more specific assertions depending on your controller's reconciliation logic. - // Example: If you expect a certain status condition after reconciliation, verify it here. - }) - }) -}) +var _ = Describe("PublicIP Controller", func() {}) diff --git a/internal/controller/securitygroup_controller_test.go b/internal/controller/securitygroup_controller_test.go index 10bade3..d8dfc0d 100644 --- a/internal/controller/securitygroup_controller_test.go +++ b/internal/controller/securitygroup_controller_test.go @@ -1,68 +1,7 @@ package controller import ( - "context" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - otcv1alpha1 "github.com/peertech.de/otc-operator/api/v1alpha1" ) -var _ = Describe("SecurityGroup Controller", func() { - Context("When reconciling a resource", func() { - const resourceName = "test-resource" - - ctx := context.Background() - - typeNamespacedName := types.NamespacedName{ - Name: resourceName, - Namespace: "default", // TODO(user):Modify as needed - } - securitygroup := &otcv1alpha1.SecurityGroup{} - - BeforeEach(func() { - By("creating the custom resource for the Kind SecurityGroup") - err := k8sClient.Get(ctx, typeNamespacedName, securitygroup) - if err != nil && errors.IsNotFound(err) { - resource := &otcv1alpha1.SecurityGroup{ - ObjectMeta: metav1.ObjectMeta{ - Name: resourceName, - Namespace: "default", - }, - // TODO(user): Specify other spec details if needed. - } - Expect(k8sClient.Create(ctx, resource)).To(Succeed()) - } - }) - - AfterEach(func() { - // TODO(user): Cleanup logic after each test, like removing the resource instance. - resource := &otcv1alpha1.SecurityGroup{} - err := k8sClient.Get(ctx, typeNamespacedName, resource) - Expect(err).NotTo(HaveOccurred()) - - By("Cleanup the specific resource instance SecurityGroup") - Expect(k8sClient.Delete(ctx, resource)).To(Succeed()) - }) - It("should successfully reconcile the resource", func() { - By("Reconciling the created resource") - controllerReconciler := &SecurityGroupReconciler{ - Client: k8sClient, - Scheme: k8sClient.Scheme(), - } - - _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{ - NamespacedName: typeNamespacedName, - }) - Expect(err).NotTo(HaveOccurred()) - // TODO(user): Add more specific assertions depending on your controller's reconciliation logic. - // Example: If you expect a certain status condition after reconciliation, verify it here. - }) - }) -}) +var _ = Describe("SecurityGroup Controller", func() {}) diff --git a/internal/controller/securitygrouprule_controller_test.go b/internal/controller/securitygrouprule_controller_test.go index b4d99b4..b701201 100644 --- a/internal/controller/securitygrouprule_controller_test.go +++ b/internal/controller/securitygrouprule_controller_test.go @@ -1,68 +1,7 @@ package controller import ( - "context" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - otcv1alpha1 "github.com/peertech.de/otc-operator/api/v1alpha1" ) -var _ = Describe("SecurityGroupRule Controller", func() { - Context("When reconciling a resource", func() { - const resourceName = "test-resource" - - ctx := context.Background() - - typeNamespacedName := types.NamespacedName{ - Name: resourceName, - Namespace: "default", // TODO(user):Modify as needed - } - securitygrouprule := &otcv1alpha1.SecurityGroupRule{} - - BeforeEach(func() { - By("creating the custom resource for the Kind SecurityGroupRule") - err := k8sClient.Get(ctx, typeNamespacedName, securitygrouprule) - if err != nil && errors.IsNotFound(err) { - resource := &otcv1alpha1.SecurityGroupRule{ - ObjectMeta: metav1.ObjectMeta{ - Name: resourceName, - Namespace: "default", - }, - // TODO(user): Specify other spec details if needed. - } - Expect(k8sClient.Create(ctx, resource)).To(Succeed()) - } - }) - - AfterEach(func() { - // TODO(user): Cleanup logic after each test, like removing the resource instance. - resource := &otcv1alpha1.SecurityGroupRule{} - err := k8sClient.Get(ctx, typeNamespacedName, resource) - Expect(err).NotTo(HaveOccurred()) - - By("Cleanup the specific resource instance SecurityGroupRule") - Expect(k8sClient.Delete(ctx, resource)).To(Succeed()) - }) - It("should successfully reconcile the resource", func() { - By("Reconciling the created resource") - controllerReconciler := &SecurityGroupRuleReconciler{ - Client: k8sClient, - Scheme: k8sClient.Scheme(), - } - - _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{ - NamespacedName: typeNamespacedName, - }) - Expect(err).NotTo(HaveOccurred()) - // TODO(user): Add more specific assertions depending on your controller's reconciliation logic. - // Example: If you expect a certain status condition after reconciliation, verify it here. - }) - }) -}) +var _ = Describe("SecurityGroupRule Controller", func() {}) diff --git a/internal/controller/snatrule_controller_test.go b/internal/controller/snatrule_controller_test.go index a1d900f..4964901 100644 --- a/internal/controller/snatrule_controller_test.go +++ b/internal/controller/snatrule_controller_test.go @@ -1,68 +1,8 @@ package controller import ( - "context" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - otcv1alpha1 "github.com/peertech.de/otc-operator/api/v1alpha1" ) var _ = Describe("SNATRule Controller", func() { - Context("When reconciling a resource", func() { - const resourceName = "test-resource" - - ctx := context.Background() - - typeNamespacedName := types.NamespacedName{ - Name: resourceName, - Namespace: "default", // TODO(user):Modify as needed - } - snatrule := &otcv1alpha1.SNATRule{} - - BeforeEach(func() { - By("creating the custom resource for the Kind SNATRule") - err := k8sClient.Get(ctx, typeNamespacedName, snatrule) - if err != nil && errors.IsNotFound(err) { - resource := &otcv1alpha1.SNATRule{ - ObjectMeta: metav1.ObjectMeta{ - Name: resourceName, - Namespace: "default", - }, - // TODO(user): Specify other spec details if needed. - } - Expect(k8sClient.Create(ctx, resource)).To(Succeed()) - } - }) - - AfterEach(func() { - // TODO(user): Cleanup logic after each test, like removing the resource instance. - resource := &otcv1alpha1.SNATRule{} - err := k8sClient.Get(ctx, typeNamespacedName, resource) - Expect(err).NotTo(HaveOccurred()) - - By("Cleanup the specific resource instance SNATRule") - Expect(k8sClient.Delete(ctx, resource)).To(Succeed()) - }) - It("should successfully reconcile the resource", func() { - By("Reconciling the created resource") - controllerReconciler := &SNATRuleReconciler{ - Client: k8sClient, - Scheme: k8sClient.Scheme(), - } - - _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{ - NamespacedName: typeNamespacedName, - }) - Expect(err).NotTo(HaveOccurred()) - // TODO(user): Add more specific assertions depending on your controller's reconciliation logic. - // Example: If you expect a certain status condition after reconciliation, verify it here. - }) - }) }) diff --git a/internal/controller/subnet_controller_test.go b/internal/controller/subnet_controller_test.go index 02b14ad..bed3f37 100644 --- a/internal/controller/subnet_controller_test.go +++ b/internal/controller/subnet_controller_test.go @@ -1,68 +1,7 @@ package controller import ( - "context" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - otcv1alpha1 "github.com/peertech.de/otc-operator/api/v1alpha1" ) -var _ = Describe("Subnet Controller", func() { - Context("When reconciling a resource", func() { - const resourceName = "test-resource" - - ctx := context.Background() - - typeNamespacedName := types.NamespacedName{ - Name: resourceName, - Namespace: "default", // TODO(user):Modify as needed - } - subnet := &otcv1alpha1.Subnet{} - - BeforeEach(func() { - By("creating the custom resource for the Kind Subnet") - err := k8sClient.Get(ctx, typeNamespacedName, subnet) - if err != nil && errors.IsNotFound(err) { - resource := &otcv1alpha1.Subnet{ - ObjectMeta: metav1.ObjectMeta{ - Name: resourceName, - Namespace: "default", - }, - // TODO(user): Specify other spec details if needed. - } - Expect(k8sClient.Create(ctx, resource)).To(Succeed()) - } - }) - - AfterEach(func() { - // TODO(user): Cleanup logic after each test, like removing the resource instance. - resource := &otcv1alpha1.Subnet{} - err := k8sClient.Get(ctx, typeNamespacedName, resource) - Expect(err).NotTo(HaveOccurred()) - - By("Cleanup the specific resource instance Subnet") - Expect(k8sClient.Delete(ctx, resource)).To(Succeed()) - }) - It("should successfully reconcile the resource", func() { - By("Reconciling the created resource") - controllerReconciler := &SubnetReconciler{ - Client: k8sClient, - Scheme: k8sClient.Scheme(), - } - - _, err := controllerReconciler.Reconcile(ctx, reconcile.Request{ - NamespacedName: typeNamespacedName, - }) - Expect(err).NotTo(HaveOccurred()) - // TODO(user): Add more specific assertions depending on your controller's reconciliation logic. - // Example: If you expect a certain status condition after reconciliation, verify it here. - }) - }) -}) +var _ = Describe("Subnet Controller", func() {})