Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typo: Fix some comments #426

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/util/testing/wrappers.go
Original file line number Diff line number Diff line change
@@ -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
@@ -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 = ""
@@ -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
@@ -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{
4 changes: 2 additions & 2 deletions pkg/webhooks/pod_admission_webhook.go
Original file line number Diff line number Diff line change
@@ -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")
googs1025 marked this conversation as resolved.
Show resolved Hide resolved
}
return nil, nil
}
@@ -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.
4 changes: 2 additions & 2 deletions pkg/webhooks/pod_mutating_webhook.go
Original file line number Diff line number Diff line change
@@ -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{}).
@@ -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