Skip to content

Commit

Permalink
Add TODOs on crashOnFailureFetchingExpectations
Browse files Browse the repository at this point in the history
When we support retry count on fetching expectations we want to expose the
crashOnFailureFetchingExpectations as a flag instead of a constant.

Signed-off-by: David-Jaeyoon-Lee <davjlee@google.com>
  • Loading branch information
David-Jaeyoon-Lee committed Jul 24, 2024
1 parent 15b4f45 commit 2a18f78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/readiness/ready_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import (

var log = logf.Log.WithName("readiness-tracker")

// Commenting out the flag and replacing with a false boolean constant because the value of the flag is currently moot without a retry limit
// TODO: Uncomment the flag and deleted the boolean constant when we support retry limits (currently the value of the flag is moot without a retry limit since failure won't happen due to unlimited retries)
// var crashOnFailureFetchingExpectations = flag.Bool("crash-on-failure-fetching-expectations", false, "Unless set (defaults to false), gatekeeper will ignore errors when gathering expectations. This prevents bootstrapping errors from crashing Gatekeeper at the cost of increasing the risk Gatekeeper will under-enforce policy. Enabling this will help prevent under-enforcement at the risk of crashing during startup. Note that enabling this flag currently does not achieve the aforementioned effect since fetching expectations will retry until success.")
const crashOnFailureFetchingExpectations = false

Expand Down Expand Up @@ -91,7 +91,7 @@ type Tracker struct {

// NewTracker creates a new Tracker and initializes the internal trackers.
func NewTracker(lister Lister, mutationEnabled, externalDataEnabled, expansionEnabled bool) *Tracker {
// Dereference crashOnFailureFetchingExpectations when we change crashOnFailureFetchingExpectations back to a flag
// TODO: Dereference crashOnFailureFetchingExpectations when we change crashOnFailureFetchingExpectations to a flag
return newTracker(lister, mutationEnabled, externalDataEnabled, expansionEnabled, crashOnFailureFetchingExpectations, nil, nil)
}

Expand Down

0 comments on commit 2a18f78

Please sign in to comment.