Skip to content

Commit 001c7e2

Browse files
Moritz Clasmeierclaude
andcommitted
Move unsupported component check into getWaitConfig default case
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e0764b9 commit 001c7e2

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

internal/deployer/deploy_via_operator.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -434,23 +434,23 @@ func (d *Deployer) waitForResourceToExist(ctx context.Context, resource, namespa
434434
}
435435
}
436436

437-
func (d *Deployer) getWaitConfig(comp component.Component) WaitConfig {
437+
func (d *Deployer) getWaitConfig(comp component.Component) (WaitConfig, error) {
438438
switch comp {
439439
case component.Central:
440-
return d.config.Central.GetWaitConfig()
440+
return d.config.Central.GetWaitConfig(), nil
441441
case component.SecuredCluster:
442-
return d.config.SecuredCluster.GetWaitConfig()
442+
return d.config.SecuredCluster.GetWaitConfig(), nil
443443
default:
444-
return WaitConfig{}
444+
return WaitConfig{}, fmt.Errorf("unsupported component for wait config: %s", comp)
445445
}
446446
}
447447

448448
// waitForComponentReady waits for a component to be ready.
449449
func (d *Deployer) waitForComponentReady(ctx context.Context, comp component.Component) error {
450-
if comp != component.Central && comp != component.SecuredCluster {
451-
return errors.New("waitForComponentReady only supports Central or SecuredCluster components")
450+
waitCfg, err := d.getWaitConfig(comp)
451+
if err != nil {
452+
return err
452453
}
453-
waitCfg := d.getWaitConfig(comp)
454454
d.logger.Infof("⏳ Waiting for %s to become ready (timeout: %s)...", comp, waitCfg.Timeout)
455455

456456
const padding = 5 * time.Second

0 commit comments

Comments
 (0)