Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var URL = os.Getenv("REGISTRATION_URL")
Functions ¶
func SetAdvanceWarning ¶
func SetRequiredWarning ¶
Types ¶
type Registration ¶
type RegistrationFunc ¶
func (RegistrationFunc) Required ¶
func (fn RegistrationFunc) Required(rec record.EventRecorder, obj client.Object, conds *[]metav1.Condition) bool
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner implements Registration by loading and validating the token at a fixed path. Its methods are safe to call concurrently.
func NewRunner ¶
NewRunner creates a Runner that periodically checks the validity of the token at tokenPath. It calls changed when the validity of the token changes.
func (*Runner) CheckToken ¶
CheckToken loads and verifies the configured token, returning an error when the file exists but cannot be verified, and returning the token if it can be verified. NOTE(upgradecheck): return the token/nil so that we can use the token in upgradecheck; currently a refresh of the token will cause a restart of the pod meaning that the token used in upgradecheck is always the current token. But if the restart behavior changes, we might drop the token return in main.go and change upgradecheck to retrieve the token itself
func (*Runner) NeedLeaderElection ¶
NeedLeaderElection returns true so that r runs only on the single manager.Manager that is elected leader in the Kubernetes namespace.