@@ -17,6 +17,7 @@ limitations under the License.
1717package v1alpha1
1818
1919import (
20+ s3model "github.com/InseeFrLab/s3-operator/pkg/s3/model"
2021 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2122)
2223
@@ -47,6 +48,10 @@ type BucketSpec struct {
4748 // Quota to apply to the bucket
4849 // +kubebuilder:validation:Required
4950 Quota Quota `json:"quota"`
51+
52+ // AccessPolicy to apply to the bucket
53+ // +kubebuilder:validation:Optional
54+ AccessPolicy * AccessPolicy `json:"accessPolicy,omitempty"`
5055}
5156
5257// BucketStatus defines the observed state of Bucket
@@ -87,6 +92,18 @@ type Quota struct {
8792 Override int64 `json:"override,omitempty"`
8893}
8994
95+ type AccessPolicy struct {
96+ // type of the AccessPolicy
97+ // +kubebuilder:validation:Required
98+ // +kubebuilder:validation:Default=Private
99+ // +kubebuilder:validation:Enum=Private;Public;Custom
100+ Type s3model.BucketAccessPolicyType `json:"type"`
101+
102+ // Content of the policy (IAM JSON format) for Custom AccessPolicy
103+ // +kubebuilder:validation:Optional
104+ PolicyContent string `json:"policyContent,omitempty"`
105+ }
106+
90107func init () {
91108 SchemeBuilder .Register (& Bucket {}, & BucketList {})
92109}
0 commit comments