Skip to content

Commit

Permalink
Added some comment related the controller field
Browse files Browse the repository at this point in the history
  • Loading branch information
kingamarton committed Mar 16, 2021
1 parent 3f35f6c commit 00aeaad
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cache/placeholder.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ type Placeholder struct {

func newPlaceholder(placeholderName string, app *Application, taskGroup v1alpha1.TaskGroup) *Placeholder {
ownerRefs := app.placeholderOwnerReferences
// we need to set the controller field to false, because since we don't know what exactly the controller will do,
// we might have some unexpected behaviour.
// For example if it is a replication controller, some pods (placeholders and/or real pods) might be deleted
// in order to met the requested replication factor.
// Since we need the owner reference only for having the placeholders garbage collected,
// we can just set the controller field = false, so we can avoid any kind of side effects.
controller := false
for _, r := range ownerRefs {
*r.Controller = controller
Expand Down

0 comments on commit 00aeaad

Please sign in to comment.