Skip to content

Commit

Permalink
golangci-lint, lll: be mindful of the max line length
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Duarte Barroso <[email protected]>
  • Loading branch information
maiqueb committed Nov 29, 2024
1 parent 6b32e68 commit 149493e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,11 @@ func (pnc *PodNetworksController) Eventf(object runtime.Object, eventtype, reaso
}
}

func (pnc *PodNetworksController) handleRollback(netnsPath, podSandboxID string, pod *corev1.Pod, attachmentsToRollback []nadv1.NetworkSelectionElement) {
func (pnc *PodNetworksController) handleRollback(
netnsPath, podSandboxID string,
pod *corev1.Pod,
attachmentsToRollback []nadv1.NetworkSelectionElement,
) {
if len(attachmentsToRollback) > 0 {
err, deleteAttachmentsError := pnc.handleDynamicInterfaceRequest(
&DynamicAttachmentRequest{
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ var _ = Describe("Dynamic Attachment controller", func() {
Expect(err).NotTo(HaveOccurred())
})

It("an `FailedAddingInterface` event and then a `FailedRemovingInterface ` are seen, no `AddedInterface` event is seen and no changes the status", func() {
It("an `FailedAddingInterface` event and then a `FailedRemovingInterface` are seen, the network status is not updated", func() {
expectedAddInterfaceFailedEvent := fmt.Sprintf(
"Warning FailedAddingInterface pod [%s]: failed adding interface %s to network: %s",
annotations.NamespacedName(namespace, podName),
Expand All @@ -400,7 +400,7 @@ var _ = Describe("Dynamic Attachment controller", func() {
)
Eventually(<-eventRecorder.Events).Should(Equal(expectedAddInterfaceFailedEvent))

// try to removing interface added failed
// try to remove interface added failed
expectedRemoveInterfaceFailedEvent := fmt.Sprintf(
"Warning FailedRemovingInterface pod [%s]: failed removing interface %s from network: %s",
annotations.NamespacedName(namespace, podName),
Expand All @@ -418,7 +418,7 @@ var _ = Describe("Dynamic Attachment controller", func() {
)
Eventually(<-eventRecorder.Events).Should(Equal(expectedAddNextInterfaceFailedEvent))

// This is not in a separate "It" since there is no change and it should wait for the events
// This is not in a separate "It" since there is no change, and it should wait for the events
// No pod network-status is added since the first one failed.
Consistently(func() ([]nad.NetworkStatus, error) {
updatedPod, err := k8sClient.CoreV1().Pods(namespace).Get(context.TODO(), podName, metav1.GetOptions{})
Expand Down

0 comments on commit 149493e

Please sign in to comment.