-
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
Convert PortForwarder to Accessor, move to Deployer #6026
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6026 +/- ##
==========================================
- Coverage 70.75% 70.75% -0.01%
==========================================
Files 464 466 +2
Lines 17928 17956 +28
==========================================
+ Hits 12685 12704 +19
- Misses 4313 4321 +8
- Partials 930 931 +1
Continue to review full report at Codecov.
|
type Provider interface { | ||
GetKubernetesAccessor(*kubernetes.ImageList) Accessor | ||
GetNoopAccessor() Accessor | ||
} |
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.
This is a little bit confusing. Are all providers supposed to provide a no-op and kubernetes accessor?
Do we need a provider here?
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.
all providers should contain an implementation for each "style" of deployer we support in skaffold - right now there are only Kubernetes deployers (and they all share the same underlying logging/debugging/accessing implementations), but in the future we'll have alternate implementations.
I like this approach because it makes it clear what the different implementations for each component are, and also makes it clear where they can be obtained from (since they rely on dependencies that are injected via closures on the constructors). definitely open to suggestions for alternative approaches here though.
Related: #5813, #5936
Description
This change creates a new object,
Accessor
, which is responsible for accessing deployed resources from Skaffold. This object is a conversion of the originalPortForward
object, and is a superset of it. TheAccessor
is moved from theRunner
to theDeployer
, since accessor-behavior is implicitly tied to the underlyingDeployer
implementation. See #5809 for a more detailed description of why we need to do this.This change adds one method to the
Deployer
interface:The
GetAccessor()
method is used by theRunner
to retrieve theAccessor
implementation and actually orchestrate that behavior in the dev loop.