Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait for manifest-issued deployments to complete before proceeding with Topology generation #556

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading