Skip to content

Commit

Permalink
typo: Fix some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
googs1025 committed Feb 14, 2024
1 parent d0d32af commit 70e6f9b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions pkg/util/testing/wrappers.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (j *JobSetWrapper) FailurePolicy(policy *jobset.FailurePolicy) *JobSetWrapp
return j
}

// StartuPolicy sets the value of jobSet.spec.startupPolicy
// StartupPolicy sets the value of jobSet.spec.startupPolicy
func (j *JobSetWrapper) StartupPolicy(policy *jobset.StartupPolicy) *JobSetWrapper {
j.Spec.StartupPolicy = policy
return j
Expand All @@ -84,7 +84,7 @@ func (j *JobSetWrapper) SetLabels(labels map[string]string) *JobSetWrapper {
return j
}

// GenerateName sets the JobSet name.
// SetGenerateName sets the JobSet name.
func (j *JobSetWrapper) SetGenerateName(namePrefix string) *JobSetWrapper {
// Name and GenerateName are mutually exclusive, so we must unset the Name field.
j.Name = ""
Expand Down Expand Up @@ -187,7 +187,7 @@ func (j *JobTemplateWrapper) CompletionMode(mode batchv1.CompletionMode) *JobTem
return j
}

// Containers sets the pod template spec containers.
// PodSpec Containers sets the pod template spec containers.
func (j *JobTemplateWrapper) PodSpec(podSpec corev1.PodSpec) *JobTemplateWrapper {
j.Spec.Template.Spec = podSpec
return j
Expand All @@ -209,7 +209,7 @@ type JobWrapper struct {
batchv1.Job
}

// MakeJobWrapper creates a wrapper for a Job.
// MakeJob creates a wrapper for a Job.
func MakeJob(jobName, ns string) *JobWrapper {
return &JobWrapper{
batchv1.Job{
Expand Down
4 changes: 2 additions & 2 deletions pkg/webhooks/pod_admission_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (p *podWebhook) ValidateCreate(ctx context.Context, obj runtime.Object) (ad
return nil, err
}
if !leaderScheduled {
return nil, fmt.Errorf("leader pod not yet scheduled, not creating follower pod. this is an expected, transient error.")
return nil, fmt.Errorf("leader pod not yet scheduled, not creating follower pod. this is an expected, transient error")
}
return nil, nil
}
Expand Down Expand Up @@ -104,7 +104,7 @@ func (p *podWebhook) leaderPodForFollower(ctx context.Context, pod *corev1.Pod)

// Validate there is only 1 leader pod for this job.
if len(podList.Items) != 1 {
return nil, fmt.Errorf("expected 1 leader pod (%s), but got %d. this is an expected, transient error.", leaderPodName, len(podList.Items))
return nil, fmt.Errorf("expected 1 leader pod (%s), but got %d. this is an expected, transient error", leaderPodName, len(podList.Items))
}

// Check if the leader pod is scheduled.
Expand Down
4 changes: 2 additions & 2 deletions pkg/webhooks/pod_mutating_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func NewPodWebhook(mgr ctrl.Manager) *podWebhook {
return &podWebhook{client: mgr.GetClient()}
}

// SetupMutatingWebhook configures the mutating webhook for pods.
// SetupWebhookWithManager configures the mutating webhook for pods.
func (p *podWebhook) SetupWebhookWithManager(mgr ctrl.Manager) error {
return ctrl.NewWebhookManagedBy(mgr).
For(&corev1.Pod{}).
Expand All @@ -50,7 +50,7 @@ func (p *podWebhook) SetupWebhookWithManager(mgr ctrl.Manager) error {
Complete()
}

// InjectDecoder, when defined, will result in the decoder automatically being set.
// InjectDecoder injects the decoder into the podWebhook.
func (p *podWebhook) InjectDecoder(d *admission.Decoder) error {
p.decoder = d
return nil
Expand Down

0 comments on commit 70e6f9b

Please sign in to comment.