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

Codespell fixes #154

Merged
merged 4 commits into from
Jun 4, 2020
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions .codespell-whitelist
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
alls
ba
cas
7 changes: 6 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,18 @@ steps:
commands:
- CGO_ENABLED=0 go test -v ./...

- name: check spelling
image: nixos/nix
commands:
- ./ci-checks.sh

- name: build
image: golang:1.13-alpine3.11
commands:
- apk add --update make
- make

- name: fmt_lint_check
- name: fmt and lint check of go code
image: golang:1.13-alpine3.11
commands:
- apk add --update make
Expand Down
4 changes: 4 additions & 0 deletions ci-checks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash

codespell -q 3 -I .codespell-whitelist *
4 changes: 2 additions & 2 deletions cmd/tink-worker/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func executeAction(ctx context.Context, action *pb.WorkflowAction, wfID string)
}
}
log.Infoln("Action container exits with status code ", status)
return fmt.Sprintf("Successfull Execution"), status, nil
return fmt.Sprintf("Successful Execution"), status, nil
}

func captureLogs(ctx context.Context, id string) {
Expand Down Expand Up @@ -271,7 +271,7 @@ func removeContainer(ctx context.Context, id string) error {
func initializeDockerClient() (*client.Client, error) {
registry = os.Getenv("DOCKER_REGISTRY")
if registry == "" {
return nil, errors.New("requried DOCKER_REGISTRY")
return nil, errors.New("required DOCKER_REGISTRY")
}
c, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/tink-worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type WorkflowMetadata struct {
func processWorkflowActions(client pb.WorkflowSvcClient) error {
workerID := os.Getenv("WORKER_ID")
if workerID == "" {
return fmt.Errorf("requried WORKER_NAME")
return fmt.Errorf("required WORKER_NAME")
}
log = logger.WithField("worker_id", workerID)
ctx := context.Background()
Expand Down
14 changes: 7 additions & 7 deletions db/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func insertIntoWfWorkerTable(ctx context.Context, db *sql.DB, wfID uuid.UUID, wo
INSERT INTO
workflow_worker_map (workflow_id, worker_id)
SELECT $1, $2
WHERE
WHERE
NOT EXISTS (
SELECT workflow_id FROM workflow_worker_map WHERE workflow_id = $1 AND worker_id = $2
);
Expand Down Expand Up @@ -149,7 +149,7 @@ func insertActionList(ctx context.Context, db *sql.DB, yamlData string, id uuid.
if err != nil {
return err
} else if workerID == "" {
return fmt.Errorf("Hardware mentioned with refernece %s not found", task.WorkerAddr)
return fmt.Errorf("Hardware mentioned with reference %s not found", task.WorkerAddr)
}
workerUID, err := uuid.FromString(workerID)
if err != nil {
Expand Down Expand Up @@ -546,8 +546,8 @@ func UpdateWorkflowState(ctx context.Context, db *sql.DB, wfContext *pb.Workflow
UPDATE workflow_state
SET current_task_name = $2,
current_action_name = $3,
current_action_state = $4,
current_worker = $5,
current_action_state = $4,
current_worker = $5,
current_action_index = $6
WHERE
workflow_id = $1;
Expand Down Expand Up @@ -649,9 +649,9 @@ func ShowWorkflowEvents(db *sql.DB, wfID string, fn func(wfs pb.WorkflowActionSt
rows, err := db.Query(`
SELECT worker_id, task_name, action_name, execution_time, message, status, created_at
FROM workflow_event
WHERE
WHERE
workflow_id = $1
ORDER BY
ORDER BY
created_at ASC;
`, wfID)

Expand Down Expand Up @@ -797,7 +797,7 @@ func getWorkerID(ctx context.Context, db *sql.DB, addr string) (string, error) {

func isValidLength(name string) error {
if len(name) > 200 {
return fmt.Errorf("Task/Action Name %s in the Temlate as more than 200 characters", name)
return fmt.Errorf("Task/Action Name %s in the Template as more than 200 characters", name)
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions docs/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ tasks:
- /statedir:/statedir
```

A template comprises Tasks, which are executed in a sequential manner. A task can consits multiple Actions. As can be in the above example, a task supports volumes and environment variables. The volumes and environment variables defined for a particular task level are inherited by each action in that particular task.
A template comprises Tasks, which are executed in a sequential manner. A task can consists multiple Actions. As can be in the above example, a task supports volumes and environment variables. The volumes and environment variables defined for a particular task level are inherited by each action in that particular task.

It is important to note that an action can also have its own volumes and environment variables. Therefore, any entry at an action will overwrite the value defined at the task level. For example, in the above template the `MIRROR_HOST` environment variable defined at action `disk-partition` will overwrite the value defined at task level. However, the other actions will receive the original value defined at the task level.

Expand All @@ -61,7 +61,7 @@ The provisioner machine is the main driver for executing a workflow. A provision
- Kibana
- NGINX

It is upto you if you would like to divide these components into multiple servers.
It is up to you if you would like to divide these components into multiple servers.

### Worker

Expand Down
2 changes: 1 addition & 1 deletion grpc-server/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (s *server) CreateTemplate(ctx context.Context, in *template.WorkflowTempla

msg := ""
labels["op"] = "createtemplate"
msg = "creating a new Teamplate"
msg = "creating a new Template"
id := uuid.NewV4()
fn := func() error { return db.CreateTemplate(ctx, s.db, in.Name, in.Data, id) }

Expand Down
2 changes: 1 addition & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ generate_certificates() {
if [ -d "$deploy"/certs ]; then
echo "$WARN found certs directory"
if grep -q "\"$TINKERBELL_HOST_IP\"" "$deploy"/tls/server-csr.in.json; then
echo "$WARN found server enty in TLS"
echo "$WARN found server entry in TLS"
echo "$INFO found existing certificates for host $TINKERBELL_HOST_IP, skipping certificate generation"
else
gen_certs
Expand Down
1 change: 1 addition & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ mkShell {
buildInputs = [
gnumake
go
pythonPackages.codespell
shfmt
shellcheck
terraform
Expand Down
4 changes: 2 additions & 2 deletions test/framework/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func createWorkerImage() error {
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
logger.Errorln("Faield to create worker image", err)
logger.Errorln("Failed to create worker image", err)
}
logger.Infoln("Worker Image created")
return err
Expand Down Expand Up @@ -104,7 +104,7 @@ func StartStack() error {
// Docker compose file for starting the containers
filepath := "../test-docker-compose.yml"

// Intialize logger
// Initialize logger
initializeLogger()

// Start Db and logging components
Expand Down
2 changes: 1 addition & 1 deletion test/framework/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func waitContainer(ctx context.Context, cli *dc.Client, id string, wg *sync.Wait
select {
case status := <-wait:
statusChannel <- status.StatusCode
fmt.Println("Worker with id ", id, "finished sucessfully with status code ", status.StatusCode)
fmt.Println("Worker with id ", id, "finished successfully with status code ", status.StatusCode)
//stopLogs <- true
case err := <-errC:
log.Println("Worker with id ", id, "failed : ", err)
Expand Down