Example #1
0
 public void WriteTlsCertificate(string name, string crtFilePath, string keyFilePath)
 {
     _logger.LogInformation($"Writing k8s Tls secret name: {name}, certificateFilePath: {crtFilePath}");
     if (_k8sClient.CreateTlsSecret(name, crtFilePath, keyFilePath) == null)
     {
         var errorMessage = "_k8sClient.CreateTlsSecret didn't produce result";
         _logger.LogError(errorMessage);
         throw new Exception(errorMessage);
     }
 }
Example #2
0
        //[Test]
        public void CreateTlsSecret()
        {
            // Arrange
            var secretName = "test-tls-secret";
            var crtFile    = Path.Combine("resources", "testtls.crt");
            var keyFile    = Path.Combine("resources", "testtls.key");

            // Act
            var actual = _k8sClient.CreateTlsSecret(secretName, crtFile, keyFile);

            // Assert
            Assert.NotNull(actual);
            Assert.AreEqual(secretName, actual.Metadata.Name);

            // Clean
            var status = _k8sClient.DeleteSecret(secretName);

            Assert.AreEqual("Success", status);
        }