Skip to content

Commit

Permalink
Fix: remove deprecated AddOnConfiguration field. (#368)
Browse files Browse the repository at this point in the history
Signed-off-by: xuezhaojun <[email protected]>
  • Loading branch information
xuezhaojun authored Sep 4, 2023
1 parent 329f6fe commit 4ddc979
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/cmd/proxy/kubectl/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"open-cluster-management.io/cluster-proxy/pkg/common"
clusterproxyclient "open-cluster-management.io/cluster-proxy/pkg/generated/clientset/versioned"
"open-cluster-management.io/cluster-proxy/pkg/util"
"open-cluster-management.io/clusteradm/pkg/config"
genericclioptionsclusteradm "open-cluster-management.io/clusteradm/pkg/genericclioptions"
msaClientv1alpha1 "open-cluster-management.io/managed-serviceaccount/pkg/generated/clientset/versioned"
)
Expand Down Expand Up @@ -180,7 +181,7 @@ func getProxyConfig(hubRestConfig *rest.Config, streams genericclioptions.IOStre
return nil, errors.Wrapf(err, "failed initializing addon api client")
}

clusterAddon, err := addonClient.AddonV1alpha1().ClusterManagementAddOns().Get(
_, err = addonClient.AddonV1alpha1().ClusterManagementAddOns().Get(
context.TODO(),
"cluster-proxy",
metav1.GetOptions{})
Expand All @@ -206,10 +207,8 @@ func getProxyConfig(hubRestConfig *rest.Config, streams genericclioptions.IOStre
return nil, errors.Wrapf(err, "failed initializing proxy api client")
}

// TODO: fix this deprecated field AddOnConfiguration
// nolint:staticcheck
proxyConfig, err := proxyClient.ProxyV1alpha1().ManagedProxyConfigurations().
Get(context.TODO(), clusterAddon.Spec.AddOnConfiguration.CRName, metav1.GetOptions{})
Get(context.TODO(), config.ManagedProxyConfigurationName, metav1.GetOptions{})
if err != nil {
return nil, errors.Wrapf(err, "failed getting managedproxyconfiguration for cluster-proxy")
}
Expand Down

0 comments on commit 4ddc979

Please sign in to comment.