Skip to content

Commit

Permalink
Fix/default registry (#876)
Browse files Browse the repository at this point in the history
* fix: default registry tricked many people

* fix: stuck state detection
  • Loading branch information
laszlocph authored Oct 6, 2024
1 parent 6e4d9d1 commit bfff2fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion web/src/components/nav/nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ function Connecting(props) {
)
}

const age = new Date() - expiringAt
const age = new Date() - (expiringAt-sevenDays)
const stuck = age > 5*60*1000
if (stuck) {
return (
Expand Down
16 changes: 11 additions & 5 deletions web/src/views/envConfig/imageWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ export default function ImageWidget(props) {
}

const setStrategy = (strategy) => {
let registry = {}
registry = registries.find(r => r.variable === "customRegistry")
if (!registry) {
registry = registries.find(r => r.variable === "containerizedRegistry")
}

switch (strategy) {
case 'dynamic':
setImage({
...image,
"strategy": strategy,
"registry": "public",
"registry": "",
"repository": "your-company/your-repo",
"tag": "{{ .SHA }}",
"dockerfile": ""
Expand All @@ -41,8 +47,8 @@ export default function ImageWidget(props) {
setImage({
...image,
"strategy": strategy,
"registry": "containerizedRegistry",
"repository": "127.0.0.1:32447/{{ .APP }}",
"registry": registry.variable,
"repository": registry.url+"/{{ .APP }}",
"tag": "{{ .SHA }}",
"dockerfile": "Dockerfile"
})
Expand All @@ -51,8 +57,8 @@ export default function ImageWidget(props) {
setImage({
...image,
"strategy": strategy,
"registry": "containerizedRegistry",
"repository": "127.0.0.1:32447/{{ .APP }}",
"registry": registry.variable,
"repository": registry.url+"/{{ .APP }}",
"tag": "{{ .SHA }}",
"dockerfile": ""
})
Expand Down

0 comments on commit bfff2fd

Please sign in to comment.