Skip to content

Commit

Permalink
fix: update index
Browse files Browse the repository at this point in the history
  • Loading branch information
acid-chicken committed May 21, 2024
1 parent 77f2f5c commit 30bee6f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/hariko/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
apiVersion: v2
name: hariko
version: 0.1.13
version: 0.1.14
2 changes: 1 addition & 1 deletion charts/misskey/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
apiVersion: v2
name: misskey
version: 0.1.13
version: 0.1.14
18 changes: 16 additions & 2 deletions hariko/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"helm.sh/helm/v3/pkg/getter"
"helm.sh/helm/v3/pkg/release"
"helm.sh/helm/v3/pkg/repo"
"sigs.k8s.io/yaml"
)

const (
Expand Down Expand Up @@ -180,17 +181,30 @@ func deploy(packageName string, repositoryName string, repositoryURL string) (*r
p := getter.All(settings)
actionConfig := new(action.Configuration)
actionConfig.Init(settings.RESTClientGetter(), settings.Namespace(), "", func(_ string, _ ...interface{}) {})
r, err := repo.NewChartRepository(&repo.Entry{
c := repo.Entry{
Name: repositoryName,
URL: repositoryURL,
}, p)
}
r, err := repo.NewChartRepository(&c, p)
if err != nil {
return nil, err
}
index, err := r.DownloadIndexFile()
if err != nil {
return nil, err
}
b, err := os.ReadFile(settings.RepositoryConfig)
if err != nil {
return nil, err
}
var re repo.File
if err := yaml.Unmarshal(b, &re); err != nil {
return nil, err
}
re.Update(&c)
if err := re.WriteFile(settings.RepositoryConfig, 0600); err != nil {
return nil, err
}
if _, err := repo.LoadIndexFile(index); err != nil {
return nil, err
}
Expand Down

0 comments on commit 30bee6f

Please sign in to comment.