mirror of
https://github.com/Azure/k8s-set-context.git
synced 2026-06-25 16:29:27 +08:00
added exports in all functions
This commit is contained in:
+2
-2
@@ -64,11 +64,11 @@ export async function getArcKubeconfig(): Promise<string> {
|
||||
}
|
||||
}
|
||||
|
||||
function sleep(ms) {
|
||||
export function sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
async function executeAzCliCommand(
|
||||
export async function executeAzCliCommand(
|
||||
command: string,
|
||||
silent?: boolean,
|
||||
execOptions: any = {},
|
||||
|
||||
+5
-5
@@ -9,7 +9,7 @@ import * as jsyaml from 'js-yaml';
|
||||
import * as util from 'util';
|
||||
import { getArcKubeconfig } from './arc-login';
|
||||
|
||||
function getKubeconfig(): string {
|
||||
export function getKubeconfig(): string {
|
||||
const method = core.getInput('method', { required: true });
|
||||
if (method == 'kubeconfig') {
|
||||
const kubeconfig = core.getInput('kubeconfig', { required: true });
|
||||
@@ -67,7 +67,7 @@ function getKubeconfig(): string {
|
||||
}
|
||||
}
|
||||
|
||||
function getExecutableExtension(): string {
|
||||
export function getExecutableExtension(): string {
|
||||
if (os.type().match(/^Win/)) {
|
||||
return '.exe';
|
||||
}
|
||||
@@ -75,7 +75,7 @@ function getExecutableExtension(): string {
|
||||
return '';
|
||||
}
|
||||
|
||||
async function getKubectlPath() {
|
||||
export async function getKubectlPath() {
|
||||
let kubectlPath = await io.which('kubectl', false);
|
||||
if (!kubectlPath) {
|
||||
const allVersions = toolCache.findAllVersions('kubectl');
|
||||
@@ -89,7 +89,7 @@ async function getKubectlPath() {
|
||||
return kubectlPath;
|
||||
}
|
||||
|
||||
async function setContext(kubeconfigPath: string) {
|
||||
export async function setContext(kubeconfigPath: string) {
|
||||
let context = core.getInput('context');
|
||||
if (context) {
|
||||
//To use kubectl commands, the environment variable KUBECONFIG needs to be set for this step
|
||||
@@ -102,7 +102,7 @@ async function setContext(kubeconfigPath: string) {
|
||||
}
|
||||
}
|
||||
|
||||
async function run() {
|
||||
export async function run() {
|
||||
try {
|
||||
let kubeconfig = '';
|
||||
const cluster_type = core.getInput('cluster-type', { required: true });
|
||||
|
||||
Reference in New Issue
Block a user