Skip to content

Commit

Permalink
IG-20084 - bugfix for Jupyter fails to scale to zero (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaelgen authored Mar 7, 2022
1 parent 84fbac2 commit 36c55ca
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions resourcescaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ func (s *AppResourceScaler) appendServiceStateChangeJSONPatchOperations(jsonPatc

desiredStatePath := fmt.Sprintf("/spec/spec/tenants/0/spec/services/%s/desired_state", serviceName)
markForRestartPath := fmt.Sprintf("/spec/spec/tenants/0/spec/services/%s/mark_for_restart", serviceName)

// Added To signal Provazio controller to apply the changes
markAsChangedPath := fmt.Sprintf("/spec/spec/tenants/0/spec/services/%s/mark_as_changed", serviceName)
scaleToZeroStatusPath := fmt.Sprintf("/status/services/%s/scale_to_zero", serviceName)
lastScaleStatePath := fmt.Sprintf("/status/services/%s/scale_to_zero/last_scale_event", serviceName)
lastScaleStateTimePath := fmt.Sprintf("/status/services/%s/scale_to_zero/last_scale_event_time", serviceName)
Expand All @@ -223,6 +226,11 @@ func (s *AppResourceScaler) appendServiceStateChangeJSONPatchOperations(jsonPatc
"path": markForRestartPath,
"value": false,
})
jsonPatchMapper = append(jsonPatchMapper, map[string]interface{}{
"op": "add",
"path": markAsChangedPath,
"value": true,
})
jsonPatchMapper = append(jsonPatchMapper, map[string]interface{}{
"op": "add",
"path": scaleToZeroStatusPath,
Expand Down

0 comments on commit 36c55ca

Please sign in to comment.