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

🐛 Fix reconcile order for new Shoots #84

Merged
merged 1 commit into from
Aug 2, 2024
Merged
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
16 changes: 11 additions & 5 deletions pkg/controller/extension/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,25 @@ func (a *actuator) Reconcile(ctx context.Context, log logr.Logger, ext *extensio
return fmt.Errorf("error creating shoot client: %w", err)
}

if err := ReconcileSecrets(ctx, log, a.client, shootClient, ext.Namespace, config, cluster.Shoot.Spec.Resources); err != nil {
return fmt.Errorf("error reconciling secrets: %w", err)
}

if IsFluxBootstrapped(ext) {
log.V(1).Info("Flux installation has been bootstrapped already, skipping reconciliation of Flux resources")
log.V(1).Info("Flux installation has been bootstrapped already, will only reconcile secrets")

if err := ReconcileSecrets(ctx, log, a.client, shootClient, ext.Namespace, config, cluster.Shoot.Spec.Resources); err != nil {
return fmt.Errorf("error reconciling secrets: %w", err)
}

return nil
}

if err := InstallFlux(ctx, log, shootClient, config.Flux); err != nil {
return fmt.Errorf("error installing Flux: %w", err)
}

// secrets might be necessary for the source to get ready
if err := ReconcileSecrets(ctx, log, a.client, shootClient, ext.Namespace, config, cluster.Shoot.Spec.Resources); err != nil {
return fmt.Errorf("error reconciling secrets: %w", err)
}

if config.Source != nil {
if err := BootstrapSource(ctx, log, shootClient, config.Source); err != nil {
return fmt.Errorf("error bootstrappping Flux GitRepository: %w", err)
Expand Down