Skip to content

Commit

Permalink
flip some spammy logs to debug level
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Stephenson committed Oct 3, 2024
1 parent c8908c7 commit 5c63734
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions internal/controller/bucket/acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (l *ACLClient) Observe(ctx context.Context, bucket *v1alpha1.Bucket, backen
}

func (l *ACLClient) observeBackend(bucket *v1alpha1.Bucket, backendName string) ResourceStatus {
l.log.Info("Observing subresource acl on backend", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)
l.log.Debug("Observing subresource acl on backend", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)

if l.backendStore.GetBackendHealthStatus(backendName) == apisv1alpha1.HealthStatusUnhealthy {
// If a backend is marked as unhealthy, we can ignore it for now by returning Updated.
Expand All @@ -68,7 +68,7 @@ func (l *ACLClient) observeBackend(bucket *v1alpha1.Bucket, backendName string)
// If your bucket uses the bucket owner enforced setting for S3 Object
// Ownership, ACLs are disabled and no longer affect permissions.
if s3types.ObjectOwnership(aws.ToString(bucket.Spec.ForProvider.ObjectOwnership)) == s3types.ObjectOwnershipBucketOwnerEnforced {
l.log.Info("Access control limits are disabled - no action required", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)
l.log.Debug("Access control limits are disabled - no action required", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)

return Updated
}
Expand All @@ -80,7 +80,7 @@ func (l *ACLClient) observeBackend(bucket *v1alpha1.Bucket, backendName string)
bucket.Spec.ForProvider.GrantWriteACP == nil &&
bucket.Spec.ForProvider.GrantRead == nil &&
bucket.Spec.ForProvider.GrantReadACP == nil {
l.log.Info("No acl or access control policy or grants requested - no action required", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)
l.log.Debug("No acl or access control policy or grants requested - no action required", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)

return Updated
}
Expand Down
8 changes: 4 additions & 4 deletions internal/controller/bucket/lifecycleconfiguration.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (l *LifecycleConfigurationClient) Observe(ctx context.Context, bucket *v1al

//nolint:gocyclo,cyclop // Function requires multiple checks.
func (l *LifecycleConfigurationClient) observeBackend(ctx context.Context, bucket *v1alpha1.Bucket, backendName string) (ResourceStatus, error) {
l.log.Info("Observing subresource lifecycle configuration on backend", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)
l.log.Debug("Observing subresource lifecycle configuration on backend", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)

if l.backendStore.GetBackendHealthStatus(backendName) == apisv1alpha1.HealthStatusUnhealthy {
// If a backend is marked as unhealthy, we can ignore it for now by returning NoAction.
Expand All @@ -106,11 +106,11 @@ func (l *LifecycleConfigurationClient) observeBackend(ctx context.Context, bucke
// Either way, it should not exist on any backend.
if response == nil || len(response.Rules) == 0 {
// No lifecycle config found on this backend.
l.log.Info("No lifecycle configuration found on backend - no action required", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)
l.log.Debug("No lifecycle configuration found on backend - no action required", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)

return NoAction, nil
} else {
l.log.Info("Lifecycle configuration found on backend - requires deletion", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)
l.log.Debug("Lifecycle configuration found on backend - requires deletion", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)

return NeedsDeletion, nil
}
Expand All @@ -137,7 +137,7 @@ func (l *LifecycleConfigurationClient) observeBackend(ctx context.Context, bucke
// is almost never expected.
if !cmp.Equal(external, rgw.GenerateLifecycleRules(local),
cmpopts.IgnoreFields(s3types.LifecycleRule{}, "ID"), cmpopts.IgnoreTypes(document.NoSerde{})) {
l.log.Info("Lifecycle configuration requires update on backend", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)
l.log.Debug("Lifecycle configuration requires update on backend", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)

return NeedsUpdate, nil
}
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/bucket/objectlockconfiguration.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (l *ObjectLockConfigurationClient) Observe(ctx context.Context, bucket *v1a
defer span.End()

if bucket.Spec.ForProvider.ObjectLockEnabledForBucket == nil || !*bucket.Spec.ForProvider.ObjectLockEnabledForBucket {
l.log.Info("Object lock configuration not enabled in Bucket CR", consts.KeyBucketName, bucket.Name)
l.log.Debug("Object lock configuration not enabled in Bucket CR", consts.KeyBucketName, bucket.Name)

return Updated, nil
}
Expand Down Expand Up @@ -86,7 +86,7 @@ func (l *ObjectLockConfigurationClient) Observe(ctx context.Context, bucket *v1a
}

func (l *ObjectLockConfigurationClient) observeBackend(ctx context.Context, bucket *v1alpha1.Bucket, backendName string) (ResourceStatus, error) {
l.log.Info("Observing subresource object lock configuration on backend", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)
l.log.Debug("Observing subresource object lock configuration on backend", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)

if l.backendStore.GetBackendHealthStatus(backendName) == apisv1alpha1.HealthStatusUnhealthy {
// If a backend is marked as unhealthy, we can ignore it for now by returning NoAction.
Expand Down
6 changes: 3 additions & 3 deletions internal/controller/bucket/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (p *PolicyClient) Observe(ctx context.Context, bucket *v1alpha1.Bucket, bac
}

func (p *PolicyClient) observeBackend(ctx context.Context, bucket *v1alpha1.Bucket, backendName string) (ResourceStatus, error) {
p.log.Info("Observing subresource policy on backend", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)
p.log.Debug("Observing subresource policy on backend", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)

if p.backendStore.GetBackendHealthStatus(backendName) == apisv1alpha1.HealthStatusUnhealthy {
// If a backend is marked as unhealthy, we can ignore it for now by returning Updated.
Expand Down Expand Up @@ -107,11 +107,11 @@ func (p *PolicyClient) observeBackend(ctx context.Context, bucket *v1alpha1.Buck
// No policy config is specified.
// In that case, it should not exist on any backend.
if external == "" {
p.log.Info("No bucket policy found on backend - no action required", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)
p.log.Debug("No bucket policy found on backend - no action required", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)

return Updated, nil
} else {
p.log.Info("Bucket policy found on backend - requires deletion", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)
p.log.Debug("Bucket policy found on backend - requires deletion", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)

return NeedsDeletion, nil
}
Expand Down
6 changes: 3 additions & 3 deletions internal/controller/bucket/versioningconfiguration.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (l *VersioningConfigurationClient) Observe(ctx context.Context, bucket *v1a
}

func (l *VersioningConfigurationClient) observeBackend(ctx context.Context, bucket *v1alpha1.Bucket, backendName string) (ResourceStatus, error) {
l.log.Info("Observing subresource versioning configuration on backend", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)
l.log.Debug("Observing subresource versioning configuration on backend", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)

if l.backendStore.GetBackendHealthStatus(backendName) == apisv1alpha1.HealthStatusUnhealthy {
// If a backend is marked as unhealthy, we can ignore it for now by returning NoAction.
Expand Down Expand Up @@ -110,14 +110,14 @@ func (l *VersioningConfigurationClient) observeBackend(ctx context.Context, buck
// An empty versioning configuration was returned from the backend, signifying
// that versioning was never enabled on this bucket. Therefore versioning is
// considered Updated for the bucket and we do nothing.
l.log.Info("Versioning is not enabled for bucket on backend - no action required", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)
l.log.Debug("Versioning is not enabled for bucket on backend - no action required", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)

return NoAction, nil
} else {
// A non-empty versioning configuration was returned from the backend, signifying
// that versioning was previously enabled for this bucket. A bucket cannot be un-versioned,
// it can only be suspended so we execute this via the NeedsDeletion path.
l.log.Info("Versioning is enabled for bucket on backend - requires suspension", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)
l.log.Debug("Versioning is enabled for bucket on backend - requires suspension", consts.KeyBucketName, bucket.Name, consts.KeyBackendName, backendName)

return NeedsDeletion, nil
}
Expand Down

0 comments on commit 5c63734

Please sign in to comment.