-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Introduce RunContext object for passing necessary context to runner constructor methods #1885
Conversation
…onstructor methods
concerns: NeedsPush is not used anywhere, Plugins are failing on kokoro. |
Plugins were failing due to the gob encoder not supporting embedded structs with zero exported fields. |
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.
LGTM
This should be a functionally equivalent change, i.e refactoring, however it does change the generated schema for the skaffold config Motivation: while introducing `RunContext` in #1885, it would be beneficial to just share the `Pipeline` part of the configuration, as: - no further functionality depends on the profiles/apiVersion/kind fields anyway - the profiles struct is not serializable by gob.encoder as it embeds `yamlpatch.Node` which does not have exported fields Changes: * extracting Pipeline struct fromSkaffoldConfig (SkaffoldPipeline originally) as an inline struct * changing top level schema definition to be the first defined struct instead of SkaffoldPipeline hardcoded
Codecov Report
@@ Coverage Diff @@
## master #1885 +/- ##
=========================================
- Coverage 49.83% 49.8% -0.03%
=========================================
Files 177 180 +3
Lines 8114 8149 +35
=========================================
+ Hits 4044 4059 +15
- Misses 3688 3708 +20
Partials 382 382
Continue to review full report at Codecov.
|
This change is a refactor that adds a new configuration object,
RunContext
, created by the runner. This object aggregates all contextual information about a skaffold pipeline run, and passes this object to all the constructors for the major components inside the runner (e.g.Builder
,Deployer
, etc.). This simplifies the constructor API, making it easier to add new parameters to these methods without having to change their signatures.One small functional change: the
Tester
now optionally consumes the list of pre-built images (passed via the command line) from theSkaffoldOptions
object, and uses this list to check against providedTestCase
s from the skaffold.yaml when running tests. This is a cleaner way of skipping tests for pre-built images.All other skaffold functionality should be unaffected by this change.