Skip to content

Commit 1bf205d

Browse files
mclasmeierclaude
andcommitted
Move unsupported component check into getWaitConfig default case
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f640511 commit 1bf205d

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
@@ -440,23 +440,23 @@ func (d *Deployer) waitForResourceToExist(ctx context.Context, resource, namespa
440440
}
441441
}
442442

443-
func (d *Deployer) getWaitConfig(comp component.Component) WaitConfig {
443+
func (d *Deployer) getWaitConfig(comp component.Component) (WaitConfig, error) {
444444
switch comp {
445445
case component.Central:
446-
return d.config.Central.GetWaitConfig()
446+
return d.config.Central.GetWaitConfig(), nil
447447
case component.SecuredCluster:
448-
return d.config.SecuredCluster.GetWaitConfig()
448+
return d.config.SecuredCluster.GetWaitConfig(), nil
449449
default:
450-
return WaitConfig{}
450+
return WaitConfig{}, fmt.Errorf("unsupported component for wait config: %s", comp)
451451
}
452452
}
453453

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

462462
const padding = 5 * time.Second

0 commit comments

Comments
 (0)