1
0
mirror of synced 2026-05-03 02:03:31 +00:00

Fetch the plugin catalog from latest immutable release

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan
2026-04-09 00:42:52 +03:00
parent 9a4b93056b
commit 2cee1d795e
2 changed files with 4 additions and 3 deletions

View File

@@ -27,7 +27,8 @@ import (
) )
const ( 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" envCatalogBase = "FLUXCD_PLUGIN_CATALOG"
pluginAPIVersion = "cli.fluxcd.io/v1beta1" pluginAPIVersion = "cli.fluxcd.io/v1beta1"
@@ -111,7 +112,7 @@ func (c *CatalogClient) baseURL() string {
// FetchManifest fetches a single plugin manifest from the catalog. // FetchManifest fetches a single plugin manifest from the catalog.
func (c *CatalogClient) FetchManifest(name string) (*PluginManifest, error) { func (c *CatalogClient) FetchManifest(name string) (*PluginManifest, error) {
url := c.baseURL() + "plugins/" + name + ".yaml" url := c.baseURL() + name + ".yaml"
body, err := c.fetch(url) body, err := c.fetch(url)
if err != nil { if err != nil {
return nil, fmt.Errorf("plugin %q not found in catalog", name) return nil, fmt.Errorf("plugin %q not found in catalog", name)

View File

@@ -38,7 +38,7 @@ versions:
checksum: sha256:abc123 checksum: sha256:abc123
` `
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 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)) w.Write([]byte(manifest))
return return
} }