Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PodArgumentor ¶
type PodArgumentor struct { SSPodId SSPodIdentifier Collector annotation.QualifiedAnnotationCollector // contains filtered or unexported fields }
PodArgumentor receives the admission request from API server when a Pod resource is created or updated
func (*PodArgumentor) InjectDecoder ¶
func (r *PodArgumentor) InjectDecoder(decoder *admission.Decoder) error
func (*PodArgumentor) Register ¶
func (r *PodArgumentor) Register(h annotation.Handler)
func (*PodArgumentor) SetupWebhookWithManager ¶
func (r *PodArgumentor) SetupWebhookWithManager(mgr ctrl.Manager)
type SSPodIdentifier ¶
type SSPodIdentifier interface {
Extract(accessor v1.ObjectMetaAccessor) (string, int, error)
}
type SSPodIdentifierFunc ¶
type SSPodIdentifierFunc func(v1.ObjectMetaAccessor) (string, int, error)
var LabelSSPodIdentifier SSPodIdentifierFunc = func(accessor v1.ObjectMetaAccessor) (string, int, error) { l, ok := accessor.GetObjectMeta().GetLabels()["statefulset.kubernetes.io/pod-name"] if !ok { podIdentifierLog.Info("statefulset label not found", "label", "statefulset.kubernetes.io/pod-name") return "", -1, errors.New("missing statefulset label") } podIdentifierLog.Info("stateful pod name", "name", l) if b, err := regexp.MatchString(".+-\\d+", l); err != nil || !b { return "", -1, errors.New("unexpected label value") } i := strings.LastIndex(l, "-") ordinal, _ := strconv.Atoi(l[i+1:]) return l[:i], ordinal, nil }
func (SSPodIdentifierFunc) Extract ¶
func (f SSPodIdentifierFunc) Extract(accessor v1.ObjectMetaAccessor) (string, int, error)
Click to show internal directories.
Click to hide internal directories.