Skip to content

Commit 06832f9

Browse files
committed
fix: if we cannot connect during init, warn and move on
When we are in an airgapped environment, we may not be able to connect to the network during init. If its the case, we warn the user and continue with the initialization process.
1 parent 745d85f commit 06832f9

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

internal/handlers/compose/init.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,21 @@ func InitHandler(isCli bool, params InitHandlerInputs) error {
5656
Registry: params.Registry,
5757
}
5858
err := registryInfo.PullConfig(destPath, params.Project, params.Version)
59+
if err != nil && err.Error() == "Error response from daemon: manifest unknown" {
60+
logger.Fatal(params.Project + ":" + params.Version + " template not found in registry " +
61+
params.Registry + ". Please check the registry or use a different version.")
62+
}
5963
if err != nil {
60-
logger.Error(err)
61-
if !app.Embed.IsTrue() {
62-
logger.Info("using embeds")
63-
return err
64-
}
64+
logger.Warn(err)
6565
}
6666
} else {
6767
err := pullLatestTemplate(destPath, params.Project, params.Version)
68+
if err != nil && err.Error() == "Error response from daemon: manifest unknown" {
69+
logger.Fatal(params.Project + ":" + params.Version + " template not found in registry " +
70+
params.Registry + ". Please check the registry or use a different version.")
71+
}
6872
if err != nil {
69-
logger.Error(err)
70-
if !app.Embed.IsTrue() {
71-
logger.Info("using embeds")
72-
return err
73-
}
73+
logger.Warn(err)
7474
}
7575
}
7676
// Instantiate config

0 commit comments

Comments
 (0)