-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Object Store #50
Conversation
|
||
// A CivoObjectStoreSpec defines the desired state of a CivoObjectStore. | ||
type CivoObjectStoreSpec struct { | ||
// User Given name to the Object Store |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// User Given name to the Object Store | |
// Name for object store(aka bucket). Name needs to be unique across the entire region |
Name string `json:"name"` | ||
|
||
// Size of object store, should be specified in GB | ||
// +kubebuilder:default:=500 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, it also needs to be a multiple of 500. Maybe we should mention that
// +kubebuilder:default:=500 | ||
Size int64 `json:"size,omitempty"` | ||
|
||
ConnectionDetails CivoObjectStoreConnectionDetails `json:"connectionDetails"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing description on field. These fields is the only help menu we provide to the user. When they do a kubectl explain
they can view the description we give. We should mention that this is going to be the place where we store access key and secret access key.
// A CivoObjectStore is an example API type. | ||
// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" | ||
// +kubebuilder:printcolumn:name="MESSAGE",type="string",JSONPath=".status.message" | ||
// +kubebuilder:printcolumn:name="APPLICATIONS",type="string",JSONPath=".spec.applications" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// +kubebuilder:printcolumn:name="APPLICATIONS",type="string",JSONPath=".spec.applications" |
// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" | ||
// +kubebuilder:printcolumn:name="MESSAGE",type="string",JSONPath=".status.message" | ||
// +kubebuilder:printcolumn:name="APPLICATIONS",type="string",JSONPath=".spec.applications" | ||
// Please replace `PROVIDER-NAME` with your actual provider name, like `aws`, `azure`, `gcp`, `alibaba` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Please replace `PROVIDER-NAME` with your actual provider name, like `aws`, `azure`, `gcp`, `alibaba` |
Name string `json:"Name"` | ||
|
||
// Size of object store | ||
Size int64 `json:"Size"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Size
can be interpreted as either used or total available capacity. We should be explicit about what size we're talking about here and should also have both the fields here.
type CivoObjectStoreObservation struct { | ||
|
||
// User Given name to the Object Store | ||
Name string `json:"Name"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need name again?
Size int64 `json:"Size"` | ||
|
||
// Status of the Object Store (e.g., Creating, Available, Deleting) | ||
Status string `json:"status,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious if Crossplane encourages Conditions
to report status. If nothing is mentioned, let's just use Conditions and not have a Status field.
https://heidloff.net/article/storing-state-status-kubernetes-resources-conditions-operators-go/
@@ -0,0 +1,21 @@ | |||
/* | |||
Copyright 2020 The Crossplane Authors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright 2024?
Description of your changes
Fixes #
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested