AppManager: cache helm charts and container images to local registry
Caching container images is disabled until we figure out how to run
container registry behind TLS.
Change-Id: I0253f2a862e5adddff18a82b102f67258151c070
diff --git a/core/installer/charts.go b/core/installer/charts.go
new file mode 100644
index 0000000..5f98d2e
--- /dev/null
+++ b/core/installer/charts.go
@@ -0,0 +1,36 @@
+package installer
+
+import (
+ "strings"
+
+ helmv2 "github.com/fluxcd/helm-controller/api/v2"
+)
+
+type LocalChartGenerator interface {
+ Generate(path string) helmv2.HelmChartTemplateSpec
+}
+
+type GitRepositoryLocalChartGenerator struct {
+ Name string
+ Namespace string
+}
+
+func (g GitRepositoryLocalChartGenerator) Generate(path string) helmv2.HelmChartTemplateSpec {
+ p, _ := strings.CutPrefix(path, "/")
+ return helmv2.HelmChartTemplateSpec{
+ Chart: p,
+ SourceRef: helmv2.CrossNamespaceObjectReference{
+ Kind: "GitRepository",
+ Name: g.Name,
+ Namespace: g.Namespace,
+ },
+ }
+}
+
+type InfraLocalChartGenerator struct {
+ GitRepositoryLocalChartGenerator
+}
+
+func NewInfraLocalChartGenerator() InfraLocalChartGenerator {
+ return InfraLocalChartGenerator{GitRepositoryLocalChartGenerator{"dodo-flux", "dodo-flux"}}
+}