-
Notifications
You must be signed in to change notification settings - Fork 14
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
Implement Hybrid Functionality and add custom Image resource #413
Conversation
It looks like the overlays used to be written by hand for every language and with this instead we get automatic extensibility in the languages dimension, that's a huge win! |
if v := req.GetVersion(); v != 0 { | ||
return nil, fmt.Errorf("unsupported schema version %d", v) | ||
} | ||
return &rpc.GetSchemaResponse{Schema: string(p.schemaBytes)}, nil | ||
} |
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.
Nit: I don't think this layer of the GetSchema will ever be called since the schema will be vended by the top-level provider interface. This can probably fail with an assertion here instead.
provider/hybrid.go
Outdated
tok := urn.Type().String() | ||
fmt.Println(tok) | ||
// TODO: implement this for actual!!! | ||
if tok == dockerImageToken { |
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.
Another interesting pattern when it comes to multiplexing custom resource handlers is what is done in the pulumiservice provider: https://github.com/pulumi/pulumi-pulumiservice/blob/main/provider/pkg/provider/provider.go. Essentially you could add a resource interface which could be used to invoke the handlers for each of the supported resources as done in that provider.
b8d219b
to
ccfc1e1
Compare
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
1 similar comment
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
The integration test failures are expected here as the tests need to be updated. |
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
8 similar comments
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
f9779a0
to
2898ead
Compare
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
6 similar comments
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
…TestDockerfileGo.
fb7beee
to
57a0ef0
Compare
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
1 similar comment
Does the PR have any schema changes?Looking good! No breaking changes found. New resources:
|
docker.DockerBuild was changed to DockerBuildArgs back in Novermber of 2022: pulumi/pulumi-docker#413 (comment)
This pull request restructures this provider to support both TF based and pulumi-native(custom) Resources.
Specifically, this adds Image as an "extra" custom resource to the resources declaration file (resources.go),
and creates a hybrid provider that handles logic to switch between a custom resource and a TF based resource.
Of note
dockerImageTok
variable, as that is the only custom resource currently needed.digest
is discontinued as per deprecation messageid
is discontinued, as per deprecation messagelocalImageName
is discontinued, as users can achieve the same behavior by settingskipPush
totrue
and image tags are lightweight and repeatable.dockerBuild
method uses the Docker client to start implementing much of the expected (current) behavior of Image:cacheFrom
andbuild
):mytag
at the end of the image name (defaults to:latest
)cacheFrom
when setenv
input to translate to setting theBuilderVersion
constant in the docker clientextraOptions
as we will need to parse them individually as client options rather can command line flagstarget
Edited to add Nov.17:
DockerBuild
type to aDockerBuildArgs
type).imageName
- not sure if this is optimal; we may want to extract a build hash here instead.Fixes #403