Skip to content

Commit

Permalink
fix: use ServiceStateType
Browse files Browse the repository at this point in the history
  • Loading branch information
rriski committed Sep 5, 2024
1 parent 81b510a commit 8c8a380
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion controllers/generic_service_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (h *genericServiceHandler) get(ctx context.Context, avn *aiven.Client, avnG
return nil, nil
}

status.State = "RUNNING" // overrides REBALANCING
status.State = service.ServiceStateTypeRunning // overrides REBALANCING
meta.SetStatusCondition(&status.Conditions,
getRunningCondition(metav1.ConditionTrue, "CheckRunning", "Instance is running on Aiven side"))

Expand Down
5 changes: 3 additions & 2 deletions tests/generic_service_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"testing"
"time"

"github.com/aiven/go-client-codegen/handler/service"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand All @@ -13,10 +14,10 @@ import (
"github.com/aiven/aiven-operator/api/v1alpha1"
)

const serviceRunningState = "RUNNING"
const serviceRunningState = service.ServiceStateTypeRunning

// serviceRunningStatesAiven these Aiven service states match to RUNNING state in kube
var serviceRunningStatesAiven = []string{"RUNNING", "REBALANCING"}
var serviceRunningStatesAiven = []service.ServiceStateType{service.ServiceStateTypeRunning, service.ServiceStateTypeRebalancing}

func getCreateServiceYaml(project, pgName string) string {
return fmt.Sprintf(`
Expand Down

0 comments on commit 8c8a380

Please sign in to comment.