Skip to content

Commit

Permalink
Update dependencies (tink) (#98)
Browse files Browse the repository at this point in the history
Signed-off-by: Kelly Deng <[email protected]>

## Description

<!--- Please describe what this PR is going to change -->
Following the merge of tinkerbell/tink#345, the `github/tinkerbell/tink` dependency in `go.mod` needs to be updated to point to the latest master.

## Why is this needed

<!--- Link to issue you have raised -->
The PR tinkerbell/tink#345 updated the protobuf files and as a result, boots (still importing an older version of tink) can no longer properly communicate with the latest version of tink.

Fixes: #

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

* Tests pass
* Tested manually

## How are existing users impacted? What migration steps/scripts do we need?

<!--- Fixes a bug, unblocks installation, removes a component of the stack etc -->
<!--- Requires a DB migration script, etc. -->


## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
  • Loading branch information
mergify[bot] authored Nov 11, 2020
2 parents 47569a7 + 1a12285 commit e81a291
Show file tree
Hide file tree
Showing 7 changed files with 565 additions and 96 deletions.
24 changes: 15 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,28 @@ require (
github.com/davecgh/go-spew v1.1.1
github.com/gammazero/workerpool v0.0.0-20200311205957-7b00833861c6
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6
github.com/golang/mock v1.4.3
github.com/google/uuid v1.1.1
github.com/golang/mock v1.4.4
github.com/google/uuid v1.1.2
github.com/packethost/cacher v0.0.0-20200825140532-0b62e6726807
github.com/packethost/dhcp4-go v0.0.0-20190402165401-39c137f31ad3
github.com/packethost/pkg v0.0.0-20200903155310-0433e0605550
github.com/pkg/errors v0.8.1
github.com/prometheus/client_golang v1.6.0
github.com/sebest/xff v0.0.0-20160910043805-6c115e0ffa35
github.com/sergi/go-diff v1.0.0 // indirect
github.com/stretchr/testify v1.4.0
github.com/stretchr/testify v1.6.1
github.com/tinkerbell/tftp-go v0.0.0-20200825172122-d9200358b6cd
github.com/tinkerbell/tink v0.0.0-20200806104854-0f947d87c35f
go.uber.org/zap v1.10.0
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
golang.org/x/net v0.0.0-20200625001655-4c5254603344 // indirect
google.golang.org/grpc v1.29.1
github.com/tinkerbell/tink v0.0.0-20201109122352-0e8e57332303
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.16.0
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/net v0.0.0-20200904194848-62affa334b73 // indirect
golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6 // indirect
golang.org/x/text v0.3.3 // indirect
golang.org/x/tools v0.0.0-20200921190806-0f52b63a40e8 // indirect
google.golang.org/genproto v0.0.0-20200921165018-b9da36f5f452 // indirect
google.golang.org/grpc v1.32.0
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
)

replace github.com/sebest/xff v0.0.0-20160910043805-6c115e0ffa35 => github.com/packethost/xff v0.0.0-20190305172552-d3e9190c41b3
509 changes: 486 additions & 23 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion job/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type Job struct {
// hwID is the hardware/worker ID corresponding to the MAC
func hasActiveWorkflow(wcl *tw.WorkflowContextList) (bool, error) {
for _, wf := range (*wcl).WorkflowContexts {
if wf.CurrentActionState == tw.ActionState_ACTION_PENDING {
if wf.CurrentActionState == tw.State_STATE_PENDING {
joblog.With("workflowID", wf.WorkflowId).Info("found active workflow for hardware")
return true, nil
}
Expand Down
4 changes: 2 additions & 2 deletions packet/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Client struct {
consumerToken string
authToken string
hardwareClient hardwareGetter
workflowClient tw.WorkflowSvcClient
workflowClient tw.WorkflowServiceClient
}

func NewClient(consumerToken, authToken string, baseURL *url.URL) (*Client, error) {
Expand All @@ -47,7 +47,7 @@ func NewClient(consumerToken, authToken string, baseURL *url.URL) (*Client, erro
}

var hg hardwareGetter
var wg tw.WorkflowSvcClient
var wg tw.WorkflowServiceClient
var err error
dataModelVersion := os.Getenv("DATA_MODEL_VERSION")
switch dataModelVersion {
Expand Down
6 changes: 3 additions & 3 deletions packet/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"os"

"github.com/packethost/cacher/protos/cacher"
tpkg "github.com/tinkerbell/tink/pkg"
tink "github.com/tinkerbell/tink/protos/hardware"
tw "github.com/tinkerbell/tink/protos/workflow"
tinkUtil "github.com/tinkerbell/tink/util"

"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -104,7 +104,7 @@ func (c *Client) DiscoverHardwareFromDHCP(mac net.HardwareAddr, giaddr net.IP, c
return nil, errors.Wrap(err, "get hardware by mac from tink")
}

b, err := json.Marshal(&tinkUtil.HardwareWrapper{Hardware: resp}) // uses HardwareWrapper for its custom marshaler
b, err := json.Marshal(&tpkg.HardwareWrapper{Hardware: resp}) // uses HardwareWrapper for its custom marshaler
if err != nil {
return nil, errors.New("marshalling tink hardware")
}
Expand Down Expand Up @@ -196,7 +196,7 @@ func (c *Client) DiscoverHardwareFromIP(ip net.IP) (Discovery, error) {
return nil, errors.Wrap(err, "get hardware by ip from tink")
}

b, err = json.Marshal(&tinkUtil.HardwareWrapper{Hardware: resp}) // uses HardwareWrapper for its custom marshaler
b, err = json.Marshal(&tpkg.HardwareWrapper{Hardware: resp}) // uses HardwareWrapper for its custom marshaler
if err != nil {
return nil, errors.New("marshalling tink hardware")
}
Expand Down
2 changes: 1 addition & 1 deletion packet/endpoints_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func TestGetWorkflowsFromTink(t *testing.T) {
c := NewMockClient(u)
ctrl := gomock.NewController(t)
defer ctrl.Finish()
cMock := workflowMock.NewMockWorkflowSvcClient(ctrl)
cMock := workflowMock.NewMockWorkflowServiceClient(ctrl)
cMock.EXPECT().GetWorkflowContextList(gomock.Any(), gomock.Any()).Return(test.wcl, test.err)
c.workflowClient = cMock
w, err := c.GetWorkflowsFromTink(test.hwID)
Expand Down
Loading

0 comments on commit e81a291

Please sign in to comment.