Skip to content

Commit

Permalink
Fix extra metrics handler (#135)
Browse files Browse the repository at this point in the history
Co-authored-by: aalexand <[email protected]>
  • Loading branch information
aalexandru and aalexand authored Apr 9, 2024
1 parent 484d54f commit afdc94d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cmd/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func main() {
}

if configFile != "" {
options, clientConfig, err = apply(configFile, &clientConfigDefaults)
options, clientConfig, err = apply(options, configFile, &clientConfigDefaults)
if err != nil {
setupLog.Error(err, "unable to load the config file")
os.Exit(1)
Expand Down Expand Up @@ -219,8 +219,8 @@ func loadWatchedGVKs(cfg configv1.ClientConfig) []schema.GroupVersionKind {
return GVKs
}

func apply(configFile string, clientConfigDefaults *configv1.ClientConfig) (ctrl.Options, configv1.ClientConfig, error) {
options, cfg, err := configv1.Load(scheme, configFile, clientConfigDefaults)
func apply(defaultOptions ctrl.Options, configFile string, clientConfigDefaults *configv1.ClientConfig) (ctrl.Options, configv1.ClientConfig, error) {
options, cfg, err := configv1.Load(defaultOptions, scheme, configFile, clientConfigDefaults)
if err != nil {
return options, cfg, err
}
Expand Down
1 change: 0 additions & 1 deletion config/crd/bases/registry.ethos.adobe.com_clusters.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
Expand Down
9 changes: 5 additions & 4 deletions pkg/api/config/v1/clientconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,12 @@ func Encode(scheme *runtime.Scheme, cfg *ClientConfig) (string, error) {

// Load returns a set of controller options and ClientConfig from the given file, if the config file path is empty
// it uses the default values.
func Load(scheme *runtime.Scheme, configFile string, defaults *ClientConfig) (ctrl.Options, ClientConfig, error) {
func Load(defaultOptions ctrl.Options, scheme *runtime.Scheme, configFile string, defaults *ClientConfig) (ctrl.Options, ClientConfig, error) {
var err error
options := ctrl.Options{
Scheme: scheme,
}

options := defaultOptions
options.Scheme = scheme

cfg := &ClientConfig{}
if defaults != nil {
cfg = defaults.DeepCopy()
Expand Down

0 comments on commit afdc94d

Please sign in to comment.