app

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package app provides the ExampleApp CRD definition shared across examples.

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is the group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "apps.example.io", Version: "v1"}

	// SchemeBuilder is used to add Go types to the GroupVersionKind scheme.
	SchemeBuilder = runtime.NewSchemeBuilder(func(scheme *runtime.Scheme) error {
		scheme.AddKnownTypes(GroupVersion, &ExampleApp{}, &ExampleAppList{})
		metav1.AddToGroupVersion(scheme, GroupVersion)
		return nil
	})

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func NewFakeClient added in v0.7.1

func NewFakeClient(scheme *runtime.Scheme, entries []RESTMapperEntry) client.WithWatch

NewFakeClient builds a fake client with a properly configured REST mapper. The scheme must already have all required types registered.

Types

type ExampleApp

type ExampleApp struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ExampleAppSpec   `json:"spec,omitempty"`
	Status ExampleAppStatus `json:"status,omitempty"`
}

ExampleApp is a mock CRD representing an application managed by our operator.

func (*ExampleApp) DeepCopyObject

func (in *ExampleApp) DeepCopyObject() runtime.Object

DeepCopyObject implements runtime.Object.

func (*ExampleApp) GetKind

func (in *ExampleApp) GetKind() string

GetKind returns the kind of the object.

func (*ExampleApp) GetStatusConditions

func (in *ExampleApp) GetStatusConditions() *[]metav1.Condition

GetStatusConditions returns the status conditions for the ExampleApp.

type ExampleAppList

type ExampleAppList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ExampleApp `json:"items"`
}

ExampleAppList contains a list of ExampleApp.

func (*ExampleAppList) DeepCopyObject

func (in *ExampleAppList) DeepCopyObject() runtime.Object

DeepCopyObject implements runtime.Object.

type ExampleAppSpec

type ExampleAppSpec struct {
	// Version of the application to deploy.
	Version string `json:"version"`

	// EnableTracing adds tracing configuration to the application.
	EnableTracing bool `json:"enableTracing"`

	// EnableMetrics adds metrics configuration to the application.
	EnableMetrics bool `json:"enableMetrics"`

	// EnableDebugLogging sets LOG_LEVEL=debug on the application container.
	EnableDebugLogging bool `json:"enableDebugLogging"`

	// Suspended determines whether the application is active.
	Suspended bool `json:"suspended"`
}

ExampleAppSpec defines the desired state of ExampleApp.

type ExampleAppStatus

type ExampleAppStatus struct {
	// Conditions store the status of the application's components.
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

ExampleAppStatus defines the observed state of ExampleApp.

type RESTMapperEntry added in v0.7.1

type RESTMapperEntry struct {
	GVK   schema.GroupVersionKind
	Scope meta.RESTScope
}

RESTMapperEntry describes a single GVK and its scope for REST mapper setup.

Jump to

Keyboard shortcuts

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