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

improvement(k8s): more robust and useful deployment status checks #865

Merged
merged 1 commit into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion garden-service/src/logger/renderers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const cliPadEnd = (s: string, width: number): string => {
const truncateSection = (s: string) => cliTruncate(s, SECTION_PREFIX_WIDTH)
const sectionStyle = (s: string) => chalk.cyan.italic(cliPadEnd(truncateSection(s), SECTION_PREFIX_WIDTH))
export const msgStyle = (s: string) => hasAnsi(s) ? s : chalk.gray(s)
export const errorStyle = chalk.red
export const errorStyle = (s: string) => hasAnsi(s) ? s : chalk.red(s)

/*** RENDER HELPERS ***/
function insertVal(out: string[], idx: number, toRender: Function | string, renderArgs: any[]): string[] {
Expand Down
3 changes: 2 additions & 1 deletion garden-service/src/plugins/kubernetes/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ export class KubeApi {
? `${basePath}/namespaces/${namespace}/${resource.name}/${name}`
: `${basePath}/${resource.name}/${name}`

return this.request(log, apiPath)
const res = await this.request(log, apiPath)
return res.body
}

async upsert<K extends keyof CrudMapType>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { RuntimeContext, Service, ServiceStatus } from "../../../types/service"
import { ContainerModule, ContainerService } from "../../container/config"
import { createIngressResources } from "./ingress"
import { createServiceResources } from "./service"
import { waitForResources } from "../status"
import { waitForResources } from "../status/status"
import { apply, deleteObjectsByLabel } from "../kubectl"
import { getAppNamespace } from "../namespace"
import { PluginContext } from "../../../plugin-context"
Expand Down
2 changes: 1 addition & 1 deletion garden-service/src/plugins/kubernetes/container/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { sleep } from "../../../util/util"
import { GetServiceStatusParams } from "../../../types/plugin/service/getServiceStatus"
import { ContainerModule } from "../../container/config"
import { KubeApi } from "../api"
import { compareDeployedObjects } from "../status"
import { compareDeployedObjects } from "../status/status"
import { getIngresses } from "./ingress"
import { getAppNamespace } from "../namespace"
import { KubernetesPluginContext } from "../config"
Expand Down
2 changes: 1 addition & 1 deletion garden-service/src/plugins/kubernetes/helm/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { ServiceStatus } from "../../../types/service"
import { getAppNamespace } from "../namespace"
import { waitForResources } from "../status"
import { waitForResources } from "../status/status"
import { helm } from "./helm-cli"
import { HelmModule } from "./config"
import {
Expand Down
2 changes: 1 addition & 1 deletion garden-service/src/plugins/kubernetes/helm/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import { ServiceStatus, ServiceState } from "../../../types/service"
import { GetServiceStatusParams } from "../../../types/plugin/service/getServiceStatus"
import { getExecModuleBuildStatus } from "../../exec"
import { compareDeployedObjects } from "../status"
import { compareDeployedObjects } from "../status/status"
import { KubeApi } from "../api"
import { getAppNamespace } from "../namespace"
import { LogEntry } from "../../../logger/log-entry"
Expand Down
2 changes: 1 addition & 1 deletion garden-service/src/plugins/kubernetes/helm/tiller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { helm } from "./helm-cli"
import { safeLoadAll } from "js-yaml"
import { KubeApi } from "../api"
import { getAppNamespace } from "../namespace"
import { checkResourceStatuses, waitForResources } from "../status"
import { checkResourceStatuses, waitForResources } from "../status/status"
import { combineStates } from "../../../types/service"
import { apply } from "../kubectl"
import { KubernetesProvider } from "../config"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { getNamespace, getAppNamespace } from "../namespace"
import { KubernetesPluginContext } from "../config"
import { KubernetesResource } from "../types"
import { ServiceStatus } from "../../../types/service"
import { compareDeployedObjects, waitForResources } from "../status"
import { compareDeployedObjects, waitForResources } from "../status/status"
import { KubeApi } from "../api"
import { ModuleAndRuntimeActions } from "../../../types/plugin/plugin"
import { getAllLogs } from "../logs"
Expand Down
Loading