这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
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
5 changes: 4 additions & 1 deletion Sources/tart/Commands/Clone.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ struct Clone: AsyncParsableCommand {
@Argument(help: "new VM name")
var newName: String

@Flag(help: "connect to the OCI registry via insecure HTTP protocol")
var insecure: Bool = false

func validate() throws {
if newName.contains("/") {
throw ValidationError("<new-name> should be a local name")
Expand All @@ -24,7 +27,7 @@ struct Clone: AsyncParsableCommand {

if let remoteName = try? RemoteName(sourceName), !ociStorage.exists(remoteName) {
// Pull the VM in case it's OCI-based and doesn't exist locally yet
let registry = try Registry(host: remoteName.host, namespace: remoteName.namespace)
let registry = try Registry(host: remoteName.host, namespace: remoteName.namespace, insecure: insecure)
try await ociStorage.pull(remoteName, registry: registry)
}

Expand Down
5 changes: 4 additions & 1 deletion Sources/tart/Commands/Pull.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ struct Pull: AsyncParsableCommand {
@Argument(help: "remote VM name")
var remoteName: String

@Flag(help: "connect to the OCI registry via insecure HTTP protocol")
var insecure: Bool = false

func run() async throws {
do {
// Be more liberal when accepting local image as argument,
Expand All @@ -19,7 +22,7 @@ struct Pull: AsyncParsableCommand {
}

let remoteName = try RemoteName(remoteName)
let registry = try Registry(host: remoteName.host, namespace: remoteName.namespace)
let registry = try Registry(host: remoteName.host, namespace: remoteName.namespace, insecure: insecure)

defaultLogger.appendNewLine("pulling \(remoteName)...")

Expand Down