Skip to content

Commit efa9968

Browse files
committed
allow overrides of filenames
1 parent 604709e commit efa9968

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

cmd/crossplane/core/core.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ import (
6161
"github.com/crossplane/crossplane/v2/internal/controller/protection"
6262
"github.com/crossplane/crossplane/v2/internal/engine"
6363
"github.com/crossplane/crossplane/v2/internal/features"
64-
"github.com/crossplane/crossplane/v2/internal/initializer"
6564
"github.com/crossplane/crossplane/v2/internal/metrics"
6665
"github.com/crossplane/crossplane/v2/internal/protection/usage"
6766
"github.com/crossplane/crossplane/v2/internal/transport"
@@ -123,6 +122,10 @@ type startCommand struct {
123122
TLSClientSecretName string `env:"TLS_CLIENT_SECRET_NAME" help:"The name of the TLS Secret that will be store Crossplane's client certificate."`
124123
TLSClientCertsDir string `env:"TLS_CLIENT_CERTS_DIR" help:"The path of the folder which will store TLS client certificate of Crossplane."`
125124

125+
TLSClientCACertFileName string `default:"ca.crt" env:"TLS_CLIENT_CA_CERT_FILENAME" help:"The filename of the CA certificate in the TLS client certs directory."`
126+
TLSClientCertFileName string `default:"tls.crt" env:"TLS_CLIENT_CERT_FILENAME" help:"The filename of the client certificate in the TLS client certs directory."`
127+
TLSClientKeyFileName string `default:"tls.key" env:"TLS_CLIENT_KEY_FILENAME" help:"The filename of the client private key in the TLS client certs directory."`
128+
126129
EnableDependencyVersionUpgrades bool `group:"Alpha Features:" help:"Enable support for upgrading dependency versions when the parent package is updated."`
127130
EnableDependencyVersionDowngrades bool `group:"Alpha Features:" help:"Enable support for upgrading and downgrading dependency versions when a dependent package is updated."`
128131
EnableSignatureVerification bool `group:"Alpha Features:" help:"Enable support for package signature verification via ImageConfig API."`
@@ -254,9 +257,9 @@ func (c *startCommand) Run(s *runtime.Scheme, log logging.Logger) error { //noli
254257
}
255258

256259
clienttls, err := certificates.LoadMTLSConfig(
257-
filepath.Join(c.TLSClientCertsDir, initializer.SecretKeyCACert),
258-
filepath.Join(c.TLSClientCertsDir, corev1.TLSCertKey),
259-
filepath.Join(c.TLSClientCertsDir, corev1.TLSPrivateKeyKey),
260+
filepath.Join(c.TLSClientCertsDir, c.TLSClientCACertFileName),
261+
filepath.Join(c.TLSClientCertsDir, c.TLSClientCertFileName),
262+
filepath.Join(c.TLSClientCertsDir, c.TLSClientKeyFileName),
260263
false)
261264
if err != nil {
262265
return errors.Wrap(err, "cannot load client TLS certificates")

0 commit comments

Comments
 (0)