forked from longhorn/longhorn-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
longhorn/longhorn#5832 Signed-off-by: Moritz Röhrich <moritz.rohrich@suse.com>
- Loading branch information
1 parent
e226293
commit b6168df
Showing
4 changed files
with
81 additions
and
0 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
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,58 @@ | ||
package v1beta2 | ||
|
||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
type ObjectEndpointState string | ||
|
||
const ( | ||
ObjectEndpointStateUnknown = ObjectEndpointState("unknown") | ||
ObjectEndpointStateStarting = ObjectEndpointState("starting") | ||
ObjectEndpointStateRunning = ObjectEndpointState("running") | ||
ObjectEndpointStateStopping = ObjectEndpointState("stopping") | ||
ObjectEndpointStateStopped = ObjectEndpointState("stopped") | ||
ObjectEndpointStateError = ObjectEndpointState("error") | ||
) | ||
|
||
type ObjectEndpointStatus struct { | ||
State ObjectEndpointState `json:"state""` | ||
Endpoint string `json:"endpoint"` | ||
} | ||
|
||
type ObjectEndpointCredentials struct { | ||
AccessKey string `json:"accessKey"` | ||
SecretKey string `json:"secretKey"` | ||
} | ||
|
||
type ObjectEndpointSpec struct { | ||
Image string `json:"image"` | ||
Credentials ObjectEndpointCredentials `json:"credentials"` | ||
Volume string `json:"volume"` | ||
} | ||
|
||
// +genclient | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
// +kubebuilder:resource:shortName=lhoe | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:storageversion | ||
// +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state`,description="The state of object endpoint" | ||
// +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.status.endpoint`,description="" | ||
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` | ||
|
||
// Representation of an object storage endpoint in the K8s API. | ||
type ObjectEndpoint struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec ObjectEndpointSpec `json:"spec,omitempty"` | ||
Status ObjectEndpointStatus `json:"status,omitempty"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// ObjectEndpointList is a list of ObjectEndpoints. | ||
type ObjectEndpointList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Items []ObjectEndpoint `json:"items"` | ||
} |
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
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