model

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func MarshalJSON

func MarshalJSON(val []byte) graphql.Marshaler

MarshalJSON marshals Unstructured JSON bytes to GraphQL.

func MarshalStringMap

func MarshalStringMap(val map[string]string) graphql.Marshaler

MarshalStringMap marshals a map[string]string to GraphQL.

func UnmarshalJSON

func UnmarshalJSON(v interface{}) ([]byte, error)

UnmarshalJSON marshals Unstructured JSON bytes from GraphQL.

func UnmarshalStringMap

func UnmarshalStringMap(v interface{}) (map[string]string, error)

UnmarshalStringMap marshals a map[string]string from GraphQL.

Types

type CompositeResource

type CompositeResource struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`
	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`
	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`
	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`
	// The desired state of this resource.
	Spec *CompositeResourceSpec `json:"spec"`
	// The observed state of this resource.
	Status *CompositeResourceStatus `json:"status"`
	// An unstructured JSON representation of the underlying Kubernetes resource.
	Unstructured []byte `json:"unstructured"`
	// Events pertaining to this resource.
	Events *EventConnection `json:"events"`
	// The definition of this resource.
	Definition *CompositeResourceDefinition `json:"definition"`
}

A CompositeResource is a resource this is reconciled by composing other composite or managed resources. Composite resources use a Composition to determine which resources to compose, and how.

func GetCompositeResource

func GetCompositeResource(u *kunstructured.Unstructured) CompositeResource

GetCompositeResource from the supplied Crossplane resource.

func (CompositeResource) IsKubernetesResource

func (CompositeResource) IsKubernetesResource()

func (CompositeResource) IsNode

func (CompositeResource) IsNode()

type CompositeResourceClaim

type CompositeResourceClaim struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`
	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`
	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`
	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`
	// The desired state of this resource.
	Spec *CompositeResourceClaimSpec `json:"spec"`
	// The observed state of this resource.
	Status *CompositeResourceClaimStatus `json:"status"`
	// An unstructured JSON representation of the underlying Kubernetes resource.
	Unstructured []byte `json:"unstructured"`
	// Events pertaining to this resource.
	Events *EventConnection `json:"events"`
	// The definition of this resource.
	Definition *CompositeResourceDefinition `json:"definition"`
}

A CompositeResourceClaim is a namespaced proxy for a composite resource.

func GetCompositeResourceClaim

func GetCompositeResourceClaim(u *kunstructured.Unstructured) CompositeResourceClaim

GetCompositeResourceClaim from the supplied Crossplane claim.

func (CompositeResourceClaim) IsKubernetesResource

func (CompositeResourceClaim) IsKubernetesResource()

func (CompositeResourceClaim) IsNode

func (CompositeResourceClaim) IsNode()

type CompositeResourceClaimConnection

type CompositeResourceClaimConnection struct {
	// Connected nodes.
	Nodes []CompositeResourceClaim `json:"nodes"`
	// The total number of connected nodes.
	TotalCount int `json:"totalCount"`
}

A CompositeResourceConnection represents a connection to composite resource claims.

func (*CompositeResourceClaimConnection) Len

func (*CompositeResourceClaimConnection) Less

func (*CompositeResourceClaimConnection) Swap

func (c *CompositeResourceClaimConnection) Swap(i, j int)

type CompositeResourceClaimConnectionDetails

type CompositeResourceClaimConnectionDetails struct {
	// The time at which the composite resource claim's connection details were last
	// published.
	LastPublishedTime *time.Time `json:"lastPublishedTime"`
}

CompositeResourceConnectionDetails represents the observed status of a composite resource claim's connection details.

type CompositeResourceClaimSpec

type CompositeResourceClaimSpec struct {
	CompositionSelector *LabelSelector `json:"compositionSelector"`

	CompositionReference *corev1.ObjectReference
	ResourceReference    *corev1.ObjectReference

	// We use a non-local secret reference because we need to know what
	// namespace the secret is in when we're resolving it, when we only have
	// access to the spec.
	WritesConnectionSecretToReference *xpv1.SecretReference
}

A CompositeResourceClaimSpec represents the desired state of a composite resource claim.

type CompositeResourceClaimStatus

type CompositeResourceClaimStatus struct {
	// The observed condition of this resource.
	Conditions []Condition `json:"conditions"`
	// The status of this composite resource's connection details.
	ConnectionDetails *CompositeResourceClaimConnectionDetails `json:"connectionDetails"`
}

A CompositeResourceClaimStatus represents the observed status of a composite resource claim.

func GetCompositeResourceClaimStatus

func GetCompositeResourceClaimStatus(xrc *unstructured.Claim) *CompositeResourceClaimStatus

GetCompositeResourceClaimStatus from the supplied Crossplane claim.

func (CompositeResourceClaimStatus) IsConditionedStatus

func (CompositeResourceClaimStatus) IsConditionedStatus()

type CompositeResourceConnection

type CompositeResourceConnection struct {
	// Connected nodes.
	Nodes []CompositeResource `json:"nodes"`
	// The total number of connected nodes.
	TotalCount int `json:"totalCount"`
}

A CompositeResourceConnection represents a connection to composite resources.

func (*CompositeResourceConnection) Len

func (*CompositeResourceConnection) Less

func (c *CompositeResourceConnection) Less(i, j int) bool

func (*CompositeResourceConnection) Swap

func (c *CompositeResourceConnection) Swap(i, j int)

type CompositeResourceConnectionDetails

type CompositeResourceConnectionDetails struct {
	// The time at which the composite resource's connection details were last
	// published.
	LastPublishedTime *time.Time `json:"lastPublishedTime"`
}

CompositeResourceConnectionDetails represents the observed status of a composite resource's connection details.

type CompositeResourceDefinition

type CompositeResourceDefinition struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`
	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`
	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`
	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`
	// The desired state of this resource.
	Spec *CompositeResourceDefinitionSpec `json:"spec"`
	// The observed state of this resource.
	Status *CompositeResourceDefinitionStatus `json:"status"`
	// An unstructured JSON representation of the underlying Kubernetes resource.
	Unstructured []byte `json:"unstructured"`
	// Events pertaining to this resource.
	Events *EventConnection `json:"events"`
	// Composite resources (XRs) defined by this XRD.
	DefinedCompositeResources *CompositeResourceConnection `json:"definedCompositeResources"`
	// Composite resource claims (XRCs) defined by this XRD.
	DefinedCompositeResourceClaims *CompositeResourceClaimConnection `json:"definedCompositeResourceClaims"`
}

A CompositeResourceDefinition (or XRD) defines a new kind of resource. The new resource is composed of other composite or managed resources.

func GetCompositeResourceDefinition

func GetCompositeResourceDefinition(xrd *extv1.CompositeResourceDefinition) CompositeResourceDefinition

GetCompositeResourceDefinition from the supplied Crossplane XRD.

func (CompositeResourceDefinition) IsKubernetesResource

func (CompositeResourceDefinition) IsKubernetesResource()

func (CompositeResourceDefinition) IsNode

func (CompositeResourceDefinition) IsNode()

type CompositeResourceDefinitionConnection

type CompositeResourceDefinitionConnection struct {
	// Connected nodes.
	Nodes []CompositeResourceDefinition `json:"nodes"`
	// The total number of connected nodes.
	TotalCount int `json:"totalCount"`
}

A CompositeResourceDefinitionConnection represents a connection to composite resource definitions (XRDs).

func (*CompositeResourceDefinitionConnection) Len

func (*CompositeResourceDefinitionConnection) Less

func (*CompositeResourceDefinitionConnection) Swap

type CompositeResourceDefinitionControllerStatus

type CompositeResourceDefinitionControllerStatus struct {
	// The CompositeResourceTypeRef is the type of composite resource that Crossplane
	// is currently reconciling for this definition. Its version will eventually
	// become consistent with the definition's referenceable version. Note that
	// clients may interact with any served type; this is simply the type that
	// Crossplane interacts with.
	CompositeResourceType *TypeReference `json:"compositeResourceType"`
	// The CompositeResourceClaimTypeRef is the type of composite resource claim
	// that Crossplane is currently reconciling for this definition. Its version
	// will eventually become consistent with the definition's referenceable version.
	// Note that clients may interact with any served type; this is simply the type
	// that Crossplane interacts with.
	CompositeResourceClaimType *TypeReference `json:"compositeResourceClaimType"`
}

A CompositeResourceDefinitionControllerStatus shows the observed state of the controllers that power the definition.

func GetCompositeResourceDefinitionControllerStatus

func GetCompositeResourceDefinitionControllerStatus(in extv1.CompositeResourceDefinitionControllerStatus) *CompositeResourceDefinitionControllerStatus

GetCompositeResourceDefinitionControllerStatus from the supplied Crossplane controllers

type CompositeResourceDefinitionNames

type CompositeResourceDefinitionNames struct {
	// The plural name of the resource to serve. Composite resources are served by
	// the Kuberntes API under `/apis/<group>/<version>/.../<plural>`.
	Plural string `json:"plural"`
	// The singular name of the resource.
	Singular *string `json:"singular"`
	// Short names for the resource, exposed in API discovery documents, and used by
	// clients to support invocations like `kubectl get <shortname>`.
	ShortNames []string `json:"shortNames"`
	// The Kubernetes API kind of the defined resource.
	Kind string `json:"kind"`
	// The Kubernetes API kind of a list of the defined resource.
	ListKind *string `json:"listKind"`
	// A list of grouped resources this custom resource belongs to (e.g. 'all'). This
	// is published in API discovery documents, and used by clients to support
	// invocations like `kubectl get all`.
	Categories []string `json:"categories"`
}

CompositeResourceDefinitionNames specifies the resource and kind names of the defined composite resource or claim.

func GetCompositeResourceDefinitionNames

func GetCompositeResourceDefinitionNames(in *kextv1.CustomResourceDefinitionNames) *CompositeResourceDefinitionNames

GetCompositeResourceDefinitionNames from the supplied Kubernetes names.

type CompositeResourceDefinitionSpec

type CompositeResourceDefinitionSpec struct {
	Group                string                               `json:"group"`
	Names                *CompositeResourceDefinitionNames    `json:"names"`
	ClaimNames           *CompositeResourceDefinitionNames    `json:"claimNames"`
	ConnectionSecretKeys []string                             `json:"connectionSecretKeys"`
	Versions             []CompositeResourceDefinitionVersion `json:"versions"`

	DefaultCompositionReference  *xpv1.Reference
	EnforcedCompositionReference *xpv1.Reference
}

A CompositeResourceDefinitionSpec represents the desired state of a CompositeResourceDefinition.

type CompositeResourceDefinitionStatus

type CompositeResourceDefinitionStatus struct {
	// The observed condition of this resource.
	Conditions []Condition `json:"conditions"`
	// Controllers represents the status of the controllers that power this
	// composite resource definition.
	Controllers *CompositeResourceDefinitionControllerStatus `json:"controllers"`
}

A CompositeResourceDefinitionStatus represents the observed state of a composite resource definition.

func GetCompositeResourceDefinitionStatus

func GetCompositeResourceDefinitionStatus(in extv1.CompositeResourceDefinitionStatus) *CompositeResourceDefinitionStatus

GetCompositeResourceDefinitionStatus from the supplied Crossplane status.

func (CompositeResourceDefinitionStatus) IsConditionedStatus

func (CompositeResourceDefinitionStatus) IsConditionedStatus()

type CompositeResourceDefinitionVersion

type CompositeResourceDefinitionVersion struct {
	// Name of this version, e.g. “v1”, “v2beta1”, etc. Composite resources are
	// served under this version at `/apis/<group>/<version>/...` if `served` is
	// true.
	Name string `json:"name"`
	// Referenceable specifies that this version may be referenced by a Composition
	// in order to configure which resources an XR may be composed of. Exactly one
	// version must be marked as referenceable; all Compositions must target only the
	// referenceable version. The referenceable version must be served.
	Referenceable bool `json:"referenceable"`
	// Served specifies that this version should be served via Kubernetes REST APIs.
	Served bool `json:"served"`
	// Schema describes the schema used for validation, pruning, and defaulting of
	// this version of the defined composite resource. Fields required by all
	// composite resources are injected into this schema automatically, and override
	// equivalently named fields in this schema.
	Schema *CompositeResourceValidation `json:"schema"`
}

A CompositeResourceDefinitionVersion describes a version of a composite resource.

func GetCompositeResourceDefinitionVersions

func GetCompositeResourceDefinitionVersions(in []extv1.CompositeResourceDefinitionVersion) []CompositeResourceDefinitionVersion

GetCompositeResourceDefinitionVersions from the supplied Kubernetes versions.

type CompositeResourceSpec

type CompositeResourceSpec struct {
	CompositionSelector *LabelSelector `json:"compositionSelector"`

	CompositionReference              *corev1.ObjectReference
	ClaimReference                    *corev1.ObjectReference
	ResourceReferences                []corev1.ObjectReference
	WritesConnectionSecretToReference *xpv1.SecretReference
}

A CompositeResourceSpec defines the desired state of a composite resource.

type CompositeResourceStatus

type CompositeResourceStatus struct {
	// The observed condition of this resource.
	Conditions []Condition `json:"conditions"`
	// The status of this composite resource's connection details.
	ConnectionDetails *CompositeResourceConnectionDetails `json:"connectionDetails"`
}

A CompositeResourceClaimStatus represents the observed state of a composite resource.

func GetCompositeResourceStatus

func GetCompositeResourceStatus(xr *unstructured.Composite) *CompositeResourceStatus

GetCompositeResourceStatus from the supplied Crossplane composite.

func (CompositeResourceStatus) IsConditionedStatus

func (CompositeResourceStatus) IsConditionedStatus()

type CompositeResourceValidation

type CompositeResourceValidation struct {
	// OpenAPIV3Schema is the OpenAPI v3 schema to use for validation and pruning.
	OpenAPIV3Schema []byte `json:"openAPIV3Schema"`
}

A CompositeResourceValidation is a list of validation methods for a composite resource.

type Composition

type Composition struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`
	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`
	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`
	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`
	// The desired state of this resource.
	Spec *CompositionSpec `json:"spec"`
	// The observed state of this resource.
	Status *CompositionStatus `json:"status"`
	// An unstructured JSON representation of the underlying Kubernetes resource.
	Unstructured []byte `json:"unstructured"`
	// Events pertaining to this resource.
	Events *EventConnection `json:"events"`
}

A Composition defines the group of resources to be created when a compatible type of composite resource is created with reference to the composition.

func GetComposition

func GetComposition(cmp *extv1.Composition) Composition

GetComposition from the supplied Crossplane Composition.

func (Composition) IsKubernetesResource

func (Composition) IsKubernetesResource()

func (Composition) IsNode

func (Composition) IsNode()

type CompositionConnection

type CompositionConnection struct {
	// Connected nodes.
	Nodes []Composition `json:"nodes"`
	// The total number of connected nodes.
	TotalCount int `json:"totalCount"`
}

A CompositionConnection represents a connection to compositions.

func (*CompositionConnection) Len

func (c *CompositionConnection) Len() int

func (*CompositionConnection) Less

func (c *CompositionConnection) Less(i, j int) bool

func (*CompositionConnection) Swap

func (c *CompositionConnection) Swap(i, j int)

type CompositionSpec

type CompositionSpec struct {
	// CompositeTypeRef specifies the type of composite resource that this
	// composition is compatible with.
	CompositeTypeRef *TypeReference `json:"compositeTypeRef"`
	// WriteConnectionSecretsToNamespace specifies the namespace in which the
	// connection secrets of composite resource dynamically provisioned using this
	// composition will be created.
	WriteConnectionSecretsToNamespace *string `json:"writeConnectionSecretsToNamespace"`
}

A CompositionSpec represents the desired state of a composition.

type CompositionStatus

type CompositionStatus struct {
	// The observed condition of this resource.
	Conditions []Condition `json:"conditions"`
}

A CompositionStatus represents the observed state of a composition.

func GetCompositionStatus

func GetCompositionStatus(in extv1.CompositionStatus) *CompositionStatus

GetCompositionStatus from the supplied Crossplane status.

func (CompositionStatus) IsConditionedStatus

func (CompositionStatus) IsConditionedStatus()

type Condition

type Condition struct {
	// Type of this condition. At most one of each condition type may apply to a
	// resource at any point in time.
	Type string `json:"type"`
	// Status of this condition; is it currently True, False, or Unknown?
	Status ConditionStatus `json:"status"`
	// LastTransitionTime is the last time this condition transitioned from one
	// status to another.
	LastTransitionTime time.Time `json:"lastTransitionTime"`
	// A Reason for this condition's last transition from one status to another.
	Reason string `json:"reason"`
	// A Message containing details about this condition's last transition from one
	// status to another, if any.
	Message *string `json:"message"`
}

A condition that may apply to a resource.

Note that type and reason are intentionally not enums; Crossplane does not limit the allowed values at the API level.

func GetConditions

func GetConditions(in []xpv1.Condition) []Condition

GetConditions from the supplied Crossplane conditions.

func GetCustomResourceDefinitionConditions

func GetCustomResourceDefinitionConditions(in []kextv1.CustomResourceDefinitionCondition) []Condition

GetCustomResourceDefinitionConditions from the supplied Kubernetes CRD conditions.

type ConditionStatus

type ConditionStatus string

A ConditionStatus represensts the status of a condition.

const (
	// The status of the condition is unknown.
	ConditionStatusUnknown ConditionStatus = "UNKNOWN"
	// The condition is false.
	ConditionStatusFalse ConditionStatus = "FALSE"
	// The condition is true.
	ConditionStatusTrue ConditionStatus = "TRUE"
)

func GetConditionStatus

func GetConditionStatus(s corev1.ConditionStatus) ConditionStatus

GetConditionStatus from the supplied Crossplane status.

func (ConditionStatus) IsValid

func (e ConditionStatus) IsValid() bool

func (ConditionStatus) MarshalGQL

func (e ConditionStatus) MarshalGQL(w io.Writer)

func (ConditionStatus) String

func (e ConditionStatus) String() string

func (*ConditionStatus) UnmarshalGQL

func (e *ConditionStatus) UnmarshalGQL(v interface{}) error

type ConditionedStatus

type ConditionedStatus interface {
	IsConditionedStatus()
}

A ConditionedStatus represents the observed state of a Kubernetes resource that exposes status conditions.

type ConfigMap

type ConfigMap struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`

	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`

	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`

	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`

	// An unstructured JSON representation of the underlying Kubernetes
	// resource.
	Unstructured []byte `json:"raw"`

	// Events pertaining to this resource.
	Events *EventConnection `json:"events"`
	// contains filtered or unexported fields
}

A ConfigMap holds configuration data.

func GetConfigMap

func GetConfigMap(cm *corev1.ConfigMap) ConfigMap

GetConfigMap from the supplied Kubernetes ConfigMap.

func (*ConfigMap) Data

func (cm *ConfigMap) Data(keys []string) map[string]string

Data of this config map.

func (ConfigMap) IsKubernetesResource

func (ConfigMap) IsKubernetesResource()

IsKubernetesResource indicates that a ConfigMap satisfies the GraphQL IsKubernetesResource interface.

func (ConfigMap) IsNode

func (ConfigMap) IsNode()

IsNode indicates that a ConfigMap satisfies the GraphQL Node interface.

type Configuration

type Configuration struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`
	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`
	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`
	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`
	// The desired state of this resource.
	Spec *ConfigurationSpec `json:"spec"`
	// The observed state of this resource.
	Status *ConfigurationStatus `json:"status"`
	// An unstructured JSON representation of the underlying Kubernetes resource.
	Unstructured []byte `json:"unstructured"`
	// Events pertaining to this resource.
	Events *EventConnection `json:"events"`
	// Revisions of this configuration.
	Revisions *ConfigurationRevisionConnection `json:"revisions"`
	// The active revision of this configuration.
	ActiveRevision *ConfigurationRevision `json:"activeRevision"`
}

A Configuration extends Crossplane with support for new composite resources.

func GetConfiguration

func GetConfiguration(c *pkgv1.Configuration) Configuration

GetConfiguration from the supplied Kubernetes configuration.

func (Configuration) IsKubernetesResource

func (Configuration) IsKubernetesResource()

func (Configuration) IsNode

func (Configuration) IsNode()

type ConfigurationConnection

type ConfigurationConnection struct {
	// Connected nodes.
	Nodes []Configuration `json:"nodes"`
	// The total number of connected nodes.
	TotalCount int `json:"totalCount"`
}

A ConfigurationConnection represents a connection to configurations.

func (*ConfigurationConnection) Len

func (c *ConfigurationConnection) Len() int

func (*ConfigurationConnection) Less

func (c *ConfigurationConnection) Less(i, j int) bool

func (*ConfigurationConnection) Swap

func (c *ConfigurationConnection) Swap(i, j int)

type ConfigurationRevision

type ConfigurationRevision struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`
	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`
	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`
	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`
	// The desired state of this resource.
	Spec *ConfigurationRevisionSpec `json:"spec"`
	// The observed state of this resource.
	Status *ConfigurationRevisionStatus `json:"status"`
	// An unstructured JSON representation of the underlying Kubernetes resource.
	Unstructured []byte `json:"unstructured"`
	// Events pertaining to this resource.
	Events *EventConnection `json:"events"`
}

A ConfigurationRevision represents a revision or 'version' of a configuration.

func GetConfigurationRevision

func GetConfigurationRevision(cr *pkgv1.ConfigurationRevision) ConfigurationRevision

GetConfigurationRevision from the supplied Kubernetes provider revision.

func (ConfigurationRevision) IsKubernetesResource

func (ConfigurationRevision) IsKubernetesResource()

func (ConfigurationRevision) IsNode

func (ConfigurationRevision) IsNode()

type ConfigurationRevisionConnection

type ConfigurationRevisionConnection struct {
	// Connected nodes.
	Nodes []ConfigurationRevision `json:"nodes"`
	// The total number of connected nodes.
	TotalCount int `json:"totalCount"`
}

A ConfigurationRevisionConnection represents a connection to configuration revisions.

func (*ConfigurationRevisionConnection) Len

func (*ConfigurationRevisionConnection) Less

func (*ConfigurationRevisionConnection) Swap

func (c *ConfigurationRevisionConnection) Swap(i, j int)

type ConfigurationRevisionSpec

type ConfigurationRevisionSpec struct {
	// Desired state of the configuration revision.
	DesiredState PackageRevisionDesiredState `json:"desiredState"`
	// Package image used by the install pod to extract package contents.
	Package string `json:"package"`
	// PackagePullPolicy defines the pull policy for the package..
	PackagePullPolicy *PackagePullPolicy `json:"packagePullPolicy"`
	// Revision number. Indicates when the revision will be garbage collected based
	// on the configuration's RevisionHistoryLimit.
	Revision int `json:"revision"`
	// IgnoreCrossplaneConstraints indicates to the package manager whether to honor
	// Crossplane version constrains specified by the package.
	IgnoreCrossplaneConstraints *bool `json:"ignoreCrossplaneConstraints"`
	// SkipDependencyResolution indicates to the package manager whether to skip
	// resolving dependencies for a package.
	SkipDependencyResolution *bool `json:"skipDependencyResolution"`
}

A ConfigurationRevisionSpec represents the desired state of a configuration revision.

type ConfigurationRevisionStatus

type ConfigurationRevisionStatus struct {
	Conditions            []Condition  `json:"conditions"`
	FoundDependencies     *int         `json:"foundDependencies"`
	InstalledDependencies *int         `json:"installedDependencies"`
	InvalidDependencies   *int         `json:"invalidDependencies"`
	PermissionRequests    []PolicyRule `json:"permissionRequests"`

	ObjectRefs []xpv1.TypedReference
}

A ConfigurationRevisionStatus reflects the observed state of a ConfigurationRevision.

func GetConfigurationRevisionStatus

func GetConfigurationRevisionStatus(in pkgv1.PackageRevisionStatus) *ConfigurationRevisionStatus

GetConfigurationRevisionStatus from the supplied Crossplane provider revision.

func (ConfigurationRevisionStatus) IsConditionedStatus

func (ConfigurationRevisionStatus) IsConditionedStatus()

IsConditionedStatus indicates that ConfigurationRevisionStatus satisfies the KubernetesResource GraphQL (and corresponding Go) interface.

type ConfigurationSpec

type ConfigurationSpec struct {
	// The name of the configuration package to pull from an OCI registry.
	Package string `json:"package"`
	// RevisionActivationPolicy specifies how the package controller should update
	// from one revision to the next.
	RevisionActivationPolicy *RevisionActivationPolicy `json:"revisionActivationPolicy"`
	// RevisionHistoryLimit dictates how the package controller cleans up old
	// inactive package revisions. Defaults to 1. Can be disabled by explicitly
	// setting to 0.
	RevisionHistoryLimit *int `json:"revisionHistoryLimit"`
	// PackagePullPolicy defines the pull policy for the package.
	PackagePullPolicy *PackagePullPolicy `json:"packagePullPolicy"`
	// IgnoreCrossplaneConstraints indicates to the package manager whether to honor
	// Crossplane version constraints specified by the package.
	IgnoreCrossplaneConstraints *bool `json:"ignoreCrossplaneConstraints"`
	// SkipDependencyResolution indicates to the package manager whether to skip
	// resolving dependencies for a package.
	SkipDependencyResolution *bool `json:"skipDependencyResolution"`
}

A ConfigurationSpec represents the desired state of a configuration.

type ConfigurationStatus

type ConfigurationStatus struct {
	// The observed condition of this resource.
	Conditions []Condition `json:"conditions"`
	// CurrentRevision is the name of the current package revision. It will reflect
	// the most up to date revision, whether it has been activated or not.
	CurrentRevision *string `json:"currentRevision"`
	// CurrentIdentifier is the most recent package source that was used to produce a
	// revision. The package manager uses this field to determine whether to check
	// for package updates for a given source when packagePullPolicy is set to
	// IfNotPresent.
	CurrentIdentifier *string `json:"currentIdentifier"`
}

A ConfigurationRevisionStatus represents the observed state of a configuration.

func GetConfigurationStatus

func GetConfigurationStatus(in pkgv1.ConfigurationStatus) *ConfigurationStatus

GetConfigurationStatus from the supplied Kubernetes status.

func (ConfigurationStatus) IsConditionedStatus

func (ConfigurationStatus) IsConditionedStatus()

type CreateKubernetesResourceInput

type CreateKubernetesResourceInput struct {
	// The Kubernetes resource to be created, as raw JSON.
	Unstructured []byte `json:"unstructured"`
	// Patches that should be applied to the Kubernetes resource before creation.
	Patches []Patch `json:"patches"`
}

CreateKubernetesResourceInput is the input required to create a Kubernetes resource.

type CreateKubernetesResourcePayload

type CreateKubernetesResourcePayload struct {
	// The created Kubernetes resource. Null if the create failed.
	Resource KubernetesResource `json:"resource"`
}

CreateKubernetesResourcePayload is the result of creating a Kubernetes resource.

type CustomResourceDefinition

type CustomResourceDefinition struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`
	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`
	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`
	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`
	// The desired state of this resource.
	Spec *CustomResourceDefinitionSpec `json:"spec"`
	// The observed state of this resource.
	Status *CustomResourceDefinitionStatus `json:"status"`
	// An unstructured JSON representation of the underlying Kubernetes resource.
	Unstructured []byte `json:"unstructured"`
	// Events pertaining to this resource.
	Events *EventConnection `json:"events"`
	// Custom resources defined by this CRD
	DefinedResources *KubernetesResourceConnection `json:"definedResources"`
}

A CustomResourceDefinition defines a type of custom resource that extends the set of resources supported by the Kubernetes API.

func GetCustomResourceDefinition

func GetCustomResourceDefinition(crd *kextv1.CustomResourceDefinition) CustomResourceDefinition

GetCustomResourceDefinition from the suppled Kubernetes CRD.

func (CustomResourceDefinition) IsKubernetesResource

func (CustomResourceDefinition) IsKubernetesResource()

func (CustomResourceDefinition) IsManagedResourceDefinition

func (CustomResourceDefinition) IsManagedResourceDefinition()

func (CustomResourceDefinition) IsNode

func (CustomResourceDefinition) IsNode()

func (CustomResourceDefinition) IsProviderConfigDefinition

func (CustomResourceDefinition) IsProviderConfigDefinition()

type CustomResourceDefinitionConnection

type CustomResourceDefinitionConnection struct {
	// Connected nodes.
	Nodes []CustomResourceDefinition `json:"nodes"`
	// The total number of connected nodes.
	TotalCount int `json:"totalCount"`
}

A CustomResourceDefinitionConnection represents a connection to custom resource definitions (CRDs).

func (*CustomResourceDefinitionConnection) Len

func (*CustomResourceDefinitionConnection) Less

func (*CustomResourceDefinitionConnection) Swap

type CustomResourceDefinitionNames

type CustomResourceDefinitionNames struct {
	// The plural name of the resource to serve. Custom resources are served by
	//  the Kuberntes API under `/apis/<group>/<version>/.../<plural>`.
	Plural string `json:"plural"`
	// The singular name of the resource.
	Singular *string `json:"singular"`
	// Short names for the resource, exposed in API discovery documents, and used by
	// clients to support invocations like `kubectl get <shortname>`.
	ShortNames []string `json:"shortNames"`
	// The Kubernetes API kind of the defined resource.
	Kind string `json:"kind"`
	// The Kubernetes API kind of a list of the defined resource.
	ListKind *string `json:"listKind"`
	// A list of grouped resources this custom resource belongs to (e.g. 'all'). This
	// is published in API discovery documents, and used by clients to support
	// invocations like `kubectl get all`.
	Categories []string `json:"categories"`
}

CustomResourceDefinitionNames specifies the resource and kind names of the defined custom resource.

func GetCustomResourceDefinitionNames

func GetCustomResourceDefinitionNames(in kextv1.CustomResourceDefinitionNames) *CustomResourceDefinitionNames

GetCustomResourceDefinitionNames from the supplied Kubernetes names.

type CustomResourceDefinitionSpec

type CustomResourceDefinitionSpec struct {
	// Group specifies the API group of the defined custom resource. Custom resources
	// are served under `/apis/<group>/...`. Must match the name of the CRD (in the
	// form `<names.plural>.<group>`).
	Group string `json:"group"`
	// Names specifies the resource and kind names of the defined custom resource.
	Names *CustomResourceDefinitionNames `json:"names"`
	// Scope of the defined custom resource.
	Scope ResourceScope `json:"scope"`
	// Versions is the list of all API versions of the defined custom resource.
	// Version names are used to compute the order in which served versions are
	// listed in API discovery. If the version string is "kube-like", it will sort
	// above non "kube-like" version strings, which are ordered lexicographically.
	// "Kube-like" versions start with a "v", then are followed by a number (the
	// major version), then optionally the string "alpha" or "beta" and another
	// number (the minor version). These are sorted first by GA > beta > alpha (where
	// GA is a version with no suffix such as beta or alpha), and then by comparing
	// major version, then minor version. An example sorted list of versions: v10,
	// v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
	Versions []CustomResourceDefinitionVersion `json:"versions"`
}

A CustomResourceDefinitionSpec represents the desired state of a custom resource definition.

type CustomResourceDefinitionStatus

type CustomResourceDefinitionStatus struct {
	// The observed condition of this resource.
	Conditions []Condition `json:"conditions"`
}

A CustomResourceDefinitionStatus represents the observed state of a custom resource definition.

func GetCustomResourceDefinitionStatus

func GetCustomResourceDefinitionStatus(in kextv1.CustomResourceDefinitionStatus) *CustomResourceDefinitionStatus

GetCustomResourceDefinitionStatus from the supplied Crossplane status.

func (CustomResourceDefinitionStatus) IsConditionedStatus

func (CustomResourceDefinitionStatus) IsConditionedStatus()

type CustomResourceDefinitionVersion

type CustomResourceDefinitionVersion struct {
	// Name of this version, e.g. “v1”, “v2beta1”, etc. Custom resources are served
	// under this version at `/apis/<group>/<version>/...` if `served` istrue.
	Name string `json:"name"`
	// Served specifies that this version should be served via Kubernetes REST APIs.
	Served bool `json:"served"`
	// Schema describes the schema used for validation, pruning, and defaulting of
	// this version of the defined custom resource.
	Schema *CustomResourceValidation `json:"schema"`
}

A CustomResourceDefinitionVersion describes a version of a custom resource.

func GetCustomResourceDefinitionVersions

func GetCustomResourceDefinitionVersions(in []kextv1.CustomResourceDefinitionVersion) []CustomResourceDefinitionVersion

GetCustomResourceDefinitionVersions from the supplied Kubernetes versions.

type CustomResourceValidation

type CustomResourceValidation struct {
	// OpenAPIV3Schema is the OpenAPI v3 schema to use for validation and pruning.
	OpenAPIV3Schema []byte `json:"openAPIV3Schema"`
}

A CustomResourceValidation is a list of validation methods for a custom resource.

type DeleteKubernetesResourcePayload

type DeleteKubernetesResourcePayload struct {
	// The deleted Kubernetes resource. Null if the delete failed.
	Resource KubernetesResource `json:"resource"`
}

DeleteKubernetesResourcePayload is the result of deleting a Kubernetes resource.

type DeletionPolicy

type DeletionPolicy string

A DeletionPolicy specifies what will happen to the underlying external resource when this managed resource is deleted - either "Delete" or "Orphan" the external resource.

const (
	// Delete the resource from the external system when the managed resource is
	// deleted.
	DeletionPolicyDelete DeletionPolicy = "DELETE"
	// Leave the resource in the external system when the managed resource is
	// deleted.
	DeletionPolicyOrphan DeletionPolicy = "ORPHAN"
)

func GetDeletionPolicy

func GetDeletionPolicy(p xpv1.DeletionPolicy) *DeletionPolicy

GetDeletionPolicy from the supplied Crossplane policy.

func (DeletionPolicy) IsValid

func (e DeletionPolicy) IsValid() bool

func (DeletionPolicy) MarshalGQL

func (e DeletionPolicy) MarshalGQL(w io.Writer)

func (DeletionPolicy) String

func (e DeletionPolicy) String() string

func (*DeletionPolicy) UnmarshalGQL

func (e *DeletionPolicy) UnmarshalGQL(v interface{}) error

type Event

type Event struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`

	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`

	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`

	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`

	// The type of event.
	Type *EventType `json:"type"`

	// The reason the event was emitted.
	Reason *string `json:"reason"`

	// Details about the event, if any.
	Message *string `json:"message"`

	// The source of the event - e.g. a controller.
	Source *EventSource `json:"source"`

	// The number of times this event has occurred.
	Count *int `json:"count"`

	// The time at which this event was first recorded.
	FirstTime *time.Time `json:"firstTime"`

	// The time at which this event was most recently recorded.
	LastTime *time.Time `json:"lastTime"`

	// An unstructured JSON representation of the event.
	Unstructured []byte `json:"raw"`

	InvolvedObjectRef corev1.ObjectReference
}

An Event pertaining to a Kubernetes resource.

func GetEvent

func GetEvent(e *corev1.Event) Event

GetEvent from the supplied Kubernetes event.

func (Event) IsNode

func (Event) IsNode()

IsNode indicates that an Event satisfies the GraphQL node interface.

type EventConnection

type EventConnection struct {
	// Connected nodes.
	Nodes []Event `json:"nodes"`
	// The total number of connected nodes.
	TotalCount int `json:"totalCount"`
}

An EventConnection represents a connection to events.

func (*EventConnection) Len

func (c *EventConnection) Len() int

func (*EventConnection) Less

func (c *EventConnection) Less(i, j int) bool

func (*EventConnection) Swap

func (c *EventConnection) Swap(i, j int)

type EventSource

type EventSource struct {
	// The software component that emitted the event.
	Component *string `json:"component"`
}

An EventSource is the source of an event. Note that in this context 'source' indicates the software or system that emitted the event, not the Kubernetes resource it pertains to.

type EventType

type EventType string

An EventType indicates the type of an event.

const (
	// A normal, informational event.
	EventTypeNormal EventType = "NORMAL"
	// A warning that something suboptimal has occurred.
	EventTypeWarning EventType = "WARNING"
)

func GetEventType

func GetEventType(in string) *EventType

GetEventType from the supplied Kubernetes event type.

func (EventType) IsValid

func (e EventType) IsValid() bool

func (EventType) MarshalGQL

func (e EventType) MarshalGQL(w io.Writer)

func (EventType) String

func (e EventType) String() string

func (*EventType) UnmarshalGQL

func (e *EventType) UnmarshalGQL(v interface{}) error

type GenericResource

type GenericResource struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`
	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`
	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`
	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`
	// An unstructured JSON representation of the underlying Kubernetes resource.
	Unstructured []byte `json:"unstructured"`
	// Events pertaining to this resource.
	Events *EventConnection `json:"events"`
}

A GenericResource represents a kind of Kubernetes resource that does not correspond to a kind or class of resources that is more specifically modelled by xgql.

func GetGenericResource

func GetGenericResource(u *kunstructured.Unstructured) GenericResource

GetGenericResource from the suppled Kubernetes resource.

func (GenericResource) IsKubernetesResource

func (GenericResource) IsKubernetesResource()

func (GenericResource) IsNode

func (GenericResource) IsNode()

type KubernetesResource

type KubernetesResource interface {
	IsKubernetesResource()
}

An object that corresponds to a Kubernetes API resource.

func GetKubernetesResource

func GetKubernetesResource(u *kunstructured.Unstructured) (KubernetesResource, error)

GetKubernetesResource from the supplied unstructured Kubernetes resource. GetKubernetesResource attempts to determine what type of resource the unstructured data contains (e.g. a managed resource, a provider, etc) and return the appropriate model type. If no type can be detected it returns a GenericResource.

type KubernetesResourceConnection

type KubernetesResourceConnection struct {
	// Connected nodes.
	Nodes []KubernetesResource `json:"nodes"`
	// The total number of connected nodes.
	TotalCount int `json:"totalCount"`
}

A KubernetesResourceConnection represents a connection to Kubernetes resources.

func (*KubernetesResourceConnection) Len

func (*KubernetesResourceConnection) Less

func (c *KubernetesResourceConnection) Less(i, j int) bool

func (*KubernetesResourceConnection) Swap

func (c *KubernetesResourceConnection) Swap(i, j int)

type LabelSelector

type LabelSelector struct {
	// The labels to match on.
	MatchLabels map[string]string `json:"matchLabels"`
}

A LabelSelector matches a Kubernetes resource by labels.

func GetLabelSelector

func GetLabelSelector(s *metav1.LabelSelector) *LabelSelector

GetLabelSelector from the supplied Kubernetes label selector

type ManagedResource

type ManagedResource struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`
	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`
	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`
	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`
	// The desired state of this resource.
	Spec *ManagedResourceSpec `json:"spec"`
	// The observed state of this resource.
	Status *ManagedResourceStatus `json:"status"`
	// An unstructured JSON representation of the underlying Kubernetes resource.
	Unstructured []byte `json:"unstructured"`
	// Events pertaining to this resource.
	Events *EventConnection `json:"events"`
	// The definition of this resource.
	Definition ManagedResourceDefinition `json:"definition"`
}

A ManagedResource is a Kubernetes API representation of a resource in an external system, such as a cloud provider's API. Crossplane providers add support for new kinds of managed resource.

func GetManagedResource

func GetManagedResource(u *kunstructured.Unstructured) ManagedResource

GetManagedResource from the supplied Crossplane resource.

func (ManagedResource) IsKubernetesResource

func (ManagedResource) IsKubernetesResource()

func (ManagedResource) IsNode

func (ManagedResource) IsNode()

type ManagedResourceDefinition

type ManagedResourceDefinition interface {
	IsManagedResourceDefinition()
}

A ManagedResourceDefinition defines a managed resource.

At the time of writing a ManagedResourceDefinition will always be a CustomResourceDefinition. We use a union because this may change in future per https://github.com/crossplane/crossplane/issues/2262

type ManagedResourceSpec

type ManagedResourceSpec struct {
	ProviderConfigRef *ProviderConfigReference `json:"providerConfigRef"`
	DeletionPolicy    *DeletionPolicy          `json:"deletionPolicy"`

	WritesConnectionSecretToReference *xpv1.SecretReference
}

A ManagedResourceSpec specifies the desired state of a managed resource.

type ManagedResourceStatus

type ManagedResourceStatus struct {
	// The observed condition of this resource.
	Conditions []Condition `json:"conditions"`
}

A ManagedResourceStatus represents the observed state of a managed resource.

func GetManagedResourceStatus

func GetManagedResourceStatus(in *unstructured.Managed) *ManagedResourceStatus

GetManagedResourceStatus from the supplied Crossplane resource.

func (ManagedResourceStatus) IsConditionedStatus

func (ManagedResourceStatus) IsConditionedStatus()

type Node

type Node interface {
	IsNode()
}

An object with an ID.

type ObjectMeta

type ObjectMeta struct {
	Name            string     `json:"name"`
	GenerateName    *string    `json:"generateName"`
	Namespace       *string    `json:"namespace"`
	UID             string     `json:"uid"`
	ResourceVersion string     `json:"resourceVersion"`
	Generation      int        `json:"generation"`
	CreationTime    time.Time  `json:"creationTime"`
	DeletionTime    *time.Time `json:"deletionTime"`

	OwnerReferences []metav1.OwnerReference
	// contains filtered or unexported fields
}

ObjectMeta that is common to all Kubernetes objects.

func GetObjectMeta

func GetObjectMeta(m metav1.Object) *ObjectMeta

GetObjectMeta from the supplied Kubernetes object.

func (*ObjectMeta) Annotations

func (om *ObjectMeta) Annotations(keys []string) map[string]string

Annotations this ObjectMeta contains.

func (*ObjectMeta) Labels

func (om *ObjectMeta) Labels(keys []string) map[string]string

Labels this ObjectMeta contains.

type Owner

type Owner struct {
	// The owner.
	Resource KubernetesResource `json:"resource"`
	// Whether the owner is the controller of the owned Kubernetes resource.
	Controller *bool `json:"controller"`
}

An owner of a Kubernetes resource.

type OwnerConnection

type OwnerConnection struct {
	// Connected nodes.
	Nodes []Owner `json:"nodes"`
	// The total number of connected nodes.
	TotalCount int `json:"totalCount"`
}

An OwnerConnection represents a connection to an owner.

type PackagePullPolicy

type PackagePullPolicy string

A PackagePullPolicy represents when to pull a package OCI image from a registry.

const (
	// Always pull the package image, even if it is already present.
	PackagePullPolicyAlways PackagePullPolicy = "ALWAYS"
	// Never pull the package image.
	PackagePullPolicyNever PackagePullPolicy = "NEVER"
	// Only pull the package image if it is not present.
	PackagePullPolicyIfNotPresent PackagePullPolicy = "IF_NOT_PRESENT"
)

func GetPackagePullPolicy

func GetPackagePullPolicy(in *corev1.PullPolicy) *PackagePullPolicy

GetPackagePullPolicy from the supplied Kubernetes policy.

func (PackagePullPolicy) IsValid

func (e PackagePullPolicy) IsValid() bool

func (PackagePullPolicy) MarshalGQL

func (e PackagePullPolicy) MarshalGQL(w io.Writer)

func (PackagePullPolicy) String

func (e PackagePullPolicy) String() string

func (*PackagePullPolicy) UnmarshalGQL

func (e *PackagePullPolicy) UnmarshalGQL(v interface{}) error

type PackageRevisionDesiredState

type PackageRevisionDesiredState string

A PackageRevisionDesiredState represents the desired state of a provider or configuration revision.

const (
	// The revision should be inactive.
	PackageRevisionDesiredStateInactive PackageRevisionDesiredState = "INACTIVE"
	// The revision should be active.
	PackageRevisionDesiredStateActive PackageRevisionDesiredState = "ACTIVE"
)

func GetPackageRevisionDesiredState

func GetPackageRevisionDesiredState(in pkgv1.PackageRevisionDesiredState) PackageRevisionDesiredState

GetPackageRevisionDesiredState from the supplies Crossplane state.

func (PackageRevisionDesiredState) IsValid

func (e PackageRevisionDesiredState) IsValid() bool

func (PackageRevisionDesiredState) MarshalGQL

func (e PackageRevisionDesiredState) MarshalGQL(w io.Writer)

func (PackageRevisionDesiredState) String

func (*PackageRevisionDesiredState) UnmarshalGQL

func (e *PackageRevisionDesiredState) UnmarshalGQL(v interface{}) error

type Patch

type Patch struct {
	// A field path references a field within a Kubernetes object via a simple
	// string. API conventions describe the syntax as "standard JavaScript syntax for
	// accessing that field, assuming the JSON object was transformed into a
	// JavaScript object, without the leading dot, such as metadata.name".
	//
	// Valid examples:
	//
	// * metadata.name
	// * spec.containers[0].name
	// * data[.config.yml]
	// * metadata.annotations['crossplane.io/external-name']
	// * spec.items[0][8]
	// * apiVersion
	// * [42]
	//
	// Invalid examples:
	//
	// * .metadata.name - Leading period.
	// * metadata..name - Double period.
	// * metadata.name. - Trailing period.
	// * spec.containers[] - Empty brackets.
	// * spec.containers.[0].name - Period before open bracket.
	//
	// https://github.com/kubernetes/community/blob/61f3d0/contributors/devel/sig-architecture/api-conventions.md#selecting-fields
	FieldPath string `json:"fieldPath"`
	// Unstructured JSON to be patched in at the suppled field path. This could be a
	// string, an object, or any other valid JSON.
	Unstructured []byte `json:"unstructured"`
}

A Patch that should be applied to an unstructured input before it is submitted.

type PolicyRule

type PolicyRule struct {
	// Verbs is a list of verbs that apply to ALL the resources specified by this
	// rule. '*' represents all verbs.
	Verbs []string `json:"verbs"`
	// APIGroups is the name of the APIGroup that contains the resources. If multiple
	// API groups are specified, any action requested against one of the enumerated
	// resources in any API group will be allowed.
	APIGroups []string `json:"apiGroups"`
	// Resources is a list of resources this rule applies to. '*' represents all
	// resources.
	Resources []string `json:"resources"`
	// ResourceNames is a list of names that the rule applies to. An empty set means
	// that everything is allowed.
	ResourceNames []string `json:"resourceNames"`
	// NonResourceURLs is a set of partial urls that a user should have access to.
	// '*' is allowed, but only as the full, final step in the path. Rules can either
	// apply to API resources (such as "pods" or "secrets") or non-resource URL paths
	// (such as "/api"),  but not both.
	NonResourceURLs []string `json:"nonResourceURLs"`
}

A PolicyRule holds information that describes a KubernetesRBAC policy rule.

func GetPolicyRules

func GetPolicyRules(in []rbacv1.PolicyRule) []PolicyRule

GetPolicyRules from the supplied Kubernetes policy rules.

type Provider

type Provider struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`
	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`
	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`
	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`
	// The desired state of this resource.
	Spec *ProviderSpec `json:"spec"`
	// The observed state of this resource.
	Status *ProviderStatus `json:"status"`
	// An unstructured JSON representation of the underlying Kubernetes resource.
	Unstructured []byte `json:"unstructured"`
	// Events pertaining to this resource.
	Events *EventConnection `json:"events"`
	// Revisions of this provider.
	Revisions *ProviderRevisionConnection `json:"revisions"`
	// The active revision of this provider.
	ActiveRevision *ProviderRevision `json:"activeRevision"`
}

A Provider extends Crossplane with support for new managed resources.

func GetProvider

func GetProvider(p *pkgv1.Provider) Provider

GetProvider from the supplied Kubernetes provider.

func (Provider) IsKubernetesResource

func (Provider) IsKubernetesResource()

func (Provider) IsNode

func (Provider) IsNode()

type ProviderConfig

type ProviderConfig struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`
	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`
	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`
	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`
	// The observed state of this resource.
	Status *ProviderConfigStatus `json:"status"`
	// An unstructured JSON representation of the underlying Kubernetes resource.
	Unstructured []byte `json:"unstructured"`
	// Events pertaining to this resource.
	Events *EventConnection `json:"events"`
	// The definition of this resource.
	Definition ProviderConfigDefinition `json:"definition"`
}

A ProviderConfig configures a provider, in that it provides configuration that is relevant to all managed resources installed by a provider.

func GetProviderConfig

func GetProviderConfig(u *kunstructured.Unstructured) ProviderConfig

GetProviderConfig from the suppled Crossplane ProviderConfig.

func (ProviderConfig) IsKubernetesResource

func (ProviderConfig) IsKubernetesResource()

func (ProviderConfig) IsNode

func (ProviderConfig) IsNode()

type ProviderConfigDefinition

type ProviderConfigDefinition interface {
	IsProviderConfigDefinition()
}

A ProviderConfigDefinition defines a provider configuration.

At the time of writing a ProviderConfigDefinition will always be a CustomResourceDefinition. We use a union because this may change in future per https://github.com/crossplane/crossplane/issues/2262

type ProviderConfigReference

type ProviderConfigReference struct {
	// Name of the provider config.
	Name string `json:"name"`
}

A reference to the ProviderConfig used by a particular managed resource.

func GetProviderConfigReference

func GetProviderConfigReference(in *xpv1.Reference) *ProviderConfigReference

GetProviderConfigReference from the supplied Crossplane reference.

type ProviderConfigStatus

type ProviderConfigStatus struct {
	// The observed condition of this resource.
	Conditions []Condition `json:"conditions"`
	// The number of managed resources currently using this provider config.
	Users *int `json:"users"`
}

A ProviderConfigStatus represents the observed state of a provider config.

func GetProviderConfigStatus

func GetProviderConfigStatus(pc *unstructured.ProviderConfig) *ProviderConfigStatus

GetProviderConfigStatus from the supplied Crossplane status.

func (ProviderConfigStatus) IsConditionedStatus

func (ProviderConfigStatus) IsConditionedStatus()

type ProviderConnection

type ProviderConnection struct {
	// Connected nodes.
	Nodes []Provider `json:"nodes"`
	// The total number of connected nodes.
	TotalCount int `json:"totalCount"`
}

A ProviderConnection represents a connection to providers.

func (*ProviderConnection) Len

func (c *ProviderConnection) Len() int

func (*ProviderConnection) Less

func (c *ProviderConnection) Less(i, j int) bool

func (*ProviderConnection) Swap

func (c *ProviderConnection) Swap(i, j int)

type ProviderRevision

type ProviderRevision struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`
	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`
	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`
	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`
	// The desired state of this resource.
	Spec *ProviderRevisionSpec `json:"spec"`
	// The observed state of this resource.
	Status *ProviderRevisionStatus `json:"status"`
	// An unstructured JSON representation of the underlying Kubernetes resource.
	Unstructured []byte `json:"unstructured"`
	// Events pertaining to this resource.
	Events *EventConnection `json:"events"`
}

A ProviderRevision represents a revision or 'version' of a provider.

func GetProviderRevision

func GetProviderRevision(pr *pkgv1.ProviderRevision) ProviderRevision

GetProviderRevision from the supplied Crossplane provider revision.

func (ProviderRevision) IsKubernetesResource

func (ProviderRevision) IsKubernetesResource()

func (ProviderRevision) IsNode

func (ProviderRevision) IsNode()

type ProviderRevisionConnection

type ProviderRevisionConnection struct {
	// Connected nodes.
	Nodes []ProviderRevision `json:"nodes"`
	// The total number of connected nodes.
	TotalCount int `json:"totalCount"`
}

A ProviderRevisionConnection represents a connection to provider revisions.

func (*ProviderRevisionConnection) Len

func (*ProviderRevisionConnection) Less

func (c *ProviderRevisionConnection) Less(i, j int) bool

func (*ProviderRevisionConnection) Swap

func (c *ProviderRevisionConnection) Swap(i, j int)

type ProviderRevisionSpec

type ProviderRevisionSpec struct {
	// Desired state of the provider revision.
	DesiredState PackageRevisionDesiredState `json:"desiredState"`
	// Package image used by the install pod to extract package contents.
	Package string `json:"package"`
	// PackagePullPolicy defines the pull policy for the package. It is also applied
	// to any images pulled for the package, such as a provider's controller image.
	PackagePullPolicy *PackagePullPolicy `json:"packagePullPolicy"`
	// Revision number. Indicates when the revision will be garbage collected based
	// on the configuration's RevisionHistoryLimit.
	Revision int `json:"revision"`
	// IgnoreCrossplaneConstraints indicates to the package manager whether to honor
	// Crossplane version constrains specified by the package.
	IgnoreCrossplaneConstraints *bool `json:"ignoreCrossplaneConstraints"`
	// SkipDependencyResolution indicates to the package manager whether to skip
	// resolving dependencies for a package.
	SkipDependencyResolution *bool `json:"skipDependencyResolution"`
}

A ProviderRevisionSpec represents the desired state of a provider revision.

type ProviderRevisionStatus

type ProviderRevisionStatus struct {
	Conditions            []Condition  `json:"conditions"`
	FoundDependencies     *int         `json:"foundDependencies"`
	InstalledDependencies *int         `json:"installedDependencies"`
	InvalidDependencies   *int         `json:"invalidDependencies"`
	PermissionRequests    []PolicyRule `json:"permissionRequests"`

	ObjectRefs []xpv1.TypedReference
}

A ProviderRevisionStatus reflects the observed state of a ProviderRevision.

func GetProviderRevisionStatus

func GetProviderRevisionStatus(in pkgv1.PackageRevisionStatus) *ProviderRevisionStatus

GetProviderRevisionStatus from the supplied Crossplane provider revision.

func (ProviderRevisionStatus) IsConditionedStatus

func (ProviderRevisionStatus) IsConditionedStatus()

IsConditionedStatus indicates that ProviderRevisionStatus satisfies the KubernetesResource GraphQL (and corresponding Go) interface.

type ProviderSpec

type ProviderSpec struct {
	// The name of the provider package to pull from an OCI registry.
	Package string `json:"package"`
	// RevisionActivationPolicy specifies how the package controller should update
	// from one revision to the next.
	RevisionActivationPolicy *RevisionActivationPolicy `json:"revisionActivationPolicy"`
	// RevisionHistoryLimit dictates how the package controller cleans up old
	// inactive package revisions. Defaults to 1. Can be disabled by explicitly
	// setting to 0.
	RevisionHistoryLimit *int `json:"revisionHistoryLimit"`
	// PackagePullPolicy defines the pull policy for the package.
	PackagePullPolicy *PackagePullPolicy `json:"packagePullPolicy"`
	// IgnoreCrossplaneConstraints indicates to the package manager whether to honor
	// Crossplane version constraints specified by the package.
	IgnoreCrossplaneConstraints *bool `json:"ignoreCrossplaneConstraints"`
	// SkipDependencyResolution indicates to the package manager whether to skip
	// resolving dependencies for a package.
	SkipDependencyResolution *bool `json:"skipDependencyResolution"`
}

A ProviderSpec represents the desired state of a provider.

type ProviderStatus

type ProviderStatus struct {
	// The observed condition of this resource.
	Conditions []Condition `json:"conditions"`
	// CurrentRevision is the name of the current package revision. It will reflect
	// the most up to date revision, whether it has been activated or not.
	CurrentRevision *string `json:"currentRevision"`
	// CurrentIdentifier is the most recent package source that was used to produce a
	// revision. The package manager uses this field to determine whether to check
	// for package updates for a given source when packagePullPolicy is set to
	// IfNotPresent.
	CurrentIdentifier *string `json:"currentIdentifier"`
}

A ProviderStatus represents the observed state of a provider.

func GetProviderStatus

func GetProviderStatus(in pkgv1.ProviderStatus) *ProviderStatus

GetProviderStatus from the supplied Kubernetes status.

func (ProviderStatus) IsConditionedStatus

func (ProviderStatus) IsConditionedStatus()

type ReferenceID

type ReferenceID struct {
	APIVersion string
	Kind       string
	Namespace  string
	Name       string
}

A ReferenceID uniquely represents a Kubernetes resource in GraphQL. It encodes to a String per the documentation of its String method, but is otherwise similar to the 'Reference' types (e.g. corev1.ObjectReference) that are used to identify Kubernetes objects.

func ParseReferenceID

func ParseReferenceID(id string) (ReferenceID, error)

ParseReferenceID parses the supplied ID string.

func (ReferenceID) MarshalGQL

func (id ReferenceID) MarshalGQL(w io.Writer)

MarshalGQL marshals a ReferenceID as a string.

func (*ReferenceID) String

func (id *ReferenceID) String() string

A String representation of a ReferenceID. The idea is to store the data that uniquely identifies a resource in the Kubernetes API (a reference) such that we can extract that data from a given ID string in future. Representing this data as a string gives GraphQL clients a single, idiomatic scalar field they may consider the "primary key" of a resource.

We serialise the reference as "apiVersion|kind|namespace|name", then compress and base64 encode it. This encourages consumers to treat IDs as opaque data, and makes them relatively URL-friendly. Cluster scoped resources have an empty namespace 'field', i.e. "apiVersion|kind||name"

func (*ReferenceID) UnmarshalGQL

func (id *ReferenceID) UnmarshalGQL(v interface{}) error

UnmarshalGQL unmarshals a ReferenceID.

type ResourceScope

type ResourceScope string

ResourceScope defines the scopes available to custom resources.

const (
	// Cluster scoped resources exist outside any namespace. The combination of their
	// API version, kind, and name must be unique within a cluster.
	ResourceScopeClusterScoped ResourceScope = "CLUSTER_SCOPED"
	// Namespace scoped resources exist within a particular namespace. The
	// combination of their API version, kind, and name must be unique only within
	// their namespace.
	ResourceScopeNamespaceScoped ResourceScope = "NAMESPACE_SCOPED"
)

func GetResourceScope

func GetResourceScope(in kextv1.ResourceScope) ResourceScope

GetResourceScope from the suppled Kubernetes scope.

func (ResourceScope) IsValid

func (e ResourceScope) IsValid() bool

func (ResourceScope) MarshalGQL

func (e ResourceScope) MarshalGQL(w io.Writer)

func (ResourceScope) String

func (e ResourceScope) String() string

func (*ResourceScope) UnmarshalGQL

func (e *ResourceScope) UnmarshalGQL(v interface{}) error

type RevisionActivationPolicy

type RevisionActivationPolicy string

A RevisionActivationPolicy indicates how a provider or configuration package should activate its revisions.

const (
	// Automatically activate package revisions.
	RevisionActivationPolicyAutomatic RevisionActivationPolicy = "AUTOMATIC"
	// Require a user to manually activate revisions.
	RevisionActivationPolicyManual RevisionActivationPolicy = "MANUAL"
)

func GetRevisionActivationPolicy

func GetRevisionActivationPolicy(in *pkgv1.RevisionActivationPolicy) *RevisionActivationPolicy

GetRevisionActivationPolicy from the supplied Crossplane policy.

func (RevisionActivationPolicy) IsValid

func (e RevisionActivationPolicy) IsValid() bool

func (RevisionActivationPolicy) MarshalGQL

func (e RevisionActivationPolicy) MarshalGQL(w io.Writer)

func (RevisionActivationPolicy) String

func (e RevisionActivationPolicy) String() string

func (*RevisionActivationPolicy) UnmarshalGQL

func (e *RevisionActivationPolicy) UnmarshalGQL(v interface{}) error

type Secret

type Secret struct {
	// An opaque identifier that is unique across all types.
	ID ReferenceID `json:"id"`

	// The underlying Kubernetes API version of this resource.
	APIVersion string `json:"apiVersion"`

	// The underlying Kubernetes API kind of this resource.
	Kind string `json:"kind"`

	// Metadata that is common to all Kubernetes API resources.
	Metadata *ObjectMeta `json:"metadata"`

	// Type of this secret.
	Type *string `json:"type"`

	// An unstructured JSON representation of the underlying Kubernetes
	// resource.
	Unstructured []byte `json:"raw"`
	// contains filtered or unexported fields
}

A Secret holds secret data.

func GetSecret

func GetSecret(s *corev1.Secret) Secret

GetSecret from the suppled Kubernetes Secret

func (*Secret) Data

func (s *Secret) Data(keys []string) map[string]string

Data of this secret.

func (Secret) IsKubernetesResource

func (Secret) IsKubernetesResource()

IsKubernetesResource indicates that a Secret satisfies the GraphQL IsKubernetesResource interface.

func (Secret) IsNode

func (Secret) IsNode()

IsNode indicates that a Secret satisfies the GraphQL Node interface.

type TypeReference

type TypeReference struct {
	// The Kubernetes API version of the referenced resource.
	APIVersion string `json:"apiVersion"`
	// The Kubernetes API kind of the referenced resource.
	Kind string `json:"kind"`
}

A TypeReference references a type of Kubernetes resource by API version and kind.

type UpdateKubernetesResourceInput

type UpdateKubernetesResourceInput struct {
	// The Kubernetes resource to be updated, as raw JSON.
	Unstructured []byte `json:"unstructured"`
	// Patches that should be applied to the Kubernetes resource before updating.
	Patches []Patch `json:"patches"`
}

UpdateKubernetesResourceInput is the input required to update a Kubernetes resource.

type UpdateKubernetesResourcePayload

type UpdateKubernetesResourcePayload struct {
	// The updated Kubernetes resource. Null if the update failed.
	Resource KubernetesResource `json:"resource"`
}

UpdateKubernetesResourcePayload is the result of updating a Kubernetes resource.

Jump to

Keyboard shortcuts

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