rkt fly: add logic to insert environment value #1989
Conversation
|
||
env := make([]string, len(envList)) | ||
for _, e := range envList { | ||
if _, exists := envList.Get(defaultEnv[0]); !exists { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function Get accepts only the name of the environment variable and not its content.
type EnvironmentVariable struct {
Name string `json:"name"`
Value string `json:"value"`
}
But here, the argument is "PATH=/bin:/sbin:/usr/bin:/usr/local/bin".
This way You have possibility to insert some values into environ file in time of POD creation, but not in time of entering which is reading already build environ file. This second option is at least needed by any terminal using program ( |
e1e9022
to
ef7c89e
Compare
env := []string{"PATH=/bin:/sbin:/usr/bin:/usr/local/bin"} | ||
defaultEnvPath := []string{"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"} | ||
envList := p.Manifest.Apps[0].App.Environment | ||
env := make([]string, len(envList)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The length seems to be len(envList)+len(defaultEnvPath)
@il9ue Thanks for the update! I added a couple of suggestions. |
90c7e04
to
687b21c
Compare
@alban Just updated and applied from suggestions and made changes! Thanks for specific feedback! |
@@ -219,7 +219,15 @@ func stage1() int { | |||
} | |||
|
|||
// TODO: insert environment from manifest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This TODO can be removed.
LGTM |
rkt fly: add logic to insert environment value
Insert environment value by checking related value in Manifest.
Please give any feedback.