Generate env vars from siteconfig 29/1329/1
authorYolanda Robla <yroblamo@redhat.com>
Tue, 6 Aug 2019 10:18:27 +0000 (12:18 +0200)
committerYolanda Robla <yroblamo@redhat.com>
Tue, 6 Aug 2019 10:19:44 +0000 (12:19 +0200)
Just accept any env var in siteConfig, to be populated
into profile.env.

Signed-off-by: Yolanda Robla <yroblamo@redhat.com>
Change-Id: I7436d138d7a3c97aa8112c50cca5f21187f42e35

pkg/site/site.go

index 914278b..3fe6917 100644 (file)
@@ -193,13 +193,12 @@ func (s Site) WriteEnvFile() {
                os.Exit(1)
        }
 
-       releaseImage, ok := configFileObj["config"].(map[interface{}]interface{})["releaseImageOverride"]
+       envVars, ok := configFileObj["config"].(map[interface{}]interface{})
        if ok {
-               // search for the releaseImageOverride key
-               envContents = fmt.Sprintf("%sexport OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE=%s\n", envContents, string(releaseImage.(string)))
+               for index, element := range envVars {
+                       envContents = fmt.Sprintf("%sexport %s=%s\n", envContents, string(index.(string)), string(element.(string)))
+               }
        }
-       envContents = fmt.Sprintf("%sexport TF_VAR_libvirt_master_memory=12288\n", envContents)
-       envContents = fmt.Sprintf("%sexport TF_VAR_libvirt_master_vcpu=4\n", envContents)
 
        // write a profile.env in the siteBuildPath
        err = ioutil.WriteFile(fmt.Sprintf("%s/profile.env", siteBuildPath), []byte(envContents), 0644)