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

Removing validation of deprecated io.buildpacks.stack.id #2119

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pglushko
Copy link

@pglushko pglushko commented Apr 7, 2024

Summary

Replaces the error with a warning.

Output

Warning: No schema version declared in project.toml, defaulting to schema version 0.1
latest: Pulling from paketobuildpacks/builder-jammy-base
Digest: sha256:9bb4d01f8d42ccb9aa3b6b10a5876c8913e3ba9709882f18c9bd8c54f46d862b
Status: Image is up to date for paketobuildpacks/builder-jammy-base:latest
latest: Pulling from buildpacks/builder/php
Digest: sha256:91065e07a53b1c048fcaf8e49936a9d19c388b2dfdf2e7e589885aab2f5aae79
Status: Image is up to date for gcr.io/buildpacks/builder/php:latest
Warning: deprecated usage of stack

Before

Error message that interrupted build process

After

Warning message, build continues

Documentation

https://buildpacks.io/docs/for-app-developers/concepts/base-images/stack/

  • Should this change be documented?
    • Yes, see #___
    • [ x] No, already documented in docs

Related

#2104

Resolves #2104

Signed-off-by: Pavlo Glushko <pawel.glushko@gmail.com>
@github-actions github-actions bot added type/enhancement Issue that requests a new feature or improvement. type/chore Issue that requests non-user facing changes. labels Apr 7, 2024
@github-actions github-actions bot added this to the 0.34.0 milestone Apr 7, 2024
@pglushko
Copy link
Author

pglushko commented Apr 7, 2024

@natalieparellano I've changed validation to warning, and build process continues, but now there is error on next step.
I am new to pack and it would be great if someone familiar with the project would assist me

After change I tried to executed command mentioned in issue got nil pointer dereference

./out/pack build stack-validation --builder paketobuildpacks/builder-jammy-base --run-image gcr.io/buildpacks/builder/php:latest

Warning: No schema version declared in project.toml, defaulting to schema version 0.1
latest: Pulling from paketobuildpacks/builder-jammy-base
Digest: sha256:9bb4d01f8d42ccb9aa3b6b10a5876c8913e3ba9709882f18c9bd8c54f46d862b
Status: Image is up to date for paketobuildpacks/builder-jammy-base:latest
latest: Pulling from buildpacks/builder/php
Digest: sha256:91065e07a53b1c048fcaf8e49936a9d19c388b2dfdf2e7e589885aab2f5aae79
Status: Image is up to date for gcr.io/buildpacks/builder/php:latest
Warning: deprecated usage of stack
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x6d133f]
goroutine 1 [running]:
github.com/buildpacks/pack/pkg/dist.GetLabel({0x0?, 0x0?}, {0x12c9046, 0x1a}, {0x1097760, 0xc0002409c0})
github.com/buildpacks/pack/pkg/dist/image.go:31 +0x3f
github.com/buildpacks/pack/pkg/client.(*Client).Build(, {, _}, {{0x0, 0x0}, {0x7fff85335d27, 0x10}, {0x7fff85335d42, 0x23}, {0x0, ...}, ...})
github.com/buildpacks/pack/pkg/client/build.go:374 +0x111d
github.com/buildpacks/pack/internal/commands.Build.func1(0xc000526900, {0xc0000caaa0?, 0x0?, 0x0?})
github.com/buildpacks/pack/internal/commands/build.go:157 +0x12f8
github.com/buildpacks/pack/internal/commands.Build.logError.func3(0xc000492600?, {0xc0000caaa0?, 0x4?, 0x12ac3b2?})
github.com/buildpacks/pack/internal/commands/commands.go:58 +0x44
github.com/spf13/cobra.(*Command).execute(0xc000526900, {0xc0000caa50, 0x5, 0x5})
github.com/spf13/cobra@v1.8.0/command.go:983 +0xabc
github.com/spf13/cobra.(*Command).ExecuteC(0xc000526600)
github.com/spf13/cobra@v1.8.0/command.go:1115 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/spf13/cobra.(*Command).ExecuteContext(0x14930c0?, {0x148ad98?, 0xc0000ca960?})
github.com/spf13/cobra@v1.8.0/command.go:1032 +0x47
main.main()
github.com/buildpacks/pack/cmd/pack/main.go:26 +0xd5

@jjbustamante jjbustamante modified the milestones: 0.34.0, 0.35.0 Apr 9, 2024
Signed-off-by: Pavlo Glushko <pawel.glushko@gmail.com>
@github-actions github-actions bot modified the milestones: 0.35.0, 0.34.0 Apr 21, 2024
@jjbustamante jjbustamante removed this from the 0.34.0 milestone Apr 22, 2024
@natalieparellano
Copy link
Member

@pglushko thanks for making the changes. I think we now need to update the acceptance test here:

when("the run image has the wrong stack ID", func() {
to expect a warning instead of a failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/chore Issue that requests non-user facing changes. type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove validation of deprecated io.buildpacks.stack.id
3 participants