Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix assign grammar of application agent #3333

Merged
merged 1 commit into from
Nov 23, 2021

Conversation

jidalong
Copy link
Member

@jidalong jidalong commented Nov 22, 2021

What type of PR is this?
/kind bug

What this PR does / why we need it:
Since variable "defaultAgent" was assigned by ":=" in line 273, so we should delete the declared line 268.
Does this PR introduce a user-facing change?:
NONE


@kubeedge-bot kubeedge-bot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 22, 2021
@kubeedge-bot kubeedge-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 22, 2021
@gy95
Copy link
Member

gy95 commented Nov 22, 2021

/LGTM

@kubeedge-bot
Copy link
Collaborator

@gy95: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

/LGTM

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jidalong jidalong force-pushed the applicationagent branch 2 times, most recently from 9b36c6b to 8189dcd Compare November 22, 2021 09:48
@@ -270,7 +270,7 @@ var once sync.Once

// edged config.Config.HostnameOverride
func NewApplicationAgent() *Agent {
defaultAgent := &Agent{nodeName: metaserverconfig.Config.NodeName}
defaultAgent = &Agent{nodeName: metaserverconfig.Config.NodeName}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that we can delete the global variable, and keep the local variable here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay~ I have delete the global variable instead.

@zc2638
Copy link
Member

zc2638 commented Nov 23, 2021

var once sync.Once

According to the NewApplicationAgent method, we probably shouldn't use once to execute.

@jidalong
Copy link
Member Author

var once sync.Once

According to the NewApplicationAgent method, we probably shouldn't use once to execute.

@zc2638 Should we just change the part of NewApplicationAgent method

once.Do(func() {
  go wait.Until(func() {
  	defaultAgent.GC()
  }, time.Minute*5, beehiveContext.Done())
})

to the flowing code, and delete the declare "var once sync.Once".

go wait.Until(func() {
    defaultAgent.GC()
}, time.Minute*5, beehiveContext.Done())

@zc2638
Copy link
Member

zc2638 commented Nov 23, 2021

@jidalong
I think so.

Signed-off-by: jidalong <jidalong@cmss.chinamobile.com>
@kubeedge-bot kubeedge-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Nov 23, 2021
@jidalong
Copy link
Member Author

@jidalong I think so.

Okey, I think it would be better as well~and has change it.

@zc2638
Copy link
Member

zc2638 commented Nov 23, 2021

/lgtm
/assign @fisherxu

@kubeedge-bot kubeedge-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 23, 2021
Copy link
Member

@fisherxu fisherxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@kubeedge-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fisherxu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeedge-bot kubeedge-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 23, 2021
@kubeedge-bot kubeedge-bot merged commit 40d2dbb into kubeedge:master Nov 23, 2021
@jidalong jidalong deleted the applicationagent branch November 25, 2021 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants