Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions api/clusters/v1alpha1/clusterrequest_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ type ClusterRequestSpec struct {
// Purpose is the purpose of the requested cluster.
// +kubebuilder:validation:MinLength=1
Purpose string `json:"purpose"`

// WaitForClusterDeletion specifies whether the ClusterProvider should remove its finalizer from the ClusterRequest only after the corresponding Cluster has been deleted.
// 'true' means that the finalizer stays until the Cluster is gone, 'false' means that the finalizer can be removed before the Cluster has been deleted.
// If not specified, this defaults to 'true' if the cluster's tenancy is 'Exclusive' and to 'false' otherwise.
// Note that the delayed finalizer removal only occurs if the deletion of the ClusterRequest actually triggers the deletion of the Cluster.
// If the cluster is shared with further ClusterRequests using it or if it does not have the 'clusters.openmcp.cloud/delete-without-requests' label set to 'true',
// the finalizer will be removed without waiting for the Cluster deletion, independently of this setting.
// +optional
WaitForClusterDeletion *bool `json:"waitForClusterDeletion,omitempty"`
}

// +kubebuilder:validation:XValidation:rule="!has(oldSelf.cluster) || has(self.cluster)", message="cluster may not be removed once set"
Expand Down
7 changes: 6 additions & 1 deletion api/clusters/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ spec:
description: Purpose is the purpose of the requested cluster.
minLength: 1
type: string
waitForClusterDeletion:
description: |-
WaitForClusterDeletion specifies whether the ClusterProvider should remove its finalizer from the ClusterRequest only after the corresponding Cluster has been deleted.
'true' means that the finalizer stays until the Cluster is gone, 'false' means that the finalizer can be removed before the Cluster has been deleted.
If not specified, this defaults to 'true' if the cluster's tenancy is 'Exclusive' and to 'false' otherwise.
Note that the delayed finalizer removal only occurs if the deletion of the ClusterRequest actually triggers the deletion of the Cluster.
If the cluster is shared with further ClusterRequests using it or if it does not have the 'clusters.openmcp.cloud/delete-without-requests' label set to 'true',
the finalizer will be removed without waiting for the Cluster deletion, independently of this setting.
type: boolean
required:
- purpose
type: object
Expand Down
20 changes: 20 additions & 0 deletions api/crds/manifests/openmcp.cloud_serviceproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,26 @@ spec:
type: integer
phase:
type: string
resources:
description: Resources is a list of Group/Version/Kind that specifies
which service resources this provider exposes.
items:
description: |-
GroupVersionKind unambiguously identifies a kind. It doesn't anonymously include GroupVersion
to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling
properties:
group:
type: string
kind:
type: string
version:
type: string
required:
- group
- kind
- version
type: object
type: array
required:
- observedGeneration
type: object
Expand Down
6 changes: 3 additions & 3 deletions api/provider/v1alpha1/serviceprovider_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// ServiceProviderSpec defines the desired state of ServiceProvider.
type ServiceProviderSpec struct {
DeploymentSpec `json:",inline"`
Expand All @@ -32,6 +29,9 @@ type ServiceProviderSpec struct {
// ServiceProviderStatus defines the observed state of ServiceProvider.
type ServiceProviderStatus struct {
DeploymentStatus `json:",inline"`

// Resources is a list of Group/Version/Kind that specifies which service resources this provider exposes.
Resources []metav1.GroupVersionKind `json:"resources,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
5 changes: 5 additions & 0 deletions api/provider/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.