add support for Kubernetes TLS keys for flux create secret tls
Add support for using `tls.key`, `tls.crt` and `ca.crt` keys while generating a Secret, using the `--tls-key-file`, `--tls-crt-file` and `--ca-crt-file` flags respectively. Mark the flags `--key-file`, `--cert-file` and `--ca-file` as deprecated. Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
This commit is contained in:
@@ -33,13 +33,19 @@ const (
|
||||
const (
|
||||
UsernameSecretKey = "username"
|
||||
PasswordSecretKey = "password"
|
||||
CAFileSecretKey = "caFile"
|
||||
CertFileSecretKey = "certFile"
|
||||
KeyFileSecretKey = "keyFile"
|
||||
CACrtSecretKey = "ca.crt"
|
||||
TlsCrtSecretKey = "tls.crt"
|
||||
TlsKeySecretKey = "tls.key"
|
||||
PrivateKeySecretKey = "identity"
|
||||
PublicKeySecretKey = "identity.pub"
|
||||
KnownHostsSecretKey = "known_hosts"
|
||||
BearerTokenKey = "bearerToken"
|
||||
|
||||
// Depreacted: These keys are used in the generated secrets if the
|
||||
// command was invoked with the deprecated TLS flags.
|
||||
CAFileSecretKey = "caFile"
|
||||
CertFileSecretKey = "certFile"
|
||||
KeyFileSecretKey = "keyFile"
|
||||
)
|
||||
|
||||
type Options struct {
|
||||
@@ -54,12 +60,18 @@ type Options struct {
|
||||
Keypair *ssh.KeyPair
|
||||
Username string
|
||||
Password string
|
||||
CAFile []byte
|
||||
CertFile []byte
|
||||
KeyFile []byte
|
||||
CACrt []byte
|
||||
TlsCrt []byte
|
||||
TlsKey []byte
|
||||
TargetPath string
|
||||
ManifestFile string
|
||||
BearerToken string
|
||||
|
||||
// Depreacted: These fields are used to store TLS data that
|
||||
// specified by the deprecated TLS flags.
|
||||
CAFile []byte
|
||||
CertFile []byte
|
||||
KeyFile []byte
|
||||
}
|
||||
|
||||
func MakeDefaultOptions() Options {
|
||||
|
||||
Reference in New Issue
Block a user