Skip to content

Commit

Permalink
Improve Unreasonable Comments (kubesphere#5674)
Browse files Browse the repository at this point in the history
Signed-off-by: sologgfun <857949825@qq.com>
  • Loading branch information
sologgfun authored and wanjunlei committed Aug 11, 2023
1 parent 0b5bf84 commit 8628eb7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error {
}

klog.Info("Starting workers")
// Launch two workers to process Foo resources

for i := 0; i < threadiness; i++ {
go wait.Until(c.runWorker, time.Second, stopCh)
}
Expand Down Expand Up @@ -194,15 +194,15 @@ func (c *Controller) processNextWorkItem() bool {
return true
}

// syncHandler compares the actual state with the desired, and attempts to
// reconcile compares the actual state with the desired, and attempts to
// converge the two. It then updates the Status block of the Foo resource
// with the current status of the resource.
func (c *Controller) reconcile(key string) error {

// Get the CertificateSigningRequest with this name
csr, err := c.csrLister.Get(key)
if err != nil {
// The user may no longer exist, in which case we stop
// The resource may no longer exist, in which case we stop
// processing.
if errors.IsNotFound(err) {
utilruntime.HandleError(fmt.Errorf("csr '%s' in work queue no longer exists", key))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error {
}

klog.Info("Starting workers")
// Launch two workers to process Foo resources

for i := 0; i < threadiness; i++ {
go wait.Until(c.runWorker, time.Second, stopCh)
}
Expand Down Expand Up @@ -199,15 +199,15 @@ func (c *Controller) processNextWorkItem() bool {
return true
}

// syncHandler compares the actual state with the desired, and attempts to
// reconcile compares the actual state with the desired, and attempts to
// converge the two. It then updates the Status block of the Foo resource
// with the current status of the resource.
func (c *Controller) reconcile(key string) error {

// Get the clusterRoleBinding with this name
clusterRoleBinding, err := c.clusterRoleBindingLister.Get(key)
if err != nil {
// The user may no longer exist, in which case we stop
// The resource may no longer exist, in which case we stop
// processing.
if errors.IsNotFound(err) {
utilruntime.HandleError(fmt.Errorf("clusterrolebinding '%s' in work queue no longer exists", key))
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/globalrole/globalrole_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error {
}

klog.Info("Starting workers")
// Launch two workers to process Foo resources

for i := 0; i < threadiness; i++ {
go wait.Until(c.runWorker, time.Second, stopCh)
}
Expand Down Expand Up @@ -201,14 +201,14 @@ func (c *Controller) processNextWorkItem() bool {
return true
}

// syncHandler compares the actual state with the desired, and attempts to
// reconcile compares the actual state with the desired, and attempts to
// converge the two. It then updates the Status block of the Foo resource
// with the current status of the resource.
func (c *Controller) reconcile(key string) error {

globalRole, err := c.globalRoleLister.Get(key)
if err != nil {
// The user may no longer exist, in which case we stop
// The resource may no longer exist, in which case we stop
// processing.
if errors.IsNotFound(err) {
utilruntime.HandleError(fmt.Errorf("globalrole '%s' in work queue no longer exists", key))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error {
}

klog.Info("Starting workers")
// Launch two workers to process Foo resources

for i := 0; i < threadiness; i++ {
go wait.Until(c.runWorker, time.Second, stopCh)
}
Expand Down Expand Up @@ -215,14 +215,14 @@ func (c *Controller) processNextWorkItem() bool {
return true
}

// syncHandler compares the actual state with the desired, and attempts to
// reconcile compares the actual state with the desired, and attempts to
// converge the two. It then updates the Status block of the Foo resource
// with the current status of the resource.
func (c *Controller) reconcile(key string) error {

globalRoleBinding, err := c.globalRoleBindingLister.Get(key)
if err != nil {
// The user may no longer exist, in which case we stop
// The resource may no longer exist, in which case we stop
// processing.
if errors.IsNotFound(err) {
utilruntime.HandleError(fmt.Errorf("globalrolebinding '%s' in work queue no longer exists", key))
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/notification/notification_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error {
}

klog.Info("Starting workers")
// Launch two workers to process Foo resources

for i := 0; i < threadiness; i++ {
go wait.Until(c.runWorker, time.Second, stopCh)
}
Expand Down Expand Up @@ -214,7 +214,7 @@ func (c *Controller) processNextWorkItem() bool {
return true
}

// syncHandler compares the actual state with the desired, and attempts to
// reconcile compares the actual state with the desired, and attempts to
// converge the two. It then updates the Status block of the Foo resource
// with the current status of the resource.
func (c *Controller) reconcile(obj interface{}) error {
Expand Down Expand Up @@ -252,7 +252,7 @@ func (c *Controller) reconcile(obj interface{}) error {

err := c.Get(context.Background(), client.ObjectKey{Name: runtimeObj.GetName(), Namespace: runtimeObj.GetNamespace()}, runtimeObj)
if err != nil {
// The user may no longer exist, in which case we stop
// The resource may no longer exist, in which case we stop
// processing.
if errors.IsNotFound(err) {
utilruntime.HandleError(fmt.Errorf("obj '%s' in work queue no longer exists", name))
Expand Down

0 comments on commit 8628eb7

Please sign in to comment.