-
Notifications
You must be signed in to change notification settings - Fork 74
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5079772
Added interpolation to docker option in manifest.yaml
b648eee
Migrate to using Go Module. Upgraded Go version to 1.14 alongside wit…
3740583
Upgraded Travis Go version to 1.14
9992d56
Added End-of-Line to a test data file
3b4b09d
Fixed test manifest.yml for integration test. Applied golint and sani…
36122de
Merge branch 'go-mod-migration' of https://github.com/huydoan2/openwh…
d4b5d56
Merge branch 'master' of https://github.com/apache/openwhisk-wskdeplo…
c1381d4
Added example for docker interpolation in manifest.yaml
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,8 @@ import ( | |
|
||
"gopkg.in/yaml.v2" | ||
|
||
"net/url" | ||
|
||
"github.com/apache/openwhisk-client-go/whisk" | ||
"github.com/apache/openwhisk-wskdeploy/conductor" | ||
"github.com/apache/openwhisk-wskdeploy/dependencies" | ||
|
@@ -40,7 +42,6 @@ import ( | |
"github.com/apache/openwhisk-wskdeploy/wski18n" | ||
"github.com/apache/openwhisk-wskdeploy/wskprint" | ||
yamlHelper "github.com/ghodss/yaml" | ||
"net/url" | ||
) | ||
|
||
const ( | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Interpolation feature in 1 line! Nice! |
||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -928,7 +928,7 @@ func TestComposeActionsForFunctionWithRemoteDir(t *testing.T) { | |
|
||
// validate manifest_parser.ComposeActions() method | ||
func TestComposeActionsForDocker(t *testing.T) { | ||
|
||
os.Setenv("image_name", "environmental_variable/image") | ||
file := "../tests/dat/manifest_data_compose_actions_for_docker.yaml" | ||
actionFile := "../tests/src/integration/docker/actions/exec.zip" | ||
|
||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for adding a unit test |
||
println(action.Action.Exec.Image) | ||
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, os.Getenv("image_name"), action.Action.Exec.Image, TEST_MSG_ACTION_DOCKER_IMAGE_MISMATCH) | ||
} | ||
} | ||
|
||
os.Unsetenv("image_name") | ||
} | ||
|
||
func TestComposeActionsForEnvVariableInFunction(t *testing.T) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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