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 switchdev-after-networkmanager service file to k8s plugin #219

Merged
merged 1 commit into from
Dec 21, 2021

Conversation

zshi-redhat
Copy link
Collaborator

Fixes #218

Signed-off-by: Zenghui Shi [email protected]

@github-actions
Copy link

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.

@zshi-redhat
Copy link
Collaborator Author

/test-e2e-nvidia-all

@zshi-redhat
Copy link
Collaborator Author

/cc @adrianchiris @e0ne

@github-actions
Copy link

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.

switchdevRenamingUdevScript = switchdevManifestPath + "files/switchdev-vf-link-name.sh.yaml"
switchdevManifestPath = "bindata/manifests/switchdev-config/"
switchdevUnits = switchdevManifestPath + "switchdev-units/"
switchdevBeforeNMUnitFile = switchdevUnits + "switchdev-configuration-before-NM.yaml"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure that we want to have upper-case letters in file name but I won't block patch for it

Copy link
Collaborator

Choose a reason for hiding this comment

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

dont think its critical, although we dont use capitals for vf nor ovs.
@zshi-redhat WDYT shall we stick with lower case letters ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure, updated to lowercase.

Copy link
Collaborator

Choose a reason for hiding this comment

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

thank you, @zshi-redhat

@github-actions
Copy link

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.

@@ -171,18 +187,24 @@ func (p *K8sPlugin) readSwitchdevManifest() error {
Name: "ConditionPathExists",
Value: "!/etc/ignition-machine-config-encapsulated.json",
}
switchdevService, err = service.RemoveFromService(switchdevService, conditionOpt)
switchdevBeforeNMService, err = service.RemoveFromService(switchdevBeforeNMService, conditionOpt)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can see this condition in switchdevAfterNMService as well

ConditionPathExists=!/etc/ignition-machine-config-encapsulated.json

I believe it should be removed as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -232,30 +254,53 @@ func (p *K8sPlugin) readManifestFiles() error {

func (p *K8sPlugin) switchdevServiceStateUpdate() error {
// Check switchdev service
swdService, err := p.serviceManager.ReadService(p.switchdevService.Path)
swdService, err := p.serviceManager.ReadService(p.switchdevBeforeNMService.Path)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we could avoid some duplicate logic here if we defined a method: bool ShouldUpdateService(Service)

and call it for both services

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, I used isSwitchdevServiceNeedUpdate as function name to be consistent with existing isSystemServiceNeedUpdate.

}

// Check switchdev run script
data, err := ioutil.ReadFile(path.Join(chroot, p.switchdevRunScript.Path))
data, err := ioutil.ReadFile(path.Join(chroot, p.switchdevBeforeNMRunScript.Path))
Copy link
Collaborator

Choose a reason for hiding this comment

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

we could avoid some duplicate logic here if we defined a method: bool ShouldUpdateServiceScript(Service)

and call it for both service scripts

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, I used isSwitchdevScriptNeedUpdate as function name to be consistent with existing isSystemServiceNeedUpdate.

@github-actions
Copy link

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.

@zshi-redhat
Copy link
Collaborator Author

/test-all

@adrianchiris adrianchiris merged commit 3ba64b7 into k8snetworkplumbingwg:master Dec 21, 2021
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.

sriov network operator fails on vanilla k8s
3 participants