mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-03-27 17:32:15 +08:00
Updated identation
This commit is contained in:
parent
31a423057f
commit
0527303033
@ -65,13 +65,12 @@ export async function downloadKubectl(version: string): Promise<string> {
|
||||
return kubectlPath;
|
||||
}
|
||||
|
||||
export function getTrafficSplitAPIVersion(kubectl: Kubectl): string
|
||||
{
|
||||
export function getTrafficSplitAPIVersion(kubectl: Kubectl): string {
|
||||
const result = kubectl.executeCommand('api-versions');
|
||||
const trafficSplitAPIVersion = result.stdout.split('\n').find(version => version.startsWith('split.smi-spec.io'));
|
||||
if (trafficSplitAPIVersion == null || typeof trafficSplitAPIVersion == 'undefined') {
|
||||
throw new Error('UnableToCreateTrafficSplitManifestFile');
|
||||
}
|
||||
|
||||
|
||||
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 {
|
||||
if(!trafficSplitAPIVersion)
|
||||
{
|
||||
if (!trafficSplitAPIVersion) {
|
||||
trafficSplitAPIVersion = kubectlUtils.getTrafficSplitAPIVersion(kubectl);
|
||||
}
|
||||
const trafficSplitObjectJson = `{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user