Skip to content

Commit

Permalink
Merge pull request #1891 from cjihrig/buffer
Browse files Browse the repository at this point in the history
test: replace use of deprecated Buffer constructor
  • Loading branch information
k8s-ci-robot authored Sep 26, 2024
2 parents 66b533d + 3a5c744 commit 1aad91f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/config_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ describe('KubeConfig', () => {

expect(opts).to.deep.equal({
headers: {},
ca: new Buffer('CADATA2', 'utf-8'),
cert: new Buffer('USER_CADATA', 'utf-8'),
key: new Buffer('USER_CKDATA', 'utf-8'),
ca: Buffer.from('CADATA2', 'utf-8'),
cert: Buffer.from('USER_CADATA', 'utf-8'),
key: Buffer.from('USER_CKDATA', 'utf-8'),
rejectUnauthorized: false,
servername: 'kube.example2.com',
});
Expand All @@ -357,9 +357,9 @@ describe('KubeConfig', () => {
expect(opts).to.deep.equal({
url: 'https://company.com',
headers: {},
ca: new Buffer('CADATA2', 'utf-8'),
cert: new Buffer('USER_CADATA', 'utf-8'),
key: new Buffer('USER_CKDATA', 'utf-8'),
ca: Buffer.from('CADATA2', 'utf-8'),
cert: Buffer.from('USER_CADATA', 'utf-8'),
key: Buffer.from('USER_CKDATA', 'utf-8'),
rejectUnauthorized: false,
strictSSL: false,
agentOptions: {
Expand All @@ -376,9 +376,9 @@ describe('KubeConfig', () => {

expect(opts).to.deep.equal({
headers: {},
ca: new Buffer('CADATA2', 'utf-8'),
cert: new Buffer('USER2_CADATA', 'utf-8'),
key: new Buffer('USER2_CKDATA', 'utf-8'),
ca: Buffer.from('CADATA2', 'utf-8'),
cert: Buffer.from('USER2_CADATA', 'utf-8'),
key: Buffer.from('USER2_CKDATA', 'utf-8'),
rejectUnauthorized: false,
});
});
Expand All @@ -393,7 +393,7 @@ describe('KubeConfig', () => {
await kc.applyToRequest(opts);
expect(opts).to.deep.equal({
headers: {},
ca: new Buffer('CADATA2', 'utf-8'),
ca: Buffer.from('CADATA2', 'utf-8'),
auth: {
username: 'foo',
password: 'bar',
Expand Down

0 comments on commit 1aad91f

Please sign in to comment.