MCPcopy
hub / github.com/firecow/gitlab-ci-local / validateCiDependencyProxyServerAuthentication

Method validateCiDependencyProxyServerAuthentication

src/job.ts:1252–1268  ·  view source on GitHub ↗
(imageName: string)

Source from the content-addressed store, hash-verified

1250 }
1251
1252 private async validateCiDependencyProxyServerAuthentication (imageName: string) {
1253 const CI_DEPENDENCY_PROXY_SERVER = this._variables["CI_DEPENDENCY_PROXY_SERVER"];
1254 if (!imageName.startsWith(CI_DEPENDENCY_PROXY_SERVER)) {
1255 return;
1256 }
1257 try {
1258 await Utils.spawn([this.argv.containerExecutable, "login", CI_DEPENDENCY_PROXY_SERVER]);
1259 } catch (e: any) {
1260 const errMsg = `Please authenticate to the Dependency Proxy (${CI_DEPENDENCY_PROXY_SERVER}) https://docs.gitlab.com/ee/user/packages/dependency_proxy/#authenticate-with-the-dependency-proxy`;
1261 if (this.argv.containerExecutable == "docker") {
1262 assert(!e.stderr.includes("Cannot perform an interactive login"), errMsg);
1263 } else if (this.argv.containerExecutable == "podman") {
1264 assert(!e.stderr.includes("Username: Error: getting username and password: reading username: EOF"), errMsg);
1265 }
1266 throw e;
1267 }
1268 }
1269
1270 private async pullImage (writeStreams: WriteStreams, imageToPull: string, imagePlatform: string | null = null) {
1271 const pullPolicy = this.argv.pullPolicy;

Callers 1

actualPullMethod · 0.95

Calls 1

spawnMethod · 0.80

Tested by

no test coverage detected