Skip to content

Commit

Permalink
Merge pull request #453 from ggalakhov/backport-2.9
Browse files Browse the repository at this point in the history
[release-2.9] Expose flags to configure TLS
  • Loading branch information
GuptaManan100 authored Jul 27, 2023
2 parents 66c6ca9 + a5282cf commit 0fa5b71
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pkg/operator/controllermanager/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,33 @@ func InitFlags() {
}
}

// expose flags to configure TLS communication to topology service and vttablets
// vttablet set contains all required flags
vttabletFlags := servenv.GetFlagSetFor("vttablet")
tlsFlags := map[string]bool{
"tablet_manager_grpc_ca": false,
"tablet_manager_grpc_server_name": false,
"topo_global_server_address": false,
"topo_etcd_tls_ca": false,
"topo_etcd_tls_cert": false,
"topo_etcd_tls_key": false,
}
vttabletFlags.VisitAll(func(f *pflag.Flag) {
_, isRequired := tlsFlags[f.Name]
if isRequired {
isAlreadyAdded := pflag.CommandLine.Lookup(f.Name) != nil
if !isAlreadyAdded {
pflag.CommandLine.AddFlag(f)
tlsFlags[f.Name] = true
}
}
})
for flagName, wasAdded := range tlsFlags {
if !wasAdded {
fmt.Fprintf(os.Stderr, "unable to add the flag - %s\n", flagName)
}
}

// Add flags registered by imported packages (e.g. glog and
// controller-runtime)
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
Expand Down

0 comments on commit 0fa5b71

Please sign in to comment.