From ec613ae64520dfb1fb1bdfcfb0ac653499d21395 Mon Sep 17 00:00:00 2001 From: Gerrit Date: Fri, 29 May 2026 14:54:54 +0200 Subject: [PATCH] Fix typos in API constants. --- api/v2/types_firewalldeployment.go | 12 ++++++------ controllers/deployment/reconcile.go | 6 +++--- controllers/deployment/recreate.go | 4 ++-- controllers/deployment/resources.go | 4 ++-- controllers/deployment/rolling.go | 4 ++-- controllers/deployment/status.go | 4 ++-- integration/integration_test.go | 30 ++++++++++++++--------------- 7 files changed, 32 insertions(+), 32 deletions(-) diff --git a/api/v2/types_firewalldeployment.go b/api/v2/types_firewalldeployment.go index 69e01fa..408e1a9 100644 --- a/api/v2/types_firewalldeployment.go +++ b/api/v2/types_firewalldeployment.go @@ -80,12 +80,12 @@ type FirewallDeploymentStatus struct { } const ( - // FirewallDeplomentAvailable indicates whether the deployment has reached the desired amount of replicas or not. - FirewallDeplomentAvailable ConditionType = "Available" - // FirewallDeplomentAvailable indicates whether the deployment has reached the desired amount of replicas or not. - FirewallDeplomentProgressing ConditionType = "Progressing" - // FirewallDeplomentRBACProvisioned indicates whether the rbac permissions for the firewall-controller to communicate with the api server were provisioned. - FirewallDeplomentRBACProvisioned ConditionType = "RBACProvisioned" + // FirewallDeploymentAvailable indicates whether the deployment has reached the desired amount of replicas or not. + FirewallDeploymentAvailable ConditionType = "Available" + // FirewallDeploymentProgressing indicates whether the deployment has reached the desired amount of replicas or not. + FirewallDeploymentProgressing ConditionType = "Progressing" + // FirewallDeploymentRBACProvisioned indicates whether the rbac permissions for the firewall-controller to communicate with the api server were provisioned. + FirewallDeploymentRBACProvisioned ConditionType = "RBACProvisioned" ) // FirewallDeploymentList contains a list of firewalls deployments diff --git a/controllers/deployment/reconcile.go b/controllers/deployment/reconcile.go index 7ab6c5c..2c1ff6d 100644 --- a/controllers/deployment/reconcile.go +++ b/controllers/deployment/reconcile.go @@ -175,7 +175,7 @@ func (c *controller) createFirewallSet(r *controllers.Ctx[*v2.FirewallDeployment err = c.c.GetSeedClient().Create(r.Ctx, set, &client.CreateOptions{}) if err != nil { - cond := v2.NewCondition(v2.FirewallDeplomentProgressing, v2.ConditionFalse, "FirewallSetCreateError", fmt.Sprintf("Error creating firewall set: %s.", err)) + cond := v2.NewCondition(v2.FirewallDeploymentProgressing, v2.ConditionFalse, "FirewallSetCreateError", fmt.Sprintf("Error creating firewall set: %s.", err)) r.Target.Status.Conditions.Set(cond) return nil, fmt.Errorf("unable to create firewall set: %w", err) @@ -183,7 +183,7 @@ func (c *controller) createFirewallSet(r *controllers.Ctx[*v2.FirewallDeployment r.Log.Info("created new firewall set", "set-name", set.Name) - cond := v2.NewCondition(v2.FirewallDeplomentProgressing, v2.ConditionTrue, "NewFirewallSetCreated", fmt.Sprintf("Created new firewall set %q.", set.Name)) + cond := v2.NewCondition(v2.FirewallDeploymentProgressing, v2.ConditionTrue, "NewFirewallSetCreated", fmt.Sprintf("Created new firewall set %q.", set.Name)) r.Target.Status.Conditions.Set(cond) c.lastSetCreation[r.Target.Name] = time.Now() @@ -215,7 +215,7 @@ func (c *controller) syncFirewallSet(r *controllers.Ctx[*v2.FirewallDeployment], r.Log.Info("updated firewall set", "set-name", set.Name) - cond := v2.NewCondition(v2.FirewallDeplomentProgressing, v2.ConditionTrue, "FirewallSetUpdated", fmt.Sprintf("Updated firewall set %q.", set.Name)) + cond := v2.NewCondition(v2.FirewallDeploymentProgressing, v2.ConditionTrue, "FirewallSetUpdated", fmt.Sprintf("Updated firewall set %q.", set.Name)) r.Target.Status.Conditions.Set(cond) c.recorder.Eventf(set, nil, corev1.EventTypeNormal, "Update", "updating set", "updated firewall set %s", set.Name) diff --git a/controllers/deployment/recreate.go b/controllers/deployment/recreate.go index f5de6ba..53accd4 100644 --- a/controllers/deployment/recreate.go +++ b/controllers/deployment/recreate.go @@ -41,14 +41,14 @@ func (c *controller) recreateStrategy(r *controllers.Ctx[*v2.FirewallDeployment] r.Log.Info("set replicas are not yet ready") if time.Since(latestSet.CreationTimestamp.Time) > c.c.GetProgressDeadline() { - cond := v2.NewCondition(v2.FirewallDeplomentProgressing, v2.ConditionFalse, "ProgressDeadlineExceeded", fmt.Sprintf("FirewallSet %q has timed out progressing.", latestSet.Name)) + cond := v2.NewCondition(v2.FirewallDeploymentProgressing, v2.ConditionFalse, "ProgressDeadlineExceeded", fmt.Sprintf("FirewallSet %q has timed out progressing.", latestSet.Name)) r.Target.Status.Conditions.Set(cond) } return nil } - cond := v2.NewCondition(v2.FirewallDeplomentProgressing, v2.ConditionTrue, "NewFirewallSetAvailable", fmt.Sprintf("FirewallSet %q has successfully progressed.", latestSet.Name)) + cond := v2.NewCondition(v2.FirewallDeploymentProgressing, v2.ConditionTrue, "NewFirewallSetAvailable", fmt.Sprintf("FirewallSet %q has successfully progressed.", latestSet.Name)) r.Target.Status.Conditions.Set(cond) return nil diff --git a/controllers/deployment/resources.go b/controllers/deployment/resources.go index 0781b32..cab954c 100644 --- a/controllers/deployment/resources.go +++ b/controllers/deployment/resources.go @@ -16,13 +16,13 @@ func (c *controller) ensureFirewallControllerRBAC(r *controllers.Ctx[*v2.Firewal if err != nil { r.Log.Error(err, "unable to ensure firewall controller rbac") - cond := v2.NewCondition(v2.FirewallDeplomentRBACProvisioned, v2.ConditionFalse, "Error", fmt.Sprintf("RBAC resources could not be provisioned %s", err)) + cond := v2.NewCondition(v2.FirewallDeploymentRBACProvisioned, v2.ConditionFalse, "Error", fmt.Sprintf("RBAC resources could not be provisioned %s", err)) r.Target.Status.Conditions.Set(cond) return } - cond := v2.NewCondition(v2.FirewallDeplomentRBACProvisioned, v2.ConditionTrue, "Provisioned", "RBAC provisioned successfully.") + cond := v2.NewCondition(v2.FirewallDeploymentRBACProvisioned, v2.ConditionTrue, "Provisioned", "RBAC provisioned successfully.") r.Target.Status.Conditions.Set(cond) }() diff --git a/controllers/deployment/rolling.go b/controllers/deployment/rolling.go index 61c48a5..fc40f9b 100644 --- a/controllers/deployment/rolling.go +++ b/controllers/deployment/rolling.go @@ -37,14 +37,14 @@ func (c *controller) rollingUpdateStrategy(r *controllers.Ctx[*v2.FirewallDeploy r.Log.Info("set replicas are not yet ready") if time.Since(latestSet.CreationTimestamp.Time) > c.c.GetProgressDeadline() { - cond := v2.NewCondition(v2.FirewallDeplomentProgressing, v2.ConditionFalse, "ProgressDeadlineExceeded", fmt.Sprintf("FirewallSet %q has timed out progressing.", latestSet.Name)) + cond := v2.NewCondition(v2.FirewallDeploymentProgressing, v2.ConditionFalse, "ProgressDeadlineExceeded", fmt.Sprintf("FirewallSet %q has timed out progressing.", latestSet.Name)) r.Target.Status.Conditions.Set(cond) } return c.cleanupIntermediateSets(r, ownedSets) } - cond := v2.NewCondition(v2.FirewallDeplomentProgressing, v2.ConditionTrue, "NewFirewallSetAvailable", fmt.Sprintf("FirewallSet %q has successfully progressed.", latestSet.Name)) + cond := v2.NewCondition(v2.FirewallDeploymentProgressing, v2.ConditionTrue, "NewFirewallSetAvailable", fmt.Sprintf("FirewallSet %q has successfully progressed.", latestSet.Name)) r.Target.Status.Conditions.Set(cond) r.Log.Info("ensuring old sets are cleaned up") diff --git a/controllers/deployment/status.go b/controllers/deployment/status.go index abe1999..6b5a6bf 100644 --- a/controllers/deployment/status.go +++ b/controllers/deployment/status.go @@ -25,10 +25,10 @@ func (c *controller) setStatus(r *controllers.Ctx[*v2.FirewallDeployment], owned } if r.Target.Status.ReadyReplicas >= r.Target.Spec.Replicas { - cond := v2.NewCondition(v2.FirewallDeplomentAvailable, v2.ConditionTrue, "MinimumReplicasAvailable", "Deployment has minimum availability.") + cond := v2.NewCondition(v2.FirewallDeploymentAvailable, v2.ConditionTrue, "MinimumReplicasAvailable", "Deployment has minimum availability.") r.Target.Status.Conditions.Set(cond) } else { - cond := v2.NewCondition(v2.FirewallDeplomentAvailable, v2.ConditionFalse, "MinimumReplicasUnavailable", "Deployment does not have minimum availability.") + cond := v2.NewCondition(v2.FirewallDeploymentAvailable, v2.ConditionFalse, "MinimumReplicasUnavailable", "Deployment does not have minimum availability.") r.Target.Status.Conditions.Set(cond) } diff --git a/integration/integration_test.go b/integration/integration_test.go index 2ace787..5df6a7b 100644 --- a/integration/integration_test.go +++ b/integration/integration_test.go @@ -393,7 +393,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the rbac condition true", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentRBACProvisioned, v2.ConditionTrue, 5*time.Second) + }, v2.FirewallDeploymentRBACProvisioned, v2.ConditionTrue, 5*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero()) @@ -404,7 +404,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the available condition true", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentAvailable, v2.ConditionTrue, 5*time.Second) + }, v2.FirewallDeploymentAvailable, v2.ConditionTrue, 5*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero()) @@ -415,7 +415,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the progress condition true", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentProgressing, v2.ConditionTrue, 15*time.Second) + }, v2.FirewallDeploymentProgressing, v2.ConditionTrue, 15*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero()) @@ -685,7 +685,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the rbac condition true", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentRBACProvisioned, v2.ConditionTrue, 5*time.Second) + }, v2.FirewallDeploymentRBACProvisioned, v2.ConditionTrue, 5*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero()) @@ -696,7 +696,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the available condition false", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentAvailable, v2.ConditionFalse, 5*time.Second) + }, v2.FirewallDeploymentAvailable, v2.ConditionFalse, 5*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero()) @@ -707,7 +707,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the progress condition true", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentProgressing, v2.ConditionTrue, 15*time.Second) + }, v2.FirewallDeploymentProgressing, v2.ConditionTrue, 15*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero()) @@ -1132,7 +1132,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the rbac condition true", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentRBACProvisioned, v2.ConditionTrue, 5*time.Second) + }, v2.FirewallDeploymentRBACProvisioned, v2.ConditionTrue, 5*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero()) @@ -1143,7 +1143,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the available condition true", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentAvailable, v2.ConditionTrue, 5*time.Second) + }, v2.FirewallDeploymentAvailable, v2.ConditionTrue, 5*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero()) @@ -1154,7 +1154,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the progress condition true", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentProgressing, v2.ConditionTrue, 15*time.Second) + }, v2.FirewallDeploymentProgressing, v2.ConditionTrue, 15*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero()) @@ -1542,7 +1542,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the rbac condition true", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentRBACProvisioned, v2.ConditionTrue, 5*time.Second) + }, v2.FirewallDeploymentRBACProvisioned, v2.ConditionTrue, 5*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero()) @@ -1553,7 +1553,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the available condition true", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentAvailable, v2.ConditionTrue, 5*time.Second) + }, v2.FirewallDeploymentAvailable, v2.ConditionTrue, 5*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero()) @@ -1564,7 +1564,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the progress condition true", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentProgressing, v2.ConditionTrue, 15*time.Second) + }, v2.FirewallDeploymentProgressing, v2.ConditionTrue, 15*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero()) @@ -1882,7 +1882,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the rbac condition true", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentRBACProvisioned, v2.ConditionTrue, 5*time.Second) + }, v2.FirewallDeploymentRBACProvisioned, v2.ConditionTrue, 5*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero()) @@ -1893,7 +1893,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the available condition true", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentAvailable, v2.ConditionTrue, 5*time.Second) + }, v2.FirewallDeploymentAvailable, v2.ConditionTrue, 5*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero()) @@ -1904,7 +1904,7 @@ var _ = Context("integration test", Ordered, func() { It("should have the progress condition true", func() { cond := testcommon.WaitForCondition(k8sClient, ctx, deployment(), func(fd *v2.FirewallDeployment) v2.Conditions { return fd.Status.Conditions - }, v2.FirewallDeplomentProgressing, v2.ConditionTrue, 30*time.Second) + }, v2.FirewallDeploymentProgressing, v2.ConditionTrue, 30*time.Second) Expect(cond.LastTransitionTime).NotTo(BeZero()) Expect(cond.LastUpdateTime).NotTo(BeZero())