-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add spacebindingrequest type to host and member operators (#370)
- Loading branch information
Showing
4 changed files
with
287 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
const ( | ||
// SpaceBindingRequestLabelKey is a label on the SpaceBinding, and will hold the name of the SpaceBindingRequest that created the SpaceBinding resource. | ||
SpaceBindingRequestLabelKey = LabelKeyPrefix + "spacebindingrequest" | ||
// SpaceBindingRequestNamespaceLabelKey is a label on the SpaceBinding, and will hold the namespace of the SpaceBindingRequest that created the SpaceBinding resource. | ||
SpaceBindingRequestNamespaceLabelKey = LabelKeyPrefix + "spacebindingrequest-namespace" | ||
) | ||
|
||
// SpaceBindingRequestSpec defines the desired state of SpaceBindingRequest | ||
// +k8s:openapi-gen=true | ||
type SpaceBindingRequestSpec struct { | ||
// MasterUserRecord is a required property introduced to retain the name of the MUR | ||
// for which this SpaceBinding is provisioned. | ||
MasterUserRecord string `json:"masterUserRecord"` | ||
|
||
// SpaceRole is a required property which defines the role that will be granted to the MUR in the current Space by the SpaceBinding resource. | ||
SpaceRole string `json:"spaceRole"` | ||
} | ||
|
||
// SpaceBindingRequestStatus defines the observed state of SpaceBinding | ||
// +k8s:openapi-gen=true | ||
type SpaceBindingRequestStatus struct { | ||
// Conditions is an array of SpaceBindingRequest conditions | ||
// Supported condition types: | ||
// Provisioning, SpaceBindingNotReady and Ready | ||
// +optional | ||
// +patchMergeKey=type | ||
// +patchStrategy=merge | ||
// +listType=map | ||
// +listMapKey=type | ||
Conditions []Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
|
||
// SpaceBindingRequest is the Schema for the SpaceBindingRequest API | ||
// +k8s:openapi-gen=true | ||
// +kubebuilder:resource:scope=Namespaced | ||
// +kubebuilder:printcolumn:name="MUR",type="string",JSONPath=`.spec.masterUserRecord` | ||
// +kubebuilder:printcolumn:name="SpaceRole",type="string",JSONPath=`.spec.spaceRole` | ||
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=`.status.conditions[?(@.type=="Ready")].status` | ||
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=`.status.conditions[?(@.type=="Ready")].reason` | ||
// +kubebuilder:validation:XPreserveUnknownFields | ||
// +operator-sdk:gen-csv:customresourcedefinitions.displayName="SpaceBindingRequest" | ||
type SpaceBindingRequest struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec SpaceBindingRequestSpec `json:"spec,omitempty"` | ||
Status SpaceBindingRequestStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// SpaceBindingRequestList contains a list of SpaceBindingRequests | ||
type SpaceBindingRequestList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []SpaceBindingRequest `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&SpaceBindingRequest{}, &SpaceBindingRequestList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters