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
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Fixed

- Allow unknows value in the `dockerfile.inline` field during the preview. (https://github.com/pulumi/pulumi-docker-build/pull/89)
- Fixed the default value for `ACTIONS_CACHE_URL` when using GitHub action caching. (https://github.com/pulumi/pulumi-docker-build/pull/80)
- Fixed Java SDK publishing. (https://github.com/pulumi/pulumi-docker-build/pull/89)
- Fixed a panic that could occur when `context` was omitted. (https://github.com/pulumi/pulumi-docker-build/pull/83)
Expand Down
7 changes: 5 additions & 2 deletions provider/internal/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,12 @@ func (bc *BuildContext) validate(preview bool, d *Dockerfile) (*Dockerfile, *Con
return d, c, newCheckFailure(err, "context.location")
}

if d.Location == "" && d.Inline == "" {
if d.Location == "" && d.Inline == "" && !preview {
// If a Dockerfile wasn't provided and our context is on-disk, then
// set our Dockerfile to a default of <PATH>/Dockerfile.
// set our Dockerfile to a default of <PATH>/Dockerfile. However, if
// we're in preview mode, we don't want to do this because we don't
// know if the inline Dockerfile parameter contains unknowns or if
// we will use the default Dockerfile.
d.Location = filepath.Join(c.Location, "Dockerfile")
}

Expand Down