util

package
v0.0.0-...-6f6d35a Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

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

func HasZeroApps(pod *corev1.Pod) bool

HasZeroApps returns whether there are zero apps in the shuffle server pod.

func NeedInspectPod

func NeedInspectPod(pod *corev1.Pod) bool

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

func (j JSONFloat) MarshalJSON() ([]byte, error)

MarshalJSON return bytes representing JSONFloat

func (*JSONFloat) UnmarshalJSON

func (j *JSONFloat) UnmarshalJSON(v []byte) error

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.

Jump to

Keyboard shortcuts

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