diff --git a/.github/workflows/check-latest-release.yml b/.github/workflows/check-latest-release.yml index b02bc975b..b514c02e8 100644 --- a/.github/workflows/check-latest-release.yml +++ b/.github/workflows/check-latest-release.yml @@ -72,7 +72,7 @@ jobs: id: scan-image uses: anchore/scan-action@v5 with: - image: buildpacksio/pack:${{ steps.read-go.outputs.latest-release-version }} + image: docker.io/buildpacksio/pack:${{ steps.read-go.outputs.latest-release-version }} - name: Create issue if needed if: failure() && steps.scan-image.outcome == 'failure' env: @@ -91,7 +91,7 @@ jobs: search_output=$(gh issue list --search "$title" --label "$label") GITHUB_WORKFLOW_URL=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID - body="Latest buildpacksio/pack v${{ steps.read-go.outputs.latest-release-version }} triggered CVE(s) from Grype. For further details, see: $GITHUB_WORKFLOW_URL" + body="Latest docker.io/buildpacksio/pack v${{ steps.read-go.outputs.latest-release-version }} triggered CVE(s) from Grype. For further details, see: $GITHUB_WORKFLOW_URL" if [ -z "${search_output// }" ] then diff --git a/.github/workflows/delivery-docker.yml b/.github/workflows/delivery-docker.yml index 9223d91a4..a1395b909 100644 --- a/.github/workflows/delivery-docker.yml +++ b/.github/workflows/delivery-docker.yml @@ -16,7 +16,7 @@ on: default: false env: - REGISTRY_NAME: 'index.docker.io' + REGISTRY_NAME: 'docker.io' USER_NAME: 'buildpacksio' IMG_NAME: 'pack' diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index f6f16acc7..ea3a09b4b 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -127,15 +127,15 @@ make prepare-for-pr ### Acceptance Tests Some options users can provide to our acceptance tests are: -| ENV_VAR | Description | Default | -|--------------|------------------------------------------------------------------------|---------| -| ACCEPTANCE_SUITE_CONFIG | A set of configurations for how to run the acceptance tests, describing the version of `pack` used for testing, the version of `pack` used to create the builders used in the test, and the version of `lifecycle` binaries used to test with Github | `[{"pack": "current", "pack_create_builder": "current", "lifecycle": "default"}]'` | -| COMPILE_PACK_WITH_VERSION | Tell `pack` what version to consider itself | `dev` | -| GITHUB_TOKEN | A Github Token, used when downloading `pack` and `lifecycle` releases from Github during the test setup | "" | -| LIFECYCLE_IMAGE | Image reference to be used in untrusted builder workflows | buildpacksio/lifecycle: | -| LIFECYCLE_PATH | Path to a `.tgz` file filled with a set of `lifecycle` binaries | The Github release for the default version of lifecycle in `pack` | -| PACK_PATH | Path to a `pack` executable. | A compiled version of the current branch | -| PREVIOUS_LIFECYCLE_IMAGE | Image reference to be used in untrusted builder workflows, used to test compatibility of `pack` with the n-1 version of the `lifecycle` | buildpacksio/lifecycle:, buildpacksio/lifecycle: | -| PREVIOUS_LIFECYCLE_PATH | Path to a `.tgz` file filled with a set of `lifecycle` binaries, used to test compatibility of `pack` with the n-1 version of the `lifecycle` | The Github release for n-1 release of `lifecycle` | -| PREVIOUS_PACK_FIXTURES_PATH | Path to a set of fixtures, used to override the most up-to-date fixtures, in case of changed functionality | `acceptance/testdata/pack_previous_fixtures_overrides` | -| PREVIOUS_PACK_PATH | Path to a `pack` executable, used to test compatibility with n-1 version of `pack` | The most recent release from `pack`'s Github release | +| ENV_VAR | Description | Default | +|--------------|------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------| +| ACCEPTANCE_SUITE_CONFIG | A set of configurations for how to run the acceptance tests, describing the version of `pack` used for testing, the version of `pack` used to create the builders used in the test, and the version of `lifecycle` binaries used to test with Github | `[{"pack": "current", "pack_create_builder": "current", "lifecycle": "default"}]'` | +| COMPILE_PACK_WITH_VERSION | Tell `pack` what version to consider itself | `dev` | +| GITHUB_TOKEN | A Github Token, used when downloading `pack` and `lifecycle` releases from Github during the test setup | "" | +| LIFECYCLE_IMAGE | Image reference to be used in untrusted builder workflows | docker.io/buildpacksio/lifecycle: | +| LIFECYCLE_PATH | Path to a `.tgz` file filled with a set of `lifecycle` binaries | The Github release for the default version of lifecycle in `pack` | +| PACK_PATH | Path to a `pack` executable. | A compiled version of the current branch | +| PREVIOUS_LIFECYCLE_IMAGE | Image reference to be used in untrusted builder workflows, used to test compatibility of `pack` with the n-1 version of the `lifecycle` | docker.io/buildpacksio/lifecycle:, buildpacksio/lifecycle: | +| PREVIOUS_LIFECYCLE_PATH | Path to a `.tgz` file filled with a set of `lifecycle` binaries, used to test compatibility of `pack` with the n-1 version of the `lifecycle` | The Github release for n-1 release of `lifecycle` | +| PREVIOUS_PACK_FIXTURES_PATH | Path to a set of fixtures, used to override the most up-to-date fixtures, in case of changed functionality | `acceptance/testdata/pack_previous_fixtures_overrides` | +| PREVIOUS_PACK_PATH | Path to a `pack` executable, used to test compatibility with n-1 version of `pack` | The most recent release from `pack`'s Github release | diff --git a/internal/commands/build.go b/internal/commands/build.go index 144bc1765..3cfb455a1 100644 --- a/internal/commands/build.go +++ b/internal/commands/build.go @@ -442,7 +442,12 @@ func isForbiddenTag(cfg config.Config, input, lifecycle, builder string) error { } } - if inputImage.Context().RepositoryStr() == config.DefaultLifecycleImageRepo { + defaultLifecycleImageRef, err := name.ParseReference(config.DefaultLifecycleImageRepo) + if err != nil { + return errors.Wrapf(err, "parsing default lifecycle image %s", config.DefaultLifecycleImageRepo) + } + + if inputImage.Context().RepositoryStr() == defaultLifecycleImageRef.Context().RepositoryStr() { return fmt.Errorf("name must not match default lifecycle image name") } diff --git a/internal/commands/build_test.go b/internal/commands/build_test.go index 1d4f4b529..7137dfcb5 100644 --- a/internal/commands/build_test.go +++ b/internal/commands/build_test.go @@ -164,6 +164,13 @@ func testBuildCommand(t *testing.T, when spec.G, it spec.S) { h.AssertNotNil(t, command.Execute()) h.AssertContains(t, outBuf.String(), "name must not match default lifecycle image name") }) + + it("refuses to build when using fully qualified name", func() { + logger.WantVerbose(true) + command.SetArgs([]string{"docker.io/buildpacksio/lifecycle:test", "--builder", "test", "--trust-builder"}) + h.AssertNotNil(t, command.Execute()) + h.AssertContains(t, outBuf.String(), "name must not match default lifecycle image name") + }) }) when("the builder is not trusted", func() { diff --git a/internal/config/config.go b/internal/config/config.go index e15da68f0..465c231a1 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -149,4 +149,4 @@ func GetRegistry(cfg Config, registryName string) (Registry, error) { return Registry{}, errors.Errorf("registry %s is not defined in your config file", style.Symbol(registryName)) } -const DefaultLifecycleImageRepo = "buildpacksio/lifecycle" +const DefaultLifecycleImageRepo = "docker.io/buildpacksio/lifecycle"