-
Notifications
You must be signed in to change notification settings - Fork 75
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
Added interpolation to docker option in manifest.yaml #1100
Conversation
@huydoan2 It appears that one of the go libs. wskdeploy uses has updated its dependencies and now only works with go 1.13: |
…h other packages. Modified unit tests to accomodate changes.
…isk-wskdeploy into action-interpolation
@huydoan2 It looks like the commit includes files from your other PR... it seems like you need to push from a rebased branch... |
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.
Please limit files committed to just ones that permit interpolation (and not ones the upgrade project to Go 1.14 and go mod).
…into action-interpolation
@@ -29,6 +29,8 @@ import ( | |||
|
|||
"gopkg.in/yaml.v2" | |||
|
|||
"net/url" |
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.
better ordering of dependencies
@@ -796,7 +797,7 @@ func (dm *YAMLParser) composeActionExec(manifestFilePath string, manifestFileNam | |||
if action.Native { | |||
exec.Image = NATIVE_DOCKER_IMAGE | |||
} else { | |||
exec.Image = action.Docker | |||
exec.Image = wskenv.InterpolateStringWithEnvVar(action.Docker).(string) |
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.
Interpolation feature in 1 line! Nice!
@@ -960,8 +960,15 @@ func TestComposeActionsForDocker(t *testing.T) { | |||
assert.NotNil(t, action.Action.Exec.Code, TEST_MSG_ACTION_CODE_MISSING) | |||
assert.Equal(t, runtimes.BLACKBOX, action.Action.Exec.Kind, fmt.Sprintf(TEST_MSG_ACTION_DOCKER_KIND_MISMATCH, action.Action.Exec.Kind)) | |||
assert.Equal(t, "mydockerhub/myimage", action.Action.Exec.Image, TEST_MSG_ACTION_DOCKER_IMAGE_MISMATCH) | |||
case "CustomDockerAction6": |
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.
Thanks for adding a unit test
@huydoan2 Could you please update the docs to indicate this value can now be interpolated? Here is the file I was thinking of: |
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.
Thanks for updating the docs!
This PR adds environmental variable interpolation to docker action so that the image name can be provided through an environmental variable.
You now can do this: