-
Notifications
You must be signed in to change notification settings - Fork 13
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
deployImageApi
implementation
#229
Conversation
deployImageApi
command implementationdeployImageApi
implementation
We can break up the image name in the Docker extension to pretty much any degree required, so if a slightly different format for the passed-in data is easier, feel free to change it. |
de35888
to
4b3e056
Compare
c64e64e
to
1326054
Compare
src/utils/imageNameUtils.ts
Outdated
import { localize } from "./localize"; | ||
|
||
export namespace imageNameUtils { | ||
export function detectRegistryDomain(imageName: string): SupportedRegistries | undefined { |
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.
I'm a little leery of the regex approach here, since there's potential for mistakes. For example, if I supply an image with the name "azurecr.io.foo/bar:baz", it would be incorrectly detected as belonging to ACR. True, this example is contrived, but my gut is telling me something else could happen.
We can supply the registry domain specifically, as part of the contract. The Docker extension already has some fairly sophisticated image name parsers that we trust. Given the domain, a more exact regex could be applied, such as /\.azurecr\.io$/i
(which demands "azurecr.io" be the end of the domain, and that it start with a dot, e.g. "myfoo.azurecr.io" passes, but "myfoo.azurecr.iot" does not). For Docker Hub, I think /^docker\.io$/i
is sufficient.
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.
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.
Instead of loginServer
, could we just send registry
(the domain), and for Docker Hub's case just map loginServer
to the other value it wants? IIRC, for ACR and others the login server === registry domain right? Generally speaking I'd prefer to keep all the parsing/splitting in the Docker extension, but having a straightforward mapping of registry -> login server seems safe.
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.
Sounds good. I have a couple things I want to clarify with you offline before making the changes
b1cafc8
to
1a77e09
Compare
1a77e09
to
f65fca3
Compare
1c1bec3
to
fa14742
Compare
fa14742
to
3b4dc9f
Compare
Ready for review. Latest work contingent on the changes from this PR |
* Add command for deploying to ACA from Docker extension * Explicitly make node undefined * `deployImageApi` implementation (#229) * Fix bad merge * Alex's feedback * Export not needed --------- Co-authored-by: Matthew Fisher <[email protected]>
Edit: Ready for review.