Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Support for Object Store #50

wants to merge 1 commit into from

Conversation

uzaxirr
Copy link
Collaborator

@uzaxirr uzaxirr commented Mar 4, 2024

Description of your changes

Fixes #

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

@uzaxirr uzaxirr self-assigned this Mar 4, 2024
@uzaxirr uzaxirr requested a review from RealHarshThakur March 4, 2024 13:40

// A CivoObjectStoreSpec defines the desired state of a CivoObjectStore.
type CivoObjectStoreSpec struct {
// User Given name to the Object Store
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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
Copy link
Collaborator

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"`
Copy link
Collaborator

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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// +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`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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"`
Copy link
Collaborator

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"`
Copy link
Collaborator

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"`
Copy link
Collaborator

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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright 2024?

@uzaxirr uzaxirr closed this Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants