From be3a22f8fd19cbfc980307c230d503b60f61385f Mon Sep 17 00:00:00 2001 From: yashodgayashan Date: Tue, 2 Jul 2024 12:38:06 +0530 Subject: [PATCH 1/2] skip push image to choreo resgitry --- dist/index.js | 151 ++++++++++++++++++++++++++------------------------ index.js | 5 ++ 2 files changed, 83 insertions(+), 73 deletions(-) diff --git a/dist/index.js b/dist/index.js index c119156..27d098c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,7 +1,7 @@ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ 529: +/***/ 690: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -28,7 +28,7 @@ var __importStar = (this && this.__importStar) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.issue = exports.issueCommand = void 0; const os = __importStar(__nccwpck_require__(37)); -const utils_1 = __nccwpck_require__(445); +const utils_1 = __nccwpck_require__(353); /** * Commands * @@ -100,7 +100,7 @@ function escapeProperty(s) { /***/ }), -/***/ 902: +/***/ 935: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -135,12 +135,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0; -const command_1 = __nccwpck_require__(529); -const file_command_1 = __nccwpck_require__(582); -const utils_1 = __nccwpck_require__(445); +const command_1 = __nccwpck_require__(690); +const file_command_1 = __nccwpck_require__(898); +const utils_1 = __nccwpck_require__(353); const os = __importStar(__nccwpck_require__(37)); const path = __importStar(__nccwpck_require__(17)); -const oidc_utils_1 = __nccwpck_require__(663); +const oidc_utils_1 = __nccwpck_require__(901); /** * The code to exit an action */ @@ -425,17 +425,17 @@ exports.getIDToken = getIDToken; /** * Summary exports */ -var summary_1 = __nccwpck_require__(184); +var summary_1 = __nccwpck_require__(50); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ -var summary_2 = __nccwpck_require__(184); +var summary_2 = __nccwpck_require__(50); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports */ -var path_utils_1 = __nccwpck_require__(531); +var path_utils_1 = __nccwpck_require__(341); Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); @@ -443,7 +443,7 @@ Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: funct /***/ }), -/***/ 582: +/***/ 898: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -474,8 +474,8 @@ exports.prepareKeyValueMessage = exports.issueFileCommand = void 0; /* eslint-disable @typescript-eslint/no-explicit-any */ const fs = __importStar(__nccwpck_require__(147)); const os = __importStar(__nccwpck_require__(37)); -const uuid_1 = __nccwpck_require__(360); -const utils_1 = __nccwpck_require__(445); +const uuid_1 = __nccwpck_require__(368); +const utils_1 = __nccwpck_require__(353); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { @@ -508,7 +508,7 @@ exports.prepareKeyValueMessage = prepareKeyValueMessage; /***/ }), -/***/ 663: +/***/ 901: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -524,9 +524,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; -const http_client_1 = __nccwpck_require__(915); -const auth_1 = __nccwpck_require__(339); -const core_1 = __nccwpck_require__(902); +const http_client_1 = __nccwpck_require__(658); +const auth_1 = __nccwpck_require__(660); +const core_1 = __nccwpck_require__(935); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { @@ -592,7 +592,7 @@ exports.OidcClient = OidcClient; /***/ }), -/***/ 531: +/***/ 341: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -657,7 +657,7 @@ exports.toPlatformPath = toPlatformPath; /***/ }), -/***/ 184: +/***/ 50: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -947,7 +947,7 @@ exports.summary = _summary; /***/ }), -/***/ 445: +/***/ 353: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -994,7 +994,7 @@ exports.toCommandProperties = toCommandProperties; /***/ }), -/***/ 339: +/***/ 660: /***/ (function(__unused_webpack_module, exports) { "use strict"; @@ -1082,7 +1082,7 @@ exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHand /***/ }), -/***/ 915: +/***/ 658: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1120,8 +1120,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; const http = __importStar(__nccwpck_require__(685)); const https = __importStar(__nccwpck_require__(687)); -const pm = __importStar(__nccwpck_require__(810)); -const tunnel = __importStar(__nccwpck_require__(563)); +const pm = __importStar(__nccwpck_require__(697)); +const tunnel = __importStar(__nccwpck_require__(477)); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; @@ -1694,7 +1694,7 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa /***/ }), -/***/ 810: +/***/ 697: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -1762,7 +1762,7 @@ exports.checkBypass = checkBypass; /***/ }), -/***/ 314: +/***/ 573: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1946,7 +1946,7 @@ exports.getCmdPath = getCmdPath; /***/ }), -/***/ 23: +/***/ 725: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -1985,7 +1985,7 @@ const assert_1 = __nccwpck_require__(491); const childProcess = __importStar(__nccwpck_require__(81)); const path = __importStar(__nccwpck_require__(17)); const util_1 = __nccwpck_require__(837); -const ioUtil = __importStar(__nccwpck_require__(314)); +const ioUtil = __importStar(__nccwpck_require__(573)); const exec = util_1.promisify(childProcess.exec); const execFile = util_1.promisify(childProcess.execFile); /** @@ -2294,15 +2294,15 @@ function copyFile(srcFile, destFile, force) { /***/ }), -/***/ 563: +/***/ 477: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -module.exports = __nccwpck_require__(918); +module.exports = __nccwpck_require__(162); /***/ }), -/***/ 918: +/***/ 162: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -2312,7 +2312,7 @@ var net = __nccwpck_require__(808); var tls = __nccwpck_require__(404); var http = __nccwpck_require__(685); var https = __nccwpck_require__(687); -var events = __nccwpck_require__(820); +var events = __nccwpck_require__(361); var assert = __nccwpck_require__(491); var util = __nccwpck_require__(837); @@ -2574,7 +2574,7 @@ exports.debug = debug; // for test /***/ }), -/***/ 360: +/***/ 368: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -2638,29 +2638,29 @@ Object.defineProperty(exports, "parse", ({ } })); -var _v = _interopRequireDefault(__nccwpck_require__(125)); +var _v = _interopRequireDefault(__nccwpck_require__(258)); -var _v2 = _interopRequireDefault(__nccwpck_require__(530)); +var _v2 = _interopRequireDefault(__nccwpck_require__(559)); -var _v3 = _interopRequireDefault(__nccwpck_require__(930)); +var _v3 = _interopRequireDefault(__nccwpck_require__(872)); -var _v4 = _interopRequireDefault(__nccwpck_require__(681)); +var _v4 = _interopRequireDefault(__nccwpck_require__(34)); -var _nil = _interopRequireDefault(__nccwpck_require__(361)); +var _nil = _interopRequireDefault(__nccwpck_require__(51)); -var _version = _interopRequireDefault(__nccwpck_require__(987)); +var _version = _interopRequireDefault(__nccwpck_require__(630)); -var _validate = _interopRequireDefault(__nccwpck_require__(848)); +var _validate = _interopRequireDefault(__nccwpck_require__(879)); -var _stringify = _interopRequireDefault(__nccwpck_require__(4)); +var _stringify = _interopRequireDefault(__nccwpck_require__(992)); -var _parse = _interopRequireDefault(__nccwpck_require__(615)); +var _parse = _interopRequireDefault(__nccwpck_require__(783)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/***/ 611: +/***/ 102: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -2690,7 +2690,7 @@ exports["default"] = _default; /***/ }), -/***/ 361: +/***/ 51: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -2705,7 +2705,7 @@ exports["default"] = _default; /***/ }), -/***/ 615: +/***/ 783: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -2716,7 +2716,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(848)); +var _validate = _interopRequireDefault(__nccwpck_require__(879)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -2757,7 +2757,7 @@ exports["default"] = _default; /***/ }), -/***/ 270: +/***/ 557: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -2772,7 +2772,7 @@ exports["default"] = _default; /***/ }), -/***/ 714: +/***/ 160: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -2803,7 +2803,7 @@ function rng() { /***/ }), -/***/ 908: +/***/ 850: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -2833,7 +2833,7 @@ exports["default"] = _default; /***/ }), -/***/ 4: +/***/ 992: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -2844,7 +2844,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(848)); +var _validate = _interopRequireDefault(__nccwpck_require__(879)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -2879,7 +2879,7 @@ exports["default"] = _default; /***/ }), -/***/ 125: +/***/ 258: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -2890,9 +2890,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(714)); +var _rng = _interopRequireDefault(__nccwpck_require__(160)); -var _stringify = _interopRequireDefault(__nccwpck_require__(4)); +var _stringify = _interopRequireDefault(__nccwpck_require__(992)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -2993,7 +2993,7 @@ exports["default"] = _default; /***/ }), -/***/ 530: +/***/ 559: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -3004,9 +3004,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(535)); +var _v = _interopRequireDefault(__nccwpck_require__(810)); -var _md = _interopRequireDefault(__nccwpck_require__(611)); +var _md = _interopRequireDefault(__nccwpck_require__(102)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -3016,7 +3016,7 @@ exports["default"] = _default; /***/ }), -/***/ 535: +/***/ 810: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -3028,9 +3028,9 @@ Object.defineProperty(exports, "__esModule", ({ exports["default"] = _default; exports.URL = exports.DNS = void 0; -var _stringify = _interopRequireDefault(__nccwpck_require__(4)); +var _stringify = _interopRequireDefault(__nccwpck_require__(992)); -var _parse = _interopRequireDefault(__nccwpck_require__(615)); +var _parse = _interopRequireDefault(__nccwpck_require__(783)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -3101,7 +3101,7 @@ function _default(name, version, hashfunc) { /***/ }), -/***/ 930: +/***/ 872: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -3112,9 +3112,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _rng = _interopRequireDefault(__nccwpck_require__(714)); +var _rng = _interopRequireDefault(__nccwpck_require__(160)); -var _stringify = _interopRequireDefault(__nccwpck_require__(4)); +var _stringify = _interopRequireDefault(__nccwpck_require__(992)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -3145,7 +3145,7 @@ exports["default"] = _default; /***/ }), -/***/ 681: +/***/ 34: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -3156,9 +3156,9 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _v = _interopRequireDefault(__nccwpck_require__(535)); +var _v = _interopRequireDefault(__nccwpck_require__(810)); -var _sha = _interopRequireDefault(__nccwpck_require__(908)); +var _sha = _interopRequireDefault(__nccwpck_require__(850)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -3168,7 +3168,7 @@ exports["default"] = _default; /***/ }), -/***/ 848: +/***/ 879: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -3179,7 +3179,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _regex = _interopRequireDefault(__nccwpck_require__(270)); +var _regex = _interopRequireDefault(__nccwpck_require__(557)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -3192,7 +3192,7 @@ exports["default"] = _default; /***/ }), -/***/ 987: +/***/ 630: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -3203,7 +3203,7 @@ Object.defineProperty(exports, "__esModule", ({ })); exports["default"] = void 0; -var _validate = _interopRequireDefault(__nccwpck_require__(848)); +var _validate = _interopRequireDefault(__nccwpck_require__(879)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -3244,7 +3244,7 @@ module.exports = require("crypto"); /***/ }), -/***/ 820: +/***/ 361: /***/ ((module) => { "use strict"; @@ -3357,8 +3357,8 @@ module.exports = require("util"); var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { -const core = __nccwpck_require__(902); -const io = __nccwpck_require__(23); +const core = __nccwpck_require__(935); +const io = __nccwpck_require__(725); const { spawn } = __nccwpck_require__(81); const fs = __nccwpck_require__(147); const path = __nccwpck_require__(17); @@ -3632,6 +3632,11 @@ async function acrLogin(cred) { } async function dockerPush(cred) { + // We do a docker login to increase the image pull rate limit and this registry id is added as a choreo-docer-hub + // so we skip the docker push for this registry + if (cred.registry_id == "choreo-docker-hub") { + return; + } const tempImage = process.env.DOCKER_TEMP_IMAGE; const registryUrl = cred.credentials.registry; const newImageTag = `${registryUrl}/${choreoApp}:${process.env.NEW_SHA}`; diff --git a/index.js b/index.js index be97d8d..24bbb95 100644 --- a/index.js +++ b/index.js @@ -273,6 +273,11 @@ async function acrLogin(cred) { } async function dockerPush(cred) { + // We do a docker login to increase the image pull rate limit and this registry id is added as a choreo-docer-hub + // so we skip the docker push for this registry + if (cred.registry_id == "choreo-docker-hub") { + return; + } const tempImage = process.env.DOCKER_TEMP_IMAGE; const registryUrl = cred.credentials.registry; const newImageTag = `${registryUrl}/${choreoApp}:${process.env.NEW_SHA}`; From 0812b6debc1efe3037bf8af4e5db91c9fe297cd8 Mon Sep 17 00:00:00 2001 From: yashodgayashan Date: Tue, 2 Jul 2024 12:43:00 +0530 Subject: [PATCH 2/2] resolved requested changes --- dist/index.js | 2 +- index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 27d098c..753bd36 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3632,7 +3632,7 @@ async function acrLogin(cred) { } async function dockerPush(cred) { - // We do a docker login to increase the image pull rate limit and this registry id is added as a choreo-docer-hub + // We do a docker login to increase the image pull rate limit and this registry id is added as a choreo-docker-hub // so we skip the docker push for this registry if (cred.registry_id == "choreo-docker-hub") { return; diff --git a/index.js b/index.js index 24bbb95..6282921 100644 --- a/index.js +++ b/index.js @@ -273,7 +273,7 @@ async function acrLogin(cred) { } async function dockerPush(cred) { - // We do a docker login to increase the image pull rate limit and this registry id is added as a choreo-docer-hub + // We do a docker login to increase the image pull rate limit and this registry id is added as a choreo-docker-hub // so we skip the docker push for this registry if (cred.registry_id == "choreo-docker-hub") { return;