コード例 #1
0
 public void WriteBinaryFile(string name, string filePath)
 {
     _logger.LogInformation($"Writing binary file k8s opaque secret name: {name}, file: {filePath}");
     if (_k8sClient.CreateBinarySecret(name, filePath) == null)
     {
         var errorMessage = "_k8sClient.CreateBinarySecret didn't produce result";
         _logger.LogError(errorMessage);
         throw new Exception(errorMessage);
     }
 }
コード例 #2
0
        //[Test]
        public void CreateBinarySecretFromP12CertFile()
        {
            // Arrange
            var secretName = "test-cert-secret";
            var certFile   = Path.Combine("resources", "testcert.p12");

            // Act
            var actual = _k8sClient.CreateBinarySecret(secretName, certFile);

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

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

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