Skip to content
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

Allow preview even if no Dockefile inline and location are not defined #103

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xunleii
Copy link

@xunleii xunleii commented Jun 12, 2024

When using the dockerfile.inline parameter, we use a "future" reference to something that has not yet been computed during the preview stage.

In this case, dockefile.location and dockerfile.infile may be empty but will be available during the processing stage. Fixes #96.

Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@xunleii xunleii force-pushed the issue-96/allow-empty-inline-on-preview branch from 96acb8d to c4b2c1a Compare June 12, 2024 12:13
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

When using `dockerfile.inline` parameter, we would use "future"
reference of something that has not already been computed during the
preview stage.
In this case, `dockefile.location` and `dockerfile.infile` can be empty
but can be available during the processing stage.

Signed-off-by: Alexandre Nicolaie <alexandre.nicolaie@radiofrance.com>
@xunleii xunleii force-pushed the issue-96/allow-empty-inline-on-preview branch from c4b2c1a to 19d6575 Compare June 18, 2024 20:08
Copy link

PR is now waiting for a maintainer to run the acceptance tests.
Note for the maintainer: To run the acceptance tests, please comment /run-acceptance-tests on the PR

@blampe
Copy link
Contributor

blampe commented Jun 21, 2024

/run-acceptance-tests

@pulumi-bot
Copy link
Collaborator

Copy link
Contributor

@blampe blampe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The upgrade test, which runs the new code against some pre-recorded state (specifically these examples) is failing due to unexpected changes to some Dockerfile/Context properties.

go test -count 1 -tags=all -run TestYAMLExampleUpgrade/upgrade-quick ./examples/...
upgrade.go:378: Replayed Diff on urn:pulumi:p-it-bryces-wor-upgrade-e061461f::provider-docker-build::docker-build:index:Image::inline
...
            	Error:      	Not equal:
            	            	expected: "\"DIFF_NONE\""
            	            	actual  : "\"DIFF_SOME\""

            	            	Diff:
            	            	--- Expected
            	            	+++ Actual
            	            	@@ -1 +1 @@
            	            	-"DIFF_NONE"
            	            	+"DIFF_SOME"
            	Test:       	TestYAMLExampleUpgrade/upgrade-quick
            	Messages:   	at #["changes"]
        json_match.go:138: [#["detailedDiff"]] unexpected value {
              "contextHash": {
                "kind": "UPDATE"
              },
              "dockerfile": {
                "kind": "UPDATE"
              }
            }
        json_match.go:138: [#["diffs"]] unexpected value [
              "dockerfile",
              "contextHash"
            ]

This tests upgrading starting from v0.0.1 of the provider, which is probably more aggressive than necessary since we essentially launched with v0.0.2. But we can also confirm this introduces some unexpected changes when run against the current v0.0.3:

  pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:dev::provider-docker-build::pulumi:pulumi:Stack::provider-docker-build-dev]
    ~ docker-build:index:Image: (update)
        [id=inline]
        [urn=urn:pulumi:dev::provider-docker-build::docker-build:index:Image::inline]
      ~ context    : {
          ~ location: "./app" => "."
        }
      - contextHash: "36c67969e6700e87bde75fcf604a7db1fa9593194718fc0ae1c498df43228aec"

So our preview thinks we need to drop our context location when the Dockerfile is inline.

All that to say this unfortunately doesn't seem backwards-compatible -- which is unfortunate because I'm really eager to see what other kinds of inline workflows people come up with!

Based on your comment #96 (comment) it sounds like you understand the limitations, and I also agree it would probably be best to put this on hold until pulumi-go-provider can give us a little more information to distinguish unknown vs. missing values.

For my personal use, I will keep a fork with my patch because I know what the limitations are, but otherwise I propose to wait until the issue in question is resolved.

👍

@blampe blampe marked this pull request as draft June 21, 2024 22:02
@blampe blampe added the blocked label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to build an image if dockerfile contains "future" output values
3 participants