Update overrides url and structure

Change-Id: I327103c18fc0e10e989a17f69b3bff9995c45eb4
This commit is contained in:
Vladimir Kozhukalov 2024-12-09 11:20:15 -06:00
parent 44241611d8
commit d2ba2d1281
3 changed files with 13 additions and 13 deletions

Binary file not shown.

24
main.go
View File

@ -27,7 +27,7 @@ import (
"github.com/spf13/cobra"
)
const DefaultBaseUrl string = "https://opendev.org/openstack/openstack-helm/raw/branch/master"
const DefaultBaseUrl string = "https://opendev.org/openstack/openstack-helm/raw/branch/master/values_overrides"
func newRootCommand() *cobra.Command {
var cwd string
@ -45,13 +45,13 @@ func newRootCommand() *cobra.Command {
If 3 features are passed, then the overrides will be looked
up in the following order:
<overrides_path>/<chart>/values_overrides/<feature-3>.yaml
<overrides_path>/<chart>/values_overrides/<feature-2>.yaml
<overrides_path>/<chart>/values_overrides/<feature-2>-<feature-3>.yaml
<overrides_path>/<chart>/values_overrides/<feature-1>.yaml
<overrides_path>/<chart>/values_overrides/<feature-1>-<feature-3>.yaml
<overrides_path>/<chart>/values_overrides/<feature-1>-<feature-2>.yaml
<overrides_path>/<chart>/values_overrides/<feature-1>-<feature-2>-<feature-3>.yaml
<overrides_path>/<chart>/<feature-3>.yaml
<overrides_path>/<chart>/<feature-2>.yaml
<overrides_path>/<chart>/<feature-2>-<feature-3>.yaml
<overrides_path>/<chart>/<feature-1>.yaml
<overrides_path>/<chart>/<feature-1>-<feature-3>.yaml
<overrides_path>/<chart>/<feature-1>-<feature-2>.yaml
<overrides_path>/<chart>/<feature-1>-<feature-2>-<feature-3>.yaml
If you think of the features as bits of a binary number where <feature3> is
the least significant bit, then the order corresponds to all numbers from 001
@ -102,16 +102,16 @@ func num2items(num uint32, power int) []int {
func overrideFile(basePath, chart, subchart, overrideName string) string {
if subchart != "" {
return filepath.Join(basePath, chart, "values_overrides", subchart, overrideName)
return filepath.Join(basePath, chart, subchart, overrideName)
}
return filepath.Join(basePath, chart, "values_overrides", overrideName)
return filepath.Join(basePath, chart, overrideName)
}
func overrideUrl(baseUrl, chart, subchart, overrideName string) string {
if subchart != "" {
return fmt.Sprintf("%s/%s/values_overrides/%s/%s", baseUrl, chart, subchart, overrideName)
return fmt.Sprintf("%s/%s/%s/%s", baseUrl, chart, subchart, overrideName)
}
return fmt.Sprintf("%s/%s/values_overrides/%s", baseUrl, chart, overrideName)
return fmt.Sprintf("%s/%s/%s", baseUrl, chart, overrideName)
}
func downloadOverride(baseUrl, basePath, chart, subchart, overrideName string) error {

View File

@ -15,7 +15,7 @@
check:
jobs:
- openstack-helm-plugin-lint
- openstack-helm-plugin-compute-kit-metallb-2024-1-ubuntu_jammy # 1 node + 2 nodes
# - openstack-helm-plugin-compute-kit-metallb-2024-1-ubuntu_jammy # 1 node + 2 nodes
gate:
jobs:
- openstack-helm-plugin-lint