Skip to content

Commit

Permalink
add proxy-url test kubeconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
krmodelski committed Dec 5, 2024
1 parent 33175a8 commit 9f3bcd3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/config_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;

Expand Down
30 changes: 30 additions & 0 deletions testdata/kubeconfig-proxy-url.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9f3bcd3

Please sign in to comment.