From 5c63734be4ac215de6c28fa590be44205d22c541 Mon Sep 17 00:00:00 2001 From: Joe Stephenson Date: Thu, 3 Oct 2024 12:20:51 +0100 Subject: [PATCH] flip some spammy logs to debug level --- internal/controller/bucket/acl.go | 6 +++--- internal/controller/bucket/lifecycleconfiguration.go | 8 ++++---- internal/controller/bucket/objectlockconfiguration.go | 4 ++-- internal/controller/bucket/policy.go | 6 +++--- internal/controller/bucket/versioningconfiguration.go | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/controller/bucket/acl.go b/internal/controller/bucket/acl.go index 5e55096e..ec5372b7 100644 --- a/internal/controller/bucket/acl.go +++ b/internal/controller/bucket/acl.go @@ -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. @@ -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 } @@ -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 } diff --git a/internal/controller/bucket/lifecycleconfiguration.go b/internal/controller/bucket/lifecycleconfiguration.go index cce4a5fe..92e46757 100644 --- a/internal/controller/bucket/lifecycleconfiguration.go +++ b/internal/controller/bucket/lifecycleconfiguration.go @@ -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. @@ -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 } @@ -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 } diff --git a/internal/controller/bucket/objectlockconfiguration.go b/internal/controller/bucket/objectlockconfiguration.go index c7ab7c0b..bd61cbd2 100644 --- a/internal/controller/bucket/objectlockconfiguration.go +++ b/internal/controller/bucket/objectlockconfiguration.go @@ -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 } @@ -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. diff --git a/internal/controller/bucket/policy.go b/internal/controller/bucket/policy.go index 0b6e1862..56c159cf 100644 --- a/internal/controller/bucket/policy.go +++ b/internal/controller/bucket/policy.go @@ -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. @@ -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 } diff --git a/internal/controller/bucket/versioningconfiguration.go b/internal/controller/bucket/versioningconfiguration.go index a5f41aff..a1268f64 100644 --- a/internal/controller/bucket/versioningconfiguration.go +++ b/internal/controller/bucket/versioningconfiguration.go @@ -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. @@ -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 }