From 9f3bcd34f578784c291ff949c80914b31b8f2bd8 Mon Sep 17 00:00:00 2001 From: krmodelski <55512362+krmodelski@users.noreply.github.com> Date: Thu, 5 Dec 2024 20:48:00 +0100 Subject: [PATCH] add proxy-url test kubeconfig --- src/config_test.ts | 3 ++- testdata/kubeconfig-proxy-url.yaml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 testdata/kubeconfig-proxy-url.yaml diff --git a/src/config_test.ts b/src/config_test.ts index 1d3cff3244..9b91f2cf44 100644 --- a/src/config_test.ts +++ b/src/config_test.ts @@ -18,6 +18,7 @@ const kc2FileName = 'testdata/kubeconfig-2.yaml'; const kcDupeCluster = 'testdata/kubeconfig-dupe-cluster.yaml'; const kcDupeContext = 'testdata/kubeconfig-dupe-context.yaml'; const kcDupeUser = 'testdata/kubeconfig-dupe-user.yaml'; +const kcProxyUrl = 'testdata/kubeconfig-proxy-url.yaml'; const kcNoUserFileName = 'testdata/empty-user-kubeconfig.yaml'; const kcInvalidContextFileName = 'testdata/empty-context-kubeconfig.yaml'; @@ -423,7 +424,7 @@ describe('KubeConfig', () => { }); it('should apply agent to request.Options', async () => { const kc = new KubeConfig(); - kc.loadFromFile(kcFileName); + kc.loadFromFile(kcProxyUrl); const opts = {} as requestlib.Options; diff --git a/testdata/kubeconfig-proxy-url.yaml b/testdata/kubeconfig-proxy-url.yaml new file mode 100644 index 0000000000..38d425a362 --- /dev/null +++ b/testdata/kubeconfig-proxy-url.yaml @@ -0,0 +1,30 @@ +apiVersion: v1 +clusters: +- cluster: + certificate-authority-data: Q0FEQVRA + server: http://example2.com + proxy-url: https://example:1187 + name: clusterA + +contexts: +- context: + cluster: clusterA + user: userA + name: contextA + +current-context: contextA +kind: Config +preferences: {} +users: +- name: userA + user: + client-certificate-data: XVNFUl9DQURBVEE= + client-key-data: XVNFUl9DS0RBVEE= +- name: userB + user: + client-certificate-data: XVNFUjJfQ0FEQVRB + client-key-data: XVNFUjJfQ0tEQVRB +- name: userC + user: + username: foo + password: bar