update log with more inclusive language (#16569)

Use the deactive for instead in the error log

Signed-off-by: Wang Yan <wangyan@vmware.com>
This commit is contained in:
Wang Yan 2022-03-23 10:56:00 +08:00 committed by GitHub
parent f37f93b735
commit 7531168c92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 11 additions and 11 deletions

View File

@ -226,7 +226,7 @@ func (bc *basicController) Scan(ctx context.Context, artifact *ar.Artifact, opti
// Check if it is disabled
if r.Disabled {
return errors.PreconditionFailedError(nil).WithMessage("scanner %s is disabled", r.Name)
return errors.PreconditionFailedError(nil).WithMessage("scanner %s is deactivated", r.Name)
}
artifacts, scannable, err := bc.collectScanningArtifacts(ctx, r, artifact)
@ -451,7 +451,7 @@ func (bc *basicController) startScanAll(ctx context.Context, executionID int64)
message := fmt.Sprintf("%d artifact(s) found", summary.TotalCount)
if summary.PreconditionCount > 0 {
message = fmt.Sprintf("%s, scanner not found or disabled for %d of them", message, summary.PreconditionCount)
message = fmt.Sprintf("%s, scanner not found or deactivated for %d of them", message, summary.PreconditionCount)
}
if summary.UnknowCount > 0 {

View File

@ -140,7 +140,7 @@ func (bc *basicController) RegistrationExists(ctx context.Context, registrationU
// UpdateRegistration ...
func (bc *basicController) UpdateRegistration(ctx context.Context, registration *scanner.Registration) error {
if registration.IsDefault && registration.Disabled {
return errors.Errorf("default registration %s can not be marked to disabled", registration.UUID)
return errors.Errorf("default registration %s can not be marked to deactivated", registration.UUID)
}
if isReservedName(registration.Name) {

View File

@ -72,7 +72,7 @@ func (ia *InternalAPI) RenameAdmin() {
// SyncQuota ...
func (ia *InternalAPI) SyncQuota() {
if !config.QuotaPerProjectEnable(orm.Context()) {
ia.SendError(errors.ForbiddenError(nil).WithMessage("quota per project is disabled"))
ia.SendError(errors.ForbiddenError(nil).WithMessage("quota per project is deactivated"))
return
}
ctx := orm.Context()

View File

@ -125,7 +125,7 @@ func (cc *CommonController) UserExists() {
securityCtx, ok := security.FromContext(ctx)
isAdmin := ok && securityCtx.IsSysAdmin()
if !flag && !isAdmin {
cc.CustomAbort(http.StatusPreconditionFailed, "self registration disabled, only sysadmin can check user existence")
cc.CustomAbort(http.StatusPreconditionFailed, "self registration deactivated, only sysadmin can check user existence")
}
target := cc.GetString("target")

View File

@ -123,7 +123,7 @@ func (l *launcher) Launch(ctx context.Context, ply *policy.Metadata, executionID
for _, rule := range ply.Rules {
if rule.Disabled {
log.Infof("Policy %d rule %d %s is disabled", ply.ID, rule.ID, rule.Template)
log.Infof("Policy %d rule %d %s is deactivated", ply.ID, rule.ID, rule.Template)
continue
}
projectCandidates := allProjects

View File

@ -84,7 +84,7 @@ func RequestMiddleware(config RequestConfig, skippers ...middleware.Skipper) fun
if !enabled {
// quota is disabled for the reference object, so direct to next handler
logger.Debugf("quota is disabled for %s %s, so direct to next handler", reference, referenceID)
logger.Debugf("quota is deactivated for %s %s, so direct to next handler", reference, referenceID)
next.ServeHTTP(w, r)
return
}
@ -216,7 +216,7 @@ func RefreshMiddleware(config RefreshConfig, skipers ...middleware.Skipper) func
}
if !enabled {
logger.Debugf("quota is disabled for %s %s, so return directly", reference, referenceID)
logger.Debugf("quota is deactivated for %s %s, so return directly", reference, referenceID)
return nil
}

View File

@ -59,7 +59,7 @@ func (r *robot) Generate(req *http.Request) security.Context {
return nil
}
if robot.Disabled {
log.Errorf("failed to authenticate disabled robot account: %s", name)
log.Errorf("failed to authenticate deactivated robot account: %s", name)
return nil
}
now := time.Now().Unix()

View File

@ -57,7 +57,7 @@ func Middleware() func(http.Handler) http.Handler {
if !proj.VulPrevented() {
// vulnerability prevention disabled, skip the checking
logger.Debugf("project %s vulnerability prevention disabled, skip the checking", proj.Name)
logger.Debugf("project %s vulnerability prevention deactivated, skip the checking", proj.Name)
return nil
}

View File

@ -735,7 +735,7 @@ func (a *projectAPI) isSysAdmin(ctx context.Context, action rbac.Action) bool {
func getProjectQuotaSummary(ctx context.Context, p *project.Project, summary *models.ProjectSummary) {
if !config.QuotaPerProjectEnable(ctx) {
log.Debug("Quota per project disabled")
log.Debug("Quota per project deactivated")
return
}