-
Notifications
You must be signed in to change notification settings - Fork 16
Implement multitenancy #50
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
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,103 @@ | ||
| /* | ||
| Copyright 2023. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| package v1alpha1 | ||
|
|
||
| import ( | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| // 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. | ||
|
|
||
| // S3InstanceSpec defines the desired state of S3Instance | ||
| type S3InstanceSpec struct { | ||
|
|
||
| // type of the S3Instance | ||
| // +kubebuilder:validation:Required | ||
| // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="S3Provider is immutable" | ||
| // +kubebuilder:default=minio | ||
| // +kubebuilder:validation:Enum=minio;mockedS3Provider | ||
| S3Provider string `json:"s3Provider,omitempty"` | ||
|
|
||
| // url of the S3Instance | ||
| // +kubebuilder:validation:Required | ||
| Url string `json:"url"` | ||
|
|
||
| // Ref to Secret associated to the S3Instance containing accessKey and secretKey | ||
| // +kubebuilder:validation:Required | ||
| SecretRef string `json:"secretRef"` | ||
|
|
||
| // region associated to the S3Instance | ||
| // +kubebuilder:validation:Optional | ||
| Region string `json:"region,omitempty"` | ||
|
|
||
| // Secret containing key ca.crt with the certificate associated to the S3InstanceUrl | ||
| // +kubebuilder:validation:Optional | ||
| CaCertSecretRef string `json:"caCertSecretRef,omitempty"` | ||
|
|
||
| // AllowedNamespaces to use this S3InstanceUrl if empty only the namespace of this instance url is allowed to use it | ||
| // +kubebuilder:validation:Optional | ||
| AllowedNamespaces []string `json:"allowedNamespaces,omitempty"` | ||
|
|
||
| // BucketDeletionEnabled Trigger bucket deletion on the S3 backend upon CR deletion. Will fail if bucket is not empty. | ||
| // +kubebuilder:default=false | ||
| BucketDeletionEnabled bool `json:"bucketDeletionEnabled,omitempty"` | ||
|
|
||
| // PolicyDeletionEnabled Trigger policy deletion on the S3 backend upon CR deletion. | ||
| // +kubebuilder:default=false | ||
| PolicyDeletionEnabled bool `json:"policyDeletionEnabled,omitempty"` | ||
|
|
||
| // PathDeletionEnabled Trigger path deletion on the S3 backend upon CR deletion. Limited to deleting the `.keep` files used by the operator. | ||
| // +kubebuilder:default=false | ||
| PathDeletionEnabled bool `json:"pathDeletionEnabled,omitempty"` | ||
|
|
||
| // S3UserDeletionEnabled Trigger S3 deletion on the S3 backend upon CR deletion. | ||
| // +kubebuilder:default=false | ||
| S3UserDeletionEnabled bool `json:"s3UserDeletionEnabled,omitempty"` | ||
| } | ||
Donatien26 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // S3InstanceStatus defines the observed state of S3Instance | ||
| type S3InstanceStatus struct { | ||
| // Status management using Conditions. | ||
| // See also : https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties | ||
| Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` | ||
| } | ||
|
|
||
| //+kubebuilder:object:root=true | ||
| //+kubebuilder:subresource:status | ||
|
|
||
| // S3Instance is the Schema for the S3Instances API | ||
| type S3Instance struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| Spec S3InstanceSpec `json:"spec,omitempty"` | ||
| Status S3InstanceStatus `json:"status,omitempty"` | ||
| } | ||
|
|
||
| //+kubebuilder:object:root=true | ||
|
|
||
| // S3InstanceList contains a list of S3Instance | ||
| type S3InstanceList struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ListMeta `json:"metadata,omitempty"` | ||
| Items []S3Instance `json:"items"` | ||
| } | ||
|
|
||
| func init() { | ||
| SchemeBuilder.Register(&S3Instance{}, &S3InstanceList{}) | ||
| } | ||
This file contains hidden or 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 hidden or 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,16 @@ | ||
| package v1alpha1 | ||
|
|
||
| // Definitions to manage status condition types | ||
| const ( | ||
| // ConditionReconciled represents the status of the resource reconciliation | ||
| ConditionReconciled = "Reconciled" | ||
| ) | ||
|
|
||
| // Definitions to manage status condition reasons | ||
| const ( | ||
| Reconciling = "Reconciling" | ||
| Unreachable = "Unreachable" | ||
| CreationFailure = "CreationFailure" | ||
| Reconciled = "Reconciled" | ||
| DeletionFailure = "DeletionFailure" | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.