From 2d012760a1a52e55d9a0470dadbc2e8b2233fc44 Mon Sep 17 00:00:00 2001 From: yuyi Date: Wed, 11 Oct 2023 18:02:05 +0800 Subject: [PATCH] chore: remove some redundant comments --- api/v1alpha1/obtenant_webhook.go | 1 - api/v1alpha1/obtenantoperation_webhook.go | 3 --- pkg/oceanbase/operation/server.go | 1 - pkg/oceanbase/operation/tenant.go | 4 ---- pkg/resource/obtenantbackuppolicy_task.go | 1 - 5 files changed, 10 deletions(-) diff --git a/api/v1alpha1/obtenant_webhook.go b/api/v1alpha1/obtenant_webhook.go index 202baa315..188f501fe 100644 --- a/api/v1alpha1/obtenant_webhook.go +++ b/api/v1alpha1/obtenant_webhook.go @@ -59,7 +59,6 @@ func (r *OBTenant) Default() { if err != nil { tenantlog.Error(err, "Failed to get cluster") } else { - tenantlog.Info("Get cluster", "cluster", cluster) r.SetOwnerReferences([]metav1.OwnerReference{{ APIVersion: cluster.APIVersion, Kind: cluster.Kind, diff --git a/api/v1alpha1/obtenantoperation_webhook.go b/api/v1alpha1/obtenantoperation_webhook.go index 18e6db597..2e2f12aca 100644 --- a/api/v1alpha1/obtenantoperation_webhook.go +++ b/api/v1alpha1/obtenantoperation_webhook.go @@ -107,14 +107,11 @@ var _ webhook.Validator = &OBTenantOperation{} // ValidateCreate implements webhook.Validator so a webhook will be registered for the type func (r *OBTenantOperation) ValidateCreate() (admission.Warnings, error) { - obtenantoperationlog.Info("validate create", "name", r.Name) - return nil, r.validateMutation() } // ValidateUpdate implements webhook.Validator so a webhook will be registered for the type func (r *OBTenantOperation) ValidateUpdate(old runtime.Object) (admission.Warnings, error) { - obtenantoperationlog.Info("validate update", "name", r.Name) _ = old return nil, r.validateMutation() } diff --git a/pkg/oceanbase/operation/server.go b/pkg/oceanbase/operation/server.go index cf0feb74b..4dda33497 100644 --- a/pkg/oceanbase/operation/server.go +++ b/pkg/oceanbase/operation/server.go @@ -28,7 +28,6 @@ func (m *OceanbaseOperationManager) GetServer(s *model.ServerInfo) (*model.OBSer return nil, err } if len(observers) == 0 { - m.Logger.Info("observer not found", "server identity", s) return nil, nil } return &observers[0], nil diff --git a/pkg/oceanbase/operation/tenant.go b/pkg/oceanbase/operation/tenant.go index 1e3700d02..08cee0265 100644 --- a/pkg/oceanbase/operation/tenant.go +++ b/pkg/oceanbase/operation/tenant.go @@ -234,7 +234,6 @@ func (m *OceanbaseOperationManager) AddUnitConfigV4(unitConfigV4 *model.UnitConf func (m *OceanbaseOperationManager) SetTenantVariable(tenantName, variableList string) error { preparedSQL, params := m.preparedSQLForSetTenantVariable(tenantName, variableList) - m.Logger.Info(fmt.Sprintf("sql: %s, parms: %v", preparedSQL, params)) err := m.ExecWithDefaultTimeout(preparedSQL, params...) if err != nil { return errors.Wrap(err, "Set Tenant Variable") @@ -244,7 +243,6 @@ func (m *OceanbaseOperationManager) SetTenantVariable(tenantName, variableList s func (m *OceanbaseOperationManager) SetUnitConfigV4(unitConfigV4 *model.UnitConfigV4SQLParam) error { preparedSQL, params := preparedSQLForSetUnitConfigV4(unitConfigV4) - m.Logger.Info(fmt.Sprintf("sql: %s, parms: %v", preparedSQL, params)) err := m.ExecWithDefaultTimeout(preparedSQL, params...) if err != nil { return errors.Wrap(err, "Set UnitConfig") @@ -254,7 +252,6 @@ func (m *OceanbaseOperationManager) SetUnitConfigV4(unitConfigV4 *model.UnitConf func (m *OceanbaseOperationManager) SetTenantUnitNum(tenantName string, unitNum int) error { preparedSQL, params := m.preparedSQLForSetTenantUnitNum(tenantName, unitNum) - m.Logger.Info(fmt.Sprintf("sql: %s, parms: %v", preparedSQL, params)) err := m.ExecWithDefaultTimeout(preparedSQL, params...) if err != nil { return errors.Wrap(err, "Set pool UnitNum") @@ -436,7 +433,6 @@ func (m *OceanbaseOperationManager) AlterPool(poolParam *model.PoolParam) error if sql != "" { return m.ExecWithDefaultTimeout(sql, args...) } - m.Logger.Info("Set pool need to execute nothing") return nil } diff --git a/pkg/resource/obtenantbackuppolicy_task.go b/pkg/resource/obtenantbackuppolicy_task.go index 00fd2073f..ff10a2b39 100644 --- a/pkg/resource/obtenantbackuppolicy_task.go +++ b/pkg/resource/obtenantbackuppolicy_task.go @@ -229,7 +229,6 @@ func (m *ObTenantBackupPolicyManager) CheckAndSpawnJobs() error { } else { backupPath = m.getBackupDestPath(tenantRecordName) } - m.Logger.Info("CheckAndSpawnJobs", "backupPath after split", backupPath) // Avoid backup failure due to destination modification latestFull, err := m.getLatestBackupJobOfTypeAndPath(constants.BackupJobTypeFull, backupPath) if err != nil {