Skip to content

Commit

Permalink
Fixup: indents in-comment code blocks and wordings
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <[email protected]>
  • Loading branch information
hiddeco committed Jul 7, 2021
1 parent 25fb8b6 commit b7eec63
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 15 deletions.
4 changes: 4 additions & 0 deletions apis/meta/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion runtime/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion runtime/controller/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion runtime/controller/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion runtime/leaderelection/leaderelection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions runtime/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions runtime/patch/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions runtime/pprof/pprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion runtime/predicates/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion runtime/probes/probes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{})
Expand Down
2 changes: 1 addition & 1 deletion runtime/testenv/testenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 <package>_test.go file within a `TestMain` function.
// is initialised in a suite_test.go or <package>_test.go file within a `TestMain` function.
func New(o ...Option) *Environment {
opts := options{}
for _, apply := range o {
Expand Down

0 comments on commit b7eec63

Please sign in to comment.