Skip to content

Commit

Permalink
fix: undefined error when no registries are configured
Browse files Browse the repository at this point in the history
  • Loading branch information
laszlocph committed Oct 8, 2024
1 parent a932708 commit 4606855
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions web/src/views/envConfig/imageWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ export default function ImageWidget(props) {
}

const setStrategy = (strategy) => {
let registry = {}
registry = registries.find(r => r.variable === "customRegistry")
let registry = registries.find(r => r.variable === "customRegistry")
if (!registry) {
registry = registries.find(r => r.variable === "containerizedRegistry")
}
Expand All @@ -55,7 +54,7 @@ export default function ImageWidget(props) {
setImage({
...image,
"strategy": strategy,
"registry": registry.variable,
"registry": registry ? registry.variable : "",
"repository": repository,
"tag": "{{ .SHA }}",
"context": ".",
Expand All @@ -66,7 +65,7 @@ export default function ImageWidget(props) {
setImage({
...image,
"strategy": strategy,
"registry": registry.variable,
"registry": registry ? registry.variable : "",
"repository": repository,
"tag": "{{ .SHA }}",
"dockerfile": ""
Expand All @@ -89,6 +88,9 @@ export default function ImageWidget(props) {
}, [image]);

const repositoryFromRegistry = (registry) => {
if (!registry) {
return ""
}
const login = registry.login ?? "your-company"
let repository = ""

Expand Down

0 comments on commit 4606855

Please sign in to comment.