Skip to content

Commit

Permalink
Fixed webhook cert ns (#63)
Browse files Browse the repository at this point in the history
* fix webhook name

* Fixing webhook namespace in certificate. Fixed tests that used old tests API but passed PR gate
  • Loading branch information
evyatarmeged authored Oct 11, 2022
1 parent 94ec6d6 commit 0dc9de6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ func (s *ExternalNetworkPolicyReconcilerTestSuite) BeforeTest(_, testName string

func (s *ExternalNetworkPolicyReconcilerTestSuite) TestNetworkPolicyCreateForIngress() {
serviceName := "test-server-ingress-test"
intents := s.AddIntents("test-intents", "test-client", []otterizev1alpha1.Intent{{
intents, err := s.AddIntents("test-intents", "test-client", []otterizev1alpha1.Intent{{
Type: otterizev1alpha1.IntentTypeHTTP, Name: serviceName,
},
})
s.Require().NoError(err)

s.Require().True(s.Mgr.GetCache().WaitForCacheSync(context.Background()))

res, err := s.NetworkPolicyReconciler.Reconcile(context.Background(), ctrl.Request{
Expand Down Expand Up @@ -126,10 +128,11 @@ func (s *ExternalNetworkPolicyReconcilerTestSuite) TestNetworkPolicyCreateForIng

func (s *ExternalNetworkPolicyReconcilerTestSuite) TestNetworkPolicyCreateForLoadBalancer() {
serviceName := "test-server-load-balancer-test"
intents := s.AddIntents("test-intents", "test-client", []otterizev1alpha1.Intent{{
intents, err := s.AddIntents("test-intents", "test-client", []otterizev1alpha1.Intent{{
Type: otterizev1alpha1.IntentTypeHTTP, Name: serviceName,
},
})
s.Require().NoError(err)
s.Require().True(s.Mgr.GetCache().WaitForCacheSync(context.Background()))

res, err := s.NetworkPolicyReconciler.Reconcile(context.Background(), ctrl.Request{
Expand Down Expand Up @@ -183,10 +186,11 @@ func (s *ExternalNetworkPolicyReconcilerTestSuite) TestNetworkPolicyCreateForLoa

func (s *ExternalNetworkPolicyReconcilerTestSuite) TestNetworkPolicyCreateForNodePort() {
serviceName := "test-server-node-port-test"
intents := s.AddIntents("test-intents", "test-client", []otterizev1alpha1.Intent{{
intents, err := s.AddIntents("test-intents", "test-client", []otterizev1alpha1.Intent{{
Type: otterizev1alpha1.IntentTypeHTTP, Name: serviceName,
},
})
s.Require().NoError(err)
s.Require().True(s.Mgr.GetCache().WaitForCacheSync(context.Background()))

res, err := s.NetworkPolicyReconciler.Reconcile(context.Background(), ctrl.Request{
Expand Down
2 changes: 1 addition & 1 deletion src/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func main() {
if selfSignedCert == true {
logrus.Infoln("Creating self signing certs")
certBundle, err =
webhooks.GenerateSelfSignedCertificate("intents-operator-webhook-service", "intents-operator-system")
webhooks.GenerateSelfSignedCertificate("intents-operator-webhook-service", podNamespace)
if err != nil {
logrus.WithError(err).Fatal("unable to create self signed certs for webhook")
}
Expand Down

0 comments on commit 0dc9de6

Please sign in to comment.