Documentation ¶
Index ¶
- Constants
- Variables
- func ErrDoPanic(err error, message string)
- func ErrIsMissingOrNil(recorder record.EventRecorder, err error, message string, ...) bool
- func GenerateHashFromName(name string) uint64
- func GetConfigMap(client client.Client, ctx context.Context, namespacedName types.NamespacedName) (corev1.ConfigMap, error)
- func GetHashForStructs(obj []interface{}) string
- func GetObjectDiff[T any](a T, b T) (diff.Changelog, error)
- func GetPodAppSelector(applicationName string) map[string]string
- func HasUpperCaseLetter(word string) bool
- func IsInternal(hostname string) bool
- func PointTo[T any](x T) *T
- func ResolveImageTags(ctx context.Context, log logr.Logger, config *rest.Config, ...) (*appsv1.Deployment, error)
- func ResourceNameWithKindPostfix(resourceName string, kind string) string
- func SetCommonAnnotations(object client.Object)
- type MatchesPredicate
- type ReconcilerBase
- func (r *ReconcilerBase) DeleteObjectIfExists(ctx context.Context, object client.Object) error
- func (r *ReconcilerBase) EmitNormalEvent(object runtime.Object, reason string, message string)
- func (r *ReconcilerBase) EmitWarningEvent(object runtime.Object, reason string, message string)
- func (r *ReconcilerBase) GetApiExtensionsClient() *apiextensionsclient.Clientset
- func (r *ReconcilerBase) GetClient() client.Client
- func (r *ReconcilerBase) GetEgressServices(ctx context.Context, owner client.Object, accessPolicy *podtypes.AccessPolicy) ([]corev1.Service, error)
- func (r *ReconcilerBase) GetRecorder() record.EventRecorder
- func (r *ReconcilerBase) GetRestConfig() *rest.Config
- func (r *ReconcilerBase) GetScheme() *runtime.Scheme
- func (r *ReconcilerBase) IsIstioEnabledForNamespace(ctx context.Context, namespaceName string) bool
- func (r *ReconcilerBase) ShouldReconcile(ctx context.Context, obj client.Object) (bool, error)
Constants ¶
View Source
const SkiperatorUser = int64(150)
Variables ¶
View Source
var ( IstioMetricsPortNumber = intstr.FromInt(15020) IstioMetricsPortName = intstr.FromString("istio-metrics") IstioMetricsPath = "/stats/prometheus" IstioRevisionLabel = "istio.io/rev" )
View Source
var CommonAnnotations = map[string]string{
"argocd.argoproj.io/sync-options": "Prune=false",
}
View Source
var LeastPrivilegeContainerSecurityContext = corev1.SecurityContext{ Capabilities: PointTo(corev1.Capabilities{ Add: []corev1.Capability{}, Drop: []corev1.Capability{ "all", }, }), Privileged: PointTo(false), RunAsUser: PointTo(SkiperatorUser), RunAsGroup: PointTo(SkiperatorUser), RunAsNonRoot: PointTo(true), ReadOnlyRootFilesystem: PointTo(true), AllowPrivilegeEscalation: PointTo(false), SeccompProfile: &corev1.SeccompProfile{ Type: corev1.SeccompProfileTypeRuntimeDefault, }, }
A security context for use in pod containers created by Skiperator follow least privilege best practices for the whole Container Security Context
Functions ¶
func ErrDoPanic ¶
func ErrIsMissingOrNil ¶
func GenerateHashFromName ¶
func GetConfigMap ¶
func GetHashForStructs ¶ added in v1.0.0
func GetHashForStructs(obj []interface{}) string
func GetObjectDiff ¶ added in v1.0.0
func GetPodAppSelector ¶ added in v1.0.0
func HasUpperCaseLetter ¶ added in v1.0.0
func IsInternal ¶
func ResolveImageTags ¶ added in v1.0.0
func ResourceNameWithKindPostfix ¶ added in v1.0.0
func SetCommonAnnotations ¶
Types ¶
type MatchesPredicate ¶
func (MatchesPredicate[T]) Create ¶
func (m MatchesPredicate[T]) Create(evt event.CreateEvent) bool
func (MatchesPredicate[T]) Delete ¶
func (m MatchesPredicate[T]) Delete(evt event.DeleteEvent) bool
func (MatchesPredicate[T]) Generic ¶
func (m MatchesPredicate[T]) Generic(evt event.GenericEvent) bool
func (MatchesPredicate[T]) Update ¶
func (m MatchesPredicate[T]) Update(evt event.UpdateEvent) bool
type ReconcilerBase ¶
type ReconcilerBase struct {
// contains filtered or unexported fields
}
ReconcilerBase is a base struct from which all reconcilers can be derived from. By doing so your reconcilers will also inherit a set of utility functions To inherit from reconciler just build your finalizer this way:
type MyReconciler struct { util.ReconcilerBase ... other optional fields ... }
func NewFromManager ¶
func NewFromManager(mgr manager.Manager, recorder record.EventRecorder) ReconcilerBase
NewReconcilerBase is a contruction function to create a new ReconcilerBase.
func NewReconcilerBase ¶
func NewReconcilerBase(client client.Client, extensionsClient *apiextensionsclient.Clientset, scheme *runtime.Scheme, restConfig *rest.Config, recorder record.EventRecorder, apireader client.Reader) ReconcilerBase
func (*ReconcilerBase) DeleteObjectIfExists ¶ added in v1.0.0
func (*ReconcilerBase) EmitNormalEvent ¶ added in v1.0.0
func (r *ReconcilerBase) EmitNormalEvent(object runtime.Object, reason string, message string)
func (*ReconcilerBase) EmitWarningEvent ¶ added in v1.0.0
func (r *ReconcilerBase) EmitWarningEvent(object runtime.Object, reason string, message string)
func (*ReconcilerBase) GetApiExtensionsClient ¶ added in v1.0.0
func (r *ReconcilerBase) GetApiExtensionsClient() *apiextensionsclient.Clientset
GetApiExtensionsClient returns the underlying API Extensions client
func (*ReconcilerBase) GetClient ¶
func (r *ReconcilerBase) GetClient() client.Client
GetClient returns the underlying client
func (*ReconcilerBase) GetEgressServices ¶ added in v1.0.0
func (r *ReconcilerBase) GetEgressServices(ctx context.Context, owner client.Object, accessPolicy *podtypes.AccessPolicy) ([]corev1.Service, error)
func (*ReconcilerBase) GetRecorder ¶
func (r *ReconcilerBase) GetRecorder() record.EventRecorder
GetRecorder returns the underlying recorder
func (*ReconcilerBase) GetRestConfig ¶
func (r *ReconcilerBase) GetRestConfig() *rest.Config
GetRestConfig returns the undelying rest config
func (*ReconcilerBase) GetScheme ¶
func (r *ReconcilerBase) GetScheme() *runtime.Scheme
GetScheme returns the scheme
func (*ReconcilerBase) IsIstioEnabledForNamespace ¶ added in v1.0.0
func (r *ReconcilerBase) IsIstioEnabledForNamespace(ctx context.Context, namespaceName string) bool
func (*ReconcilerBase) ShouldReconcile ¶ added in v1.0.0
Click to show internal directories.
Click to hide internal directories.