Skip to content

Commit d30d19c

Browse files
committed
fix: casing of applyToHttpsOptions
1 parent fbe3a3a commit d30d19c

File tree

7 files changed

+31
-31
lines changed

7 files changed

+31
-31
lines changed

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export class KubeConfig implements SecurityAuthentication {
146146
this.makePathsAbsolute(rootDirectory);
147147
}
148148

149-
public async applytoHTTPSOptions(opts: https.RequestOptions): Promise<void> {
149+
public async applyToHTTPSOptions(opts: https.RequestOptions): Promise<void> {
150150
const user = this.getCurrentUser();
151151

152152
await this.applyOptions(opts);

src/config_test.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ describe('KubeConfig', () => {
243243
kc.loadFromFile(kcFileName);
244244

245245
const opts: https.RequestOptions = {};
246-
kc.applytoHTTPSOptions(opts);
246+
kc.applyToHTTPSOptions(opts);
247247

248248
expect(opts).to.deep.equal({
249249
headers: {},
@@ -264,7 +264,7 @@ describe('KubeConfig', () => {
264264
};
265265
const rc = new RequestContext(testServerName1, HttpMethod.GET);
266266
await kc.applySecurityAuthentication(rc);
267-
await kc.applytoHTTPSOptions(opts);
267+
await kc.applyToHTTPSOptions(opts);
268268
const expectedCA = Buffer.from('CADATA2', 'utf-8');
269269
const expectedAgent = new https.Agent({
270270
ca: expectedCA,
@@ -669,7 +669,7 @@ describe('KubeConfig', () => {
669669

670670
config.loadFromClusterAndUser({} as Cluster, { username: user, password: passwd } as User);
671671
const opts = {} as https.RequestOptions;
672-
await config.applytoHTTPSOptions(opts);
672+
await config.applyToHTTPSOptions(opts);
673673

674674
expect(opts.auth).to.equal(`${user}:${passwd}`);
675675
});
@@ -689,7 +689,7 @@ describe('KubeConfig', () => {
689689
);
690690
const opts = {} as RequestOptions;
691691

692-
await config.applytoHTTPSOptions(opts);
692+
await config.applyToHTTPSOptions(opts);
693693

694694
/* tslint:disable no-unused-expression*/
695695
expect(opts.auth).to.not.be.undefined;
@@ -704,7 +704,7 @@ describe('KubeConfig', () => {
704704
config.loadFromClusterAndUser({ skipTLSVerify: false } as Cluster, {} as User);
705705
const opts = {} as RequestOptions;
706706

707-
await config.applytoHTTPSOptions(opts);
707+
await config.applyToHTTPSOptions(opts);
708708

709709
expect(opts.rejectUnauthorized).to.equal(undefined);
710710
});
@@ -719,7 +719,7 @@ describe('KubeConfig', () => {
719719
);
720720
const opts = {} as RequestOptions;
721721

722-
await config.applytoHTTPSOptions(opts);
722+
await config.applyToHTTPSOptions(opts);
723723
expect(opts.headers).to.not.be.undefined;
724724
if (opts.headers) {
725725
expect(opts.headers.Authorization).to.equal(`Bearer ${token}`);
@@ -742,14 +742,14 @@ describe('KubeConfig', () => {
742742
);
743743
const opts = {} as RequestOptions;
744744

745-
await config.applytoHTTPSOptions(opts);
745+
await config.applyToHTTPSOptions(opts);
746746
expect(opts.headers).to.not.be.undefined;
747747
if (opts.headers) {
748748
expect(opts.headers.Authorization).to.equal(`Bearer ${token}`);
749749
}
750750
opts.headers = {};
751751
opts.headers.Host = 'foo.com';
752-
await config.applytoHTTPSOptions(opts);
752+
await config.applyToHTTPSOptions(opts);
753753
expect(opts.headers.Authorization).to.equal(`Bearer ${token}`);
754754
});
755755

@@ -769,7 +769,7 @@ describe('KubeConfig', () => {
769769
);
770770
const opts = {} as RequestOptions;
771771

772-
await config.applytoHTTPSOptions(opts);
772+
await config.applyToHTTPSOptions(opts);
773773
expect(opts.headers).to.not.be.undefined;
774774
if (opts.headers) {
775775
expect(opts.headers.Authorization).to.equal(`Bearer ${token}`);
@@ -792,7 +792,7 @@ describe('KubeConfig', () => {
792792
);
793793
const opts = {} as RequestOptions;
794794

795-
await config.applytoHTTPSOptions(opts);
795+
await config.applyToHTTPSOptions(opts);
796796
expect(opts.rejectUnauthorized).to.equal(false);
797797
});
798798

@@ -814,7 +814,7 @@ describe('KubeConfig', () => {
814814
);
815815
const opts = {} as RequestOptions;
816816

817-
await config.applytoHTTPSOptions(opts);
817+
await config.applyToHTTPSOptions(opts);
818818
expect(opts.rejectUnauthorized).to.equal(undefined);
819819
});
820820

@@ -833,7 +833,7 @@ describe('KubeConfig', () => {
833833
);
834834
const opts = {} as RequestOptions;
835835

836-
return expect(config.applytoHTTPSOptions(opts)).to.eventually.be.rejectedWith(
836+
return expect(config.applyToHTTPSOptions(opts)).to.eventually.be.rejectedWith(
837837
'Token is expired!',
838838
);
839839
});
@@ -854,7 +854,7 @@ describe('KubeConfig', () => {
854854
} as User,
855855
);
856856
const opts = {} as RequestOptions;
857-
return expect(config.applytoHTTPSOptions(opts)).to.eventually.be.rejectedWith(
857+
return expect(config.applyToHTTPSOptions(opts)).to.eventually.be.rejectedWith(
858858
/Failed to refresh token/,
859859
);
860860
});
@@ -883,7 +883,7 @@ describe('KubeConfig', () => {
883883
} as User,
884884
);
885885
const opts = {} as RequestOptions;
886-
await config.applytoHTTPSOptions(opts);
886+
await config.applyToHTTPSOptions(opts);
887887
expect(opts.headers).to.not.be.undefined;
888888
if (opts.headers) {
889889
expect(opts.headers.Authorization).to.equal(`Bearer ${token}`);
@@ -914,7 +914,7 @@ describe('KubeConfig', () => {
914914
} as User,
915915
);
916916
const opts = {} as RequestOptions;
917-
await config.applytoHTTPSOptions(opts);
917+
await config.applyToHTTPSOptions(opts);
918918
expect(opts.headers).to.not.be.undefined;
919919
if (opts.headers) {
920920
expect(opts.headers.Authorization).to.equal(`Bearer ${token}`);
@@ -944,7 +944,7 @@ describe('KubeConfig', () => {
944944
} as User,
945945
);
946946
const opts = {} as RequestOptions;
947-
await config.applytoHTTPSOptions(opts);
947+
await config.applyToHTTPSOptions(opts);
948948
expect(opts.headers).to.not.be.undefined;
949949
if (opts.headers) {
950950
expect(opts.headers.Authorization).to.equal(`Bearer ${token}`);
@@ -973,7 +973,7 @@ describe('KubeConfig', () => {
973973
} as User,
974974
);
975975
const opts = {} as RequestOptions;
976-
await config.applytoHTTPSOptions(opts);
976+
await config.applyToHTTPSOptions(opts);
977977
expect(opts.headers).to.not.be.undefined;
978978
if (opts.headers) {
979979
expect(opts.headers.Authorization).to.equal(`Bearer ${token}`);
@@ -1002,7 +1002,7 @@ describe('KubeConfig', () => {
10021002
} as User,
10031003
);
10041004
const opts = {} as RequestOptions;
1005-
await config.applytoHTTPSOptions(opts);
1005+
await config.applyToHTTPSOptions(opts);
10061006
expect(opts.headers).to.not.be.undefined;
10071007
if (opts.headers) {
10081008
expect(opts.headers.Authorization).to.equal(`Bearer ${token}`);
@@ -1038,7 +1038,7 @@ describe('KubeConfig', () => {
10381038
);
10391039
// TODO: inject the exec command here and validate env vars?
10401040
const opts = {} as RequestOptions;
1041-
await config.applytoHTTPSOptions(opts);
1041+
await config.applyToHTTPSOptions(opts);
10421042
expect(opts.headers).to.not.be.undefined;
10431043
if (opts.headers) {
10441044
expect(opts.headers.Authorization).to.equal(`Bearer ${token}`);
@@ -1074,7 +1074,7 @@ describe('KubeConfig', () => {
10741074
);
10751075
// TODO: inject the exec command here?
10761076
const opts = {} as RequestOptions;
1077-
await config.applytoHTTPSOptions(opts);
1077+
await config.applyToHTTPSOptions(opts);
10781078
expect(opts.headers).to.not.be.undefined;
10791079
if (opts.headers) {
10801080
expect(opts.headers.Authorization).to.equal(`Bearer ${token}`);
@@ -1105,7 +1105,7 @@ describe('KubeConfig', () => {
11051105
);
11061106
// TODO: inject the exec command here?
11071107
const opts = {} as RequestOptions;
1108-
await config.applytoHTTPSOptions(opts);
1108+
await config.applyToHTTPSOptions(opts);
11091109
expect(opts.headers).to.not.be.undefined;
11101110
if (opts.headers) {
11111111
expect(opts.headers.Authorization).to.equal(`Bearer ${token}`);
@@ -1137,7 +1137,7 @@ describe('KubeConfig', () => {
11371137
);
11381138
// TODO: inject the exec command here?
11391139
const opts = {} as RequestOptions;
1140-
await config.applytoHTTPSOptions(opts);
1140+
await config.applyToHTTPSOptions(opts);
11411141
let execAuthenticator = (KubeConfig as any).authenticators.find(
11421142
(authenticator) => authenticator instanceof ExecAuth,
11431143
);
@@ -1158,7 +1158,7 @@ describe('KubeConfig', () => {
11581158
} as User,
11591159
);
11601160
const opts = {} as RequestOptions;
1161-
return expect(config.applytoHTTPSOptions(opts)).to.eventually.be.rejectedWith(
1161+
return expect(config.applyToHTTPSOptions(opts)).to.eventually.be.rejectedWith(
11621162
'No command was specified for exec authProvider!',
11631163
);
11641164
});
@@ -1457,7 +1457,7 @@ describe('KubeConfig', () => {
14571457

14581458
it('should apply to request', async () => {
14591459
const opts = {} as RequestOptions;
1460-
await emptyConfig.applytoHTTPSOptions(opts);
1460+
await emptyConfig.applyToHTTPSOptions(opts);
14611461
});
14621462
});
14631463

src/log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export class Log {
123123
const searchParams = requestURL.searchParams;
124124
AddOptionsToSearchParams(options, searchParams);
125125

126-
await this.config.applytoHTTPSOptions(requestOptions);
126+
await this.config.applyToHTTPSOptions(requestOptions);
127127

128128
const req = await fetch(requestURL.toString(), requestOptions)
129129
.then((response) => {

src/metrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class Metrics {
9090

9191
const requestURL = cluster.server + path;
9292

93-
await this.config.applytoHTTPSOptions(requestOptions);
93+
await this.config.applyToHTTPSOptions(requestOptions);
9494

9595
return fetch(requestURL, requestOptions)
9696
.then((response) => {

src/proto-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class ProtoClient {
1414
hostname: u.hostname,
1515
protocol: u.protocol,
1616
};
17-
await this.config.applytoHTTPSOptions(options);
17+
await this.config.applyToHTTPSOptions(options);
1818
const req = http.request(options);
1919

2020
const result = await new Promise<any>((resolve, reject) => {

src/watch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ export class Watch {
9494
watchURL.searchParams.set('watch', 'true');
9595

9696
const httpsOptions: RequestOptions = {};
97-
// TODO: fix applytoHTTPSOptions for watch
98-
await this.config.applytoHTTPSOptions(httpsOptions);
97+
// TODO: fix applyToHTTPSOptions for watch
98+
await this.config.applyToHTTPSOptions(httpsOptions);
9999

100100
const controller = new AbortController();
101101
// @ts-ignore

src/web-socket-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export class WebSocketHandler implements WebSocketInterface {
166166

167167
const opts: WebSocket.ClientOptions = {};
168168

169-
await this.config.applytoHTTPSOptions(opts);
169+
await this.config.applyToHTTPSOptions(opts);
170170

171171
return await new Promise<WebSocket>((resolve, reject) => {
172172
const client = this.socketFactory

0 commit comments

Comments
 (0)