-
Notifications
You must be signed in to change notification settings - Fork 948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: remove InstanceInfo from container env #1738
feature: remove InstanceInfo from container env #1738
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1738 +/- ##
==========================================
- Coverage 14.14% 13.49% -0.65%
==========================================
Files 281 281
Lines 56755 58270 +1515
==========================================
- Hits 8027 7864 -163
- Misses 47805 49476 +1671
- Partials 923 930 +7
|
func updateContainerEnv(inputRawEnv []string, baseFs string) error { | ||
var ( | ||
envPropertiesPath = path.Join(baseFs, containerInstanceInfo) | ||
envShPath = path.Join(baseFs, pouchEnvFile) |
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.
Where do we create envShPath
and envShDir
, are they create in rich-mode with runc?
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 file is located in the image's rootfs.
In addition, the file is in the base image.
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.
do you mean we not create the file, but only judge the file
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.
yes
daemon/mgr/container_envs.go
Outdated
if _, err := os.Stat(envPropertiesPath); err != nil { | ||
//if etc/instanceInfo is not exist, it's unnecessary to update that file. | ||
return nil | ||
} | ||
if _, err := os.Stat(envShPath); err != nil { | ||
return fmt.Errorf("failed to stat container's env file /etc/profile.d/pouchenv.sh: %v", err) |
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.
if envShPath
is not exist, we should return nil, as you said, we just judge the file i exist.
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.
Using
if _, err := os.Stat(envShPath); err != nil {
logrus.Warnf("failed to stat container's env file /etc/profile.d/pouchenv.sh: %v", err)
return nil
}
Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
14fa23a
to
3d3dc95
Compare
LGTM |
Signed-off-by: Allen Sun allensun.shl@alibaba-inc.com
Ⅰ. Describe what this PR did
remove InstanceInfo from container env since this part could be added in the plugin.
And this block of code is for special use, not so general.
@Ace-Tang
Ⅱ. Does this pull request fix one issue?
none
Ⅲ. Describe how you did it
none
Ⅳ. Describe how to verify it
none
Ⅴ. Special notes for reviews
none