Skip to content

Commit

Permalink
Remove some unneeded renames.
Browse files Browse the repository at this point in the history
  • Loading branch information
deverton-godaddy committed Jan 12, 2024
1 parent 9a8705b commit aa690c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions reapers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import (
"context"

"github.com/cilium/cilium/api/v1/models"
"github.com/hashicorp/nomad/api"
nomad_api "github.com/hashicorp/nomad/api"
)

type AllocationInfo interface {
Info(allocID string, q *api.QueryOptions) (*api.Allocation, *api.QueryMeta, error)
Info(allocID string, q *nomad_api.QueryOptions) (*nomad_api.Allocation, *nomad_api.QueryMeta, error)
}

type EventStreamer interface {
Stream(ctx context.Context, topics map[api.Topic][]string, index uint64, q *api.QueryOptions) (<-chan *api.Events, error)
Stream(ctx context.Context, topics map[nomad_api.Topic][]string, index uint64, q *nomad_api.QueryOptions) (<-chan *nomad_api.Events, error)
}

type EndpointLister interface {
Expand Down
18 changes: 9 additions & 9 deletions reapers/endpoints_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import (
"testing"

"github.com/cilium/cilium/api/v1/models"
"github.com/cilium/cilium/pkg/endpoint/id"
"github.com/hashicorp/nomad/api"
endpoint_id "github.com/cilium/cilium/pkg/endpoint/id"
nomad_api "github.com/hashicorp/nomad/api"
)

type allocationInfoMock struct {
infoFn func(allocID string, q *api.QueryOptions) (*api.Allocation, *api.QueryMeta, error)
infoFn func(allocID string, q *nomad_api.QueryOptions) (*nomad_api.Allocation, *nomad_api.QueryMeta, error)
}

func (p *allocationInfoMock) Info(allocID string, q *api.QueryOptions) (*api.Allocation, *api.QueryMeta, error) {
func (p *allocationInfoMock) Info(allocID string, q *nomad_api.QueryOptions) (*nomad_api.Allocation, *nomad_api.QueryMeta, error) {
if p != nil && p.infoFn != nil {
return p.infoFn(allocID, q)
}
Expand Down Expand Up @@ -60,12 +60,12 @@ func TestEndpointReconcile(t *testing.T) {
},
},
}
allocationOne := &api.Allocation{
allocationOne := &nomad_api.Allocation{
ID: "containerID",
JobID: "jobID",
Namespace: "namespace",
TaskGroup: "taskGroup",
Job: &api.Job{
Job: &nomad_api.Job{
Meta: map[string]string{},
},
}
Expand Down Expand Up @@ -93,7 +93,7 @@ func TestEndpointReconcile(t *testing.T) {
},
},
&allocationInfoMock{
infoFn: func(allocID string, q *api.QueryOptions) (*api.Allocation, *api.QueryMeta, error) {
infoFn: func(allocID string, q *nomad_api.QueryOptions) (*nomad_api.Allocation, *nomad_api.QueryMeta, error) {
t.Fatalf("unexpected call to allocation info")
return nil, nil, nil
},
Expand All @@ -107,7 +107,7 @@ func TestEndpointReconcile(t *testing.T) {
return []*models.Endpoint{endpointOne}, nil
},
endpointPatchFn: func(endpointID string, ep *models.EndpointChangeRequest) error {
expectedID := id.NewCiliumID(endpointOne.ID)
expectedID := endpoint_id.NewCiliumID(endpointOne.ID)
expectedContainerID := endpointOne.Status.ExternalIdentifiers.ContainerID

if endpointID != expectedID {
Expand All @@ -126,7 +126,7 @@ func TestEndpointReconcile(t *testing.T) {
},
},
&allocationInfoMock{
infoFn: func(allocID string, q *api.QueryOptions) (*api.Allocation, *api.QueryMeta, error) {
infoFn: func(allocID string, q *nomad_api.QueryOptions) (*nomad_api.Allocation, *nomad_api.QueryMeta, error) {
expectedContainerID := endpointOne.Status.ExternalIdentifiers.ContainerID
if allocID != expectedContainerID {
t.Errorf("wrong container ID passed, expected %v, got %v", expectedContainerID, allocID)
Expand Down

0 comments on commit aa690c3

Please sign in to comment.