v1alpha1

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	RegistryKind     = "Registry"
	RegistryListKind = "RegistryList"

	RegistrySingular  = "registry"
	RegistryPlural    = "registries"
	RegistryShortName = "reg"

	RegistryTypeOCI RegistryType = "oci"
)
View Source
const Version = "v1alpha1"

+k8s:deepcopy-gen=package +groupName=reposure.puccini.cloud

Variables

View Source
var AddToScheme = schemeBuilder.AddToScheme

Registers this API group and version to a scheme Note: Generator *requires* it to be called "AddToScheme"

View Source
var RegistryCustomResourceDefinition = apiextensions.CustomResourceDefinition{
	ObjectMeta: meta.ObjectMeta{
		Name: RegistryResourcesName,
	},
	Spec: apiextensions.CustomResourceDefinitionSpec{
		Group: group.GroupName,
		Names: apiextensions.CustomResourceDefinitionNames{
			Singular: RegistrySingular,
			Plural:   RegistryPlural,
			Kind:     RegistryKind,
			ListKind: RegistryListKind,
			ShortNames: []string{
				RegistryShortName,
			},
			Categories: []string{
				"all",
			},
		},
		Scope: apiextensions.NamespaceScoped,
		Versions: []apiextensions.CustomResourceDefinitionVersion{
			{
				Name:    Version,
				Served:  true,
				Storage: true,
				Subresources: &apiextensions.CustomResourceSubresources{
					Status: &apiextensions.CustomResourceSubresourceStatus{},
				},
				Schema: &apiextensions.CustomResourceValidation{
					OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
						Description: "Reposure registry",
						Type:        "object",
						Required:    []string{"spec"},
						Properties: map[string]apiextensions.JSONSchemaProps{
							"spec": {
								Type:     "object",
								Required: []string{"type"},
								Properties: map[string]apiextensions.JSONSchemaProps{
									"type": {
										Description: "Registry type",
										Type:        "string",
										Enum: []apiextensions.JSON{
											kubernetes.JSONString(RegistryTypeOCI),
										},
									},
									"direct": {
										Description: "Direct reference to registry",
										Type:        "object",
										Required:    []string{"host"},
										Properties: map[string]apiextensions.JSONSchemaProps{
											"host": {
												Description: "Registry host (either \"host:port\" or \"host\")",
												Type:        "string",
											},
										},
									},
									"indirect": {
										Description: "Indirect reference to registry",
										Type:        "object",
										Required:    []string{"service", "port"},
										Properties: map[string]apiextensions.JSONSchemaProps{
											"namespace": {
												Description: "Namespace for service resource (optional; defaults to same namespace as this registry)",
												Type:        "string",
											},
											"service": {
												Description: "Name of service resource",
												Type:        "string",
											},
											"port": {
												Description: "TCP port to use with service",
												Type:        "integer",
											},
										},
									},
									"authenticationSecret": {
										Description: "Name of authentication Secret required for connecting to the registry (optional)",
										Type:        "string",
									},
									"authenticationSecretDataKey": {
										Description: "Name of key within the authentication Secret data required for connecting to the registry (optional)",
										Type:        "string",
									},
									"authorizationSecret": {
										Description: "Name of authorization Secret required for connecting to the registry (optional)",
										Type:        "string",
									},
								},
								OneOf: []apiextensions.JSONSchemaProps{
									{
										Required: []string{"direct"},
									},
									{
										Required: []string{"indirect"},
									},
								},
							},
							"status": {
								Type: "object",
								Properties: map[string]apiextensions.JSONSchemaProps{
									"surrogatePod": {
										Description: "Name of surrogate pod resource (in the same namespace as this registry)",
										Type:        "string",
									},
								},
							},
						},
					},
				},
				AdditionalPrinterColumns: []apiextensions.CustomResourceColumnDefinition{
					{
						Name:     "Type",
						Type:     "string",
						JSONPath: ".spec.type",
					},
					{
						Name:     "SurrogatePod",
						Type:     "string",
						JSONPath: ".status.surrogatePod",
					},
				},
			},
		},
	},
}
View Source
var RegistryGVK = SchemeGroupVersion.WithKind(RegistryKind)
View Source
var RegistryResourcesName = fmt.Sprintf("%s.%s", RegistryPlural, group.GroupName)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: group.GroupName, Version: Version}

Group version used to register these objects Note: Generator *requires* it to be called "SchemeGroupVersion"

Functions

func Kind

func Kind(kind string) schema.GroupKind

Takes an unqualified kind and returns a group-qualified GroupKind Note: Generator *requires* it to be called "Kind"

func RegistryToARD

func RegistryToARD(registry *Registry) ard.StringMap

func Resource

func Resource(resource string) schema.GroupResource

Takes an unqualified resource and returns a group-qualified GroupResource Note: Generator *requires* it to be called "Resource"

Types

type Registry

type Registry struct {
	meta.TypeMeta   `json:",inline"`
	meta.ObjectMeta `json:"metadata,omitempty"`

	Spec   RegistrySpec   `json:"spec"`
	Status RegistryStatus `json:"status"`
}

+genclient +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*Registry) DeepCopy

func (in *Registry) DeepCopy() *Registry

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Registry.

func (*Registry) DeepCopyInto

func (in *Registry) DeepCopyInto(out *Registry)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Registry) DeepCopyObject

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

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RegistryDirect

type RegistryDirect struct {
	Host string `json:"host"` // Registry host (either "host:port" or "host")
}

func (*RegistryDirect) DeepCopy

func (in *RegistryDirect) DeepCopy() *RegistryDirect

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryDirect.

func (*RegistryDirect) DeepCopyInto

func (in *RegistryDirect) DeepCopyInto(out *RegistryDirect)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RegistryIndirect

type RegistryIndirect struct {
	Namespace string `json:"namespace,omitempty"` // Namespace for service resource (optional; defaults to same namespace as this registry)
	Service   string `json:"service"`             // Name of service resource
	Port      uint64 `json:"port"`                // TCP port to use with service
}

func (*RegistryIndirect) DeepCopy

func (in *RegistryIndirect) DeepCopy() *RegistryIndirect

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryIndirect.

func (*RegistryIndirect) DeepCopyInto

func (in *RegistryIndirect) DeepCopyInto(out *RegistryIndirect)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RegistryList

type RegistryList struct {
	meta.TypeMeta `json:",inline"`
	meta.ListMeta `json:"metadata"`

	Items []Registry `json:"items"`
}

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*RegistryList) DeepCopy

func (in *RegistryList) DeepCopy() *RegistryList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryList.

func (*RegistryList) DeepCopyInto

func (in *RegistryList) DeepCopyInto(out *RegistryList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RegistryList) DeepCopyObject

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

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RegistrySpec

type RegistrySpec struct {
	Type                        RegistryType      `json:"type"`                                  // Registry type
	Direct                      *RegistryDirect   `json:"direct,omitempty"`                      // Direct reference to registry
	Indirect                    *RegistryIndirect `json:"indirect,omitempty"`                    // Indirect reference to registry
	AuthenticationSecret        string            `json:"authenticationSecret,omitempty"`        // Name of authentication Secret required for connecting to the registry (optional)
	AuthenticationSecretDataKey string            `json:"authenticationSecretDataKey,omitempty"` // Name of key within the authentication Secret data required for connecting to the registry (optional)
	AuthorizationSecret         string            `json:"authorizationSecret,omitempty"`         // Name of authorization Secret required for connecting to the registry (optional)
}

func (*RegistrySpec) DeepCopy

func (in *RegistrySpec) DeepCopy() *RegistrySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistrySpec.

func (*RegistrySpec) DeepCopyInto

func (in *RegistrySpec) DeepCopyInto(out *RegistrySpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RegistryStatus

type RegistryStatus struct {
	SurrogatePod string `json:"surrogatePod"` // Name of surrogate pod resource (in the same namespace as this registry)
}

func (*RegistryStatus) DeepCopy

func (in *RegistryStatus) DeepCopy() *RegistryStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryStatus.

func (*RegistryStatus) DeepCopyInto

func (in *RegistryStatus) DeepCopyInto(out *RegistryStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RegistryType

type RegistryType string

Jump to

Keyboard shortcuts

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