mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-25 14:09:27 +08:00
Added exception for null kubectl commands
This commit is contained in:
@@ -69,7 +69,7 @@ export async function downloadKubectl(version: string): Promise<string> {
|
||||
export function getTrafficSplitAPIVersion(kubectl: Kubectl): string {
|
||||
const result = kubectl.executeCommand('api-versions');
|
||||
const trafficSplitAPIVersion = result.stdout.split('\n').find(version => version.startsWith(trafficSplitAPIVersionPrefix));
|
||||
if (trafficSplitAPIVersion == null || typeof trafficSplitAPIVersion == 'undefined') {
|
||||
if (!trafficSplitAPIVersion) {
|
||||
throw new Error('UnableToCreateTrafficSplitManifestFile');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user