Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions api/common/reference_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package common

import (
corev1 "k8s.io/api/core/v1"
apimachinery "k8s.io/apimachinery/pkg/types"
)

// ObjectReference is a reference to an object in any namespace.
type ObjectReference apimachinery.NamespacedName

// LocalObjectReference is a reference to an object in the same namespace as the resource referencing it.
type LocalObjectReference corev1.LocalObjectReference

// SecretReference is a reference to a secret in any namespace with a key.
type SecretReference struct {
ObjectReference `json:",inline"`
// Key is the key in the secret to use.
Key string `json:"key"`
}

// LocalSecretReference is a reference to a secret in the same namespace as the resource referencing it with a key.
type LocalSecretReference struct {
LocalObjectReference `json:",inline"`
// Key is the key in the secret to use.
Key string `json:"key"`
}
25 changes: 25 additions & 0 deletions api/common/status_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package common

import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

const (
// StatusPhaseReady indicates that the resource is ready. All conditions are met and are in status "True".
StatusPhaseReady = "Ready"
// StatusPhaseProgressing indicates that the resource is not ready and being created or updated. At least one condition is not met and is in status "False".
StatusPhaseProgressing = "Progressing"
// StatusPhaseTerminating indicates that the resource is not ready and in deletion. At least one condition is not met and is in status "False".
StatusPhaseTerminating = "Terminating"
)

// Status represents the status of an openMCP resource.
type Status struct {
// ObservedGeneration is the generation of this resource that was last reconciled by the controller.
ObservedGeneration int64 `json:"observedGeneration"`

// Phase is the current phase of the resource.
Phase string `json:"phase"`

// Conditions contains the conditions.
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
}