Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions api/v2/types_firewalldeployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions controllers/deployment/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ 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)
}

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()
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions controllers/deployment/recreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions controllers/deployment/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}()

Expand Down
4 changes: 2 additions & 2 deletions controllers/deployment/rolling.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions controllers/deployment/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
30 changes: 15 additions & 15 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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())
Expand All @@ -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())
Expand Down Expand Up @@ -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())
Expand All @@ -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())
Expand All @@ -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())
Expand Down Expand Up @@ -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())
Expand All @@ -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())
Expand All @@ -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())
Expand Down Expand Up @@ -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())
Expand All @@ -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())
Expand All @@ -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())
Expand Down Expand Up @@ -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())
Expand All @@ -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())
Expand All @@ -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())
Expand Down
Loading