Skip to content

Commit afdc94d

Browse files
aalexandruaalexand
and
aalexand
authored
Fix extra metrics handler (#135)
Co-authored-by: aalexand <[email protected]>
1 parent 484d54f commit afdc94d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cmd/client/client.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func main() {
112112
}
113113

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

222-
func apply(configFile string, clientConfigDefaults *configv1.ClientConfig) (ctrl.Options, configv1.ClientConfig, error) {
223-
options, cfg, err := configv1.Load(scheme, configFile, clientConfigDefaults)
222+
func apply(defaultOptions ctrl.Options, configFile string, clientConfigDefaults *configv1.ClientConfig) (ctrl.Options, configv1.ClientConfig, error) {
223+
options, cfg, err := configv1.Load(defaultOptions, scheme, configFile, clientConfigDefaults)
224224
if err != nil {
225225
return options, cfg, err
226226
}

config/crd/bases/registry.ethos.adobe.com_clusters.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
apiVersion: apiextensions.k8s.io/v1
43
kind: CustomResourceDefinition

pkg/api/config/v1/clientconfig.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,12 @@ func Encode(scheme *runtime.Scheme, cfg *ClientConfig) (string, error) {
133133

134134
// Load returns a set of controller options and ClientConfig from the given file, if the config file path is empty
135135
// it uses the default values.
136-
func Load(scheme *runtime.Scheme, configFile string, defaults *ClientConfig) (ctrl.Options, ClientConfig, error) {
136+
func Load(defaultOptions ctrl.Options, scheme *runtime.Scheme, configFile string, defaults *ClientConfig) (ctrl.Options, ClientConfig, error) {
137137
var err error
138-
options := ctrl.Options{
139-
Scheme: scheme,
140-
}
138+
139+
options := defaultOptions
140+
options.Scheme = scheme
141+
141142
cfg := &ClientConfig{}
142143
if defaults != nil {
143144
cfg = defaults.DeepCopy()

0 commit comments

Comments
 (0)