Skip to content

Commit

Permalink
Made webhook secret part of kustomize (kyma-project#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfaizanse authored Oct 23, 2023
1 parent 9bf7307 commit 67a272c
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 55 deletions.
1 change: 1 addition & 0 deletions config/webhook/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ resources:
- cronjob.yaml
- webhook_configs.yaml
- service.yaml
- secret.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Expand Down
11 changes: 11 additions & 0 deletions config/webhook/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# secret without any data. The cronjob will insert the cert into this file.
apiVersion: v1
kind: Secret
metadata:
name: eventing-manager-webhook-server-cert
labels:
app.kubernetes.io/name: eventing-manager-webhook-service
app.kubernetes.io/component: eventing-manager
app.kubernetes.io/created-by: eventing-manager
app.kubernetes.io/part-of: eventing-manager
type: Opaque
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ require (
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.0 // indirect
github.com/kyma-project/kyma/components/application-operator v0.0.0-20230127165033-ec8e43477eca // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
Expand All @@ -80,7 +79,6 @@ require (
golang.org/x/term v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.13.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
Expand Down
14 changes: 0 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/emicklei/go-restful/v3 v3.10.1 h1:rc42Y5YTp7Am7CS630D7JmhRjq4UlEUuEKfrDac4bSQ=
github.com/emicklei/go-restful/v3 v3.10.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
Expand Down Expand Up @@ -95,14 +93,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kyma-project/api-gateway v0.0.0-20220819093753-296e6704d413 h1:fkGKNOFbltycpdQ7yCGfa+7MpH9X18F09x+n7Tgfp7A=
github.com/kyma-project/api-gateway v0.0.0-20220819093753-296e6704d413/go.mod h1:5kBV6C2JEaapjTAn10Mo81Te4e6LN3epexUCSLXgQLI=
github.com/kyma-project/kyma/common/logging v0.0.0-20230616102347-ad6927dc28d5 h1:Uey3jJWq9eyXiepEvqQjBIWwPGM8nMIylBpcTc9FuDM=
github.com/kyma-project/kyma/common/logging v0.0.0-20230616102347-ad6927dc28d5/go.mod h1:JGb5RBi8Uz+RZ/jf54+qA+RqY6uPQBJ8pO1w3KSwm1Q=
github.com/kyma-project/kyma/common/logging v0.0.0-20231020092259-d58329d50da1 h1:Lur/R654ghUmsZiNrSrQBDjxCAvkb/7CueB0X/VQbKg=
github.com/kyma-project/kyma/common/logging v0.0.0-20231020092259-d58329d50da1/go.mod h1:JGb5RBi8Uz+RZ/jf54+qA+RqY6uPQBJ8pO1w3KSwm1Q=
github.com/kyma-project/kyma/components/application-operator v0.0.0-20230127165033-ec8e43477eca h1:7UpCIk6+sMCOhPfolAlppRugSln5M4T8/dHJm8x0erc=
github.com/kyma-project/kyma/components/application-operator v0.0.0-20230127165033-ec8e43477eca/go.mod h1:Tog02gZ1VT7yvFmhSqmiuGZpDYt18zTF4kr6E0N9ttk=
github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20231006112231-696ba866d5ec h1:P+V9r14NJKUFbIZIEMrjInABT+qN/ySLqWQ01aeq068=
github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20231006112231-696ba866d5ec/go.mod h1:Ht1hT95iSKe5md3QhIZQrq3j9WXkiWe/qdDMaDrmdyI=
github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20231020092259-d58329d50da1 h1:DeK2GvRpL2YPPkCguEN376Lj6dlKkjwn1Z4Df1LHatg=
github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20231020092259-d58329d50da1/go.mod h1:llsnpySZ+YAB6WrWplNWbGdnYYPmMlUMXEhFl0sXtsE=
github.com/kyma-project/nats-manager v1.0.2 h1:uJiVrLFFqnOsnz1IGNn76fm5cQoK+4L8GxP829mX2C8=
Expand Down Expand Up @@ -260,8 +252,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw=
Expand Down Expand Up @@ -310,12 +300,8 @@ k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ=
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk=
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/controller-runtime v0.15.2 h1:9V7b7SDQSJ08IIsJ6CY1CE85Okhp87dyTMNDG0FS7f4=
sigs.k8s.io/controller-runtime v0.15.2/go.mod h1:7ngYvp1MLT+9GeZ+6lH3LOlcHkp/+tzA/fmHa4iq9kk=
sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4=
sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
Expand Down
76 changes: 37 additions & 39 deletions hack/e2e/cleanup/cleanup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,45 +79,43 @@ func Test_NoPublisherServiceAccountExists(t *testing.T) {
require.NoError(t, err)
}

//// Enable this test once https://github.com/kyma-project/eventing-manager/issues/34 is done!
//// Test_NoPublisherClusterRoleExists tests if the publisher-proxy ClusterRole was deleted.
//func Test_NoPublisherClusterRoleExists(t *testing.T) {
// t.Parallel()
// ctx := context.TODO()
// eventingCR := EventingCR(eventingv1alpha1.BackendType(testEnvironment.TestConfigs.BackendType))
// err := Retry(testenvironment.Attempts, testenvironment.Interval, func() error {
// _, getErr := testEnvironment.K8sClientset.RbacV1().ClusterRoles().Get(ctx,
// eventing.GetPublisherClusterRoleName(*eventingCR), metav1.GetOptions{})
// if getErr == nil {
// return errors.New("PublisherClusterRole should have been deleted")
// }
// if !k8serrors.IsNotFound(getErr) {
// return getErr
// }
// return nil
// })
// require.NoError(t, err)
//}
//
//// Enable this test once https://github.com/kyma-project/eventing-manager/issues/34 is done!
//// Test_NoPublisherClusterRoleBindingExists tests if the publisher-proxy ClusterRoleBinding was deleted.
//func Test_NoPublisherClusterRoleBindingExists(t *testing.T) {
// t.Parallel()
// ctx := context.TODO()
// eventingCR := EventingCR(eventingv1alpha1.BackendType(testEnvironment.TestConfigs.BackendType))
// err := Retry(testenvironment.Attempts, testenvironment.Interval, func() error {
// _, getErr := testEnvironment.K8sClientset.RbacV1().ClusterRoleBindings().Get(ctx,
// eventing.GetPublisherClusterRoleBindingName(*eventingCR), metav1.GetOptions{})
// if getErr == nil {
// return errors.New("PublisherClusterRoleBinding should have been deleted")
// }
// if !k8serrors.IsNotFound(getErr) {
// return getErr
// }
// return nil
// })
// require.NoError(t, err)
//}
// Test_NoPublisherClusterRoleExists tests if the publisher-proxy ClusterRole was deleted.
func Test_NoPublisherClusterRoleExists(t *testing.T) {
t.Parallel()
ctx := context.TODO()
eventingCR := EventingCR(eventingv1alpha1.BackendType(testEnvironment.TestConfigs.BackendType))
err := Retry(testenvironment.Attempts, testenvironment.Interval, func() error {
_, getErr := testEnvironment.K8sClientset.RbacV1().ClusterRoles().Get(ctx,
eventing.GetPublisherClusterRoleName(*eventingCR), metav1.GetOptions{})
if getErr == nil {
return errors.New("PublisherClusterRole should have been deleted")
}
if !k8serrors.IsNotFound(getErr) {
return getErr
}
return nil
})
require.NoError(t, err)
}

// Test_NoPublisherClusterRoleBindingExists tests if the publisher-proxy ClusterRoleBinding was deleted.
func Test_NoPublisherClusterRoleBindingExists(t *testing.T) {
t.Parallel()
ctx := context.TODO()
eventingCR := EventingCR(eventingv1alpha1.BackendType(testEnvironment.TestConfigs.BackendType))
err := Retry(testenvironment.Attempts, testenvironment.Interval, func() error {
_, getErr := testEnvironment.K8sClientset.RbacV1().ClusterRoleBindings().Get(ctx,
eventing.GetPublisherClusterRoleBindingName(*eventingCR), metav1.GetOptions{})
if getErr == nil {
return errors.New("PublisherClusterRoleBinding should have been deleted")
}
if !k8serrors.IsNotFound(getErr) {
return getErr
}
return nil
})
require.NoError(t, err)
}

// Test_NoPublisherServicesExists tests if the publisher-proxy Services was deleted.
func Test_NoPublisherServicesExists(t *testing.T) {
Expand Down

0 comments on commit 67a272c

Please sign in to comment.