fix: reset inputs back to initial state in secrets.APIController
This fixes a bug when after an error generating certificates controller gets into a state of not being able to read its expected inputs (NetworkStatus specifically). Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
This commit is contained in:
parent
64cb873ec4
commit
0f60ef6d38
@ -76,6 +76,11 @@ func (ctrl *APIController) Run(ctx context.Context, r controller.Runtime, logger
|
||||
case <-r.EventCh():
|
||||
}
|
||||
|
||||
// reset inputs back to what they were initially
|
||||
if err := r.UpdateInputs(ctrl.Inputs()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
machineTypeRes, err := r.Get(ctx, resource.NewMetadata(config.NamespaceName, config.MachineTypeType, config.MachineTypeID, resource.VersionUndefined))
|
||||
if err != nil {
|
||||
if state.IsNotFoundError(err) {
|
||||
@ -121,11 +126,6 @@ func (ctrl *APIController) Run(ctx context.Context, r controller.Runtime, logger
|
||||
if err = ctrl.teardownAll(ctx, r); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// reset inputs back to what they were initially
|
||||
if err = r.UpdateInputs(ctrl.Inputs()); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user