From 5677f89016dc084e024694e86f8f175af28dab9e Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Sat, 25 Apr 2020 15:11:45 -0700 Subject: [PATCH] Remove weird code from secret validation I'm not sure why this is here... --- src/Microsoft.Tye.Core/ValidateSecretStep.cs | 40 -------------------- 1 file changed, 40 deletions(-) diff --git a/src/Microsoft.Tye.Core/ValidateSecretStep.cs b/src/Microsoft.Tye.Core/ValidateSecretStep.cs index 80d2905f..eda1e293 100644 --- a/src/Microsoft.Tye.Core/ValidateSecretStep.cs +++ b/src/Microsoft.Tye.Core/ValidateSecretStep.cs @@ -181,46 +181,6 @@ namespace Microsoft.Tye } } } - - var yaml = service.Outputs.OfType().ToArray(); - if (yaml.Length == 0) - { - output.WriteDebugLine($"No yaml manifests found for service '{service.Name}'. Skipping."); - return; - } - - using var tempFile = TempFile.Create(); - output.WriteDebugLine($"Writing output to '{tempFile.FilePath}'."); - - { - await using var stream = File.OpenWrite(tempFile.FilePath); - await using var writer = new StreamWriter(stream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), bufferSize: -1, leaveOpen: true); - var yamlStream = new YamlStream(yaml.Select(y => y.Yaml)); - yamlStream.Save(writer, assignAnchors: false); - } - - // kubectl apply logic is implemented in the client in older versions of k8s. The capability - // to get the same behavior in the server isn't present in every version that's relevant. - // - // https://kubernetes.io/docs/reference/using-api/api-concepts/#server-side-apply - // - output.WriteDebugLine("Running 'kubectl apply'."); - output.WriteCommandLine("kubectl", $"apply -f \"{tempFile.FilePath}\""); - var capture = output.Capture(); - var exitCode = await Process.ExecuteAsync( - $"kubectl", - $"apply -f \"{tempFile.FilePath}\"", - System.Environment.CurrentDirectory, - stdOut: capture.StdOut, - stdErr: capture.StdErr); - - output.WriteDebugLine($"Done running 'kubectl apply' exit code: {exitCode}"); - if (exitCode != 0) - { - throw new CommandException("'kubectl apply' failed."); - } - - output.WriteInfoLine($"Deployed service '{service.Name}'."); } } }