diff options
author | Lukasz Rajewski <lukasz.rajewski@orange.com> | 2021-10-25 22:21:16 +0200 |
---|---|---|
committer | Lukasz Rajewski <lukasz.rajewski@orange.com> | 2021-10-25 22:21:16 +0200 |
commit | 3f0da55c0183e9da2f4658308dee1915338266aa (patch) | |
tree | c2b9b4ad06786e51bf9262cb3d0dfacad7ee9853 /src/k8splugin/internal/rb | |
parent | 6c28e5a7ca5a0688f5aefad010e0a3071ff6fe0b (diff) |
Fix resolution of values for Config API0.9.3
Issue-ID: MULTICLOUD-1414
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
Change-Id: Ibca5846ffe083bfc4d505c4c3c13efac2c6e2426
Diffstat (limited to 'src/k8splugin/internal/rb')
-rw-r--r-- | src/k8splugin/internal/rb/profile.go | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/k8splugin/internal/rb/profile.go b/src/k8splugin/internal/rb/profile.go index 77398580..ac90a63b 100644 --- a/src/k8splugin/internal/rb/profile.go +++ b/src/k8splugin/internal/rb/profile.go @@ -279,6 +279,25 @@ func (v *ProfileClient) Download(rbName, rbVersion, prName string) ([]byte, erro return nil, pkgerrors.New("Error downloading Profile content") } +//GetYamlClient GEt Yaml Files client for profile +func (v *ProfileClient) GetYamlClient(rbName string, rbVersion string, profileName string) (ProfileYamlClient, error) { + prData, err := v.Download(rbName, rbVersion, profileName) + if err != nil { + return ProfileYamlClient{}, pkgerrors.Wrap(err, "Downloading Profile") + } + + prPath, err := ExtractTarBall(bytes.NewBuffer(prData)) + if err != nil { + return ProfileYamlClient{}, pkgerrors.Wrap(err, "Extracting Profile Content") + } + + prYamlClient, err := ProcessProfileYaml(prPath, v.manifestName) + if err != nil { + return ProfileYamlClient{}, pkgerrors.Wrap(err, "Processing Profile Manifest") + } + return prYamlClient, nil +} + //Resolve returns the path where the helm chart merged with //configuration overrides resides and final ReleaseName picked for instantiation func (v *ProfileClient) Resolve(rbName string, rbVersion string, @@ -291,17 +310,7 @@ func (v *ProfileClient) Resolve(rbName string, rbVersion string, //Download and process the profile first //If everything seems okay, then download the definition - prData, err := v.Download(rbName, rbVersion, profileName) - if err != nil { - return sortedTemplates, crdList, hookList, finalReleaseName, pkgerrors.Wrap(err, "Downloading Profile") - } - - prPath, err := ExtractTarBall(bytes.NewBuffer(prData)) - if err != nil { - return sortedTemplates, crdList, hookList, finalReleaseName, pkgerrors.Wrap(err, "Extracting Profile Content") - } - - prYamlClient, err := ProcessProfileYaml(prPath, v.manifestName) + prYamlClient, err := v.GetYamlClient(rbName, rbVersion, profileName) if err != nil { return sortedTemplates, crdList, hookList, finalReleaseName, pkgerrors.Wrap(err, "Processing Profile Manifest") } |