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

Add config field for periodic update interval #28

Merged
merged 1 commit into from
Nov 24, 2020

Conversation

Mmduh-483
Copy link
Contributor

This change brings a new config field which is used to config the periodic update interval of the device plugin.
When periodic update interval is 0 periodic update is disabled

Fixes #27

@coveralls
Copy link

coveralls commented Nov 16, 2020

Pull Request Test Coverage Report for Build 100

  • 22 of 23 (95.65%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 85.369%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/resources/resources_manager.go 22 23 95.65%
Totals Coverage Status
Change from base Build 97: 0.2%
Covered Lines: 671
Relevant Lines: 786

💛 - Coveralls

@Mmduh-483 Mmduh-483 force-pushed the config-periodic-interval branch 4 times, most recently from 340b1d3 to a00be45 Compare November 17, 2020 07:56
.travis.yml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated
@@ -97,6 +98,9 @@ The plugin has several configuration fields, this section explains each field us
}
```

`periodicUpdateInterval` is the time interval in seconds to update the resouces accourding to host devices changes if there changed.
Note: if `periodicUpdateInterval` is 0 then periodic update for host devices will be disabled.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This breaks current default behaviour.

Copy link
Contributor Author

@Mmduh-483 Mmduh-483 Nov 19, 2020

Choose a reason for hiding this comment

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

If 0 then use current default value?

Copy link
Collaborator

Choose a reason for hiding this comment

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

how will you disable it ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

then go routine of periodic will not run, since the condition of the periodic interval is not positive, check here:
https://github.com/Mellanox/k8s-rdma-shared-dev-plugin/blob/master/pkg/resources/resources_manager.go#L288

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

README.md Outdated Show resolved Hide resolved
@@ -77,7 +77,8 @@ var _ = Describe("ResourcesManger", func() {
"deviceIDs": ["1017"],
"ifNames": ["ib2", "ib3"]}
}
]}`
],
"periodicUpdateInterval": 60}`
Copy link
Collaborator

@adrianchiris adrianchiris Nov 22, 2020

Choose a reason for hiding this comment

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

can you add a test for the default value as well ?
and this should preferrably be changed to a different value (other than the default)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

This change brings a new config field which is used to config
the periodic update interval of the device plugin.

When periodic update interval is 0 periodic update is disabled

Signed-off-by: Mamduh Alassi <mamduhala@mellanox.com>
@adrianchiris adrianchiris merged commit f32fb45 into Mellanox:master Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Periodic update interval should be configurable
3 participants