Skip to content

Commit 0897be8

Browse files
authored
Merge pull request #364 from oasisprotocol/kostko/feature/rofl-create-check
fix(cmd/rofl): Refuse to overwrite app ID in create
2 parents cb323b7 + 1f74c3f commit 0897be8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/rofl/mgmt.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,11 @@ var (
213213
cobra.CheckErr("no ParaTime selected")
214214
}
215215

216+
// In case an app ID is already assigned, refuse to overwrite.
217+
if deployment != nil && deployment.AppID != "" {
218+
cobra.CheckErr(fmt.Errorf("ROFL app identifier already defined (%s) for deployment '%s', refusing to overwrite", deployment.AppID, deploymentName))
219+
}
220+
216221
// When not in offline mode, connect to the given network endpoint.
217222
ctx := context.Background()
218223
var conn connection.Connection
@@ -242,7 +247,7 @@ var (
242247
return
243248
}
244249

245-
fmt.Printf("Created ROFL application: %s\n", appID)
250+
fmt.Printf("Created ROFL app: %s\n", appID)
246251

247252
if deployment != nil {
248253
switch doUpdate {

0 commit comments

Comments
 (0)