diff --git a/configuration-ignore.yaml b/configuration-ignore.yaml index 4216a84e7..d90d5b7a5 100644 --- a/configuration-ignore.yaml +++ b/configuration-ignore.yaml @@ -58,3 +58,9 @@ - group: policy\.linkerd\.io kind: httproute version: v1 +- description: | + Incorrectly named when imported - this is actually from https://github.com/mysql/mysql-operator - https://github.com/mysql/mysql-operator/blob/d478c51e56b903df410fc9ac37ef13f0e4178c07/helm/mysql-operator/crds/crd.yaml#L8 + items: + - group: mysql\.presslabs\.org + kind: mysqlbackup + version: v2 diff --git a/configuration.yaml b/configuration.yaml index 8d545ff38..02452068f 100644 --- a/configuration.yaml +++ b/configuration.yaml @@ -487,6 +487,12 @@ kind: helm name: datawire repository: https://getambassador.io +- kind: git + name: datawire-edge-stack + repository: https://github.com/datawire/edge-stack + searchPaths: + - charts/edge-stack/crds + versionPrefix: chart-v - kind: git kustomizationPaths: - config/crd @@ -721,7 +727,7 @@ name: intents-operator repository: https://github.com/otterize/intents-operator searchPaths: - - /src/operator/otterizecrds + - src/operator/otterizecrds versionPrefix: v - entries: - base @@ -1207,7 +1213,6 @@ repository: https://opensource.zalando.com/postgres-operator/charts/postgres-operator - entries: - db-operator - - mysql-operator - wp-operator kind: helm name: presslabs diff --git a/internal/generator/realmClient.go b/internal/generator/realmClient.go index 6a7761a5b..44b86ac4c 100644 --- a/internal/generator/realmClient.go +++ b/internal/generator/realmClient.go @@ -54,11 +54,11 @@ func (realm *realmClient) ListOciTags(uri string) ([]string, error) { } path := strings.Trim(u.Path, "/") - request := fmt.Sprintf("%s://%s/v2/%s/tags/list", scheme, u.Host, path) - return realm.listOciTags(request, "") + return realm.listOciTags(fmt.Sprintf("%s://%s", scheme, u.Host), fmt.Sprintf("/v2/%s/tags/list", path), "") } -func (realm *realmClient) listOciTags(request, token string) ([]string, error) { +func (realm *realmClient) listOciTags(host, path, token string) ([]string, error) { + request := fmt.Sprintf("%s%s", host, path) req, err := http.NewRequest(http.MethodGet, request, nil) if err != nil { return nil, err @@ -79,7 +79,7 @@ func (realm *realmClient) listOciTags(request, token string) ([]string, error) { return nil, err } - return realm.listOciTags(request, *token) + return realm.listOciTags(host, path, *token) } bytes, err := realm.read(resp) @@ -93,7 +93,12 @@ func (realm *realmClient) listOciTags(request, token string) ([]string, error) { return nil, err } - return r.Tags, nil + tags, err := realm.next(resp.Header, host, token) + if err != nil { + return nil, err + } + + return append(r.Tags, tags...), nil } func (realm *realmClient) fetchToken(req string) (*string, error) { @@ -157,3 +162,21 @@ func (*realmClient) parseChallenge(challenge string) (map[string]string, error) return cfg, nil } + +func (realm *realmClient) next(header http.Header, host, token string) ([]string, error) { + result := make([]string, 0) + links := header.Get("link") + + for link := range strings.SplitSeq(links, ",") { + if len(link) == 0 || !strings.Contains(strings.ToLower(link), `; rel="next"`) { + continue + } + + req := strings.SplitN(link, ";", 2)[0] + path := strings.Trim(req, "<>") + + return realm.listOciTags(host, path, token) + } + + return result, nil +}