From 3a2cba69291a91ec5b7426b8ab84204b5b9fb76f Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Mon, 10 Jul 2023 18:19:21 +0400 Subject: [PATCH] Introduce TART_REGISTRY_HOSTNAME (#545) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Introduce TART_REGISTRY_HOST * TART_REGISTRY_HOST → TART_REGISTRY_HOSTNAME --- .../tart/Credentials/EnvironmentCredentialsProvider.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/tart/Credentials/EnvironmentCredentialsProvider.swift b/Sources/tart/Credentials/EnvironmentCredentialsProvider.swift index 5deb949..c91e273 100644 --- a/Sources/tart/Credentials/EnvironmentCredentialsProvider.swift +++ b/Sources/tart/Credentials/EnvironmentCredentialsProvider.swift @@ -2,6 +2,11 @@ import Foundation class EnvironmentCredentialsProvider: CredentialsProvider { func retrieve(host: String) throws -> (String, String)? { + if let tartRegistryHostname = ProcessInfo.processInfo.environment["TART_REGISTRY_HOSTNAME"], + tartRegistryHostname != host { + return nil + } + let username = ProcessInfo.processInfo.environment["TART_REGISTRY_USERNAME"] let password = ProcessInfo.processInfo.environment["TART_REGISTRY_PASSWORD"] if let username = username, let password = password {