diff --git a/pkg/controller/build/build_controller.go b/pkg/controller/build/build_controller.go index f5ef7a8d28..c8a49e2b2d 100644 --- a/pkg/controller/build/build_controller.go +++ b/pkg/controller/build/build_controller.go @@ -70,7 +70,7 @@ func add(ctx context.Context, mgr manager.Manager, r reconcile.Reconciler) error if oldAnnot[build.AnnotationBuildRunDeletion] != newAnnot[build.AnnotationBuildRunDeletion] { ctxlog.Debug( ctx, - "Updating predicated passed, the annotation was modified.", + "updating predicated passed, the annotation was modified.", namespace, e.MetaNew.GetNamespace(), name, @@ -172,7 +172,7 @@ func (r *ReconcileBuild) Reconcile(request reconcile.Request) (reconcile.Result, updateErr := r.client.Status().Update(ctx, b) return reconcile.Result{}, fmt.Errorf("errors: %v %v", err, updateErr) } - ctxlog.Info(ctx, "build strategy found", namespace, b.Namespace, name, b.Name, "strategy", b.Spec.StrategyRef.Name) + ctxlog.Info(ctx, "buildStrategy found", namespace, b.Namespace, name, b.Name, "strategy", b.Spec.StrategyRef.Name) } // validate if "spec.runtime" attributes are valid @@ -220,7 +220,7 @@ func (r *ReconcileBuild) validateStrategyRef(ctx context.Context, s *build.Strat return fmt.Errorf("unknown strategy %v", *s.Kind) } } else { - ctxlog.Info(ctx, "BuildStrategy kind is nil, use default NamespacedBuildStrategyKind") + ctxlog.Info(ctx, "buildStrategy kind is nil, use default NamespacedBuildStrategyKind") if err := r.validateBuildStrategy(ctx, s.Name, ns); err != nil { return err } @@ -245,7 +245,7 @@ func (r *ReconcileBuild) validateBuildStrategy(ctx context.Context, n string, ns return nil } } - return fmt.Errorf("BuildStrategy %s does not exist in namespace %s", n, ns) + return fmt.Errorf("buildStrategy %s does not exist in namespace %s", n, ns) } return nil } diff --git a/pkg/controller/build/build_controller_test.go b/pkg/controller/build/build_controller_test.go index 7183ba35e2..6bc0a7cf05 100644 --- a/pkg/controller/build/build_controller_test.go +++ b/pkg/controller/build/build_controller_test.go @@ -404,13 +404,13 @@ var _ = Describe("Reconcile Build", func() { return nil }) - statusCall := ctl.StubFunc(corev1.ConditionFalse, fmt.Sprintf("BuildStrategy %s does not exist in namespace %s", buildStrategyName, namespace)) + statusCall := ctl.StubFunc(corev1.ConditionFalse, fmt.Sprintf("buildStrategy %s does not exist in namespace %s", buildStrategyName, namespace)) statusWriter.UpdateCalls(statusCall) _, err := reconciler.Reconcile(request) Expect(err).To(HaveOccurred()) Expect(statusWriter.UpdateCallCount()).To(Equal(1)) - Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("BuildStrategy %s does not exist in namespace %s", buildStrategyName, namespace))) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("buildStrategy %s does not exist in namespace %s", buildStrategyName, namespace))) }) It("succeed when the strategy exists", func() { @@ -483,13 +483,13 @@ var _ = Describe("Reconcile Build", func() { return nil }) - statusCall := ctl.StubFunc(corev1.ConditionFalse, fmt.Sprintf("BuildStrategy %s does not exist in namespace %s", buildStrategyName, namespace)) + statusCall := ctl.StubFunc(corev1.ConditionFalse, fmt.Sprintf("buildStrategy %s does not exist in namespace %s", buildStrategyName, namespace)) statusWriter.UpdateCalls(statusCall) _, err := reconciler.Reconcile(request) Expect(err).To(HaveOccurred()) Expect(statusWriter.UpdateCallCount()).To(Equal(1)) - Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("BuildStrategy %s does not exist in namespace %s", buildStrategyName, namespace))) + Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("buildStrategy %s does not exist in namespace %s", buildStrategyName, namespace))) }) It("default to BuildStrategy and succeed if the strategy exists", func() { diff --git a/pkg/controller/buildrun/buildrun_controller.go b/pkg/controller/buildrun/buildrun_controller.go index 8d9d247c39..4c5b0a0098 100644 --- a/pkg/controller/buildrun/buildrun_controller.go +++ b/pkg/controller/buildrun/buildrun_controller.go @@ -187,11 +187,11 @@ func handleError(message string, listOfErrors ...error) error { // ValidateBuildRegistration verifies that a referenced Build is properly registered func (r *ReconcileBuildRun) ValidateBuildRegistration(ctx context.Context, build *buildv1alpha1.Build, buildRun *buildv1alpha1.BuildRun) error { if build.Status.Registered == "" { - err := fmt.Errorf("The Build is not yet validated, build: %s", build.Name) + err := fmt.Errorf("the Build is not yet validated, build: %s", build.Name) return err } if build.Status.Registered != corev1.ConditionTrue { - err := fmt.Errorf("The Build is not registered correctly, build: %s, registered status: %s, reason: %s", build.Name, build.Status.Registered, build.Status.Reason) + err := fmt.Errorf("the Build is not registered correctly, build: %s, registered status: %s, reason: %s", build.Name, build.Status.Registered, build.Status.Reason) updateErr := r.updateBuildRunErrorStatus(ctx, buildRun, err.Error()) return handleError("Build is not ready", err, updateErr) } @@ -324,7 +324,7 @@ func (r *ReconcileBuildRun) Reconcile(request reconcile.Request) (reconcile.Resu return reconcile.Result{}, err } } else { - ctxlog.Info(ctx, "TaskRun already exists", namespace, request.Namespace, name, request.Name) + ctxlog.Info(ctx, "taskRun already exists", namespace, request.Namespace, name, request.Name) err = r.GetBuildRunObject(ctx, lastTaskRun.Labels[buildv1alpha1.LabelBuildRun], request.Namespace, buildRun) if err != nil && !apierrors.IsNotFound(err) { @@ -338,7 +338,7 @@ func (r *ReconcileBuildRun) Reconcile(request reconcile.Request) (reconcile.Resu // finishes which would be missed otherwise. But, if the TaskRun was already completed and the status // synchronized into the BuildRun, then yet another reconciliation is not necessary. if buildRun.Status.CompletionTime != nil { - ctxlog.Info(ctx, "BuildRun already marked completed", namespace, request.Namespace, name, request.Name) + ctxlog.Info(ctx, "buildRun already marked completed", namespace, request.Namespace, name, request.Name) return reconcile.Result{}, nil } @@ -461,7 +461,7 @@ func (r *ReconcileBuildRun) retrieveServiceAccount(ctx context.Context, build *b if err != nil { return nil, err } - ctxlog.Debug(ctx, "Automatic generation of service account", namespace, serviceAccount.Namespace, name, serviceAccount.Name, "Operation", op) + ctxlog.Debug(ctx, "automatic generation of service account", namespace, serviceAccount.Namespace, name, serviceAccount.Name, "Operation", op) } else { // If ServiceAccount or the name of ServiceAccount in buildRun is nil, use pipeline serviceaccount if buildRun.Spec.ServiceAccount == nil || buildRun.Spec.ServiceAccount.Name == nil { @@ -560,7 +560,7 @@ func (r *ReconcileBuildRun) createTaskRun(ctx context.Context, build *buildv1alp // Set OwnerReference for BuildRun and TaskRun if err := r.setOwnerReferenceFunc(buildRun, generatedTaskRun, r.scheme); err != nil { updateErr := r.updateBuildRunErrorStatus(ctx, buildRun, err.Error()) - return nil, handleError("Failed to set OwnerReference for BuildRun and TaskRun", err, updateErr) + return nil, handleError("failed to set OwnerReference for BuildRun and TaskRun", err, updateErr) } return generatedTaskRun, nil diff --git a/pkg/controller/buildrun/buildrun_controller_test.go b/pkg/controller/buildrun/buildrun_controller_test.go index 9f4c40d25d..54eabba781 100644 --- a/pkg/controller/buildrun/buildrun_controller_test.go +++ b/pkg/controller/buildrun/buildrun_controller_test.go @@ -648,7 +648,7 @@ var _ = Describe("Reconcile BuildRun", func() { _, err := reconciler.Reconcile(buildRunRequest) Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(Equal(fmt.Sprintf("The Build is not yet validated, build: %s", buildName))) + Expect(err.Error()).To(Equal(fmt.Sprintf("the Build is not yet validated, build: %s", buildName))) Expect(client.StatusCallCount()).To(Equal(0)) }) diff --git a/test/integration/build_to_buildruns_test.go b/test/integration/build_to_buildruns_test.go index 9d2a9a7ea5..773cc9eafb 100644 --- a/test/integration/build_to_buildruns_test.go +++ b/test/integration/build_to_buildruns_test.go @@ -221,7 +221,7 @@ var _ = Describe("Integration tests Build and BuildRuns", func() { br, err := tb.GetBRTillCompletion(buildRunObject.Name) Expect(err).To(BeNil()) - Expect(br.Status.Reason).To(Equal(fmt.Sprintf("The Build is not registered correctly, build: %s, registered status: False, reason: secret fake-secret does not exist", BUILD+tb.Namespace))) + Expect(br.Status.Reason).To(Equal(fmt.Sprintf("the Build is not registered correctly, build: %s, registered status: False, reason: secret fake-secret does not exist", BUILD+tb.Namespace))) }) })