add role, webhook resource

This commit is contained in:
kkb0318
2024-05-11 17:08:43 +09:00
parent 4b1c81fd35
commit 9cac8fcd0b
9 changed files with 117 additions and 31 deletions
+7 -3
View File
@@ -8,7 +8,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
)
type AwsWebhook struct {
type WebhookSetup struct {
resources []client.Object
}
@@ -19,13 +19,17 @@ func secretNamespacedName() types.NamespacedName {
}
}
func NewWebHook() (*AwsWebhook, error) {
func (w *WebhookSetup) Resources() []client.Object {
return w.resources
}
func NewWebHookSetup() (*WebhookSetup, error) {
factory := newBaseManifestFactory()
resources, err := myCertificate(factory)
if err != nil {
return nil, err
}
return &AwsWebhook{resources}, nil
return &WebhookSetup{resources}, nil
}
func myCertificate(base *baseManifestFactory) ([]client.Object, error) {