diff --git a/Sources/ContainerCommands/Network/NetworkDelete.swift b/Sources/ContainerCommands/Network/NetworkDelete.swift index 80e545e2..4df3374b 100644 --- a/Sources/ContainerCommands/Network/NetworkDelete.swift +++ b/Sources/ContainerCommands/Network/NetworkDelete.swift @@ -90,8 +90,8 @@ extension Application { for network in networks { group.addTask { do { - // delete atomically disables the IP allocator, then deletes - // the allocator disable fails if any IPs are still in use + // Delete atomically disables the IP allocator, then deletes + // the allocator. The disable fails if any IPs are still in use. try await ClientNetwork.delete(id: network.id) print(network.id) return nil diff --git a/Sources/ContainerCommands/Registry/Login.swift b/Sources/ContainerCommands/Registry/Login.swift index 3346f3fe..018e168d 100644 --- a/Sources/ContainerCommands/Registry/Login.swift +++ b/Sources/ContainerCommands/Registry/Login.swift @@ -25,20 +25,23 @@ extension Application { public struct Login: AsyncParsableCommand { public init() {} public static let configuration = CommandConfiguration( - abstract: "Login to a registry" + abstract: "Log in to a registry" ) - @Option(name: .shortAndLong, help: "Username") - var username: String = "" + @OptionGroup + var registry: Flags.Registry @Flag(help: "Take the password from stdin") var passwordStdin: Bool = false - @Argument(help: "Registry server name") - var server: String + @Option(name: .shortAndLong, help: "Registry user name") + var username: String = "" @OptionGroup - var registry: Flags.Registry + var global: Flags.Global + + @Argument(help: "Registry server name") + var server: String public func run() async throws { var username = self.username diff --git a/Sources/ContainerCommands/Registry/Logout.swift b/Sources/ContainerCommands/Registry/Logout.swift index ac115501..1eb27419 100644 --- a/Sources/ContainerCommands/Registry/Logout.swift +++ b/Sources/ContainerCommands/Registry/Logout.swift @@ -25,12 +25,12 @@ extension Application { public static let configuration = CommandConfiguration( abstract: "Log out from a registry") - @Argument(help: "Registry server name") - var registry: String - @OptionGroup var global: Flags.Global + @Argument(help: "Registry server name") + var registry: String + public func run() async throws { let keychain = KeychainHelper(id: Constants.keychainID) let r = Reference.resolveDomain(domain: registry) diff --git a/Sources/ContainerCommands/Registry/RegistryCommand.swift b/Sources/ContainerCommands/Registry/RegistryCommand.swift index 55c2fc1e..5a478204 100644 --- a/Sources/ContainerCommands/Registry/RegistryCommand.swift +++ b/Sources/ContainerCommands/Registry/RegistryCommand.swift @@ -18,15 +18,16 @@ import ArgumentParser extension Application { public struct RegistryCommand: AsyncParsableCommand { - public init() {} public static let configuration = CommandConfiguration( commandName: "registry", - abstract: "Manage registry configurations", + abstract: "Manage registry logins", subcommands: [ Login.self, Logout.self, ], aliases: ["r"] ) + + public init() {} } } diff --git a/Sources/ContainerCommands/Volume/VolumeDelete.swift b/Sources/ContainerCommands/Volume/VolumeDelete.swift index 54133d21..021d910d 100644 --- a/Sources/ContainerCommands/Volume/VolumeDelete.swift +++ b/Sources/ContainerCommands/Volume/VolumeDelete.swift @@ -71,8 +71,6 @@ extension Application.VolumeCommand { for volume in volumes { group.addTask { do { - // delete atomically disables the IP allocator, then deletes - // the allocator disable fails if any IPs are still in use try await ClientVolume.delete(name: volume.id) print(volume.id) return nil