Skip to content

Commit

Permalink
refactor: remove unused credentials
Browse files Browse the repository at this point in the history
ChrisKujawa committed Dec 9, 2022
1 parent c7b468e commit aec1dba
Showing 2 changed files with 4 additions and 21 deletions.
14 changes: 0 additions & 14 deletions go-chaos/cmd/root.go
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@ import (
"fmt"
"os"

"github.com/camunda/zeebe/clients/go/v8/pkg/zbc"
"github.com/rs/zerolog/log"

"github.com/spf13/cobra"
@@ -70,9 +69,6 @@ var Commit = "HEAD"
var Verbose bool
var KubeConfigPath string
var Namespace string
var ClientId string
var ClientSecret string
var Audience string
var JsonLogging bool

func NewCmd() *cobra.Command {
@@ -91,23 +87,13 @@ func NewCmd() *cobra.Command {
}
internal.Namespace = Namespace
internal.KubeConfigPath = KubeConfigPath
if ClientId != "" && ClientSecret != "" {
internal.ZeebeClientCredential, _ = zbc.NewOAuthCredentialsProvider(&zbc.OAuthProviderConfig{
ClientID: ClientId,
ClientSecret: ClientSecret,
Audience: Audience,
})
}
},
}

rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose output")
rootCmd.PersistentFlags().BoolVarP(&JsonLogging, "jsonLogging", "", false, "json logging output")
rootCmd.PersistentFlags().StringVar(&KubeConfigPath, "kubeconfig", "", "path the the kube config that will be used")
rootCmd.PersistentFlags().StringVarP(&Namespace, "namespace", "n", "", "connect to the given namespace")
rootCmd.PersistentFlags().StringVarP(&ClientId, "clientId", "c", "", "connect using the given clientId")
rootCmd.PersistentFlags().StringVar(&ClientSecret, "clientSecret", "", "connect using the given client secret")
rootCmd.PersistentFlags().StringVar(&Audience, "audience", "", "connect using the given client secret")

AddBackupCommand(rootCmd, flags)
AddBrokersCommand(rootCmd)
11 changes: 4 additions & 7 deletions go-chaos/internal/flags.go
Original file line number Diff line number Diff line change
@@ -15,21 +15,18 @@
package internal

import (
"github.com/camunda/zeebe/clients/go/v8/pkg/zbc"
"github.com/rs/zerolog"
)

// defines whether the functions should print verbose output
// Verbosity defines whether the functions should print verbose output
var Verbosity = false

// defines if a custom kube config should be used instead of the default one found by k8s
// KubeConfigPath defines if a custom kube config should be used instead of the default one found by k8s
var KubeConfigPath string

// sets the namespace to be used instead of the namespace from the current kube context
// Namespace sets the namespace to be used instead of the namespace from the current kube context
var Namespace string

var ZeebeClientCredential zbc.CredentialsProvider

// defines whether the logging should be structured json logging
// JsonLogging defines whether the logging should be structured json logging
var JsonLogging bool
var JsonLogger zerolog.Logger

0 comments on commit aec1dba

Please sign in to comment.