Skip to content

Commit

Permalink
Merge pull request #398 from summerwind/fix-status-last-reg-check-tim…
Browse files Browse the repository at this point in the history
…e-type-err

Fix `status.lastRegistrationCheckTime in body must be of type string: \"null\"` error
  • Loading branch information
mumoshu authored Mar 18, 2021
2 parents ecc441d + 3cccca8 commit 2929a73
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions api/v1alpha1/horizontalrunnerautoscaler_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ type HorizontalRunnerAutoscalerStatus struct {
DesiredReplicas *int `json:"desiredReplicas,omitempty"`

// +optional
// +nullable
LastSuccessfulScaleOutTime *metav1.Time `json:"lastSuccessfulScaleOutTime,omitempty"`

// +optional
Expand Down
2 changes: 1 addition & 1 deletion charts/actions-runner-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.10.1
version: 0.10.2

home: https://github.com/summerwind/actions-runner-controller

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ spec:
type: integer
lastSuccessfulScaleOutTime:
format: date-time
nullable: true
type: string
observedGeneration:
description: ObservedGeneration is the most recent generation observed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ spec:
type: integer
lastSuccessfulScaleOutTime:
format: date-time
nullable: true
type: string
observedGeneration:
description: ObservedGeneration is the most recent generation observed
Expand Down
8 changes: 4 additions & 4 deletions controllers/runner_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ func (r *RunnerReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
updated.Status.LastRegistrationCheckTime = &metav1.Time{Time: time.Now()}

if err := r.Status().Patch(ctx, updated, client.MergeFrom(&runner)); err != nil {
log.Error(err, "Failed to update runner status")
log.Error(err, "Failed to update runner status for LastRegistrationCheckTime")
return ctrl.Result{}, err
}

Expand All @@ -391,7 +391,7 @@ func (r *RunnerReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
updated.Status.Message = pod.Status.Message

if err := r.Status().Patch(ctx, updated, client.MergeFrom(&runner)); err != nil {
log.Error(err, "Failed to update runner status")
log.Error(err, "Failed to update runner status for Phase/Reason/Message")
return ctrl.Result{}, err
}
}
Expand Down Expand Up @@ -463,8 +463,8 @@ func (r *RunnerReconciler) updateRegistrationToken(ctx context.Context, runner v
ExpiresAt: metav1.NewTime(rt.GetExpiresAt().Time),
}

if err := r.Status().Update(ctx, updated); err != nil {
log.Error(err, "Failed to update runner status")
if err := r.Status().Patch(ctx, updated, client.MergeFrom(&runner)); err != nil {
log.Error(err, "Failed to update runner status for Registration")
return false, err
}

Expand Down

0 comments on commit 2929a73

Please sign in to comment.