Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KIM Integration - using imported constants #1094

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
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ func (s *CreateRuntimeResourceStep) createLabelsForRuntime(operation internal.Op
"operator.kyma-project.io/kyma-name": kymaName,
}
if s.kimConfig.ViewOnly && !s.kimConfig.IsDrivenByKimOnly(broker.PlanNamesMapping[operation.ProvisioningParameters.PlanID]) {
labels["kyma-project.io/controlled-by-provisioner"] = "true"
labels[imv1.LabelControlledByProvisioner] = "true"
} else {
labels["kyma-project.io/controlled-by-provisioner"] = "false"
labels[imv1.LabelControlledByProvisioner] = "false"
}
return labels
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,14 +731,14 @@ func assertSecurityWithNetworkingFilter(t *testing.T, runtime imv1.Runtime, egre
func assertLabelsKIMDriven(t *testing.T, preOperation internal.Operation, runtime imv1.Runtime) {
assertLabels(t, preOperation, runtime)

provisionerDriven, ok := runtime.Labels["kyma-project.io/controlled-by-provisioner"]
provisionerDriven, ok := runtime.Labels[imv1.LabelControlledByProvisioner]
assert.True(t, ok && provisionerDriven == "false")
}

func assertLabelsProvisionerDriven(t *testing.T, preOperation internal.Operation, runtime imv1.Runtime) {
assertLabels(t, preOperation, runtime)

provisionerDriven, ok := runtime.Labels["kyma-project.io/controlled-by-provisioner"]
provisionerDriven, ok := runtime.Labels[imv1.LabelControlledByProvisioner]
assert.True(t, ok && provisionerDriven == "true")
}

Expand Down
4 changes: 1 addition & 3 deletions internal/process/steps/runtime_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)

const RuntimeResourceStateReady = "Ready"

func NewCheckRuntimeResourceStep(os storage.Operations, k8sClient client.Client, kimConfig broker.KimConfig, runtimeResourceStepTimeout time.Duration) *checkRuntimeResource {
return &checkRuntimeResource{
k8sClient: k8sClient,
Expand Down Expand Up @@ -52,7 +50,7 @@ func (s *checkRuntimeResource) Run(operation internal.Operation, log logrus.Fiel
// check status
state := runtime.Status.State
log.Infof("Runtime resource state: %s", state)
if state != RuntimeResourceStateReady {
if state != imv1.RuntimeStateReady {
if time.Since(operation.UpdatedAt) > s.runtimeResourceStepTimeout {
description := fmt.Sprintf("Waiting for Runtime resource (%s/%s) ready state timeout.", operation.KymaResourceNamespace, operation.RuntimeID)
log.Error(description)
Expand Down
Loading