mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-25 22:29:26 +08:00
Vidya reddy/prettier code (#203)
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
import { Kubectl } from "../types/kubectl";
|
||||
import {Kubectl} from '../types/kubectl'
|
||||
|
||||
const trafficSplitAPIVersionPrefix = "split.smi-spec.io";
|
||||
const trafficSplitAPIVersionPrefix = 'split.smi-spec.io'
|
||||
|
||||
export async function getTrafficSplitAPIVersion(
|
||||
kubectl: Kubectl
|
||||
kubectl: Kubectl
|
||||
): Promise<string> {
|
||||
const result = await kubectl.executeCommand("api-versions");
|
||||
const trafficSplitAPIVersion = result.stdout
|
||||
.split("\n")
|
||||
.find((version) => version.startsWith(trafficSplitAPIVersionPrefix));
|
||||
const result = await kubectl.executeCommand('api-versions')
|
||||
const trafficSplitAPIVersion = result.stdout
|
||||
.split('\n')
|
||||
.find((version) => version.startsWith(trafficSplitAPIVersionPrefix))
|
||||
|
||||
if (!trafficSplitAPIVersion) {
|
||||
throw new Error("Unable to find traffic split api version");
|
||||
}
|
||||
if (!trafficSplitAPIVersion) {
|
||||
throw new Error('Unable to find traffic split api version')
|
||||
}
|
||||
|
||||
return trafficSplitAPIVersion;
|
||||
return trafficSplitAPIVersion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user