Skip to content

Commit

Permalink
Fixes to report messages plus timeout increased
Browse files Browse the repository at this point in the history
  • Loading branch information
akgalwas committed Nov 26, 2024
1 parent 489b630 commit 3cce0f2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions hack/runtime-migrator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ cat ./runtime-migrator \
2024/11/22 17:05:28
2024/11/22 17:05:33 INFO Migrating runtimes
2024/11/22 17:05:33 INFO Reading runtimeIds from input file
2024/11/22 17:05:43 INFO Runtime processed successfully runtimeID=1df09b5b-0347-459d-aa0a-715db8fcaad7
2024/11/22 17:05:45 INFO Runtime processed successfully runtimeID=ea439a5e-aa59-4e3e-8bfb-9bab1b31371e
2024/11/22 17:05:49 INFO Runtime processed successfully runtimeID=d6eeafee-ffd5-4f23-97dc-a1df197b3b30
2024/11/22 17:05:43 INFO Runtime processed successfully (dry run) runtimeID=1df09b5b-0347-459d-aa0a-715db8fcaad7
2024/11/22 17:05:45 INFO Runtime processed successfully (dry run) runtimeID=ea439a5e-aa59-4e3e-8bfb-9bab1b31371e
2024/11/22 17:05:49 INFO Runtime processed successfully (dry run) runtimeID=d6eeafee-ffd5-4f23-97dc-a1df197b3b30
2024/11/22 17:05:52 WARN Runtime CR can cause unwanted update in Gardener runtimeID=99a38a99-e8d7-4b98-a6f2-5a54ed389c4d
2024/11/22 17:05:52 ERROR Failed to fetch shoot: shoot was deleted or the runtime ID is incorrect runtimeID=0a61a3c4-0ea8-4e39-860a-7853f0b6d180
2024/11/22 17:05:55 ERROR Failed to verify runtime runtimeID=6daf5f59-b0ab-44af-bb8e-7735fd609449
Expand Down
2 changes: 1 addition & 1 deletion hack/runtime-migrator/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
)

const (
timeoutK8sOperation = 15 * time.Second
timeoutK8sOperation = 20 * time.Second
expirationTime = 60 * time.Minute
runtimeIDAnnotation = "kcp.provisioner.kyma-project.io/runtime-id"
)
Expand Down
10 changes: 6 additions & 4 deletions hack/runtime-migrator/cmd/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,17 @@ func (m Migration) Do(ctx context.Context, runtimeIDs []string) error {
return
}

if !m.isDryRun {
if m.isDryRun {
reportSuccess(runtimeID, shoot.Name, "Runtime processed successfully (dry-run)")
} else {
err = m.applyRuntimeCR(runtime)
if err != nil {
reportError(runtimeID, shoot.Name, "Failed to apply Runtime CR", err)
return
}
return
}

reportSuccess(runtimeID, shoot.Name, "Runtime processed successfully")
reportSuccess(runtimeID, shoot.Name, "Runtime have been applied")
}
}

main:
Expand Down

0 comments on commit 3cce0f2

Please sign in to comment.