Documentation ¶
Index ¶
- func AdmissionReviewAllow(ar *admissionv1.AdmissionReview) *admissionv1.AdmissionReview
- func AdmissionReviewFailed(ar *admissionv1.AdmissionReview, err error) *admissionv1.AdmissionReview
- func AdmissionReviewForbidden(ar *admissionv1.AdmissionReview, message string) *admissionv1.AdmissionReview
- func AdmissionReviewWithPatches(ar *admissionv1.AdmissionReview, patches []byte) *admissionv1.AdmissionReview
- func HasZeroApps(pod *corev1.Pod) bool
- func NeedInspectPod(pod *corev1.Pod) bool
- func WithAdmissionReviewHandler(handler AdmissionReviewHandler) http.HandlerFunc
- type AdmissionReviewHandler
- type JSONFloat
- type MetricItem
- type MetricList
- type PatchOperation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdmissionReviewAllow ¶
func AdmissionReviewAllow(ar *admissionv1.AdmissionReview) *admissionv1.AdmissionReview
AdmissionReviewAllow allows the AdmissionReview.
func AdmissionReviewFailed ¶
func AdmissionReviewFailed(ar *admissionv1.AdmissionReview, err error) *admissionv1.AdmissionReview
AdmissionReviewFailed returns error for the AdmissionReview.
func AdmissionReviewForbidden ¶
func AdmissionReviewForbidden(ar *admissionv1.AdmissionReview, message string) *admissionv1.AdmissionReview
AdmissionReviewForbidden forbids the AdmissionReview with delete operation.
func AdmissionReviewWithPatches ¶
func AdmissionReviewWithPatches(ar *admissionv1.AdmissionReview, patches []byte) *admissionv1.AdmissionReview
AdmissionReviewWithPatches returns the AdmissionReview with patches in response.
func HasZeroApps ¶
HasZeroApps returns whether there are zero apps in the shuffle server pod.
func NeedInspectPod ¶
NeedInspectPod returns whether we need to inspect the pod.
func WithAdmissionReviewHandler ¶
func WithAdmissionReviewHandler(handler AdmissionReviewHandler) http.HandlerFunc
WithAdmissionReviewHandler checks before InspectorFunc executes and creates a handleFunc.
Types ¶
type AdmissionReviewHandler ¶
type AdmissionReviewHandler func(ar *admissionv1.AdmissionReview) *admissionv1.AdmissionReview
AdmissionReviewHandler handles AdmissionReviews and set response in them.
type JSONFloat ¶
type JSONFloat float64
JSONFloat is used to parse the float64 which may be NaN
func (JSONFloat) MarshalJSON ¶
MarshalJSON return bytes representing JSONFloat
func (*JSONFloat) UnmarshalJSON ¶
UnmarshalJSON return the parsed JSONFloat
type MetricItem ¶
type MetricItem struct { Name string `json:"name"` LabelNames []string `json:"labelNames"` LabelValues []string `json:"labelValues"` Value JSONFloat `json:"value"` }
MetricItem records an item of metric information of shuffle servers.
type MetricList ¶
type MetricList struct { Metrics []*MetricItem `json:"metrics"` TimeStamp int64 `json:"timestamp"` }
MetricList records all items of metric information of shuffle servers.
type PatchOperation ¶
type PatchOperation struct { Op string `json:"op"` Path string `json:"path"` Value interface{} `json:"value,omitempty"` }
PatchOperation defines the information of a patch's operation.