Skip to content

Commit

Permalink
Wait for manifest-issued deployments to complete before proceeding wi…
Browse files Browse the repository at this point in the history
…th Topology generation (#556)

adding fix
  • Loading branch information
LarsxGitHub authored Aug 7, 2024
1 parent 55626ef commit c7582e5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,17 @@ func (k *KindSpec) Deploy(ctx context.Context) error {
}
}

// If any additional manifests were provided, there is a chance they started new deployment, e.g.,
// a manifest file might deploy a webhook that needs to be running before proceeding with later
// stages such as topology creation. Hence, we Wait for any potential deployments to complete.
// If no deployments were configured, the waiting status call simply returns immediately with a
// "No resources found in default namespace." error message that we should warn about.
if len(k.AdditionalManifests) > 0 {
log.Infof("Waiting for potential manifest-issued deployments to complete")
if err := run.LogCommand("kubectl", "rollout", "status", "deployment", "-w"); err != nil {
log.Warningf("Unable to wait for deployments to complete: %w", err)
}
}
return nil
}

Expand Down
1 change: 1 addition & 0 deletions deploy/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ func TestKindSpec(t *testing.T) {
{Cmd: "docker", Args: []string{"tag", "docker", "local"}, OutOfOrder: true},
{Cmd: "docker", Args: []string{"pull", "gar"}, OutOfOrder: true},
{Cmd: "docker", Args: []string{"tag", "gar", "docker"}, OutOfOrder: true},
{Cmd: "kubectl", Args: []string{"rollout", "status", "deployment", "-w"}},
},
}, {
desc: "failed create cluster load containers additional manifests",
Expand Down

0 comments on commit c7582e5

Please sign in to comment.