Skip to content

Commit

Permalink
MGMT-13111: Freeze on 404 Not Found (#628)
Browse files Browse the repository at this point in the history
Currently when the user deletes a host the next step runner receives a
`404 Not Found` response code from the server, logs it and tries again
with exponential backoff. After approximately 15 minutes it stops
retrying and exits, and then the main process of the agent will register
the host again. The net result is that the host is automatically
re-added after those 15 minutes, and we don't want that. To avoid that
this patch changes the next step runner so that it freezes the agent. To
register the host again the user will have to start the agent or else
reboot the host.

Related: https://issues.redhat.com/browse/MGMT-13111

Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
Co-authored-by: Juan Hernandez <juan.hernandez@redhat.com>
  • Loading branch information
openshift-cherrypick-robot and jhernand committed Nov 29, 2023
1 parent 35357f5 commit c561104
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/commands/step_processor.go
Expand Up @@ -236,7 +236,11 @@ func (s *stepSession) processSingleSession() (delay time.Duration, exit bool, er
invalidateCache(s.stepCache)
switch err.(type) {
case *installer.V2GetNextStepsNotFound:
err = errors.Wrapf(err, "infra-env %s was not found in inventory or user is not authorized", s.agentConfig.InfraEnvID)
s.Logger().WithError(err).Errorf(
"infra-env %s was not found in inventory, will freeze",
s.agentConfig.InfraEnvID,
)
select {}
case *installer.V2GetNextStepsUnauthorized:
err = errors.Wrapf(err, "user is not authenticated to perform the operation")
case *installer.V2GetNextStepsForbidden:
Expand Down

0 comments on commit c561104

Please sign in to comment.