Skip to content

Commit

Permalink
KIM Integration - adjustments to current KIM behavior (#1049)
Browse files Browse the repository at this point in the history
rebase
  • Loading branch information
jaroslaw-pieszka authored Aug 19, 2024
1 parent 983b4dc commit f8e1464
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions internal/process/provisioning/create_runtime_resource_step.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ func (s *CreateRuntimeResourceStep) createLabelsForRuntime(operation internal.Op
}
if s.kimConfig.ViewOnly && !s.kimConfig.IsDrivenByKimOnly(broker.PlanNamesMapping[operation.ProvisioningParameters.PlanID]) {
labels["kyma-project.io/controlled-by-provisioner"] = "true"
} else {
labels["kyma-project.io/controlled-by-provisioner"] = "false"
}
return labels
}
Expand Down Expand Up @@ -339,6 +341,8 @@ func (s *CreateRuntimeResourceStep) createNetworkingConfiguration(operation inte
Pods: DefaultIfParamNotSet(networking.DefaultPodsCIDR, networkingParams.PodsCidr),
Services: DefaultIfParamNotSet(networking.DefaultServicesCIDR, networkingParams.ServicesCidr),
Nodes: DefaultIfParamZero(networking.DefaultNodesCIDR, networkingParams.NodesCidr),
//TODO remove when KIM is ready with setting this value
Type: ptr.String("calico"),
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,15 @@ const (
)

var runtimeAdministrators = []string{"[email protected]", "[email protected]"}

var defaultNetworking = imv1.Networking{
Nodes: networking.DefaultNodesCIDR,
Pods: networking.DefaultPodsCIDR,
Services: networking.DefaultServicesCIDR,
//TODO: remove after KIM is handling this properly
Type: ptr.String("calico"),
}

var defaultOIDSConfig = internal.OIDCConfigDTO{
ClientID: "client-id-default",
GroupsClaim: "gc-default",
Expand Down Expand Up @@ -414,6 +418,8 @@ func TestCreateRuntimeResourceStep_Defaults_AWS_MultiZoneWithNetworking_ActualCr
Nodes: "192.168.48.0/20",
Pods: "10.104.0.0/24",
Services: "10.105.0.0/24",
//TODO remove after KIM is handling this properly
Type: ptr.String("calico"),
}, runtime.Spec.Shoot.Networking)

_, err = memoryStorage.Instances().GetByID(operation.InstanceID)
Expand Down Expand Up @@ -728,7 +734,7 @@ func assertLabelsKIMDriven(t *testing.T, preOperation internal.Operation, runtim
assertLabels(t, preOperation, runtime)

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

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

0 comments on commit f8e1464

Please sign in to comment.