Skip to content

Commit

Permalink
fix: docker secret creation
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-tkachenko committed Dec 2, 2019
1 parent 1e6db83 commit 9e901b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/processors/secrets/ApplyDockerSercretActionProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class ApplyDockerSecretActionProcessor extends BaseActionProcessor {
private async prepareCLIArgs(): Promise<string[]> {
const args: string[] = ['apply'];

let dockerconfigjson;
let dockerconfigjson: string;
if (this.options.inline) {
const { username, password, email, server } = this.options.inline;
dockerconfigjson = Buffer.from(
Expand All @@ -81,14 +81,14 @@ export class ApplyDockerSecretActionProcessor extends BaseActionProcessor {
username,
password,
email,
auth: Buffer.from(`${username}:${password}`),
auth: Buffer.from(`${username}:${password}`).toString('base64'),
},
}),
).toString('base64');
} else {
const path = FSUtil.getAbsolutePath(this.options.path, this.snapshot.wd);
dockerconfigjson = await FSUtil.readFile(path);
dockerconfigjson = dockerconfigjson.toString('base64');
const fileContents = await FSUtil.readFile(path);
dockerconfigjson = fileContents.toString('base64');
}

const secretFilePaht = await this.writeJsonToTempFile({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class ApplyDockerSecretActionHandlerTestSuite {
username: options.inline.username,
password: options.inline.password,
email: options.inline.email,
auth: Buffer.from(`${options.inline.username}:${options.inline.password}`),
auth: Buffer.from(`${options.inline.username}:${options.inline.password}`).toString('base64'),
},
}),
).toString('base64'),
Expand Down

0 comments on commit 9e901b0

Please sign in to comment.