From 35decf2699357a8aad4ff334e9903f34eb3017c0 Mon Sep 17 00:00:00 2001 From: Gamya Date: Tue, 17 Dec 2024 22:31:43 +0530 Subject: [PATCH] feat: implement list pack registries --- client/registry.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/registry.go b/client/registry.go index 44dfd16d..7e2d3e5e 100644 --- a/client/registry.go +++ b/client/registry.go @@ -52,6 +52,16 @@ func (h *V1Client) GetPackRegistryByName(registryName string) (*models.V1PackReg return nil, fmt.Errorf("registry '%s' not found", registryName) } +// ListPackRegistries retries a list of all Pack registries. +func (h *V1Client) ListPackRegistries() ([]*models.V1PackRegistrySummary, error) { + params := clientv1.NewV1RegistriesPackSummaryListParamsWithContext(h.ctx) + resp, err := h.Client.V1RegistriesPackSummaryList(params) + if err != nil { + return nil, err + } + return resp.Payload.Items, nil +} + // ListHelmRegistries retrieves a list of all Helm registries, filtered by scope. func (h *V1Client) ListHelmRegistries(scope string) ([]*models.V1HelmRegistrySummary, error) { params := clientv1.NewV1RegistriesHelmSummaryListParamsWithContext(h.ctx).