Skip to content

Commit

Permalink
fixup! feat: Controller that copies ClusterClasses to namespaces
Browse files Browse the repository at this point in the history
fix linters
  • Loading branch information
dlipovetsky committed Jun 11, 2024
1 parent ffd0909 commit 7503d26
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
13 changes: 10 additions & 3 deletions pkg/controllers/namespacesync/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ func TestReconcileNewNamespaces(t *testing.T) {
g := NewWithT(t)
timeout := 5 * time.Second

sourceClusterClassName, cleanup, err := createUniqueClusterClassAndTemplates(sourceClusterClassNamespace)
sourceClusterClassName, cleanup, err := createUniqueClusterClassAndTemplates(
sourceClusterClassNamespace,
)
g.Expect(err).ToNot(HaveOccurred())
defer func() {
g.Expect(cleanup()).To(Succeed())
Expand Down Expand Up @@ -50,7 +52,9 @@ func TestReconcileNewClusterClass(t *testing.T) {
targetNamespaces, err := createTargetNamespaces(3)
g.Expect(err).ToNot(HaveOccurred())

sourceClusterClassName, cleanup, err := createUniqueClusterClassAndTemplates(sourceClusterClassNamespace)
sourceClusterClassName, cleanup, err := createUniqueClusterClassAndTemplates(
sourceClusterClassNamespace,
)
g.Expect(err).ToNot(HaveOccurred())
defer func() {
g.Expect(cleanup()).To(Succeed())
Expand Down Expand Up @@ -95,7 +99,10 @@ func createUniqueClusterClassAndTemplates(namespace string) (
cleanup func() error,
err error,
) {
return createClusterClassAndTemplates(names.SimpleNameGenerator.GenerateName("test-"), namespace)
return createClusterClassAndTemplates(
names.SimpleNameGenerator.GenerateName("test-"),
namespace,
)
}

func createClusterClassAndTemplates(
Expand Down
10 changes: 8 additions & 2 deletions pkg/controllers/namespacesync/copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ func TestDoNotUpdateIfTargetExists(t *testing.T) {
timeout := 50 * time.Second

prefix := names.SimpleNameGenerator.GenerateName("test-")
sourceClusterClassName, cleanup, err := createClusterClassAndTemplates(prefix, sourceClusterClassNamespace)
sourceClusterClassName, cleanup, err := createClusterClassAndTemplates(
prefix,
sourceClusterClassNamespace,
)
g.Expect(err).ToNot(HaveOccurred())

targetNamespaces, err := createTargetNamespaces(3)
Expand All @@ -38,7 +41,10 @@ func TestDoNotUpdateIfTargetExists(t *testing.T) {
g.Expect(cleanup()).To(Succeed())

// Create source class again
sourceClusterClassName, cleanup, err = createClusterClassAndTemplates(prefix, sourceClusterClassNamespace)
sourceClusterClassName, cleanup, err = createClusterClassAndTemplates(
prefix,
sourceClusterClassNamespace,
)
g.Expect(err).ToNot(HaveOccurred())
defer func() {
g.Expect(cleanup()).To(Succeed())
Expand Down

0 comments on commit 7503d26

Please sign in to comment.