Skip to content

Commit

Permalink
Merge pull request #66 from take-five/fix-ess-alpha-feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanduplessis authored Oct 7, 2024
2 parents 5f796fa + 677b5dc commit c59039a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions cmd/provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,20 @@ func main() {
SetupFn: clients.TerraformSetupBuilder(*terraformVersion, *providerSource, *providerVersion),
}

o.ESSOptions = &tjcontroller.ESSOptions{}
if *essTLSCertsPath != "" {
log.Info("ESS TLS certificates path is set. Loading mTLS configuration.")
tCfg, err := certificates.LoadMTLSConfig(filepath.Join(*essTLSCertsPath, "ca.crt"), filepath.Join(*essTLSCertsPath, "tls.crt"), filepath.Join(*essTLSCertsPath, "tls.key"), false)
kingpin.FatalIfError(err, "Cannot load ESS TLS config.")

o.ESSOptions.TLSConfig = tCfg
}

if *enableExternalSecretStores {
o.Features.Enable(features.EnableAlphaExternalSecretStores)
o.SecretStoreConfigGVK = &v1alpha1.StoreConfigGroupVersionKind
log.Info("Alpha feature enabled", "flag", features.EnableAlphaExternalSecretStores)

o.ESSOptions = &tjcontroller.ESSOptions{}
if *essTLSCertsPath != "" {
log.Info("ESS TLS certificates path is set. Loading mTLS configuration.")
tCfg, err := certificates.LoadMTLSConfig(filepath.Join(*essTLSCertsPath, "ca.crt"), filepath.Join(*essTLSCertsPath, "tls.crt"), filepath.Join(*essTLSCertsPath, "tls.key"), false)
kingpin.FatalIfError(err, "Cannot load ESS TLS config.")

o.ESSOptions.TLSConfig = tCfg
}

// Ensure default store config exists.
kingpin.FatalIfError(resource.Ignore(kerrors.IsAlreadyExists, mgr.GetClient().Create(context.Background(), &v1alpha1.StoreConfig{
ObjectMeta: metav1.ObjectMeta{
Expand Down

0 comments on commit c59039a

Please sign in to comment.