public async Task TestGetServiceAsync_PassesKubeconfig() { await _objectUnderTest.GetServiceAsync(DefaultServiceName); _processServiceMock.VerifyGetJsonOutputAsyncArgs <GkeService>( s => s.Contains($"--kubeconfig=\"{_kubeConfigPath}\"")); }
private static async Task <string> WaitForServicePublicIpAddressAsync(string name, KubectlContext kubectlContext) { DateTime start = DateTime.Now; TimeSpan actualTime = DateTime.Now - start; while (actualTime < s_newServiceIpTimeout) { GcpOutputWindow.Default.OutputLine(Resources.GkePublishWaitingForServiceIpMessage); var service = await kubectlContext.GetServiceAsync(name); var ingress = service?.Status?.LoadBalancer?.Ingress?.FirstOrDefault(); if (ingress != null && ingress.TryGetValue("ip", out string ipAddress)) { Debug.WriteLine($"Found service IP address: {ipAddress}"); return(ipAddress); } Debug.WriteLine("Waiting for service to be public."); await Task.Delay(s_pollingDelay); actualTime = DateTime.Now - start; } Debug.WriteLine("Timeout while waiting for the ip address."); return(null); }
private static async Task <string> WaitForServiceClusterIpAddressAsync(string name, KubectlContext context) { var service = await context.GetServiceAsync(name); return(service?.Spec?.ClusterIp); }
public async Task TestGetServiceAsync_PassesKubeconfig() { await _objectUnderTest.GetServiceAsync(DefaultServiceName); VerifyGetJsonOutputArgsContain <GkeService>($"--kubeconfig=\"{_kubeConfigPath}\""); }