Skip to content

Commit

Permalink
minor refactor from pr comment and fix crashing for loading old resou…
Browse files Browse the repository at this point in the history
…rce without imagebuilderconfig
  • Loading branch information
leonlnj committed Dec 8, 2023
1 parent 2d1e720 commit ed13ac9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions api/cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ func main() {

ModelDeletionEnabled: cfg.FeatureToggleConfig.ModelDeletionConfig.Enabled,

ImageBuilderCluster: cfg.ImageBuilderConfig.ClusterName,
ImageBuilderProject: cfg.ImageBuilderConfig.GcpProject,
ImageBuilderNamespace: cfg.ImageBuilderConfig.BuildNamespace,
ImageBuilderCluster: cfg.ImageBuilderConfig.ClusterName,

Check failure on line 176 in api/cmd/api/main.go

View workflow job for this annotation

GitHub Actions / lint-api

File is not `gofmt`-ed with `-s` (gofmt)
ImageBuilderGCPProject: cfg.ImageBuilderConfig.GcpProject,
ImageBuilderNamespace: cfg.ImageBuilderConfig.BuildNamespace,
}

uiHomePage := fmt.Sprintf("/%s", strings.TrimPrefix(cfg.ReactAppConfig.HomePage, "/"))
Expand Down
6 changes: 3 additions & 3 deletions api/cmd/api/ui_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ type uiEnvHandler struct {

ModelDeletionEnabled bool `json:"REACT_APP_MODEL_DELETION_ENABLED"`

ImageBuilderCluster string `json:"REACT_APP_IMAGE_BUILDER_CLUSTER"`
ImageBuilderProject string `json:"REACT_APP_IMAGE_BUILDER_PROJECT"`
ImageBuilderNamespace string `json:"REACT_APP_IMAGE_BUILDER_NAMESPACE"`
ImageBuilderCluster string `json:"REACT_APP_IMAGE_BUILDER_CLUSTER"`

Check failure on line 26 in api/cmd/api/ui_handler.go

View workflow job for this annotation

GitHub Actions / lint-api

File is not `gofmt`-ed with `-s` (gofmt)
ImageBuilderGCPProject string `json:"REACT_APP_IMAGE_BUILDER_GCP_PROJECT"`
ImageBuilderNamespace string `json:"REACT_APP_IMAGE_BUILDER_NAMESPACE"`
}

func (h uiEnvHandler) handler(w http.ResponseWriter, r *http.Request) {
Expand Down
6 changes: 3 additions & 3 deletions ui/src/components/logs/ContainerLogsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ export const ContainerLogsView = ({
titleProps={{ style: { width: "30%", fontSize: '14px'} }}
type="column"
>
<EuiDescriptionListTitle style={{ width: "30%", fontSize: '14px'}} >Imagebuider URL</EuiDescriptionListTitle>
<EuiDescriptionListTitle style={{ width: "30%", fontSize: '14px'}} >Stackdriver Logs</EuiDescriptionListTitle>
<EuiDescriptionListDescription>
<EuiLink href={imagebuilderStackdriverUrl} target="_blank" external>Stackdriver Logs</EuiLink>
<EuiLink href={imagebuilderStackdriverUrl} target="_blank" external>Image Builder</EuiLink>
</EuiDescriptionListDescription>
</EuiDescriptionList>
</EuiCard>
Expand Down Expand Up @@ -255,7 +255,7 @@ export const ContainerLogsView = ({
</EuiFlexGroup>
) : (
<EuiEmptyPrompt
title={<h2>You have no logs</h2>}
title={<h2>Active Container Logs</h2>}
body={
<Fragment>
<p>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const appConfig = {
},
imagebuilder:{
cluster: getEnv("REACT_APP_IMAGE_BUILDER_CLUSTER"),
gcp_project: getEnv("REACT_APP_IMAGE_BUILDER_PROJECT"),
gcp_project: getEnv("REACT_APP_IMAGE_BUILDER_GCP_PROJECT"),
namespace: getEnv("REACT_APP_IMAGE_BUILDER_NAMESPACE"),
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const ImageBuilderSection = ({
>
<EuiFieldText
placeholder="500m"
value={imageBuilderResourceConfig.cpu_request}
value={imageBuilderResourceConfig?.cpu_request}
onChange={(e) => onChange("cpu_request")(e.target.value)}
isInvalid={!!errors.cpu_request}
name="cpu"
Expand All @@ -59,7 +59,7 @@ export const ImageBuilderSection = ({
>
<EuiFieldText
placeholder="500Mi"
value={imageBuilderResourceConfig.memory_request}
value={imageBuilderResourceConfig?.memory_request}
onChange={(e) => onChange("memory_request")(e.target.value)}
isInvalid={!!errors.memory_request}
name="memory"
Expand Down

0 comments on commit ed13ac9

Please sign in to comment.