Skip to content

Commit

Permalink
Fix secret reconciliation for new shoots (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
maboehm authored Aug 2, 2024
1 parent 15feec8 commit 4ea9514
Showing 1 changed file with 11 additions and 5 deletions.
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

0 comments on commit 4ea9514

Please sign in to comment.