Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pluralsh/deployment-operator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.5.10
Choose a base ref
...
head repository: pluralsh/deployment-operator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.5.11
Choose a head ref
  • 2 commits
  • 7 files changed
  • 3 contributors

Commits on Feb 10, 2025

  1. Updated chart to release v0.5.10 (#367)

    Co-authored-by: michaeljguarino <michaeljguarino@users.noreply.github.com>
    github-actions[bot] and michaeljguarino authored Feb 10, 2025
    Copy the full SHA
    b7210e6 View commit details

Commits on Feb 11, 2025

  1. chore: remove more low-signal logs and change health rules for status…

    … condition (#368)
    
    * remove more low-signal logs
    
    * add unit test
    zreigz authored Feb 11, 2025
    Copy the full SHA
    468abb0 View commit details
4 changes: 2 additions & 2 deletions charts/deployment-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: deployment-operator
description: creates a new instance of the plural deployment operator
appVersion: 0.5.9
version: 0.5.9
appVersion: 0.5.10
version: 0.5.10
maintainers:
- name: Plural
url: https://www.plural.sh
10 changes: 9 additions & 1 deletion pkg/common/health.go
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"strings"
"time"

"github.com/argoproj/argo-rollouts/pkg/apis/rollouts"
rolloutv1alpha1 "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1"
@@ -896,8 +897,15 @@ func GetOtherHealthStatus(obj *unstructured.Unstructured) (*HealthStatus, error)
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(s, &sts); err != nil {
return defaultReadyStatus, nil
}
if meta.FindStatusCondition(sts.Conditions, readyCondition) != nil {
if cond := meta.FindStatusCondition(sts.Conditions, readyCondition); cond != nil {
status := HealthStatusProgressing

// status older than 5min
cutoffTime := metav1.NewTime(time.Now().Add(-5 * time.Minute))
if cond.LastTransitionTime.Before(&cutoffTime) {
status = HealthStatusDegraded
}

if meta.IsStatusConditionTrue(sts.Conditions, readyCondition) {
status = HealthStatusHealthy
}
28 changes: 25 additions & 3 deletions pkg/common/health_test.go
Original file line number Diff line number Diff line change
@@ -49,12 +49,13 @@ var _ = Describe("Health Test", Ordered, func() {
}))
})

It("should get healthy status from CRD with condition block", func() {
It("should get progressing status from CRD with condition block", func() {
customResource.Status = deploymentsv1alpha1.MetricsAggregateStatus{
Conditions: []metav1.Condition{
{
Type: "Ready",
Status: "False",
Type: "Ready",
Status: "False",
LastTransitionTime: metav1.Now(),
},
},
}
@@ -68,6 +69,27 @@ var _ = Describe("Health Test", Ordered, func() {
}))
})

It("should get degraded status from CRD with condition block", func() {
sixMinutesAgo := metav1.NewTime(time.Now().Add(-6 * time.Minute))
customResource.Status = deploymentsv1alpha1.MetricsAggregateStatus{
Conditions: []metav1.Condition{
{
Type: "Ready",
Status: "False",
LastTransitionTime: sixMinutesAgo,
},
},
}
obj, err := common.ToUnstructured(customResource)
Expect(err).NotTo(HaveOccurred())
status, err := common.GetResourceHealth(obj)
Expect(err).NotTo(HaveOccurred())
Expect(status).To(Not(BeNil()))
Expect(*status).To(Equal(common.HealthStatus{
Status: common.HealthStatusDegraded,
}))
})

It("should get HealthStatusProgressing status during deletion", func() {
customResource.DeletionTimestamp = &metav1.Time{
Time: time.Now(),
4 changes: 2 additions & 2 deletions pkg/controller/namespaces/reconciler.go
Original file line number Diff line number Diff line change
@@ -85,7 +85,7 @@ func (n *NamespaceReconciler) ShutdownQueue() {

func (n *NamespaceReconciler) ListNamespaces(ctx context.Context) *algorithms.Pager[*console.ManagedNamespaceEdgeFragment] {
logger := log.FromContext(ctx)
logger.Info("create namespace pager")
logger.V(4).Info("create namespace pager")
fetch := func(page *string, size int64) ([]*console.ManagedNamespaceEdgeFragment, *algorithms.PageInfo, error) {
resp, err := n.consoleClient.ListNamespaces(page, &size)
if err != nil {
@@ -104,7 +104,7 @@ func (n *NamespaceReconciler) ListNamespaces(ctx context.Context) *algorithms.Pa

func (n *NamespaceReconciler) Poll(ctx context.Context) error {
logger := log.FromContext(ctx)
logger.Info("fetching namespaces")
logger.V(4).Info("fetching namespaces")
pager := n.ListNamespaces(ctx)

for pager.HasNext() {
4 changes: 2 additions & 2 deletions pkg/controller/pipelinegates/reconciler.go
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ func (s *GateReconciler) GetPollInterval() time.Duration {

func (s *GateReconciler) ListGates(ctx context.Context) *algorithms.Pager[*console.PipelineGateIDsEdgeFragment] {
logger := log.FromContext(ctx)
logger.Info("create pipeline gate pager")
logger.V(4).Info("create pipeline gate pager")
fetch := func(page *string, size int64) ([]*console.PipelineGateIDsEdgeFragment, *algorithms.PageInfo, error) {
resp, err := s.consoleClient.GetClusterGates(page, &size)
if err != nil {
@@ -106,7 +106,7 @@ func (s *GateReconciler) ListGates(ctx context.Context) *algorithms.Pager[*conso

func (s *GateReconciler) Poll(ctx context.Context) error {
logger := log.FromContext(ctx)
logger.V(1).Info("fetching gates for cluster")
logger.V(4).Info("fetching gates for cluster")

pager := s.ListGates(ctx)

2 changes: 1 addition & 1 deletion pkg/controller/service/reconciler_status.go
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@ func (s *ServiceReconciler) UpdateApplyStatus(
} else {
msg := fmt.Sprintf("%s apply %s: %s\n", resourceIDToString(gk, name),
strings.ToLower(e.ApplyEvent.Status.String()), e.ApplyEvent.Error.Error())
logger.Info(msg)
logger.V(4).Info(msg)
}
} else if printStatus {
logger.Info(resourceIDToString(gk, name),
8 changes: 4 additions & 4 deletions pkg/controller/stacks/reconciler.go
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ func (r *StackReconciler) ShutdownQueue() {

func (r *StackReconciler) ListStacks(ctx context.Context) *algorithms.Pager[*console.MinimalStackRunEdgeFragment] {
logger := log.FromContext(ctx)
logger.Info("create stack run pager")
logger.V(4).Info("create stack run pager")
fetch := func(page *string, size int64) ([]*console.MinimalStackRunEdgeFragment, *algorithms.PageInfo, error) {
resp, err := r.consoleClient.ListClusterStackRuns(page, &size)
if err != nil {
@@ -109,7 +109,7 @@ func (r *StackReconciler) ListStacks(ctx context.Context) *algorithms.Pager[*con

func (r *StackReconciler) Poll(ctx context.Context) error {
logger := log.FromContext(ctx)
logger.Info("fetching stacks")
logger.V(4).Info("fetching stacks")
pager := r.ListStacks(ctx)

for pager.HasNext() {
@@ -119,7 +119,7 @@ func (r *StackReconciler) Poll(ctx context.Context) error {
return err
}
for _, stack := range stacks {
logger.Info("sending update for", "stack run", stack.Node.ID)
logger.V(1).Info("sending update for", "stack run", stack.Node.ID)
r.stackCache.Add(stack.Node.ID, stack.Node)
r.stackQueue.Add(stack.Node.ID)
}
@@ -130,7 +130,7 @@ func (r *StackReconciler) Poll(ctx context.Context) error {

func (r *StackReconciler) Reconcile(ctx context.Context, id string) (reconcile.Result, error) {
logger := log.FromContext(ctx)
logger.Info("attempting to sync stack run", "id", id)
logger.V(4).Info("attempting to sync stack run", "id", id)
stackRun, err := r.stackCache.Get(id)
if err != nil {
if clienterrors.IsNotFound(err) {