Compare commits

..

2 Commits

Author SHA1 Message Date
Oliver King 078bac016f Add node modules and compiled JavaScript from main 2022-11-11 18:53:50 +00:00
Oliver King 4912b34152 Merge branch 'releases/v3' into tmp 2022-11-11 18:53:26 +00:00
6 changed files with 187 additions and 258 deletions
+4 -4
View File
@@ -19,7 +19,7 @@ Refer to the [action metadata file](./action.yml) for details about inputs. Note
### Kubeconfig approach ### Kubeconfig approach
```yaml ```yaml
- uses: azure/k8s-set-context@v3 - uses: azure/k8s-set-context@v2
with: with:
method: kubeconfig method: kubeconfig
kubeconfig: <your kubeconfig> kubeconfig: <your kubeconfig>
@@ -50,7 +50,7 @@ Please refer to documentation on fetching [kubeconfig for any generic K8s cluste
### Service account approach ### Service account approach
```yaml ```yaml
- uses: azure/k8s-set-context@v3 - uses: azure/k8s-set-context@v2
with: with:
method: service-account method: service-account
k8s-url: <URL of the cluster's API server> k8s-url: <URL of the cluster's API server>
@@ -74,7 +74,7 @@ kubectl get secret <service-account-secret-name> -n <namespace> -o yaml
### Service account approach for arc cluster ### Service account approach for arc cluster
```yaml ```yaml
- uses: azure/k8s-set-context@v3 - uses: azure/k8s-set-context@v2
with: with:
method: service-account method: service-account
cluster-type: arc cluster-type: arc
@@ -86,7 +86,7 @@ kubectl get secret <service-account-secret-name> -n <namespace> -o yaml
### Service principal approach for arc cluster ### Service principal approach for arc cluster
```yaml ```yaml
- uses: azure/k8s-set-context@v3 - uses: azure/k8s-set-context@v2
with: with:
method: service-principal method: service-principal
cluster-type: arc cluster-type: arc
+132 -201
View File
@@ -148478,10 +148478,10 @@ module.exports = (fromStream, toStream) => {
module.exports = minimatch module.exports = minimatch
minimatch.Minimatch = Minimatch minimatch.Minimatch = Minimatch
var path = (function () { try { return __nccwpck_require__(71017) } catch (e) {}}()) || { var path = { sep: '/' }
sep: '/' try {
} path = __nccwpck_require__(71017)
minimatch.sep = path.sep } catch (er) {}
var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
var expand = __nccwpck_require__(90308) var expand = __nccwpck_require__(90308)
@@ -148533,64 +148533,43 @@ function filter (pattern, options) {
} }
function ext (a, b) { function ext (a, b) {
a = a || {}
b = b || {} b = b || {}
var t = {} var t = {}
Object.keys(a).forEach(function (k) {
t[k] = a[k]
})
Object.keys(b).forEach(function (k) { Object.keys(b).forEach(function (k) {
t[k] = b[k] t[k] = b[k]
}) })
Object.keys(a).forEach(function (k) {
t[k] = a[k]
})
return t return t
} }
minimatch.defaults = function (def) { minimatch.defaults = function (def) {
if (!def || typeof def !== 'object' || !Object.keys(def).length) { if (!def || !Object.keys(def).length) return minimatch
return minimatch
}
var orig = minimatch var orig = minimatch
var m = function minimatch (p, pattern, options) { var m = function minimatch (p, pattern, options) {
return orig(p, pattern, ext(def, options)) return orig.minimatch(p, pattern, ext(def, options))
} }
m.Minimatch = function Minimatch (pattern, options) { m.Minimatch = function Minimatch (pattern, options) {
return new orig.Minimatch(pattern, ext(def, options)) return new orig.Minimatch(pattern, ext(def, options))
} }
m.Minimatch.defaults = function defaults (options) {
return orig.defaults(ext(def, options)).Minimatch
}
m.filter = function filter (pattern, options) {
return orig.filter(pattern, ext(def, options))
}
m.defaults = function defaults (options) {
return orig.defaults(ext(def, options))
}
m.makeRe = function makeRe (pattern, options) {
return orig.makeRe(pattern, ext(def, options))
}
m.braceExpand = function braceExpand (pattern, options) {
return orig.braceExpand(pattern, ext(def, options))
}
m.match = function (list, pattern, options) {
return orig.match(list, pattern, ext(def, options))
}
return m return m
} }
Minimatch.defaults = function (def) { Minimatch.defaults = function (def) {
if (!def || !Object.keys(def).length) return Minimatch
return minimatch.defaults(def).Minimatch return minimatch.defaults(def).Minimatch
} }
function minimatch (p, pattern, options) { function minimatch (p, pattern, options) {
assertValidPattern(pattern) if (typeof pattern !== 'string') {
throw new TypeError('glob pattern string required')
}
if (!options) options = {} if (!options) options = {}
@@ -148599,6 +148578,9 @@ function minimatch (p, pattern, options) {
return false return false
} }
// "" only matches ""
if (pattern.trim() === '') return p === ''
return new Minimatch(pattern, options).match(p) return new Minimatch(pattern, options).match(p)
} }
@@ -148607,14 +148589,15 @@ function Minimatch (pattern, options) {
return new Minimatch(pattern, options) return new Minimatch(pattern, options)
} }
assertValidPattern(pattern) if (typeof pattern !== 'string') {
throw new TypeError('glob pattern string required')
}
if (!options) options = {} if (!options) options = {}
pattern = pattern.trim() pattern = pattern.trim()
// windows support: need to use /, not \ // windows support: need to use /, not \
if (!options.allowWindowsEscape && path.sep !== '/') { if (path.sep !== '/') {
pattern = pattern.split(path.sep).join('/') pattern = pattern.split(path.sep).join('/')
} }
@@ -148625,7 +148608,6 @@ function Minimatch (pattern, options) {
this.negate = false this.negate = false
this.comment = false this.comment = false
this.empty = false this.empty = false
this.partial = !!options.partial
// make the set of regexps etc. // make the set of regexps etc.
this.make() this.make()
@@ -148635,6 +148617,9 @@ Minimatch.prototype.debug = function () {}
Minimatch.prototype.make = make Minimatch.prototype.make = make
function make () { function make () {
// don't do it more than once.
if (this._made) return
var pattern = this.pattern var pattern = this.pattern
var options = this.options var options = this.options
@@ -148654,7 +148639,7 @@ function make () {
// step 2: expand braces // step 2: expand braces
var set = this.globSet = this.braceExpand() var set = this.globSet = this.braceExpand()
if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) } if (options.debug) this.debug = console.error
this.debug(this.pattern, set) this.debug(this.pattern, set)
@@ -148734,11 +148719,12 @@ function braceExpand (pattern, options) {
pattern = typeof pattern === 'undefined' pattern = typeof pattern === 'undefined'
? this.pattern : pattern ? this.pattern : pattern
assertValidPattern(pattern) if (typeof pattern === 'undefined') {
throw new TypeError('undefined pattern')
}
// Thanks to Yeting Li <https://github.com/yetingli> for if (options.nobrace ||
// improving this regexp to avoid a ReDOS vulnerability. !pattern.match(/\{.*\}/)) {
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
// shortcut. no need to expand. // shortcut. no need to expand.
return [pattern] return [pattern]
} }
@@ -148746,17 +148732,6 @@ function braceExpand (pattern, options) {
return expand(pattern) return expand(pattern)
} }
var MAX_PATTERN_LENGTH = 1024 * 64
var assertValidPattern = function (pattern) {
if (typeof pattern !== 'string') {
throw new TypeError('invalid pattern')
}
if (pattern.length > MAX_PATTERN_LENGTH) {
throw new TypeError('pattern is too long')
}
}
// parse a component of the expanded set. // parse a component of the expanded set.
// At this point, no pattern may contain "/" in it // At this point, no pattern may contain "/" in it
// so we're going to return a 2d array, where each entry is the full // so we're going to return a 2d array, where each entry is the full
@@ -148771,17 +148746,14 @@ var assertValidPattern = function (pattern) {
Minimatch.prototype.parse = parse Minimatch.prototype.parse = parse
var SUBPARSE = {} var SUBPARSE = {}
function parse (pattern, isSub) { function parse (pattern, isSub) {
assertValidPattern(pattern) if (pattern.length > 1024 * 64) {
throw new TypeError('pattern is too long')
}
var options = this.options var options = this.options
// shortcuts // shortcuts
if (pattern === '**') { if (!options.noglobstar && pattern === '**') return GLOBSTAR
if (!options.noglobstar)
return GLOBSTAR
else
pattern = '*'
}
if (pattern === '') return '' if (pattern === '') return ''
var re = '' var re = ''
@@ -148837,12 +148809,10 @@ function parse (pattern, isSub) {
} }
switch (c) { switch (c) {
/* istanbul ignore next */ case '/':
case '/': {
// completely not allowed, even escaped. // completely not allowed, even escaped.
// Should already be path-split by now. // Should already be path-split by now.
return false return false
}
case '\\': case '\\':
clearStateChar() clearStateChar()
@@ -148961,23 +148931,25 @@ function parse (pattern, isSub) {
// handle the case where we left a class open. // handle the case where we left a class open.
// "[z-a]" is valid, equivalent to "\[z-a\]" // "[z-a]" is valid, equivalent to "\[z-a\]"
// split where the last [ was, make sure we don't have if (inClass) {
// an invalid re. if so, re-walk the contents of the // split where the last [ was, make sure we don't have
// would-be class to re-translate any characters that // an invalid re. if so, re-walk the contents of the
// were passed through as-is // would-be class to re-translate any characters that
// TODO: It would probably be faster to determine this // were passed through as-is
// without a try/catch and a new RegExp, but it's tricky // TODO: It would probably be faster to determine this
// to do safely. For now, this is safe and works. // without a try/catch and a new RegExp, but it's tricky
var cs = pattern.substring(classStart + 1, i) // to do safely. For now, this is safe and works.
try { var cs = pattern.substring(classStart + 1, i)
RegExp('[' + cs + ']') try {
} catch (er) { RegExp('[' + cs + ']')
// not a valid class! } catch (er) {
var sp = this.parse(cs, SUBPARSE) // not a valid class!
re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' var sp = this.parse(cs, SUBPARSE)
hasMagic = hasMagic || sp[1] re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
inClass = false hasMagic = hasMagic || sp[1]
continue inClass = false
continue
}
} }
// finish up the class. // finish up the class.
@@ -149061,7 +149033,9 @@ function parse (pattern, isSub) {
// something that could conceivably capture a dot // something that could conceivably capture a dot
var addPatternStart = false var addPatternStart = false
switch (re.charAt(0)) { switch (re.charAt(0)) {
case '[': case '.': case '(': addPatternStart = true case '.':
case '[':
case '(': addPatternStart = true
} }
// Hack to work around lack of negative lookbehind in JS // Hack to work around lack of negative lookbehind in JS
@@ -149123,7 +149097,7 @@ function parse (pattern, isSub) {
var flags = options.nocase ? 'i' : '' var flags = options.nocase ? 'i' : ''
try { try {
var regExp = new RegExp('^' + re + '$', flags) var regExp = new RegExp('^' + re + '$', flags)
} catch (er) /* istanbul ignore next - should be impossible */ { } catch (er) {
// If it was an invalid regular expression, then it can't match // If it was an invalid regular expression, then it can't match
// anything. This trick looks for a character after the end of // anything. This trick looks for a character after the end of
// the string, which is of course impossible, except in multi-line // the string, which is of course impossible, except in multi-line
@@ -149181,7 +149155,7 @@ function makeRe () {
try { try {
this.regexp = new RegExp(re, flags) this.regexp = new RegExp(re, flags)
} catch (ex) /* istanbul ignore next - should be impossible */ { } catch (ex) {
this.regexp = false this.regexp = false
} }
return this.regexp return this.regexp
@@ -149199,8 +149173,8 @@ minimatch.match = function (list, pattern, options) {
return list return list
} }
Minimatch.prototype.match = function match (f, partial) { Minimatch.prototype.match = match
if (typeof partial === 'undefined') partial = this.partial function match (f, partial) {
this.debug('match', f, this.pattern) this.debug('match', f, this.pattern)
// short-circuit in the case of busted things. // short-circuit in the case of busted things.
// comments, etc. // comments, etc.
@@ -149282,7 +149256,6 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
// should be impossible. // should be impossible.
// some invalid regexp stuff in the set. // some invalid regexp stuff in the set.
/* istanbul ignore if */
if (p === false) return false if (p === false) return false
if (p === GLOBSTAR) { if (p === GLOBSTAR) {
@@ -149356,7 +149329,6 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
// no match was found. // no match was found.
// However, in partial mode, we can't say this is necessarily over. // However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then // If there's more *pattern* left, then
/* istanbul ignore if */
if (partial) { if (partial) {
// ran out of file // ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr) this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
@@ -149370,7 +149342,11 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
// patterns with magic have been turned into regexps. // patterns with magic have been turned into regexps.
var hit var hit
if (typeof p === 'string') { if (typeof p === 'string') {
hit = f === p if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase()
} else {
hit = f === p
}
this.debug('string match', p, f, hit) this.debug('string match', p, f, hit)
} else { } else {
hit = f.match(p) hit = f.match(p)
@@ -149401,16 +149377,16 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) {
// this is ok if we're doing the match as part of // this is ok if we're doing the match as part of
// a glob fs traversal. // a glob fs traversal.
return partial return partial
} else /* istanbul ignore else */ if (pi === pl) { } else if (pi === pl) {
// ran out of pattern, still have file left. // ran out of pattern, still have file left.
// this is only acceptable if we're on the very last // this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash. // empty segment of a file with a trailing slash.
// a/* should match a/b/ // a/* should match a/b/
return (fi === fl - 1) && (file[fi] === '') var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
return emptyFileEnd
} }
// should be unreachable. // should be unreachable.
/* istanbul ignore next */
throw new Error('wtf?') throw new Error('wtf?')
} }
@@ -155371,7 +155347,7 @@ module.exports = {
return replace.call(value, percentTwenties, '+'); return replace.call(value, percentTwenties, '+');
}, },
RFC3986: function (value) { RFC3986: function (value) {
return String(value); return value;
} }
}, },
RFC1738: 'RFC1738', RFC1738: 'RFC1738',
@@ -155459,15 +155435,14 @@ var parseObject = function (chain, val, options) {
var obj; var obj;
var root = chain[i]; var root = chain[i];
if (root === '[]' && options.parseArrays) { if (root === '[]') {
obj = [].concat(leaf); obj = [];
obj = obj.concat(leaf);
} else { } else {
obj = options.plainObjects ? Object.create(null) : {}; obj = options.plainObjects ? Object.create(null) : {};
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
var index = parseInt(cleanRoot, 10); var index = parseInt(cleanRoot, 10);
if (!options.parseArrays && cleanRoot === '') { if (
obj = { 0: leaf };
} else if (
!isNaN(index) !isNaN(index)
&& root !== cleanRoot && root !== cleanRoot
&& String(index) === cleanRoot && String(index) === cleanRoot
@@ -155476,7 +155451,7 @@ var parseObject = function (chain, val, options) {
) { ) {
obj = []; obj = [];
obj[index] = leaf; obj[index] = leaf;
} else if (cleanRoot !== '__proto__') { } else {
obj[cleanRoot] = leaf; obj[cleanRoot] = leaf;
} }
} }
@@ -155593,23 +155568,17 @@ var utils = __nccwpck_require__(63763);
var formats = __nccwpck_require__(11466); var formats = __nccwpck_require__(11466);
var arrayPrefixGenerators = { var arrayPrefixGenerators = {
brackets: function brackets(prefix) { brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
return prefix + '[]'; return prefix + '[]';
}, },
indices: function indices(prefix, key) { indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
return prefix + '[' + key + ']'; return prefix + '[' + key + ']';
}, },
repeat: function repeat(prefix) { repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
return prefix; return prefix;
} }
}; };
var isArray = Array.isArray;
var push = Array.prototype.push;
var pushToArray = function (arr, valueOrArray) {
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
};
var toISO = Date.prototype.toISOString; var toISO = Date.prototype.toISOString;
var defaults = { var defaults = {
@@ -155617,14 +155586,14 @@ var defaults = {
encode: true, encode: true,
encoder: utils.encode, encoder: utils.encode,
encodeValuesOnly: false, encodeValuesOnly: false,
serializeDate: function serializeDate(date) { serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
return toISO.call(date); return toISO.call(date);
}, },
skipNulls: false, skipNulls: false,
strictNullHandling: false strictNullHandling: false
}; };
var stringify = function stringify( var stringify = function stringify( // eslint-disable-line func-name-matching
object, object,
prefix, prefix,
generateArrayPrefix, generateArrayPrefix,
@@ -155643,9 +155612,7 @@ var stringify = function stringify(
obj = filter(prefix, obj); obj = filter(prefix, obj);
} else if (obj instanceof Date) { } else if (obj instanceof Date) {
obj = serializeDate(obj); obj = serializeDate(obj);
} } else if (obj === null) {
if (obj === null) {
if (strictNullHandling) { if (strictNullHandling) {
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix; return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
} }
@@ -155668,7 +155635,7 @@ var stringify = function stringify(
} }
var objKeys; var objKeys;
if (isArray(filter)) { if (Array.isArray(filter)) {
objKeys = filter; objKeys = filter;
} else { } else {
var keys = Object.keys(obj); var keys = Object.keys(obj);
@@ -155682,8 +155649,8 @@ var stringify = function stringify(
continue; continue;
} }
if (isArray(obj)) { if (Array.isArray(obj)) {
pushToArray(values, stringify( values = values.concat(stringify(
obj[key], obj[key],
generateArrayPrefix(prefix, key), generateArrayPrefix(prefix, key),
generateArrayPrefix, generateArrayPrefix,
@@ -155698,7 +155665,7 @@ var stringify = function stringify(
encodeValuesOnly encodeValuesOnly
)); ));
} else { } else {
pushToArray(values, stringify( values = values.concat(stringify(
obj[key], obj[key],
prefix + (allowDots ? '.' + key : '[' + key + ']'), prefix + (allowDots ? '.' + key : '[' + key + ']'),
generateArrayPrefix, generateArrayPrefix,
@@ -155722,7 +155689,7 @@ module.exports = function (object, opts) {
var obj = object; var obj = object;
var options = opts ? utils.assign({}, opts) : {}; var options = opts ? utils.assign({}, opts) : {};
if (options.encoder !== null && typeof options.encoder !== 'undefined' && typeof options.encoder !== 'function') { if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
throw new TypeError('Encoder has to be a function.'); throw new TypeError('Encoder has to be a function.');
} }
@@ -155747,7 +155714,7 @@ module.exports = function (object, opts) {
if (typeof options.filter === 'function') { if (typeof options.filter === 'function') {
filter = options.filter; filter = options.filter;
obj = filter('', obj); obj = filter('', obj);
} else if (isArray(options.filter)) { } else if (Array.isArray(options.filter)) {
filter = options.filter; filter = options.filter;
objKeys = filter; objKeys = filter;
} }
@@ -155783,7 +155750,8 @@ module.exports = function (object, opts) {
if (skipNulls && obj[key] === null) { if (skipNulls && obj[key] === null) {
continue; continue;
} }
pushToArray(keys, stringify(
keys = keys.concat(stringify(
obj[key], obj[key],
key, key,
generateArrayPrefix, generateArrayPrefix,
@@ -155867,8 +155835,8 @@ var merge = function merge(target, source, options) {
if (typeof source !== 'object') { if (typeof source !== 'object') {
if (Array.isArray(target)) { if (Array.isArray(target)) {
target.push(source); target.push(source);
} else if (target && typeof target === 'object') { } else if (typeof target === 'object') {
if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
target[source] = true; target[source] = true;
} }
} else { } else {
@@ -155878,7 +155846,7 @@ var merge = function merge(target, source, options) {
return target; return target;
} }
if (!target || typeof target !== 'object') { if (typeof target !== 'object') {
return [target].concat(source); return [target].concat(source);
} }
@@ -155890,9 +155858,8 @@ var merge = function merge(target, source, options) {
if (Array.isArray(target) && Array.isArray(source)) { if (Array.isArray(target) && Array.isArray(source)) {
source.forEach(function (item, i) { source.forEach(function (item, i) {
if (has.call(target, i)) { if (has.call(target, i)) {
var targetItem = target[i]; if (target[i] && typeof target[i] === 'object') {
if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { target[i] = merge(target[i], item, options);
target[i] = merge(targetItem, item, options);
} else { } else {
target.push(item); target.push(item);
} }
@@ -155973,7 +155940,6 @@ var encode = function encode(str) {
i += 1; i += 1;
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
/* eslint operator-linebreak: [2, "before"] */
out += hexTable[0xF0 | (c >> 18)] out += hexTable[0xF0 | (c >> 18)]
+ hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 12) & 0x3F)]
+ hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)]
@@ -188874,77 +188840,6 @@ try {
} catch (er) {} } catch (er) {}
/***/ }),
/***/ 27289:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.run = void 0;
const core = __importStar(__nccwpck_require__(26024));
const path = __importStar(__nccwpck_require__(71017));
const fs = __importStar(__nccwpck_require__(57147));
const cluster_1 = __nccwpck_require__(68077);
const utils_1 = __nccwpck_require__(76077);
/**
* Sets the Kubernetes context based on supplied action inputs
*/
function run() {
return __awaiter(this, void 0, void 0, function* () {
// get inputs
const clusterType = (0, cluster_1.parseCluster)(core.getInput('cluster-type', {
required: true
}));
const runnerTempDirectory = process.env['RUNNER_TEMP'];
const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`);
// get kubeconfig and update context
const kubeconfig = yield (0, utils_1.getKubeconfig)(clusterType);
const kubeconfigWithContext = (0, utils_1.setContext)(kubeconfig);
// output kubeconfig
core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`);
fs.writeFileSync(kubeconfigPath, kubeconfigWithContext);
fs.chmodSync(kubeconfigPath, '600');
core.debug('Setting KUBECONFIG environment variable');
core.exportVariable('KUBECONFIG', kubeconfigPath);
});
}
exports.run = run;
/***/ }), /***/ }),
/***/ 63297: /***/ 63297:
@@ -189241,11 +189136,47 @@ var __importStar = (this && this.__importStar) || function (mod) {
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
const action_1 = __nccwpck_require__(27289); exports.run = void 0;
const core = __importStar(__nccwpck_require__(26024)); const core = __importStar(__nccwpck_require__(26024));
const path = __importStar(__nccwpck_require__(71017));
const fs = __importStar(__nccwpck_require__(57147));
const cluster_1 = __nccwpck_require__(68077);
const utils_1 = __nccwpck_require__(76077);
/**
* Sets the Kubernetes context based on supplied action inputs
*/
function run() {
return __awaiter(this, void 0, void 0, function* () {
// get inputs
const clusterType = (0, cluster_1.parseCluster)(core.getInput('cluster-type', {
required: true
}));
const runnerTempDirectory = process.env['RUNNER_TEMP'];
const kubeconfigPath = path.join(runnerTempDirectory, `kubeconfig_${Date.now()}`);
// get kubeconfig and update context
const kubeconfig = yield (0, utils_1.getKubeconfig)(clusterType);
const kubeconfigWithContext = (0, utils_1.setContext)(kubeconfig);
// output kubeconfig
core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`);
fs.writeFileSync(kubeconfigPath, kubeconfigWithContext);
fs.chmodSync(kubeconfigPath, '600');
core.debug('Setting KUBECONFIG environment variable');
core.exportVariable('KUBECONFIG', kubeconfigPath);
});
}
exports.run = run;
// Run the application // Run the application
(0, action_1.run)().catch(core.setFailed); run().catch(core.setFailed);
/***/ }), /***/ }),
+18 -18
View File
@@ -3233,9 +3233,9 @@
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
}, },
"node_modules/json5": { "node_modules/json5": {
"version": "2.2.3", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
"dev": true, "dev": true,
"bin": { "bin": {
"json5": "lib/cli.js" "json5": "lib/cli.js"
@@ -3418,9 +3418,9 @@
} }
}, },
"node_modules/minimatch": { "node_modules/minimatch": {
"version": "3.1.2", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dependencies": { "dependencies": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
}, },
@@ -3786,9 +3786,9 @@
} }
}, },
"node_modules/qs": { "node_modules/qs": {
"version": "6.5.3", "version": "6.5.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
"integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
"engines": { "engines": {
"node": ">=0.6" "node": ">=0.6"
} }
@@ -7095,9 +7095,9 @@
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
}, },
"json5": { "json5": {
"version": "2.2.3", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz",
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==",
"dev": true "dev": true
}, },
"jsonpath-plus": { "jsonpath-plus": {
@@ -7232,9 +7232,9 @@
"integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ=="
}, },
"minimatch": { "minimatch": {
"version": "3.1.2", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@@ -7494,9 +7494,9 @@
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
}, },
"qs": { "qs": {
"version": "6.5.3", "version": "6.5.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
"integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==" "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
}, },
"quick-lru": { "quick-lru": {
"version": "5.1.1", "version": "5.1.1",
-33
View File
@@ -1,33 +0,0 @@
import * as core from '@actions/core'
import * as path from 'path'
import * as fs from 'fs'
import {Cluster, parseCluster} from './types/cluster'
import {setContext, getKubeconfig} from './utils'
/**
* Sets the Kubernetes context based on supplied action inputs
*/
export async function run() {
// get inputs
const clusterType: Cluster | undefined = parseCluster(
core.getInput('cluster-type', {
required: true
})
)
const runnerTempDirectory: string = process.env['RUNNER_TEMP']
const kubeconfigPath: string = path.join(
runnerTempDirectory,
`kubeconfig_${Date.now()}`
)
// get kubeconfig and update context
const kubeconfig: string = await getKubeconfig(clusterType)
const kubeconfigWithContext: string = setContext(kubeconfig)
// output kubeconfig
core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`)
fs.writeFileSync(kubeconfigPath, kubeconfigWithContext)
fs.chmodSync(kubeconfigPath, '600')
core.debug('Setting KUBECONFIG environment variable')
core.exportVariable('KUBECONFIG', kubeconfigPath)
}
+1 -1
View File
@@ -1,5 +1,5 @@
import {getRequiredInputError} from '../tests/util' import {getRequiredInputError} from '../tests/util'
import {run} from './action' import {run} from './run'
import fs from 'fs' import fs from 'fs'
import * as utils from './utils' import * as utils from './utils'
+32 -1
View File
@@ -1,5 +1,36 @@
import {run} from './action'
import * as core from '@actions/core' import * as core from '@actions/core'
import * as path from 'path'
import * as fs from 'fs'
import {Cluster, parseCluster} from './types/cluster'
import {setContext, getKubeconfig} from './utils'
/**
* Sets the Kubernetes context based on supplied action inputs
*/
export async function run() {
// get inputs
const clusterType: Cluster | undefined = parseCluster(
core.getInput('cluster-type', {
required: true
})
)
const runnerTempDirectory: string = process.env['RUNNER_TEMP']
const kubeconfigPath: string = path.join(
runnerTempDirectory,
`kubeconfig_${Date.now()}`
)
// get kubeconfig and update context
const kubeconfig: string = await getKubeconfig(clusterType)
const kubeconfigWithContext: string = setContext(kubeconfig)
// output kubeconfig
core.debug(`Writing kubeconfig contents to ${kubeconfigPath}`)
fs.writeFileSync(kubeconfigPath, kubeconfigWithContext)
fs.chmodSync(kubeconfigPath, '600')
core.debug('Setting KUBECONFIG environment variable')
core.exportVariable('KUBECONFIG', kubeconfigPath)
}
// Run the application // Run the application
run().catch(core.setFailed) run().catch(core.setFailed)