Skip to content

Commit

Permalink
switch order of namespace and isOrIsNot parameters (#104)
Browse files Browse the repository at this point in the history
Co-authored-by: eramirez8 <[email protected]>
  • Loading branch information
estela-ramirez and eramirez8 authored Jul 3, 2023
1 parent 440bef1 commit 7325567
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/kube/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ func (kc *ClientSet) NodesWithSelectorShouldBe(expectedNodes int, selector, stat
return structured.NodesWithSelectorShouldBe(kc.KubeInterface, kc.getWaiterConfig(), expectedNodes, selector, state)
}

func (kc *ClientSet) ResourceInNamespace(resourceType, name, namespace, isOrIsNot string) error {
return structured.ResourceInNamespace(kc.KubeInterface, resourceType, name, namespace, isOrIsNot)
func (kc *ClientSet) ResourceInNamespace(resourceType, name, isOrIsNot, namespace string) error {
return structured.ResourceInNamespace(kc.KubeInterface, resourceType, name, isOrIsNot, namespace)
}

func (kc *ClientSet) ScaleDeployment(name, namespace string, replicas int32) error {
Expand Down
4 changes: 2 additions & 2 deletions pkg/kube/structured/structured.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ func SendTrafficToIngress(kubeClientset kubernetes.Interface, w common.WaiterCon
return nil
}

func ResourceInNamespace(kubeClientset kubernetes.Interface, resourceType, name, namespace, isOrIsNot string) error {
func ResourceInNamespace(kubeClientset kubernetes.Interface, resourceType, name, isOrIsNot, namespace string) error {
var err error

if err := common.ValidateClientset(kubeClientset); err != nil {
Expand Down Expand Up @@ -415,6 +415,6 @@ func ResourceInNamespace(kubeClientset kubernetes.Interface, resourceType, name,
return err
}
} else {
return errors.Errorf("paramter isOrIsNot can only be 'is' or 'is not'")
return errors.Errorf("parameter isOrIsNot can only be 'is' or 'is not'")
}
}
2 changes: 1 addition & 1 deletion pkg/kube/structured/structured_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func TestResourceInNamespace(t *testing.T) {
}
}

err = ResourceInNamespace(fakeClient, tt.resource, tt.name, namespace, tt.isOrIsNot)
err = ResourceInNamespace(fakeClient, tt.resource, tt.name, tt.isOrIsNot, namespace)
g.Expect(err).ShouldNot(gomega.HaveOccurred())
})
}
Expand Down

0 comments on commit 7325567

Please sign in to comment.