Skip to content

Commit

Permalink
Enable custom aws route controller manager if no provider config is s…
Browse files Browse the repository at this point in the history
…pecified.

The custom aws route controller manager is essential to the shoot cluster
working without overlay network. Therefore, it needs to be enabled regardless
if there is a provider configuration or not. Otherwise, shoot clusters will
get no overlay, but no pod routes.
  • Loading branch information
ScheererJ committed Sep 19, 2022
1 parent 315d219 commit 0f5bd88
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions pkg/webhook/controlplane/ensurer.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,25 +667,25 @@ func (c *controlPlaneMutator) Mutate(ctx context.Context, new, old client.Object
if greaterEqual122 {
switch x.Name {
case cluster.Shoot.Name:
config := &awsv1alpha1.ControlPlaneConfig{
TypeMeta: metav1.TypeMeta{
APIVersion: awsv1alpha1.SchemeGroupVersion.String(),
Kind: "ControlPlaneConfig",
},
}
if x.Spec.ProviderConfig != nil && x.Spec.ProviderConfig.Raw != nil {
config := &awsv1alpha1.ControlPlaneConfig{
TypeMeta: metav1.TypeMeta{
APIVersion: awsv1alpha1.SchemeGroupVersion.String(),
Kind: "ControlPlaneConfig",
},
}
if _, _, err := decoder.Decode(x.Spec.ProviderConfig.Raw, nil, config); err != nil {
return err
}
if config.CloudControllerManager == nil {
config.CloudControllerManager = &awsv1alpha1.CloudControllerManagerConfig{}
}
if config.CloudControllerManager.UseCustomRouteController == nil {
extensionswebhook.LogMutation(c.logger, x.Kind, x.Namespace, x.Name)
config.CloudControllerManager.UseCustomRouteController = pointer.Bool(true)
x.Spec.ProviderConfig = &runtime.RawExtension{
Object: config,
}
}
if config.CloudControllerManager == nil {
config.CloudControllerManager = &awsv1alpha1.CloudControllerManagerConfig{}
}
if config.CloudControllerManager.UseCustomRouteController == nil {
extensionswebhook.LogMutation(c.logger, x.Kind, x.Namespace, x.Name)
config.CloudControllerManager.UseCustomRouteController = pointer.Bool(true)
x.Spec.ProviderConfig = &runtime.RawExtension{
Object: config,
}
}
}
Expand Down

0 comments on commit 0f5bd88

Please sign in to comment.