mirror of
https://github.com/storytold/irsa-manager.git
synced 2026-10-26 08:27:47 +00:00
serviceaccount
This commit is contained in:
@@ -1 +0,0 @@
|
||||
package manifests
|
||||
@@ -0,0 +1,34 @@
|
||||
package manifests
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
)
|
||||
|
||||
type ServiceAccountBuilder struct {
|
||||
annotation map[string]string
|
||||
}
|
||||
|
||||
func NewServiceAccountBuilder() *ServiceAccountBuilder {
|
||||
return &ServiceAccountBuilder{}
|
||||
}
|
||||
|
||||
func (b *ServiceAccountBuilder) WithAnnotation(annotation map[string]string) *ServiceAccountBuilder {
|
||||
b.annotation = annotation
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ServiceAccountBuilder) Build(namespacedName types.NamespacedName) *corev1.ServiceAccount {
|
||||
return &corev1.ServiceAccount{
|
||||
TypeMeta: metav1.TypeMeta{
|
||||
APIVersion: corev1.SchemeGroupVersion.String(),
|
||||
Kind: "ServiceAccount",
|
||||
},
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: namespacedName.Name,
|
||||
Namespace: namespacedName.Namespace,
|
||||
Annotations: b.annotation,
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user