Documentation
¶
Index ¶
- Constants
- func CalculateHash(data map[string][]byte) string
- func Contains(commaSeparatedString, value string) bool
- func GetClusterName() string
- func GetNextFiveMinutes() time.Duration
- func LabelsForStaleSecretWatchConfigMap(name string) map[string]string
- func MarshalConfigData(configData ConfigData) ([]byte, error)
- func ParseTime(timeStr string) (time.Time, error)
- func RetrieveModifiedTime(om metav1.ObjectMeta) string
- type Block
- type ConfigData
- type Divider
- type Element
- type History
- type Markup
- type Namespace
- type Secret
- type SlackPayload
- type StaleSecretWatchReconciler
- type Style
- type TextElement
Constants ¶
const ( RT = "rich_text" RTF = "rich_text_preformatted" )
Variables ¶
This section is empty.
Functions ¶
func CalculateHash ¶
func GetClusterName ¶
func GetClusterName() string
func GetNextFiveMinutes ¶
GetNextFiveMinutes calculates the duration until the next 5-minute mark to facilitate running a task every 5 minutes.
func LabelsForStaleSecretWatchConfigMap ¶
labelsForStaleSecretWatchConfigMap returns the labels for selecting the resources More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
func MarshalConfigData ¶
func MarshalConfigData(configData ConfigData) ([]byte, error)
func RetrieveModifiedTime ¶
func RetrieveModifiedTime(om metav1.ObjectMeta) string
Types ¶
type Block ¶
type Block struct { Type string `json:"type"` Text *TextElement `json:"text,omitempty"` Elements []Element `json:"elements,omitempty"` Divider *Divider `json:"divider,omitempty"` }
type ConfigData ¶
type ConfigData struct {
Namespaces []Namespace `json:"namespaces"`
}
type Divider ¶
type Divider struct {
Type string `json:"type"`
}
Updated Divider struct with explicit type field
type SlackPayload ¶
type StaleSecretWatchReconciler ¶
type StaleSecretWatchReconciler struct { client.Client Log logr.Logger RequeueInterval time.Duration Scheme *runtime.Scheme Recorder record.EventRecorder }
StaleSecretWatchReconciler reconciles a StaleSecretWatch object
func (*StaleSecretWatchReconciler) NotifySlack ¶
func (r *StaleSecretWatchReconciler) NotifySlack(ctx context.Context, logger logr.Logger, staleSecretWatch *securityv1beta1.StaleSecretWatch) error
NotifySlack prepares Blocks to send msg over slack
func (*StaleSecretWatchReconciler) Reconcile ¶
func (r *StaleSecretWatchReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the StaleSecretWatch object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.
For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile
func (*StaleSecretWatchReconciler) SetupWithManager ¶
func (r *StaleSecretWatchReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.