mirror of
https://github.com/fluxcd/flux2.git
synced 2025-10-28 23:14:48 +08:00
Add --proxy-secret-ref to flux create source commands
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
@ -56,6 +56,7 @@ type sourceGitFlags struct {
|
||||
keyRSABits flags.RSAKeyBits
|
||||
keyECDSACurve flags.ECDSACurve
|
||||
secretRef string
|
||||
proxySecretRef string
|
||||
provider flags.SourceGitProvider
|
||||
caFile string
|
||||
privateKeyFile string
|
||||
@ -145,6 +146,7 @@ func init() {
|
||||
createSourceGitCmd.Flags().Var(&sourceGitArgs.keyRSABits, "ssh-rsa-bits", sourceGitArgs.keyRSABits.Description())
|
||||
createSourceGitCmd.Flags().Var(&sourceGitArgs.keyECDSACurve, "ssh-ecdsa-curve", sourceGitArgs.keyECDSACurve.Description())
|
||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.secretRef, "secret-ref", "", "the name of an existing secret containing SSH or basic credentials")
|
||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.proxySecretRef, "proxy-secret-ref", "", "the name of an existing secret containing the proxy address and credentials")
|
||||
createSourceGitCmd.Flags().Var(&sourceGitArgs.provider, "provider", sourceGitArgs.provider.Description())
|
||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.caFile, "ca-file", "", "path to TLS CA file used for validating self-signed certificates")
|
||||
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.privateKeyFile, "private-key-file", "", "path to a passwordless private key file used for authenticating to the Git SSH server")
|
||||
@ -244,6 +246,12 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
if sourceGitArgs.proxySecretRef != "" {
|
||||
gitRepository.Spec.ProxySecretRef = &meta.LocalObjectReference{
|
||||
Name: sourceGitArgs.proxySecretRef,
|
||||
}
|
||||
}
|
||||
|
||||
if provider := sourceGitArgs.provider.String(); provider != "" {
|
||||
gitRepository.Spec.Provider = provider
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user