Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made command dropdown optional in Kubernetes V0 and V1 task #8931

Merged
merged 7 commits into from
Dec 3, 2018

Conversation

Anumita
Copy link
Contributor

@Anumita Anumita commented Nov 28, 2018

Right now, output variables are populated only with the output of the kubectl command.
As the command dropdown will be optional now, the output variable if there is no command specified
will be populated with the name of the configmap or secret created.

@@ -229,6 +229,7 @@ tr.registerMock('./utilities', {
StringWritable: ut.StringWritable,
PackerVersion: ut.PackerVersion,
isGreaterVersion: ut.isGreaterVersion,
setOutputVariable: ut.setOutputVariable,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why setoutputVariable?

@@ -70,7 +70,9 @@ function createConfigMap(connection: ClusterConnection, configMapName: string):
command.arg("configmap");
command.arg(configMapName);
command.line(getConfigMapArguments());
return connection.execCommand(command);
return connection.execCommand(command).fin(function cleanup() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why function name is cleanup?

@@ -67,7 +67,9 @@ function createDockerRegistrySecret(connection: ClusterConnection, authenticatio
command.arg("--docker-password="+ authenticationToken.getPassword());
command.arg("--docker-email="+ authenticationToken.getEmail());

return connection.execCommand(command);
return connection.execCommand(command).fin(function cleanup() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above, cleanup?

@@ -92,7 +94,9 @@ function createGenericSecret(connection: ClusterConnection, secret: string): any
command.line(secretArguments);
}

return connection.execCommand(command);
return connection.execCommand(command).fin(function cleanup() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

export function setOutputVariable(value: string) {
var ouputVariableName = tl.getInput("kubectlOutput", false);
if(ouputVariableName) {
tl.setVariable(ouputVariableName, value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can it cause a secret to get leaked?

@@ -70,7 +71,9 @@ function createConfigMap(connection: ClusterConnection, configMapName: string):
command.arg("configmap");
command.arg(configMapName);
command.line(getConfigMapArguments());
return connection.execCommand(command);
return connection.execCommand(command).fin(function cleanup() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

@@ -63,7 +64,9 @@ function createDockerRegistrySecret(connection: ClusterConnection, authenticatio
command.arg("--docker-password="+ authenticationToken.getPassword());
command.arg("--docker-email="+ authenticationToken.getEmail());

return connection.execCommand(command);
return connection.execCommand(command).fin(function cleanup() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this

@Anumita Anumita force-pushed the users/ansheno/kubeCmdDrpOptional branch from 410af18 to 54b5e3b Compare November 30, 2018 09:13
@Anumita Anumita force-pushed the users/ansheno/kubeCmdDrpOptional branch from 54b5e3b to ccf9456 Compare November 30, 2018 09:17
@Anumita Anumita force-pushed the users/ansheno/kubeCmdDrpOptional branch from 08fde7c to a161008 Compare November 30, 2018 09:27
@Anumita Anumita force-pushed the users/ansheno/kubeCmdDrpOptional branch from b5969c2 to 35884bf Compare December 3, 2018 06:45
@Anumita Anumita merged commit 9227e1d into master Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants