Remove requirement for certificate authority and certificate authority data in kubeconfig. (#222)

* Remove requirement for certificate authority data in kubeconfig.

* Update src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs

Update casing of `URL` at @itowlson suggestion.

Co-Authored-By: twitchax <twitchax@gmail.com>
This commit is contained in:
Aaron Roney
2018-12-11 21:08:55 -08:00
committed by Kubernetes Prow Robot
parent 6bc54a68c4
commit b7f79c924f
3 changed files with 16 additions and 65 deletions

View File

@@ -70,17 +70,6 @@ namespace k8s.Tests
Assert.Equal(File.ReadAllText("assets/client-key-data.txt"), cfg.ClientCertificateKeyData);
}
/// <summary>
/// Checks that a KubeConfigException is thrown when no certificate-authority-data is set and user do not require tls
/// skip
/// </summary>
[Fact]
public void CheckClusterTlsCorrectness()
{
var fi = new FileInfo("assets/kubeconfig.tls-no-skip-error.yml");
Assert.Throws<KubeConfigException>(() => KubernetesClientConfiguration.BuildConfigFromConfigFile(fi));
}
/// <summary>
/// Checks that a KubeConfigException is thrown when no certificate-authority-data is set and user do not require tls
/// skip

View File

@@ -1,25 +0,0 @@
# Sample file based on https://kubernetes.io/docs/tasks/access-application-cluster/authenticate-across-clusters-kubeconfig/
# WARNING: File includes minor fixes
---
current-context: federal-context
apiVersion: v1
clusters:
- cluster:
server: http://cow.org:8080
name: cow-cluster
- cluster:
# certificate-authority: path/to/my/cafile
server: https://horse.org:4443
name: horse-cluster
contexts:
- context:
cluster: horse-cluster
namespace: chisel-ns
user: green-user
name: federal-context
kind: Config
users:
- name: green-user
user:
client-certificate: assets/client.crt
client-key: assets/client.key