Massive refactor (#165)

This commit is contained in:
Oliver King
2022-02-02 09:07:53 -05:00
committed by GitHub
parent 5cbd4acaca
commit ca8d2604ac
139 changed files with 19176 additions and 17005 deletions
+18
View File
@@ -0,0 +1,18 @@
import { Kubectl } from "../types/kubectl";
const trafficSplitAPIVersionPrefix = "split.smi-spec.io";
export async function getTrafficSplitAPIVersion(
kubectl: Kubectl
): Promise<string> {
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");
}
return trafficSplitAPIVersion;
}