Skip to content

Commit

Permalink
Fix: using deprecated field AddOnConfiguiration causing `proxy heal…
Browse files Browse the repository at this point in the history
…th` not work. (#348)

Signed-off-by: xuezhaojun <zxue@redhat.com>
  • Loading branch information
xuezhaojun committed Jul 4, 2023
1 parent d416817 commit b254f69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/cmd/proxy/health/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"open-cluster-management.io/cluster-proxy/pkg/common"
"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"
konnectivity "sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client"
proxyutil "sigs.k8s.io/apiserver-network-proxy/pkg/util"
)
Expand Down Expand Up @@ -77,7 +78,7 @@ func (o *Options) run(streams genericclioptions.IOStreams) error {
return 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 @@ -103,10 +104,8 @@ func (o *Options) run(streams genericclioptions.IOStreams) error {
return 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 errors.Wrapf(err, "failed getting managedproxyconfiguration for cluster-proxy")
}
Expand Down
1 change: 1 addition & 0 deletions pkg/config/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ const (
BootstrapSecretPrefix = "bootstrap-token-"
HubClusterNamespace = "open-cluster-management-hub"
ManagedClusterNamespace = "open-cluster-management-agent"
ManagedProxyConfigurationName = "cluster-proxy"
)

0 comments on commit b254f69

Please sign in to comment.