diff --git a/apis/meta/conditions.go b/apis/meta/conditions.go index 9cd5b9b7..726890f6 100644 --- a/apis/meta/conditions.go +++ b/apis/meta/conditions.go @@ -46,12 +46,16 @@ const ( // encountered an error during the reconcile process or it has made insufficient progress (timeout). // The Condition adheres to an "abnormal-true" polarity pattern, and MUST only be present on the resource if the // Condition is True. + // For more information about polarity patterns, see: + // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties StalledCondition string = "Stalled" // ReconcilingCondition indicates the controller is currently working on reconciling the latest changes. This MAY be // True for multiple reconciliation attempts, e.g. when an transient error occurred. // The Condition adheres to an "abnormal-true" polarity pattern, and MUST only be present on the resource if the // Condition is True. + // For more information about polarity patterns, see: + // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties ReconcilingCondition string = "Reconciling" ) diff --git a/runtime/client/client.go b/runtime/client/client.go index 5fa21f57..25e4e21f 100644 --- a/runtime/client/client.go +++ b/runtime/client/client.go @@ -44,7 +44,7 @@ const ( // // // Get a runtime Kubernetes client configuration with the options set // restConfig := client.GetConfigOrDie(clientOptions) -// } +// } type Options struct { // QPS indicates the maximum queries-per-second of requests sent to to the Kubernetes API, defaults to 20. QPS float32 diff --git a/runtime/controller/doc.go b/runtime/controller/doc.go index 3ad460d7..70203fe3 100644 --- a/runtime/controller/doc.go +++ b/runtime/controller/doc.go @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package controller offers embeddable structs for usage in your controller and underlying reconcilers, to help with +// Package controller offers embeddable structs for use in your controller and underlying reconcilers, to help with // conforming to GitOps Toolkit conventions. package controller diff --git a/runtime/controller/metrics.go b/runtime/controller/metrics.go index 0b973d6f..1babef4b 100644 --- a/runtime/controller/metrics.go +++ b/runtime/controller/metrics.go @@ -55,7 +55,7 @@ type Metrics struct { // MustMakeMetrics creates a new Metrics with a new metrics.Recorder, and the Metrics.Scheme set to that of the given // mgr. // It attempts to register the metrics collectors in the controller-runtime metrics registry, which panics upon the -// first registration that causes an error. Which usually happens if you try to initialize a Metrics value twice for +// first registration that causes an error. Which usually happens if you try to initialise a Metrics value twice for // your controller. func MustMakeMetrics(mgr ctrl.Manager) Metrics { metricsRecorder := metrics.NewRecorder() diff --git a/runtime/leaderelection/leaderelection.go b/runtime/leaderelection/leaderelection.go index 0abfaefc..92e6aa2f 100644 --- a/runtime/leaderelection/leaderelection.go +++ b/runtime/leaderelection/leaderelection.go @@ -54,7 +54,7 @@ const ( // RenewDeadline: &leaderElectionOptions.RenewDeadline, // RetryPeriod: &leaderElectionOptions.RetryPeriod, // }) -// } +// } type Options struct { // Enable determines whether or not to use leader election when starting the manager. Enable bool diff --git a/runtime/logger/logger.go b/runtime/logger/logger.go index d21aba1e..f5e538cd 100644 --- a/runtime/logger/logger.go +++ b/runtime/logger/logger.go @@ -39,9 +39,8 @@ var levelStrings = map[string]zapcore.Level{ "error": zapcore.ErrorLevel, } -// These are for convenience when doing log.V(...) to log at a -// particular level. They correspond to the logr equivalents of the -// zap levels above. +// These are for convenience when doing log.V(...) to log at a particular level. They correspond to the logr +// equivalents of the zap levels above. const ( TraceLevel = 2 DebugLevel = 1 @@ -72,7 +71,7 @@ var stackLevelStrings = map[string]zapcore.Level{ // // // Use the values during the initialisation of the logger // ctrl.SetLogger(logger.NewLogger(logOptions)) -// } +// } type Options struct { LogEncoding string LogLevel string diff --git a/runtime/patch/patch.go b/runtime/patch/patch.go index 4f3f39d5..7ba47887 100644 --- a/runtime/patch/patch.go +++ b/runtime/patch/patch.go @@ -57,7 +57,7 @@ import ( // return ctrl.Result{}, client.IgnoreNotFound(err) // } // -// // Initialize the patch helper +// // Initialise the patch helper // patchHelper, err := patch.NewHelper(obj, r.Client) // if err != nil { // return ctrl.Result{}, err @@ -131,7 +131,7 @@ type Helper struct { isConditionsSetter bool } -// NewHelper returns an initialized Helper. +// NewHelper returns an initialised Helper. func NewHelper(obj client.Object, crClient client.Client) (*Helper, error) { // Get the GroupVersionKind of the object, // used to validate against later on. diff --git a/runtime/pprof/pprof.go b/runtime/pprof/pprof.go index 10ca67ee..bf6ffaf4 100644 --- a/runtime/pprof/pprof.go +++ b/runtime/pprof/pprof.go @@ -43,7 +43,7 @@ var endpoints = map[string]http.Handler{ // SetupHandlers registers the pprof endpoints on the metrics server of the given mgr. // -// The func can be used in the main.go file of your, after initialisation of the manager: +// The func can be used in the main.go file of your controller, after initialisation of the manager: // // func main() { // mgr, err := ctrl.NewManager(cfg, ctrl.Options{}) @@ -52,7 +52,7 @@ var endpoints = map[string]http.Handler{ // os.Exit(1) // } // pprof.SetupHandlers(mgr, log) -// } +// } func SetupHandlers(mgr ctrl.Manager, log logr.Logger) { // Only set the fraction if there is no existing setting if runtime.SetMutexProfileFraction(-1) == 0 { diff --git a/runtime/predicates/doc.go b/runtime/predicates/doc.go index 6484bd68..7b5122a1 100644 --- a/runtime/predicates/doc.go +++ b/runtime/predicates/doc.go @@ -14,5 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package predicates provides generic predicates for GitOps Toolkit components to filter events conform standards. +// Package predicates provides generic controller-runtime predicates for GitOps Toolkit components to filter events. package predicates diff --git a/runtime/probes/probes.go b/runtime/probes/probes.go index cd6e6a1e..7da3c984 100644 --- a/runtime/probes/probes.go +++ b/runtime/probes/probes.go @@ -26,7 +26,7 @@ import ( // SetupChecks configures simple default ready and health probes on the given mgr. // -// The func can be used in the main.go file of your, after initialisation of the manager: +// The func can be used in the main.go file of your controller, after initialisation of the manager: // // func main() { // mgr, err := ctrl.NewManager(cfg, ctrl.Options{}) diff --git a/runtime/testenv/testenv.go b/runtime/testenv/testenv.go index 1ed20848..510d9c3f 100644 --- a/runtime/testenv/testenv.go +++ b/runtime/testenv/testenv.go @@ -111,7 +111,7 @@ func WithCRDPath(path ...string) Option { // New creates a new environment spinning up a local api-server. // // NOTE: This function should be called only once for each package you are running tests within, usually the environment -// is initialized in a suite_test.go or _test.go file within a `TestMain` function. +// is initialised in a suite_test.go or _test.go file within a `TestMain` function. func New(o ...Option) *Environment { opts := options{} for _, apply := range o {