Provide environment at init time#4722
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4722 +/- ##
==========================================
- Coverage 85% 78.37% -6.63%
==========================================
Files 198 198
Lines 8841 8846 +5
Branches 614 619 +5
==========================================
- Hits 7515 6933 -582
- Misses 1326 1913 +587
Continue to review full report at Codecov.
|
Member
|
This LGTM. |
rabbah
reviewed
Nov 12, 2019
chetanmeh
approved these changes
Nov 19, 2019
chetanmeh
left a comment
Member
There was a problem hiding this comment.
Thanks @upgle for this 🎉
At times for some web actions I needed the namespace at init time to compute some routing url and then realized that they were only available at run time. With this doing such init time work would be easier
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
As discussed here, it changes the container proxy to provide an environment at init time (
/init).But I couldn't move the entire context from /run to /init to maintain backward compatibility.
1. /init
Put environment variables in the env field. and runtimes can use this value.
2. /run
The namespace, action_name, activation_id, transaction_id, and deadline fields are uppercased and prefixed with "
__OW_" by runtimes [1].namespace->__OW_NAMESPACEaction_name->__OW_ACTION_NAMEI think these fields cannot be removed due to backward compatibility.
This is a draft pull request, please let me know if there is a better way.
ref
[1] https://github.com/apache/openwhisk/blob/master/docs/actions-actionloop.md#what-the-launcher-needs-to-do
Related issue and scope
https://lists.apache.org/thread.html/ef18f833671a3266d4cde3bf4eaff379596d03b3e147a785a9b06941@%3Cdev.openwhisk.apache.org%3E
My changes affect the following components
Types of changes
Checklist: