diff --git a/internal/plugin/catalog.go b/internal/plugin/catalog.go index 84f673d2..b1b67bfa 100644 --- a/internal/plugin/catalog.go +++ b/internal/plugin/catalog.go @@ -27,7 +27,8 @@ import ( ) const ( - defaultCatalogBase = "https://raw.githubusercontent.com/fluxcd/plugins/main/" + // defaultCatalogBase points at the latest GitHub release of fluxcd/plugins. + defaultCatalogBase = "https://github.com/fluxcd/plugins/releases/latest/download/" envCatalogBase = "FLUXCD_PLUGIN_CATALOG" pluginAPIVersion = "cli.fluxcd.io/v1beta1" @@ -111,7 +112,7 @@ func (c *CatalogClient) baseURL() string { // FetchManifest fetches a single plugin manifest from the catalog. func (c *CatalogClient) FetchManifest(name string) (*PluginManifest, error) { - url := c.baseURL() + "plugins/" + name + ".yaml" + url := c.baseURL() + name + ".yaml" body, err := c.fetch(url) if err != nil { return nil, fmt.Errorf("plugin %q not found in catalog", name) diff --git a/internal/plugin/catalog_test.go b/internal/plugin/catalog_test.go index 37c4d34c..8134a010 100644 --- a/internal/plugin/catalog_test.go +++ b/internal/plugin/catalog_test.go @@ -38,7 +38,7 @@ versions: checksum: sha256:abc123 ` server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.URL.Path == "/plugins/operator.yaml" { + if r.URL.Path == "/operator.yaml" { w.Write([]byte(manifest)) return }