Skip to content

Commit

Permalink
Merge pull request #1202 from brendandburns/fix-node-20
Browse files Browse the repository at this point in the history
Change how we use readFileSync to renable mockfs to work.
  • Loading branch information
k8s-ci-robot committed Aug 17, 2023
2 parents 2fc86b3 + 79cbbe0 commit 8b8fa33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class KubeConfig implements SecurityAuthentication {

public loadFromFile(file: string, opts?: Partial<ConfigOptions>): void {
const rootDirectory = path.dirname(file);
this.loadFromString(fs.readFileSync(file, 'utf8'), opts);
this.loadFromString(fs.readFileSync(file).toString('utf-8'), opts);
this.makePathsAbsolute(rootDirectory);
}

Expand Down Expand Up @@ -323,7 +323,7 @@ export class KubeConfig implements SecurityAuthentication {
const namespaceFile = `${pathPrefix}${SERVICEACCOUNT_NAMESPACE_PATH}`;
let namespace: string | undefined;
if (fileExists(namespaceFile)) {
namespace = fs.readFileSync(namespaceFile, 'utf8');
namespace = fs.readFileSync(namespaceFile).toString('utf-8');
}
this.contexts = [
{
Expand Down

0 comments on commit 8b8fa33

Please sign in to comment.