apihelpers

package
v0.0.0-...-88a9ed4 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindGRDCondition

FindGRDCondition returns the condition you're looking for or nil.

func GRDHasFinalizer

func GRDHasFinalizer(grd *kindsv1.GrafanaResourceDefinition, needle string) bool

GRDHasFinalizer returns true if the finalizer is in the list.

func GRDRemoveFinalizer

func GRDRemoveFinalizer(grd *kindsv1.GrafanaResourceDefinition, needle string)

GRDRemoveFinalizer removes the finalizer if present.

func GetGRDStorageVersion

func GetGRDStorageVersion(grd *kindsv1.GrafanaResourceDefinition) (string, error)

GetGRDStorageVersion returns the storage version for given GRD.

func HasPerVersionColumns

func HasPerVersionColumns(versions []kindsv1.GrafanaResourceDefinitionVersion) bool

HasPerVersionColumns returns true if a GRD uses per-version columns.

func HasPerVersionSchema

func HasPerVersionSchema(versions []kindsv1.GrafanaResourceDefinitionVersion) bool

HasPerVersionSchema returns true if a GRD uses per-version schema.

func HasPerVersionSubresources

func HasPerVersionSubresources(versions []kindsv1.GrafanaResourceDefinitionVersion) bool

HasPerVersionSubresources returns true if a GRD uses per-version subresources.

func HasServedGRDVersion

func HasServedGRDVersion(grd *kindsv1.GrafanaResourceDefinition, version string) bool

HasServedGRDVersion returns true if the given version is in the list of GRD's versions and the Served flag is set.

func HasVersionServed

func HasVersionServed(grd *kindsv1.GrafanaResourceDefinition, version string) bool

HasVersionServed returns true if given GRD has given version served.

func IsGRDConditionEquivalent

func IsGRDConditionEquivalent(lhs, rhs *kindsv1.GrafanaResourceDefinitionCondition) bool

IsGRDConditionEquivalent returns true if the lhs and rhs are equivalent except for times.

func IsGRDConditionFalse

IsGRDConditionFalse indicates if the condition is present and false.

func IsGRDConditionPresentAndEqual

func IsGRDConditionPresentAndEqual(grd *kindsv1.GrafanaResourceDefinition, conditionType kindsv1.GrafanaResourceDefinitionConditionType, status kindsv1.ConditionStatus) bool

IsGRDConditionPresentAndEqual indicates if the condition is present and equal to the given status.

func IsGRDConditionTrue

IsGRDConditionTrue indicates if the condition is present and strictly true.

func IsProtectedCommunityGroup

func IsProtectedCommunityGroup(group string) bool

IsProtectedCommunityGroup returns whether or not a group specified for a GRD is protected for the community and needs to have the v1beta1.KubeAPIApprovalAnnotation set.

func IsStoredVersion

func IsStoredVersion(grd *kindsv1.GrafanaResourceDefinition, version string) bool

IsStoredVersion returns whether the given version is the storage version of the GRD.

func RemoveGRDCondition

RemoveGRDCondition removes the status condition.

func SetGRDCondition

SetGRDCondition sets the status condition. It either overwrites the existing one or creates a new one.

Types

type APIApprovalState

type APIApprovalState int

APIApprovalState covers the various options for API approval annotation states

const (
	// APIApprovalInvalid means the annotation doesn't have an expected value
	APIApprovalInvalid APIApprovalState = iota
	// APIApproved if the annotation has a URL (this means the API is approved)
	APIApproved
	// APIApprovalBypassed if the annotation starts with "unapproved" indicating that for whatever reason the API isn't approved, but we should allow its creation
	APIApprovalBypassed
	// APIApprovalMissing means the annotation is empty
	APIApprovalMissing
)

func GetAPIApprovalState

func GetAPIApprovalState(annotations map[string]string) (state APIApprovalState, reason string)

GetAPIApprovalState returns the state of the API approval and reason for that state

type SubresourceStreamer

type SubresourceStreamer struct {
	// contains filtered or unexported fields
}

func (*SubresourceStreamer) DeepCopyObject

func (s *SubresourceStreamer) DeepCopyObject() runtime.Object

func (*SubresourceStreamer) GetObjectKind

func (s *SubresourceStreamer) GetObjectKind() schema.ObjectKind

func (*SubresourceStreamer) InputStream

func (s *SubresourceStreamer) InputStream(ctx context.Context, apiVersion, acceptHeader string) (stream io.ReadCloser, flush bool, contentType string, err error)

func (*SubresourceStreamer) SetInputStream

func (s *SubresourceStreamer) SetInputStream(fn inputStreamFn)

Jump to

Keyboard shortcuts

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