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 featuregate package and use it in controllers #673

Merged
merged 2 commits into from
Apr 4, 2024

Conversation

ykulazhenkov
Copy link
Collaborator

This change is required to simplify usage of feature gates outside of SriovOperatorConfig controller.

SriovOperatorConfig controller is responsible for initialization of the featuregate helper.
Other controllers can check configured feature gates by using the interface.

Copy link

github-actions bot commented Apr 2, 2024

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@coveralls
Copy link

coveralls commented Apr 2, 2024

Pull Request Test Coverage Report for Build 8534567081

Details

  • 32 of 32 (100.0%) changed or added relevant lines in 2 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 38.446%

Files with Coverage Reduction New Missed Lines %
controllers/drain_controller.go 3 70.36%
Totals Coverage Status
Change from base Build 8524971074: 0.2%
Covered Lines: 4820
Relevant Lines: 12537

💛 - Coveralls

Copy link
Collaborator

@e0ne e0ne left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -58,7 +59,8 @@ const nodePolicySyncEventName = "node-policy-sync-event"
// SriovNetworkNodePolicyReconciler reconciles a SriovNetworkNodePolicy object
type SriovNetworkNodePolicyReconciler struct {
client.Client
Scheme *runtime.Scheme
Scheme *runtime.Scheme
FeatureGate featuregate.FeatureGate
Copy link
Member

Choose a reason for hiding this comment

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

This field is not used. I guess it will be used in some future PR, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this is preparation for the next PR.

// completely removes the previous state
Init(features map[string]bool)
// Set state of the specific feature, keeps existing state for other features
Set(feature string, state bool)
Copy link
Member

Choose a reason for hiding this comment

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

Same here, Set seems to be used in tests only. How is it going to be used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The Set hadler was added to provide API completeness. There is no real reason to keep it. I will drop it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@zeeke I removed Set function

This package is required to simplify usage of feature gates
outside of the SriovOperatorConfig controller

Signed-off-by: Yury Kulazhenkov <[email protected]>
Use featuregate package in SriovOperatorConfig
and in SriovNetworkNodePolicy controllers

Signed-off-by: Yury Kulazhenkov <[email protected]>
Copy link

github-actions bot commented Apr 2, 2024

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@ykulazhenkov ykulazhenkov reopened this Apr 3, 2024
Copy link

github-actions bot commented Apr 3, 2024

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@ykulazhenkov
Copy link
Collaborator Author

@zeeke Can we merge this PR if it looks good for you? thx

Copy link
Member

@zeeke zeeke left a comment

Choose a reason for hiding this comment

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

LGTM

I was waiting for the CI to finish

@zeeke zeeke merged commit c03c62f into k8snetworkplumbingwg:master Apr 4, 2024
22 of 23 checks passed
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.

4 participants