resources

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2025 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdateResource

func CreateOrUpdateResource[K client.Object](ctx context.Context, clt client.Client, m Mutator[K]) error

func DeleteResource

func DeleteResource[K client.Object](ctx context.Context, clt client.Client, m Mutator[K]) error

func GetResource

func GetResource[K client.Object](ctx context.Context, clt client.Client, m Mutator[K]) (K, error)

func NewClusterRoleRef

func NewClusterRoleRef(name string) v1.RoleRef

NewClusterRoleRef creates a RoleRef for a ClusterRole.

func NewRoleRef

func NewRoleRef(name string) v1.RoleRef

NewRoleRef creates a RoleRef for a Role.

Types

type ClusterRoleBindingMutator

type ClusterRoleBindingMutator struct {
	ClusterRoleBindingName string
	RoleRef                v1.RoleRef
	Subjects               []v1.Subject
	// contains filtered or unexported fields
}

func (*ClusterRoleBindingMutator) Empty

func (*ClusterRoleBindingMutator) Mutate

func (*ClusterRoleBindingMutator) String

func (m *ClusterRoleBindingMutator) String() string

type ClusterRoleMutator

type ClusterRoleMutator struct {
	Name  string
	Rules []v1.PolicyRule
	// contains filtered or unexported fields
}

func (*ClusterRoleMutator) Empty

func (m *ClusterRoleMutator) Empty() *v1.ClusterRole

func (*ClusterRoleMutator) Mutate

func (m *ClusterRoleMutator) Mutate(r *v1.ClusterRole) error

func (*ClusterRoleMutator) String

func (m *ClusterRoleMutator) String() string

type ConfigMapMutator

type ConfigMapMutator struct {
	Name      string
	Namespace string
	Data      map[string]string
	// contains filtered or unexported fields
}

func (*ConfigMapMutator) Empty

func (m *ConfigMapMutator) Empty() *core.ConfigMap

func (*ConfigMapMutator) Mutate

func (m *ConfigMapMutator) Mutate(cm *core.ConfigMap) error

func (*ConfigMapMutator) String

func (m *ConfigMapMutator) String() string

type Mutator

type Mutator[K client.Object] interface {
	Empty() K
	Mutate(res K) error
	String() string
}

func NewClusterRoleBindingMutator

func NewClusterRoleBindingMutator(clusterRoleBindingName string, subjects []v1.Subject, roleRef v1.RoleRef, labels map[string]string, annotations map[string]string) Mutator[*v1.ClusterRoleBinding]

func NewClusterRoleMutator

func NewClusterRoleMutator(name string, rules []v1.PolicyRule, labels map[string]string, annotations map[string]string) Mutator[*v1.ClusterRole]

func NewConfigMapMutator

func NewConfigMapMutator(name, namespace string, data map[string]string, labels map[string]string, annotations map[string]string) Mutator[*core.ConfigMap]

func NewMetadataMutator

func NewMetadataMutator(labels map[string]string, annotations map[string]string) Mutator[client.Object]

func NewNamespaceMutator

func NewNamespaceMutator(name string, labels map[string]string, annotations map[string]string) Mutator[*v1.Namespace]

func NewRoleBindingMutator

func NewRoleBindingMutator(name, namespace string, subjects []v1.Subject, roleRef v1.RoleRef, labels map[string]string, annotations map[string]string) Mutator[*v1.RoleBinding]

func NewRoleMutator

func NewRoleMutator(name, namespace string, rules []v1.PolicyRule, labels map[string]string, annotations map[string]string) Mutator[*v1.Role]

func NewSecretMutator

func NewSecretMutator(name, namespace string, data map[string][]byte, secretType core.SecretType, labels map[string]string, annotations map[string]string) Mutator[*core.Secret]

func NewServiceAccountMutator

func NewServiceAccountMutator(name, namespace string, labels map[string]string, annotations map[string]string) Mutator[*core.ServiceAccount]

type RoleBindingMutator

type RoleBindingMutator struct {
	Name      string
	Namespace string
	Subjects  []v1.Subject
	RoleRef   v1.RoleRef
	// contains filtered or unexported fields
}

func (*RoleBindingMutator) Empty

func (m *RoleBindingMutator) Empty() *v1.RoleBinding

func (*RoleBindingMutator) Mutate

func (m *RoleBindingMutator) Mutate(rb *v1.RoleBinding) error

func (*RoleBindingMutator) String

func (m *RoleBindingMutator) String() string

type RoleMutator

type RoleMutator struct {
	Name      string
	Namespace string
	Rules     []v1.PolicyRule
	// contains filtered or unexported fields
}

func (*RoleMutator) Empty

func (m *RoleMutator) Empty() *v1.Role

func (*RoleMutator) Mutate

func (m *RoleMutator) Mutate(r *v1.Role) error

func (*RoleMutator) String

func (m *RoleMutator) String() string

type SecretMutator

type SecretMutator struct {
	Name      string
	Namespace string
	Data      map[string][]byte
	Type      core.SecretType
	// contains filtered or unexported fields
}

func (*SecretMutator) Empty

func (m *SecretMutator) Empty() *core.Secret

func (*SecretMutator) Mutate

func (m *SecretMutator) Mutate(s *core.Secret) error

func (*SecretMutator) String

func (m *SecretMutator) String() string

type ServiceAccountMutator

type ServiceAccountMutator struct {
	Name      string
	Namespace string
	// contains filtered or unexported fields
}

func (*ServiceAccountMutator) Empty

func (*ServiceAccountMutator) Mutate

func (*ServiceAccountMutator) String

func (m *ServiceAccountMutator) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL