Add test that we replace meta args in builder correctly (#255)

Depends on https://github.com/apple/container-builder-shim/pull/24 

Related to https://github.com/apple/container/issues/252

---------

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
This commit is contained in:
Kathryn Baldauf
2025-06-24 13:25:58 -07:00
committed by GitHub
parent 5d36134b96
commit 4a6a1f15d8
3 changed files with 18 additions and 5 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ if let path = ProcessInfo.processInfo.environment["CONTAINERIZATION_PATH"] {
let releaseVersion = ProcessInfo.processInfo.environment["RELEASE_VERSION"] ?? "0.0.0"
let gitCommit = ProcessInfo.processInfo.environment["GIT_COMMIT"] ?? "unspecified"
let builderShimVersion = "0.2.0"
let builderShimVersion = "0.2.1"
let package = Package(
name: "container",
+4 -4
View File
@@ -110,7 +110,7 @@ import SwiftProtobuf
///
///
/// NOTE: the client should close the send stream once it has finished
/// receiving the build output or abadon the current build due to error.
/// receiving the build output or abandon the current build due to error.
/// Server should keep the stream open until it receives the EOF that client
/// has closed the stream, which the server should then close its send stream.
///
@@ -340,7 +340,7 @@ public struct Com_Apple_Container_Build_V1_BuilderNIOClient: Com_Apple_Container
///
///
/// NOTE: the client should close the send stream once it has finished
/// receiving the build output or abadon the current build due to error.
/// receiving the build output or abandon the current build due to error.
/// Server should keep the stream open until it receives the EOF that client
/// has closed the stream, which the server should then close its send stream.
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
@@ -603,7 +603,7 @@ public enum Com_Apple_Container_Build_V1_BuilderClientMetadata {
///
///
/// NOTE: the client should close the send stream once it has finished
/// receiving the build output or abadon the current build due to error.
/// receiving the build output or abandon the current build due to error.
/// Server should keep the stream open until it receives the EOF that client
/// has closed the stream, which the server should then close its send stream.
///
@@ -750,7 +750,7 @@ extension Com_Apple_Container_Build_V1_BuilderProvider {
///
///
/// NOTE: the client should close the send stream once it has finished
/// receiving the build output or abadon the current build due to error.
/// receiving the build output or abandon the current build due to error.
/// Server should keep the stream open until it receives the EOF that client
/// has closed the stream, which the server should then close its send stream.
///
@@ -113,6 +113,19 @@ extension TestCLIBuildBase {
#expect(try self.inspectImage(imageName) == imageName, "expected to have successfully built \(imageName)")
}
@Test func testBuildArg() throws {
let tempDir: URL = try createTempDir()
let dockerfile: String =
"""
ARG TAG=unknown
FROM ghcr.io/linuxcontainers/alpine:${TAG}
"""
try createContext(tempDir: tempDir, dockerfile: dockerfile)
let imageName: String = "registry.local/build-arg:\(UUID().uuidString)"
try self.build(tag: imageName, tempDir: tempDir, args: ["TAG=3.20"])
#expect(try self.inspectImage(imageName) == imageName, "expected to have successfully built \(imageName)")
}
@Test func testBuildNetworkAccess() throws {
let tempDir: URL = try createTempDir()
let dockerfile: String =