Skip to content

Commit

Permalink
fix: propagate force flag to deployService action
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed May 24, 2018
1 parent 7a7d5af commit 6ccc9d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugins/kubernetes/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,26 @@ interface KubeEnvVar {
}

export async function deployService(
{ ctx, provider, service, env, runtimeContext, logEntry }: DeployServiceParams<ContainerModule>,
{ ctx, provider, service, env, runtimeContext, force, logEntry }: DeployServiceParams<ContainerModule>,
): Promise<ServiceStatus> {
const namespace = await getAppNamespace(ctx, provider)

const context = provider.config.context
const deployment = await createDeployment(service, runtimeContext)
await apply(context, deployment, { namespace })
await apply(context, deployment, { namespace, force })

// TODO: automatically clean up Services and Ingresses if they should no longer exist

const kubeservices = await createServices(service)

for (let kubeservice of kubeservices) {
await apply(context, kubeservice, { namespace })
await apply(context, kubeservice, { namespace, force })
}

const ingress = await createIngress(ctx, provider, service)

if (ingress !== null) {
await apply(context, ingress, { namespace })
await apply(context, ingress, { namespace, force })
}

await waitForDeployment({ ctx, provider, service, logEntry, env })
Expand Down
1 change: 1 addition & 0 deletions src/tasks/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export class DeployTask extends Task {
serviceName: this.service.name,
runtimeContext: await this.service.prepareRuntimeContext(),
logEntry,
force: this.force,
})

logEntry.setSuccess({ msg: chalk.green(`Ready`), append: true })
Expand Down
1 change: 1 addition & 0 deletions src/types/plugin/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export interface GetServiceStatusParams<T extends Module = Module> extends Plugi

export interface DeployServiceParams<T extends Module = Module> extends PluginServiceActionParamsBase<T> {
runtimeContext: RuntimeContext,
force?: boolean,
}

export interface GetServiceOutputsParams<T extends Module = Module> extends PluginServiceActionParamsBase<T> {
Expand Down

0 comments on commit 6ccc9d0

Please sign in to comment.