Skip to content

Commit

Permalink
fix(tests) Update Harbor resources
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Péronnet <pierre.peronnet@corp.ovh.com>
  • Loading branch information
holyhope committed Jan 17, 2020
1 parent 780116c commit dc4e30a
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions controllers/harbor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ var _ = Context("Inside of a new namespace", func() {
PublicURL: publicURL.String(),
},
}
harbor.Default()

Expect(k8sClient.Create(ctx, harbor)).Should(WithTransform(apierrs.IsInvalid, BeTrue()))
})
Expand All @@ -78,6 +79,7 @@ var _ = Context("Inside of a new namespace", func() {
PublicURL: "123::bad::dns",
},
}
harbor.Default()

Expect(k8sClient.Create(ctx, harbor)).Should(WithTransform(apierrs.IsInvalid, BeTrue()))
})
Expand Down Expand Up @@ -182,17 +184,29 @@ func newValidHarborTest(ns string) (*containerregistryv1alpha1.Harbor, client.Ob
Host: "the.dns",
}

return &containerregistryv1alpha1.Harbor{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: ns,
},
Spec: containerregistryv1alpha1.HarborSpec{
HarborVersion: "1.9.1",
PublicURL: publicURL.String(),
},
}, client.ObjectKey{
harbor := &containerregistryv1alpha1.Harbor{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: ns,
}
},
Spec: containerregistryv1alpha1.HarborSpec{
HarborVersion: "1.9.1",
PublicURL: publicURL.String(),
AdminPasswordSecret: "admin-secret",
Components: containerregistryv1alpha1.HarborComponents{
Core: containerregistryv1alpha1.CoreComponent{
DatabaseSecret: "core-database-secret",
},
JobService: containerregistryv1alpha1.JobServiceComponent{
RedisSecret: "jobservice-redis-secret",
},
},
},
}
harbor.Default()

return harbor, client.ObjectKey{
Name: name,
Namespace: ns,
}
}

0 comments on commit dc4e30a

Please sign in to comment.