Skip to content

Commit

Permalink
add ListProviderResources
Browse files Browse the repository at this point in the history
  • Loading branch information
sbueringer committed Oct 12, 2021
1 parent 60cd932 commit ab56cff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions cmd/clusterctl/client/cluster/cert_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,7 @@ func (cm *certManagerClient) PlanUpgrade() (CertManagerUpgradePlan, error) {
func (cm *certManagerClient) EnsureLatestVersion() error {
log := logf.Log

objs, err := cm.proxy.List(context.TODO(), &listOptions{
Labels: map[string]string{clusterctlv1.ClusterctlCoreLabelName: clusterctlv1.ClusterctlCoreLabelCertManagerValue},
Namespaces: []string{certManagerNamespace},
})
objs, err := cm.proxy.ListResources(map[string]string{clusterctlv1.ClusterctlCoreLabelName: clusterctlv1.ClusterctlCoreLabelCertManagerValue}, certManagerNamespace)
if err != nil {
return errors.Wrap(err, "failed get cert manager components")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/clusterctl/internal/test/fake_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (f *FakeProxy) ListResources(labels map[string]string, namespaces ...string
}

func (f *FakeProxy) ListProviderResources(_ context.Context, provider, namespace string) ([]unstructured.Unstructured, error) {
// FIXME: filter
// TODO: this func should filter out objects of CRDs of other providers
return f.ListResources(map[string]string{
clusterctlv1.ClusterctlLabelName: "",
clusterv1.ProviderLabelName: provider,
Expand Down

0 comments on commit ab56cff

Please sign in to comment.