From 1fc2cec0a066636cbee0018efd031b338ea6c65d Mon Sep 17 00:00:00 2001 From: arcolife Date: Wed, 5 May 2021 00:42:25 +0530 Subject: [PATCH 1/3] upgrade ptypes.TimestampProto to timestamppb.New Signed-off-by: arcolife --- db/template.go | 10 +++++----- db/workflow.go | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/db/template.go b/db/template.go index 9e84ec2e2..043a8f067 100644 --- a/db/template.go +++ b/db/template.go @@ -6,7 +6,6 @@ import ( "fmt" "time" - "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/timestamp" "github.com/google/uuid" "github.com/pkg/errors" @@ -14,6 +13,7 @@ import ( wflow "github.com/tinkerbell/tink/workflow" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" ) // CreateTemplate creates a new workflow template @@ -83,8 +83,8 @@ func (d TinkDB) GetTemplate(ctx context.Context, fields map[string]string, delet ) err = row.Scan(&id, &name, &data, &createdAt, &updatedAt) if err == nil { - crAt, _ := ptypes.TimestampProto(createdAt) - upAt, _ := ptypes.TimestampProto(updatedAt) + crAt := timestamppb.New(createdAt) + upAt := timestamppb.New(updatedAt) return &tb.WorkflowTemplate{ Id: id, Name: name, @@ -160,8 +160,8 @@ func (d TinkDB) ListTemplates(filter string, fn func(id, n string, in, del *time return err } - tCr, _ := ptypes.TimestampProto(createdAt) - tUp, _ := ptypes.TimestampProto(updatedAt) + tCr := timestamppb.New(createdAt) + tUp := timestamppb.New(updatedAt) err = fn(id, name, tCr, tUp) if err != nil { return err diff --git a/db/workflow.go b/db/workflow.go index 34a8c8701..6474d3a20 100644 --- a/db/workflow.go +++ b/db/workflow.go @@ -11,7 +11,6 @@ import ( "strings" "time" - "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/timestamp" "github.com/google/uuid" "github.com/pkg/errors" @@ -19,6 +18,7 @@ import ( wflow "github.com/tinkerbell/tink/workflow" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/timestamppb" ) // Workflow represents a workflow instance in database @@ -351,8 +351,8 @@ func (d TinkDB) GetWorkflow(ctx context.Context, id string) (Workflow, error) { ) err := row.Scan(&tmp, &tar, &crAt, &upAt) if err == nil { - createdAt, _ := ptypes.TimestampProto(crAt) - updatedAt, _ := ptypes.TimestampProto(upAt) + createdAt := timestamppb.New(crAt) + updatedAt := timestamppb.New(upAt) return Workflow{ ID: id, Template: tmp, @@ -449,8 +449,8 @@ func (d TinkDB) ListWorkflows(fn func(wf Workflow) error) error { Template: tmp, Hardware: tar, } - wf.CreatedAt, _ = ptypes.TimestampProto(crAt) - wf.UpdatedAt, _ = ptypes.TimestampProto(upAt) + wf.CreatedAt = timestamppb.New(crAt) + wf.UpdatedAt = timestamppb.New(upAt) err = fn(wf) if err != nil { return err @@ -645,7 +645,7 @@ func (d TinkDB) ShowWorkflowEvents(wfID string, fn func(wfs *pb.WorkflowActionSt d.logger.Error(err) return err } - createdAt, _ := ptypes.TimestampProto(evTime) + createdAt := timestamppb.New(evTime) wfs := &pb.WorkflowActionStatus{ WorkerId: id, TaskName: tName, From 4d0652988a222133ae327c7a9c236cf691b51261 Mon Sep 17 00:00:00 2001 From: Gaurav Gahlot Date: Wed, 2 Jun 2021 18:37:48 +0530 Subject: [PATCH 2/3] adding tinkerbell community details Signed-off-by: Gaurav Gahlot --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index bd87c8f97..b87e4f280 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,24 @@ This repository is [Experimental](https://github.com/packethost/standards/blob/master/experimental-statement.md) meaning that it's based on untested ideas or techniques and not yet established or finalized or involves a radically new and innovative style! This means that support is best effort (at best!) and we strongly encourage you to NOT use this in production. +## License + +Tinkerbell is licensed under the Apache License, Version 2.0. See [LICENSE](./LICENSE) for the full license text. Some of the projects used by the Tinkerbell project may be governed by a different license, please refer to its specific license. + +Tinkerbell is part of the CNCF Projects. + +[![CNCF](https://github.com/cncf/artwork/blob/master/other/cncf/horizontal/color/cncf-color.png)](https://landscape.cncf.io/?selected=tinkerbell) + +## Community + +The Tinkerbell community meets bi-weekly on Tuesday. The meeting details can be found [here][7]. + +Community Resources: + +- [Community Slack](https://eqix-metal-community.slack.com/) +- [CNCF #tinkerbell](https://app.slack.com/client/T08PSQ7BQ/C01SRB41GMT) +- [YouTube Channel (demos, meeting recordings, virtual meetups)](https://www.youtube.com/channel/UCTzWInTQPvzH21KHS8jrq7A/featured) + ## What's Powering Tinkerbell? The Tinkerbell stack consists of several microservices, and a gRPC API: @@ -60,3 +78,4 @@ For complete documentation, please visit the Tinkerbell project hosted at [tinke [4]: https://github.com/tinkerbell/osie [5]: https://github.com/tinkerbell/hook [6]: https://github.com/tinkerbell/pbnj +[7]: https://docs.google.com/document/d/1cEObfvQ9Tdp8zIIIg9O7P5i3CKaSj2t3JTxEufDxwWs/ From 3a8f0eb590b06afa73d20570c5320f16d86fc92b Mon Sep 17 00:00:00 2001 From: Gaurav Gahlot Date: Wed, 2 Jun 2021 18:44:25 +0530 Subject: [PATCH 3/3] make ci happy Signed-off-by: Gaurav Gahlot --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b87e4f280..fb2c796eb 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ The Tinkerbell community meets bi-weekly on Tuesday. The meeting details can be Community Resources: -- [Community Slack](https://eqix-metal-community.slack.com/) -- [CNCF #tinkerbell](https://app.slack.com/client/T08PSQ7BQ/C01SRB41GMT) -- [YouTube Channel (demos, meeting recordings, virtual meetups)](https://www.youtube.com/channel/UCTzWInTQPvzH21KHS8jrq7A/featured) +- [Community Slack](https://eqix-metal-community.slack.com/) +- [CNCF #tinkerbell](https://app.slack.com/client/T08PSQ7BQ/C01SRB41GMT) +- [YouTube Channel (demos, meeting recordings, virtual meetups)](https://www.youtube.com/channel/UCTzWInTQPvzH21KHS8jrq7A/featured) ## What's Powering Tinkerbell?