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

Daemon redesign - using controller-runtime #788

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,19 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: test pkg
run: make test-pkg
- name: test pkg on kubernetes
run: CLUSTER_TYPE=kubernetes make test-pkg

- name: test pkg on openshift
run: CLUSTER_TYPE=openshift make test-pkg

- name: test cmd
run: make test-cmd

- name: test api
run: make test-api

- name: test controllers on opensfhit
- name: test controllers on openshift
run: CLUSTER_TYPE=openshift make test-controllers

- name: test controllers on kubernetes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ contents: |

[Service]
Type=oneshot
ExecStart=/var/lib/sriov/sriov-network-config-daemon -v 2 --zap-log-level 2 service --phase post
ExecStart=/var/lib/sriov/sriov-network-config-daemon service --phase post
StandardOutput=journal+console

[Install]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ contents: |

[Service]
Type=oneshot
ExecStart=/var/lib/sriov/sriov-network-config-daemon -v 2 --zap-log-level 2 service --phase pre
ExecStart=/var/lib/sriov/sriov-network-config-daemon service --phase pre
Copy link
Collaborator

@adrianchiris adrianchiris Jan 19, 2025

Choose a reason for hiding this comment

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

this means reboot on update ? since systemd file changes

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 it will make a reboot one time

StandardOutput=journal+console

[Install]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:

[Service]
Type=oneshot
ExecStart=/var/lib/sriov/sriov-network-config-daemon service -v {{ .LogLevel }} --zap-log-level {{ .LogLevel }} --phase pre
ExecStart=/var/lib/sriov/sriov-network-config-daemon service --phase pre
StandardOutput=journal+console

[Install]
Expand All @@ -38,7 +38,7 @@ spec:

[Service]
Type=oneshot
ExecStart=/var/lib/sriov/sriov-network-config-daemon service -v {{ .LogLevel }} --zap-log-level {{ .LogLevel }} --phase post
ExecStart=/var/lib/sriov/sriov-network-config-daemon service --phase post
StandardOutput=journal+console

[Install]
Expand Down
3 changes: 2 additions & 1 deletion cmd/sriov-network-config-daemon/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func runServiceCmd(cmd *cobra.Command, args []string) error {
}
// init logger
snolog.InitLog()
snolog.SetLogLevel(2)
setupLog := log.Log.WithName("sriov-config-service").WithValues("phase", phaseArg)

setupLog.V(0).Info("Starting sriov-config-service", "version", version.Version)
Expand Down Expand Up @@ -168,7 +169,7 @@ func phasePre(setupLog logr.Logger, conf *systemd.SriovConfig, hostHelpers helpe

func phasePost(setupLog logr.Logger, conf *systemd.SriovConfig, hostHelpers helper.HostHelpersInterface) error {
setupLog.V(0).Info("check result of the Pre phase")
prePhaseResult, err := systemd.ReadSriovResult()
prePhaseResult, _, err := systemd.ReadSriovResult()
if err != nil {
return fmt.Errorf("failed to read result of the pre phase: %v", err)
}
Expand Down
Loading
Loading