mirror of
https://github.com/imjasonh/krust
synced 2026-07-08 14:55:35 +00:00
successfully pushed to GAR
Signed-off-by: Jason Hall <jason@chainguard.dev>
This commit is contained in:
parent
d095c26871
commit
e47442d04d
23 changed files with 406 additions and 299 deletions
2
tests/testdata/alpine_platforms.txt
vendored
2
tests/testdata/alpine_platforms.txt
vendored
|
|
@ -17,6 +17,6 @@ fn main() {
|
|||
|
||||
# Build with Alpine base - should detect many platforms
|
||||
env RUST_LOG=info
|
||||
exec ./krust build --no-push --image test.local/alpine:latest .
|
||||
exec ./krust build --no-push .
|
||||
stderr 'Detecting available platforms from base image: alpine:latest'
|
||||
stderr 'platforms'
|
||||
|
|
|
|||
2
tests/testdata/auth_base64.txt
vendored
2
tests/testdata/auth_base64.txt
vendored
|
|
@ -29,6 +29,6 @@ env HOME=$WORK
|
|||
env RUST_LOG=debug
|
||||
|
||||
# Try to build (will fail at registry, but auth should be resolved)
|
||||
! exec ./krust build --platform linux/amd64 --image ghcr.io/user/app:latest .
|
||||
! exec ./krust build --platform linux/amd64 .
|
||||
stderr 'Resolving auth'
|
||||
stderr 'ghcr.io'
|
||||
|
|
|
|||
2
tests/testdata/auth_credential_helper.txt
vendored
2
tests/testdata/auth_credential_helper.txt
vendored
|
|
@ -57,6 +57,6 @@ env RUST_LOG=debug
|
|||
|
||||
# Try to push to mock.registry.io (will fail at network level, but should call helper)
|
||||
# Using --no-push to avoid actual network call
|
||||
! exec ./krust build --platform linux/amd64 --image mock.registry.io/test:latest .
|
||||
! exec ./krust build --platform linux/amd64 .
|
||||
# Should see the helper being attempted
|
||||
stderr 'credential helper'
|
||||
|
|
|
|||
2
tests/testdata/auth_docker_config_basic.txt
vendored
2
tests/testdata/auth_docker_config_basic.txt
vendored
|
|
@ -31,6 +31,6 @@ env RUST_LOG=debug
|
|||
|
||||
# Try to build and push (will fail at registry level, but auth should be resolved)
|
||||
# We can verify auth was read from config in debug logs
|
||||
! exec ./krust build --platform linux/amd64 --image test.example.com/app:latest .
|
||||
! exec ./krust build --platform linux/amd64 .
|
||||
stderr 'Resolving auth'
|
||||
stderr 'test.example.com'
|
||||
|
|
|
|||
4
tests/testdata/build_requires_repo.txt
vendored
4
tests/testdata/build_requires_repo.txt
vendored
|
|
@ -12,6 +12,6 @@ fn main() {
|
|||
println!("Hello, world!");
|
||||
}
|
||||
|
||||
# Build without KRUST_REPO or --image should fail
|
||||
# Build without KRUST_REPO should fail
|
||||
! exec ./krust build --no-push .
|
||||
stderr 'Either --image or KRUST_REPO must be set'
|
||||
stderr 'KRUST_REPO must be set'
|
||||
|
|
|
|||
1
tests/testdata/build_with_env.txt
vendored
1
tests/testdata/build_with_env.txt
vendored
|
|
@ -13,7 +13,6 @@ fn main() {
|
|||
}
|
||||
|
||||
# Build with KRUST_REPO should succeed
|
||||
env KRUST_REPO=test.local
|
||||
[linux] exec ./krust build --no-push --platform linux/amd64 .
|
||||
[darwin] exec ./krust build --no-push --platform linux/amd64 .
|
||||
stderr 'Building Rust project'
|
||||
|
|
|
|||
19
tests/testdata/build_with_image_flag.txt
vendored
19
tests/testdata/build_with_image_flag.txt
vendored
|
|
@ -1,19 +0,0 @@
|
|||
# Test build with --image flag
|
||||
|
||||
-- Cargo.toml --
|
||||
[package]
|
||||
name = "test-app"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
-- src/main.rs --
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
|
||||
# Build with --image flag should succeed
|
||||
[linux] exec ./krust build --no-push --platform linux/amd64 --image test.local/myapp:v1 .
|
||||
[darwin] exec ./krust build --no-push --platform linux/amd64 --image test.local/myapp:v1 .
|
||||
stderr 'Building Rust project'
|
||||
stderr 'Successfully built image'
|
||||
4
tests/testdata/clean_output.txt
vendored
4
tests/testdata/clean_output.txt
vendored
|
|
@ -13,8 +13,8 @@ fn main() {
|
|||
}
|
||||
|
||||
# With --no-push, stdout should be empty
|
||||
[linux] exec ./krust build --no-push --platform linux/amd64 --image test.local/clean:latest .
|
||||
[darwin] exec ./krust build --no-push --platform linux/amd64 --image test.local/clean:latest .
|
||||
[linux] exec ./krust build --no-push --platform linux/amd64 .
|
||||
[darwin] exec ./krust build --no-push --platform linux/amd64 .
|
||||
! stdout .
|
||||
stderr 'Building Rust project'
|
||||
stderr 'Successfully built image'
|
||||
|
|
|
|||
14
tests/testdata/custom_base_image.txt
vendored
14
tests/testdata/custom_base_image.txt
vendored
|
|
@ -16,8 +16,12 @@ fn main() {
|
|||
}
|
||||
|
||||
# Build with custom base image
|
||||
[linux] exec ./krust build --no-push --platform linux/amd64 --image test.local/alpine-app:latest .
|
||||
[darwin] exec ./krust build --no-push --platform linux/amd64 --image test.local/alpine-app:latest .
|
||||
stderr 'Building Rust project'
|
||||
stderr 'base-image.*alpine'
|
||||
stderr 'Successfully built image'
|
||||
[linux] exec ./krust build --no-push --platform linux/amd64 .
|
||||
[linux] stderr 'Building Rust project'
|
||||
[linux] stderr 'base-image.*alpine'
|
||||
[linux] stderr 'Successfully built image'
|
||||
|
||||
[darwin] exec ./krust build --no-push --platform linux/amd64 .
|
||||
[darwin] stderr 'Building Rust project'
|
||||
[darwin] stderr 'base-image.*alpine'
|
||||
[darwin] stderr 'Successfully built image'
|
||||
|
|
|
|||
4
tests/testdata/multi_platform.txt
vendored
4
tests/testdata/multi_platform.txt
vendored
|
|
@ -14,10 +14,10 @@ fn main() {
|
|||
|
||||
# Build for multiple platforms
|
||||
# Note: This may fail if toolchains aren't installed, which is expected
|
||||
[linux] exec ./krust build --no-push --platform linux/amd64,linux/arm64 --image test.local/multi:latest .
|
||||
[linux] exec ./krust build --no-push --platform linux/amd64,linux/arm64 .
|
||||
[linux] stderr 'Building for platform: linux/amd64'
|
||||
[linux] stderr 'Building for platform: linux/arm64'
|
||||
|
||||
[darwin] exec ./krust build --no-push --platform linux/amd64,linux/arm64 --image test.local/multi:latest .
|
||||
[darwin] exec ./krust build --no-push --platform linux/amd64,linux/arm64 .
|
||||
[darwin] stderr 'Building for platform: linux/amd64'
|
||||
[darwin] stderr 'Building for platform: linux/arm64'
|
||||
|
|
|
|||
2
tests/testdata/platform_detection.txt
vendored
2
tests/testdata/platform_detection.txt
vendored
|
|
@ -14,6 +14,6 @@ fn main() {
|
|||
|
||||
# Build without explicit platform - should detect from base image
|
||||
env RUST_LOG=info
|
||||
exec ./krust build --no-push --image test.local/detection:latest .
|
||||
exec ./krust build --no-push .
|
||||
stderr 'Detecting available platforms'
|
||||
stderr 'Detected platforms'
|
||||
|
|
|
|||
4
tests/testdata/platform_override.txt
vendored
4
tests/testdata/platform_override.txt
vendored
|
|
@ -14,7 +14,7 @@ fn main() {
|
|||
|
||||
# When platform is explicit, no detection should happen
|
||||
env RUST_LOG=info
|
||||
[linux] exec ./krust build --no-push --platform linux/amd64 --image test.local/explicit:latest .
|
||||
[darwin] exec ./krust build --no-push --platform linux/amd64 --image test.local/explicit:latest .
|
||||
[linux] exec ./krust build --no-push --platform linux/amd64 .
|
||||
[darwin] exec ./krust build --no-push --platform linux/amd64 .
|
||||
! stderr 'Detecting available platforms'
|
||||
stderr 'Building for platform: linux/amd64'
|
||||
|
|
|
|||
4
tests/testdata/single_platform.txt
vendored
4
tests/testdata/single_platform.txt
vendored
|
|
@ -13,10 +13,10 @@ fn main() {
|
|||
}
|
||||
|
||||
# Build for single platform
|
||||
[linux] exec ./krust build --no-push --platform linux/amd64 --image test.local/single:latest .
|
||||
[linux] exec ./krust build --no-push --platform linux/amd64 .
|
||||
[linux] stderr 'Building for platform: linux/amd64'
|
||||
[linux] stderr 'Successfully built image for 1 platform'
|
||||
|
||||
[darwin] exec ./krust build --no-push --platform linux/amd64 --image test.local/single:latest .
|
||||
[darwin] exec ./krust build --no-push --platform linux/amd64 .
|
||||
[darwin] stderr 'Building for platform: linux/amd64'
|
||||
[darwin] stderr 'Successfully built image for 1 platform'
|
||||
|
|
|
|||
4
tests/testdata/verbose_logging.txt
vendored
4
tests/testdata/verbose_logging.txt
vendored
|
|
@ -13,6 +13,6 @@ fn main() {
|
|||
}
|
||||
|
||||
# Build with --verbose should show DEBUG logs
|
||||
[linux] exec ./krust --verbose build --no-push --platform linux/amd64 --image test.local/myapp:latest .
|
||||
[darwin] exec ./krust --verbose build --no-push --platform linux/amd64 --image test.local/myapp:latest .
|
||||
[linux] exec ./krust --verbose build --no-push --platform linux/amd64 .
|
||||
[darwin] exec ./krust --verbose build --no-push --platform linux/amd64 .
|
||||
stderr 'DEBUG'
|
||||
|
|
|
|||
4
tests/testdata/workspace_support.txt
vendored
4
tests/testdata/workspace_support.txt
vendored
|
|
@ -17,7 +17,7 @@ fn main() {
|
|||
}
|
||||
|
||||
# Build workspace member by specifying its directory
|
||||
[linux] exec ./krust build --no-push --platform linux/amd64 --image test.local/workspace:latest app
|
||||
[darwin] exec ./krust build --no-push --platform linux/amd64 --image test.local/workspace:latest app
|
||||
[linux] exec ./krust build --no-push --platform linux/amd64 app
|
||||
[darwin] exec ./krust build --no-push --platform linux/amd64 app
|
||||
stderr 'Building Rust project'
|
||||
stderr 'Successfully built image'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue