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

Update dependencies in glide.yaml for make to succeed in building odo binary #3369

Merged
merged 2 commits into from
Jun 20, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 8 additions & 13 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 0 additions & 21 deletions pkg/lclient/containers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/go-connections/nat"
gomock "github.com/golang/mock/gomock"
"github.com/openshift/odo/pkg/devfile/adapters/common"
)
Expand Down Expand Up @@ -183,16 +182,6 @@ func TestGetContainersList(t *testing.T) {
"component": "golang",
"8080": "testurl2",
},
HostConfig: container.HostConfig{
PortBindings: nat.PortMap{
nat.Port("8080/tcp"): []nat.PortBinding{
nat.PortBinding{
HostIP: "127.0.0.1",
HostPort: "54321",
},
},
},
},
},
{
Names: []string{"/go-test-build"},
Expand All @@ -203,16 +192,6 @@ func TestGetContainersList(t *testing.T) {
"alias": "alias1",
"8080": "testurl3",
},
HostConfig: container.HostConfig{
PortBindings: nat.PortMap{
nat.Port("8080/tcp"): []nat.PortBinding{
nat.PortBinding{
HostIP: "127.0.0.1",
HostPort: "65432",
},
},
},
},
Mounts: []types.MountPoint{
{
Destination: OdoSourceVolumeMount,
Expand Down
109 changes: 78 additions & 31 deletions pkg/lclient/fakeclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,82 @@ var mockImageSummary = []types.ImageSummary{
},
}

var mockContainerJSONList = []types.ContainerJSON{
types.ContainerJSON{
ContainerJSONBase: &types.ContainerJSONBase{
Name: "/node",
Image: "node",
ID: "1",
},
Mounts: []types.MountPoint{
{
Destination: OdoSourceVolumeMount,
},
},
Config: &container.Config{
Image: "node",
Labels: map[string]string{
"component": "test",
"alias": "alias1",
},
},
},
types.ContainerJSON{
ContainerJSONBase: &types.ContainerJSONBase{
Name: "/go-test",
Copy link
Contributor

@mik-dass mik-dass Jun 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? It's not related to anything we've modified so far in this. 🤔

Also, the tests are complaining elsehwere:

Applying URL changes                                                                           
 ✓  URL example: https://example.com created
                                                                                               
Applying URL changes                                                                           
 ✓  URL example: https://example.com created                                                   
--- FAIL: TestListDockerURL (0.00s)                                                            
    url_test.go:1471: Expected error since no physical env file to write   
    url_test.go:1476: Expected error since no physical env file to write                       
    --- FAIL: TestListDockerURL/Case_1:_Successfully_retrieve_the_URL_list (0.00s)             
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1f22172]
                                               
goroutine 73 [running]:              
testing.tRunner.func1.1(0x2091700, 0x3455d90)                                                  
        /usr/lib/golang/src/testing/testing.go:940 +0x421                                      
testing.tRunner.func1(0xc000223680)                                                            
        /usr/lib/golang/src/testing/testing.go:943 +0x600               
panic(0x2091700, 0x3455d90)                                                                    
        /usr/lib/golang/src/runtime/panic.go:975 +0x3e3               
github.com/openshift/odo/pkg/url.ListDockerURL(0xc000560b20, 0x22673bc, 0x6, 0xc00007fbc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/dshah/go/src/github.com/openshift/odo/pkg/url/url.go:528 +0xc92
github.com/openshift/odo/pkg/url.TestListDockerURL.func1(0xc000223680)                         
        /home/dshah/go/src/github.com/openshift/odo/pkg/url/url_test.go:1528 +0xd1
testing.tRunner(0xc000223680, 0xc000560f40)
        /usr/lib/golang/src/testing/testing.go:991 +0x1ec
created by testing.(*T).Run
        /usr/lib/golang/src/testing/testing.go:1042 +0x661
FAIL    github.com/openshift/odo/pkg/url        0.758s
ok      github.com/openshift/odo/pkg/url/labels (cached)
--- FAIL: TestGetAbsPath (0.00s)
    util_test.go:513: Running test:  Case 1: Valid abs path resolution of `~`
    --- FAIL: TestGetAbsPath/Case_1:_Valid_abs_path_resolution_of_`~` (0.00s)
        util_test.go:538: Expected /home/dshah/, got /home/dshah
    util_test.go:513: Running test:  Case 2: Valid abs path resolution of `.`
FAIL
FAIL    github.com/openshift/odo/pkg/util       0.504s
?       github.com/openshift/odo/pkg/version    [no test files]
ok      github.com/openshift/odo/pkg/watch      (cached)
FAIL
make: *** [Makefile:144: test] Error 1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? It's not related to anything we've modified so far in this. 🤔

Ah, my bad.

Image: "golang",
ID: "2",
HostConfig: &container.HostConfig{
PortBindings: nat.PortMap{
nat.Port("8080/tcp"): []nat.PortBinding{
nat.PortBinding{
HostIP: "127.0.0.1",
HostPort: "54321",
},
},
},
},
},
Config: &container.Config{
Image: "golang",
Labels: map[string]string{
"component": "golang",
"8080": "testurl2",
},
},
},
types.ContainerJSON{
ContainerJSONBase: &types.ContainerJSONBase{
Name: "/go-test-build",
Image: "golang",
ID: "3",
HostConfig: &container.HostConfig{
PortBindings: nat.PortMap{
nat.Port("8080/tcp"): []nat.PortBinding{
nat.PortBinding{
HostIP: "127.0.0.1",
HostPort: "65432",
},
},
},
},
},
Mounts: []types.MountPoint{
{
Destination: OdoSourceVolumeMount,
},
},
Config: &container.Config{
Image: "golang",
Labels: map[string]string{
"component": "test",
"alias": "alias1",
mik-dass marked this conversation as resolved.
Show resolved Hide resolved
"8080": "testurl3",
},
},
},
}

var mockContainerList = []types.Container{
types.Container{
Names: []string{"/node"},
Expand All @@ -62,16 +138,6 @@ var mockContainerList = []types.Container{
"component": "golang",
"8080": "testurl2",
},
HostConfig: container.HostConfig{
PortBindings: nat.PortMap{
nat.Port("8080/tcp"): []nat.PortBinding{
nat.PortBinding{
HostIP: "127.0.0.1",
HostPort: "54321",
},
},
},
},
},
types.Container{
Names: []string{"/go-test-build"},
Expand All @@ -87,16 +153,6 @@ var mockContainerList = []types.Container{
Destination: OdoSourceVolumeMount,
},
},
HostConfig: container.HostConfig{
PortBindings: nat.PortMap{
nat.Port("8080/tcp"): []nat.PortBinding{
nat.PortBinding{
HostIP: "127.0.0.1",
HostPort: "65432",
},
},
},
},
},
}

Expand Down Expand Up @@ -143,18 +199,9 @@ func (m *mockDockerClient) ContainerRemove(ctx context.Context, containerID stri
}

func (m *mockDockerClient) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) {
for _, containerElement := range mockContainerList {
for _, containerElement := range mockContainerJSONList {
if containerElement.ID == containerID {
containerConfig := container.Config{
Image: containerElement.Image,
Labels: containerElement.Labels,
}
return types.ContainerJSON{
ContainerJSONBase: &types.ContainerJSONBase{
HostConfig: &containerElement.HostConfig,
},
Config: &containerConfig,
}, nil
return containerElement, nil
}
}
return types.ContainerJSON{}, nil
Expand Down
28 changes: 15 additions & 13 deletions vendor/github.com/docker/docker/api/types/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions vendor/github.com/docker/go-connections/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions vendor/github.com/docker/go-connections/circle.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions vendor/github.com/docker/go-connections/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions vendor/github.com/docker/go-connections/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading