From 194b004fc3c1636dc23cc1d9702a04f1ed0634a7 Mon Sep 17 00:00:00 2001 From: Yuan Chen Date: Fri, 10 May 2024 09:56:51 -0700 Subject: [PATCH] Fix typos and format issues Signed-off-by: Yuan Chen Remove venv Signed-off-by: Yuan Chen Add venv to gitignore Signed-off-by: Yuan Chen --- .gitignore | 1 + README.md | 2 +- pkg/engine/check_object_task.go | 2 +- resources/templates/example.yml | 6 +++--- resources/templates/k8s/failed-job.yml | 4 ++-- resources/templates/k8s/job.yml | 4 ++-- resources/templates/k8s/jobset-with-driver.yml | 12 ++++++------ resources/templates/k8s/jobset.yml | 10 +++++----- resources/tests/k8s/test-failed-job.yml | 2 +- resources/tests/volcano/test-job.yml | 2 +- 10 files changed, 23 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 5e56e04..45a20f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /bin +/venv diff --git a/README.md b/README.md index 5acdaec..67d8fca 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Knavigator is a project designed to analyze, optimize, and compare scheduling sy The term "knavigator" is derived from "navigator," with a silent "k" prefix representing "kubernetes." Much like a navigator, this initiative assists in charting a secure route and steering clear of obstacles within the cluster. -Knavigator interfaces with Kubernetes clusters to manage tasks such as manupulating with Kubernetes objects, evaluating PromQL queries, as well as executing specific operations. +Knavigator interfaces with Kubernetes clusters to manage tasks such as manipulating with Kubernetes objects, evaluating PromQL queries, as well as executing specific operations. Knavigator can operate both outside and inside a Kubernetes cluster, leveraging the Kubernetes API for task management. diff --git a/pkg/engine/check_object_task.go b/pkg/engine/check_object_task.go index 8e744f9..4d24e32 100644 --- a/pkg/engine/check_object_task.go +++ b/pkg/engine/check_object_task.go @@ -151,7 +151,7 @@ func (task *CheckObjTask) checkStateAsync(ctx context.Context, name string, info } } -// checkState validates state conformance and removes object name from the map if succeded +// checkState validates state conformance and removes object name from the map if succeeded func (task *CheckObjTask) checkState(ctx context.Context, name string, info *ObjInfo, nameMap *utils.SyncMap) error { cr, err := task.client.Resource(info.GVR).Namespace(info.Namespace).Get(ctx, name, metav1.GetOptions{}) if err != nil { diff --git a/resources/templates/example.yml b/resources/templates/example.yml index ea15601..444ac04 100644 --- a/resources/templates/example.yml +++ b/resources/templates/example.yml @@ -9,9 +9,9 @@ spec: template: metadata: annotations: - orgName: {{or .orgName "my-org" }} - teamName: {{or .teamName "my-team" }} - userName: "{{or .userName "my-user"}}" + orgName: {{or .orgName "my-org"}} + teamName: {{or .teamName "my-team"}} + userName: {{or .userName "my-user"}} labels: obj-name: test instance: {{.instance}} diff --git a/resources/templates/k8s/failed-job.yml b/resources/templates/k8s/failed-job.yml index ad011a0..dc730e0 100644 --- a/resources/templates/k8s/failed-job.yml +++ b/resources/templates/k8s/failed-job.yml @@ -1,11 +1,11 @@ apiVersion: batch/v1 -kind: Job +kind: Job metadata: name: "{{._NAME_}}" namespace: "{{.namespace}}" spec: backoffLimit: {{.backoffLimit}} - completions: {{.completions}} + completions: {{.completions}} parallelism: {{.parallelism}} completionMode: {{.completionMode}} template: diff --git a/resources/templates/k8s/job.yml b/resources/templates/k8s/job.yml index 7ebdcdb..0b37041 100644 --- a/resources/templates/k8s/job.yml +++ b/resources/templates/k8s/job.yml @@ -1,11 +1,11 @@ apiVersion: batch/v1 -kind: Job +kind: Job metadata: name: "{{._NAME_}}" namespace: "{{.namespace}}" spec: backoffLimit: {{.backoffLimit}} - completions: {{.completions}} + completions: {{.completions}} parallelism: {{.parallelism}} completionMode: {{.completionMode}} template: diff --git a/resources/templates/k8s/jobset-with-driver.yml b/resources/templates/k8s/jobset-with-driver.yml index a2d96ed..37919d0 100644 --- a/resources/templates/k8s/jobset-with-driver.yml +++ b/resources/templates/k8s/jobset-with-driver.yml @@ -1,11 +1,11 @@ apiVersion: jobset.x-k8s.io/v1alpha2 -kind: JobSet +kind: JobSet metadata: name: "{{._NAME_}}" namespace: "{{.namespace}}" spec: -# We want to declare our JobSet successful if workers finish. -# If workers finish we should clean up the remaining replicatedJobs. + # We want to declare our JobSet successful if workers finish. + # If workers finish we should clean up the remaining replicatedJobs. successPolicy: operator: All targetReplicatedJobs: @@ -16,7 +16,7 @@ spec: template: spec: # Set backoff limit to 0 so job will immediately fail if any pod fails. - backoffLimit: 0 + backoffLimit: 0 completions: 1 parallelism: 1 template: @@ -25,11 +25,11 @@ spec: - name: driver image: {{.image}} - name: workers - replicas: {{.replicas}} + replicas: {{.replicas}} template: spec: backoffLimit: {{.backoffLimit}} - completions: {{.completions}} + completions: {{.completions}} parallelism: {{.parallelism}} completionMode: {{.completionMode}} template: diff --git a/resources/templates/k8s/jobset.yml b/resources/templates/k8s/jobset.yml index 907bd6a..aebbd68 100644 --- a/resources/templates/k8s/jobset.yml +++ b/resources/templates/k8s/jobset.yml @@ -1,22 +1,22 @@ apiVersion: jobset.x-k8s.io/v1alpha2 -kind: JobSet +kind: JobSet metadata: name: "{{._NAME_}}" namespace: "{{.namespace}}" spec: -# We want to declare our JobSet successful if workers finish. -# If workers finish we should clean up the remaining replicatedJobs. + # We want to declare our JobSet successful if workers finish. + # If workers finish we should clean up the remaining replicatedJobs. successPolicy: operator: All targetReplicatedJobs: - workers replicatedJobs: - name: workers - replicas: {{.replicas}} + replicas: {{.replicas}} template: spec: backoffLimit: {{.backoffLimit}} - completions: {{.completions}} + completions: {{.completions}} parallelism: {{.parallelism}} completionMode: {{.completionMode}} template: diff --git a/resources/tests/k8s/test-failed-job.yml b/resources/tests/k8s/test-failed-job.yml index 53e6b67..bfaa897 100644 --- a/resources/tests/k8s/test-failed-job.yml +++ b/resources/tests/k8s/test-failed-job.yml @@ -32,6 +32,6 @@ tasks: - id: status type: CheckPod params: - refTaskId: job + refTaskId: job status: Failed timeout: 10s diff --git a/resources/tests/volcano/test-job.yml b/resources/tests/volcano/test-job.yml index bc3f867..20e388d 100644 --- a/resources/tests/volcano/test-job.yml +++ b/resources/tests/volcano/test-job.yml @@ -22,7 +22,7 @@ tasks: pods: range: pattern: "{{._NAME_}}-test-{{._INDEX_}}" - ranges: ["0-1"] + ranges: ["0-1"] - id: status type: CheckPod params: