mirror of
https://github.com/hauler-dev/hauler.git
synced 2026-08-18 11:56:42 +00:00
feat: extend charts resource by platform (#657)
Signed-off-by: Eric Klatzer <eric@klatzer.at> Co-authored-by: Zack Brady <zackbrady123@gmail.com>
This commit is contained in:
co-authored by
Zack Brady
parent
06ab061e10
commit
8dc864ca77
@@ -87,6 +87,7 @@ jobs:
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y unzip
|
||||
sudo apt-get install -y tree
|
||||
sudo apt-get install -y jq
|
||||
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v6
|
||||
@@ -316,6 +317,8 @@ jobs:
|
||||
hauler store sync --filename testdata/hauler-manifest-pipeline.yaml
|
||||
# verify images are present
|
||||
hauler store info | grep 'musl'
|
||||
# verify that only one kube-vip image with the correct platform is present
|
||||
hauler store info --output json | jq -e '.artifacts | map(select(.type=="image" and .reference=="ghcr.io/kube-vip/kube-vip:v1.0.4")) | length == 1' >/dev/null
|
||||
# verify via sync with multiple files
|
||||
hauler store sync --filename testdata/hauler-manifest-pipeline.yaml --filename testdata/hauler-manifest.yaml
|
||||
# need more tests here
|
||||
|
||||
@@ -501,6 +501,14 @@ func processContent(ctx context.Context, fi *os.File, o *flags.SyncOpts, s *stor
|
||||
valuesFiles = append(valuesFiles, filepath.Join(filepath.Dir(fi.Name()), path))
|
||||
}
|
||||
|
||||
platform := o.Platform
|
||||
if annotation != nil && annotation[consts.ImageAnnotationPlatform] != "" {
|
||||
platform = annotation[consts.ImageAnnotationPlatform]
|
||||
}
|
||||
if ch.Platform != "" {
|
||||
platform = ch.Platform
|
||||
}
|
||||
|
||||
if err := storeChart(ctx, s, ch,
|
||||
&flags.AddChartOpts{
|
||||
ChartOpts: &action.ChartPathOptions{
|
||||
@@ -511,7 +519,7 @@ func processContent(ctx context.Context, fi *os.File, o *flags.SyncOpts, s *stor
|
||||
AddDependencies: ch.AddDependencies,
|
||||
ExcludeExtras: excludeExtras,
|
||||
Registry: registry,
|
||||
Platform: o.Platform,
|
||||
Platform: platform,
|
||||
ValuesFiles: valuesFiles,
|
||||
},
|
||||
rso, ro,
|
||||
|
||||
@@ -21,6 +21,7 @@ type Chart struct {
|
||||
Version string `json:"version,omitempty"`
|
||||
Rewrite string `json:"rewrite,omitempty"`
|
||||
ValuesFiles []string `json:"valuesFiles,omitempty"`
|
||||
Platform string `json:"platform,omitempty"`
|
||||
|
||||
AddImages bool `json:"add-images,omitempty"`
|
||||
AddDependencies bool `json:"add-dependencies,omitempty"`
|
||||
|
||||
+5
@@ -45,6 +45,11 @@ spec:
|
||||
valuesFiles:
|
||||
- "chart-with-file-dependency-chart-required-values-2.yaml"
|
||||
- "chart-with-file-dependency-chart-required-values.yaml"
|
||||
- name: kube-vip
|
||||
repoURL: https://kube-vip.github.io/helm-charts/
|
||||
version: 0.9.9
|
||||
add-images: true
|
||||
platform: linux/amd64
|
||||
---
|
||||
apiVersion: content.hauler.cattle.io/v1
|
||||
kind: Files
|
||||
|
||||
Reference in New Issue
Block a user