Skip to content

Commit

Permalink
Merge pull request #1055 from jacobweinstock/workflow-bug
Browse files Browse the repository at this point in the history
Fix Workflow's not moving out of STATE_PREPARING:

## Description

<!--- Please describe what this PR is going to change -->
This resolves an issue where a Workflow with only BootOption -> `toggleAllowNetboot: true` will stay indefinitely in a preparing state.

## Why is this needed

<!--- Link to issue you have raised -->

Fixes: #

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->


## How are existing users impacted? What migration steps/scripts do we need?

<!--- Fixes a bug, unblocks installation, removes a component of the stack etc -->
<!--- Requires a DB migration script, etc. -->


## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
  • Loading branch information
jacobweinstock authored Jan 9, 2025
2 parents 66c3d7c + 2fe31e9 commit acc982d
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/tink-agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM alpine:3.20.3
ARG TARGETOS
ARG TARGETARCH

RUN apk add --no-cache --update --upgrade ca-certificates=20241121-r0
RUN apk add --no-cache --update --upgrade ca-certificates=20241121-r1

COPY bin/tink-agent-${TARGETOS}-${TARGETARCH} /usr/bin/tink-agent

Expand Down
2 changes: 1 addition & 1 deletion cmd/tink-controller-v1alpha2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM alpine:3.20.3
ARG TARGETOS
ARG TARGETARCH

RUN apk add --no-cache --update --upgrade ca-certificates=20241121-r0
RUN apk add --no-cache --update --upgrade ca-certificates=20241121-r1

COPY bin/tink-controller-v1alpha2-${TARGETOS}-${TARGETARCH} /usr/bin/tink-controller

Expand Down
2 changes: 1 addition & 1 deletion cmd/tink-controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM alpine:3.20.3
ARG TARGETOS
ARG TARGETARCH

RUN apk add --no-cache --update --upgrade ca-certificates=20241121-r0
RUN apk add --no-cache --update --upgrade ca-certificates=20241121-r1

COPY bin/tink-controller-${TARGETOS}-${TARGETARCH} /usr/bin/tink-controller

Expand Down
2 changes: 1 addition & 1 deletion cmd/tink-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG TARGETARCH

EXPOSE 42113 42114

RUN apk add --no-cache --update --upgrade ca-certificates=20241121-r0
RUN apk add --no-cache --update --upgrade ca-certificates=20241121-r1

COPY bin/tink-server-${TARGETOS}-${TARGETARCH} /usr/bin/tink-server

Expand Down
2 changes: 1 addition & 1 deletion cmd/tink-worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM alpine:3.20.3
ARG TARGETOS
ARG TARGETARCH

RUN apk add --no-cache --update --upgrade ca-certificates=20241121-r0
RUN apk add --no-cache --update --upgrade ca-certificates=20241121-r1

COPY bin/tink-worker-${TARGETOS}-${TARGETARCH} /usr/bin/tink-worker

Expand Down
2 changes: 1 addition & 1 deletion cmd/virtual-worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM alpine:3.20.3
ARG TARGETOS
ARG TARGETARCH

RUN apk add --no-cache --update --upgrade ca-certificates=20241121-r0
RUN apk add --no-cache --update --upgrade ca-certificates=20241121-r1

COPY bin/virtual-worker-${TARGETOS}-${TARGETARCH} /usr/bin/virtual-worker

Expand Down
1 change: 1 addition & 0 deletions internal/deprecated/workflow/pre.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ func (s *state) prepareWorkflow(ctx context.Context) (reconcile.Result, error) {
return r, err
}
}
s.workflow.Status.State = v1alpha1.WorkflowStatePending

return reconcile.Result{}, nil
}
7 changes: 6 additions & 1 deletion internal/deprecated/workflow/pre_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ func TestPrepareWorkflow(t *testing.T) {
hardware: &v1alpha1.Hardware{},
wantHardware: &v1alpha1.Hardware{},
workflow: &v1alpha1.Workflow{},
wantWorkflow: &v1alpha1.Workflow{},
wantWorkflow: &v1alpha1.Workflow{
Status: v1alpha1.WorkflowStatus{
State: v1alpha1.WorkflowStatePending,
},
},
},
"toggle allowPXE": {
wantResult: reconcile.Result{},
Expand Down Expand Up @@ -82,6 +86,7 @@ func TestPrepareWorkflow(t *testing.T) {
},
wantWorkflow: &v1alpha1.Workflow{
Status: v1alpha1.WorkflowStatus{
State: v1alpha1.WorkflowStatePending,
BootOptions: v1alpha1.BootOptionsStatus{
AllowNetboot: v1alpha1.AllowNetbootStatus{
ToggledTrue: true,
Expand Down

0 comments on commit acc982d

Please sign in to comment.