mirror of
https://github.com/fluxcd/flux2.git
synced 2025-11-02 10:48:03 +08:00
Generate image pull secret at bootstrap
Add an optional flag called `--registry-creds` to the bootstrap command for generating an image pull secret for container images stored in private registries. Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
@ -207,6 +207,14 @@ func (b *PlainGitBootstrapper) ReconcileComponents(ctx context.Context, manifest
|
||||
b.logger.Successf("installed components")
|
||||
}
|
||||
|
||||
// Reconcile image pull secret if needed
|
||||
if options.ImagePullSecret != "" && options.RegistryCredential != "" {
|
||||
if err := reconcileImagePullSecret(ctx, b.kube, options); err != nil {
|
||||
return fmt.Errorf("failed to reconcile image pull secret: %w", err)
|
||||
}
|
||||
b.logger.Successf("reconciled image pull secret %s", options.ImagePullSecret)
|
||||
}
|
||||
|
||||
b.logger.Successf("reconciled components")
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user