mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-04-09 06:52:18 +08:00
Updated identation
This commit is contained in:
parent
0451f7cf6e
commit
91654ff2fe
@ -65,13 +65,12 @@ export async function downloadKubectl(version: string): Promise<string> {
|
|||||||
return kubectlPath;
|
return kubectlPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTrafficSplitAPIVersion(kubectl: Kubectl): string
|
export function getTrafficSplitAPIVersion(kubectl: Kubectl): string {
|
||||||
{
|
|
||||||
const result = kubectl.executeCommand('api-versions');
|
const result = kubectl.executeCommand('api-versions');
|
||||||
const trafficSplitAPIVersion = result.stdout.split('\n').find(version => version.startsWith('split.smi-spec.io'));
|
const trafficSplitAPIVersion = result.stdout.split('\n').find(version => version.startsWith('split.smi-spec.io'));
|
||||||
if (trafficSplitAPIVersion == null || typeof trafficSplitAPIVersion == 'undefined') {
|
if (trafficSplitAPIVersion == null || typeof trafficSplitAPIVersion == 'undefined') {
|
||||||
throw new Error('UnableToCreateTrafficSplitManifestFile');
|
throw new Error('UnableToCreateTrafficSplitManifestFile');
|
||||||
}
|
}
|
||||||
|
|
||||||
return trafficSplitAPIVersion;
|
return trafficSplitAPIVersion;
|
||||||
}
|
}
|
||||||
@ -183,8 +183,7 @@ function createTrafficSplitManifestFile(kubectl: Kubectl, serviceName: string, s
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getTrafficSplitObject(kubectl: Kubectl, name: string, stableWeight: number, baselineWeight: number, canaryWeight: number): string {
|
function getTrafficSplitObject(kubectl: Kubectl, name: string, stableWeight: number, baselineWeight: number, canaryWeight: number): string {
|
||||||
if(!trafficSplitAPIVersion)
|
if (!trafficSplitAPIVersion) {
|
||||||
{
|
|
||||||
trafficSplitAPIVersion = kubectlUtils.getTrafficSplitAPIVersion(kubectl);
|
trafficSplitAPIVersion = kubectlUtils.getTrafficSplitAPIVersion(kubectl);
|
||||||
}
|
}
|
||||||
const trafficSplitObjectJson = `{
|
const trafficSplitObjectJson = `{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user