Documentation
¶
Index ¶
- Constants
- func EffectiveMaxRetentionInDays(spec *s3v1alpha1.S3ObjectLockTenantSpec, sg *s3v1alpha1.StorageGrid) int32
- func IgnoreReferencePolicyPredicate() predicate.Funcs
- func PredicateWithoutStatusChange() predicate.Predicate
- func ValidateAccountClaim(ctx context.Context, k8sClient client.Client, tenant *s3v1alpha1.S3Tenant, ...) error
- type HasManagementPolicy
- type S3BucketReconciler
- type S3TenantAccountReconciler
- type S3TenantClassReconciler
- type S3TenantReconciler
- type StorageGridReconciler
Constants ¶
const ( // Tenant Lifecycle Events. EventTenantCreating = "TenantCreating" EventTenantCreated = "TenantCreated" EventTenantCreateFailed = "TenantCreateFailed" EventTenantImported = "TenantImported" EventTenantImportFailed = "TenantImportFailed" EventTenantUpdating = "TenantUpdating" EventTenantUpdated = "TenantUpdated" EventTenantUpdateFailed = "TenantUpdateFailed" EventTenantDeleting = "TenantDeleting" EventTenantDeleted = "TenantDeleted" EventTenantDeleteFailed = "TenantDeleteFailed" // Ownership Management Events. EventOwnershipConflict = "OwnershipConflict" // Backend Connection Events. EventBackendConnectionFailed = "BackendConnectionFailed" EventBackendConnectionRestored = "BackendConnectionRestored" // Quota Events. EventQuotaWarning = "QuotaWarning" // Usage at 80% threshold EventQuotaExceeded = "QuotaExceeded" // Usage exceeded quota EventQuotaNormal = "QuotaNormal" // Usage back under threshold // Credential Events. EventCredentialsRotated = "CredentialsRotated" EventCredentialsRotationFailed = "CredentialsRotationFailed" // Deletion Policy Events. EventDeletionPolicyApplied = "DeletionPolicyApplied" EventDeletionPolicyFailed = "DeletionPolicyFailed" )
Event reasons for S3TenantAccount controller. These events reflect platform-level operations on the backing StorageGrid tenant.
const ( // Account Binding Events. EventAccountCreating = "AccountCreating" EventAccountCreated = "AccountCreated" EventAccountCreateFailed = "AccountCreateFailed" EventAccountClaiming = "AccountClaiming" EventAccountClaimed = "AccountClaimed" EventAccountClaimFailed = "AccountClaimFailed" EventAccountBound = "AccountBound" EventAccountBindingFailed = "AccountBindingFailed" EventAccountUnbound = "AccountUnbound" EventAccountNotReady = "AccountNotReady" // Configuration Management Events. EventConfigurationChanged = "ConfigurationChanged" EventConfigurationPending = "ConfigurationPending" EventConfigurationApplied = "ConfigurationApplied" EventConfigurationFailed = "ConfigurationFailed" // Tenant Status Events. EventTenantReady = "TenantReady" EventTenantNotReady = "TenantNotReady" )
Event reasons for S3Tenant controller. These events reflect user-facing operations and account binding.
const ( // Gateway Management Events. EventGatewayFetchFailed = "GatewayFetchFailed" EventGatewayStatusRefreshed = "GatewayStatusRefreshed" EventEndpointNotInCertificate = "EndpointNotInCertificate" // Tenant Allowlist Management Events. EventTenantAddedToAllowlist = "TenantAddedToAllowlist" EventTenantRemovedFromAllowlist = "TenantRemovedFromAllowlist" EventAllowlistUpdateFailed = "AllowlistUpdateFailed" )
Event reasons for S3TenantClass controller. These events reflect gateway endpoint management and tenant allowlist operations.
const ( // Connection & Authentication Events. EventGridConnectionFailed = "GridConnectionFailed" EventGridConnectionEstablished = "GridConnectionEstablished" EventGridCredentialsFailed = "GridCredentialsFailed" // Health Monitoring Events. EventGridHealthCheckFailed = "GridHealthCheckFailed" EventGridUnhealthy = "GridUnhealthy" EventGridHealthRecovered = "GridHealthRecovered" // Configuration Events. EventRegionsUpdated = "RegionsUpdated" EventRegionsFetchFailed = "RegionsFetchFailed" EventDefaultRegionSet = "DefaultRegionSet" )
Event reasons for StorageGrid controller. These events reflect grid connectivity, health monitoring, and configuration discovery.
const ( // Bucket Lifecycle Events. EventBucketCreating = "BucketCreating" EventBucketCreated = "BucketCreated" EventBucketCreateFailed = "BucketCreateFailed" EventBucketDeleting = "BucketDeleting" EventBucketDeleted = "BucketDeleted" EventBucketDeleteFailed = "BucketDeleteFailed" EventBucketNotEmpty = "BucketNotEmpty" // Tenant Dependency Events. EventBucketTenantNotReady = "TenantNotReady" EventBucketTenantReady = "TenantReady" EventBucketTenantGone = "TenantGone" // Bucket Credentials Events. EventBucketCredentialsCreated = "CredentialsCreated" EventBucketCredentialsRotated = "CredentialsRotated" EventBucketCredentialsRotationFailed = "CredentialsRotationFailed" EventBucketCredentialsSecretMissing = "CredentialsSecretMissing" // Bucket Policy Events. EventBucketPolicyApplied = "PolicyApplied" EventBucketPolicyRemoved = "PolicyRemoved" EventBucketPolicyApplyFailed = "PolicyApplyFailed" EventBucketPolicyRemoveFailed = "PolicyRemoveFailed" EventBucketPolicyDeprecated = "PolicyJsonDeprecated" // Bucket Lifecycle Management Events. EventBucketLifecycleApplied = "LifecycleApplied" EventBucketLifecycleRemoved = "LifecycleRemoved" EventBucketLifecycleApplyFailed = "LifecycleApplyFailed" EventBucketLifecycleRemoveFailed = "LifecycleRemoveFailed" EventBucketLifecycleObjectLockConflict = "LifecycleObjectLockConflict" // Bucket Consistency Events. EventBucketConsistencyApplied = "ConsistencyApplied" EventBucketConsistencyReverted = "ConsistencyReverted" EventBucketConsistencyApplyFailed = "ConsistencyApplyFailed" EventBucketConsistencyRevertFailed = "ConsistencyRevertFailed" // Connection Details Events (shared by S3Bucket and S3Access). EventConnectionDetailsApplied = "ConnectionDetailsApplied" EventConnectionDetailsRemoved = "ConnectionDetailsRemoved" EventConnectionDetailsApplyFailed = "ConnectionDetailsApplyFailed" EventConnectionDetailsRemoveFailed = "ConnectionDetailsRemoveFailed" // Admin User Management Events. EventBucketAdminUserCreated = "AdminUserCreated" EventBucketAdminUserCreateFailed = "AdminUserCreateFailed" // S3 Endpoint Access Events. EventS3EndpointConnectionEstablished = "S3EndpointConnectionEstablished" EventS3EndpointConnectionFailed = "S3EndpointConnectionFailed" // Usage Monitoring Events. EventBucketUsageUpdated = "UsageUpdated" EventBucketUsageFetchFailed = "UsageFetchFailed" // Region Events. EventBucketRegionValidationFailed = "RegionValidationFailed" EventBucketRegionSet = "RegionSet" // Bucket Import Events. EventBucketImported = "BucketImported" EventBucketImportFailed = "BucketImportFailed" // Bucket Ownership Events. EventBucketOwnershipCheckFailed = "BucketOwnershipCheckFailed" EventBucketOwnershipTaggingFailed = "BucketOwnershipTaggingFailed" EventBucketNotOwnedByOperator = "BucketNotOwnedByOperator" // Bucket Object Lock Events. EventBucketObjectLockUpdated = "BucketObjectLockUpdated" EventBucketObjectLockUpdateFailed = "BucketObjectLockUpdateFailed" // Bucket Drain Events. EventBucketDrainingStarted = "BucketDrainingStarted" EventBucketDrainingProgress = "BucketDrainingProgress" EventBucketDrainingComplete = "BucketDrainingComplete" EventBucketDrainingStuck = "BucketDrainingStuck" EventBucketDrainingCanceled = "BucketDrainingCanceled" EventBucketDrainFailed = "BucketDrainFailed" EventBucketOrphanedDrain = "BucketOrphanedDrainDetected" EventBucketAlreadyEmpty = "BucketAlreadyEmpty" )
Event reasons for S3Bucket controller. These events reflect bucket lifecycle, policy management, and S3 endpoint access.
Variables ¶
This section is empty.
Functions ¶
func EffectiveMaxRetentionInDays ¶ added in v0.3.0
func EffectiveMaxRetentionInDays(spec *s3v1alpha1.S3ObjectLockTenantSpec, sg *s3v1alpha1.StorageGrid) int32
EffectiveMaxRetentionInDays resolves the S3 Object Lock retention ceiling for a tenant: its own MaxRetentionInDays when set, otherwise the grid-wide default.
Deliberately independent of Mode. Mode governs whether an S3Bucket may enable object lock at all, but the ceiling also binds Governance retention a tenant can request directly over the S3 API, where the bucket-level gate never applies.
Never returns zero: StorageGrid rejects an empty ceiling once S3 Object Lock is enabled grid-wide, and silently substitutes 100 years for a request that carries no ceiling at all.
func IgnoreReferencePolicyPredicate ¶
Ignore reconciliation if managementPolicy is "Reference".
func PredicateWithoutStatusChange ¶
PredicateWithoutStatusChange creates a predicate that triggers reconciliation. for changes in generation, annotations, or labels.
func ValidateAccountClaim ¶
func ValidateAccountClaim(ctx context.Context, k8sClient client.Client, tenant *s3v1alpha1.S3Tenant, account *s3v1alpha1.S3TenantAccount) error
ValidateAccountClaim validates whether an S3Tenant can claim an S3TenantAccount. This function is shared between the webhook and controller to ensure consistent validation.
Validation rules: 1. Account must not be bound to a different tenant (name+namespace check) 2. If account has pre-binding (spec.s3TenantRef), it must match the claiming tenant 3. Both must reference the same StorageGrid 4. Tenant quota must be >= account quota (minimum requirement) 5. TenantClass must match exactly.
Types ¶
type HasManagementPolicy ¶
type HasManagementPolicy interface {
GetManagementPolicy() string
}
type S3BucketReconciler ¶
type S3BucketReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
}
S3BucketReconciler reconciles a S3Bucket object.
func (*S3BucketReconciler) Reconcile ¶
Reconcile is part of the main kubernetes reconciliation loop.
func (*S3BucketReconciler) SetupWithManager ¶
func (r *S3BucketReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type S3TenantAccountReconciler ¶
type S3TenantAccountReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
OperatorNamespace string // Namespace where the operator is running, used for creating secrets
}
S3TenantAccountReconciler reconciles a S3TenantAccount object.
func (*S3TenantAccountReconciler) SetupWithManager ¶
func (r *S3TenantAccountReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type S3TenantClassReconciler ¶
type S3TenantClassReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
}
S3TenantClassReconciler reconciles a S3TenantClass object.
func (*S3TenantClassReconciler) SetupWithManager ¶
func (r *S3TenantClassReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type S3TenantReconciler ¶
type S3TenantReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
}
S3TenantReconciler reconciles a S3Tenant object.
func (*S3TenantReconciler) Reconcile ¶
Reconcile is part of the main kubernetes reconciliation loop which aims to. move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here:. - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.18.4/pkg/reconcile
func (*S3TenantReconciler) SetupWithManager ¶
func (r *S3TenantReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type StorageGridReconciler ¶
type StorageGridReconciler struct {
client.Client
Scheme *runtime.Scheme
Recorder record.EventRecorder
}
StorageGridReconciler reconciles a StorageGrid object.
func (*StorageGridReconciler) Reconcile ¶
func (r *StorageGridReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to. move the current state of the cluster closer to the desired state.
For more details, check Reconcile and its Result here:. - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.18.4/pkg/reconcile
func (*StorageGridReconciler) SetupWithManager ¶
func (r *StorageGridReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.