Skip to content

Commit b4d0522

Browse files
committed
Change how we use readFileSync to renable mockfs to work.
1 parent e5b15c3 commit b4d0522

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export class KubeConfig {
126126

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

@@ -245,7 +245,7 @@ export class KubeConfig {
245245
const namespaceFile = `${pathPrefix}${Config.SERVICEACCOUNT_NAMESPACE_PATH}`;
246246
let namespace: string | undefined;
247247
if (fileExists(namespaceFile)) {
248-
namespace = fs.readFileSync(namespaceFile, 'utf8');
248+
namespace = fs.readFileSync(namespaceFile).toString('utf-8');
249249
}
250250
this.contexts = [
251251
{

0 commit comments

Comments
 (0)