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

Build fails with "incompatible type for field 3 in struct construction" #35

Open
hoeghh opened this issue Aug 23, 2016 · 1 comment
Open

Comments

@hoeghh
Copy link

hoeghh commented Aug 23, 2016

When i do a go build . i get

I run

export GOPATH=$(pwd)
go get ./...
go build .

And get

./main.go:134:3: error: range clause must have array, slice, string, map, or channel type
   for _, volumestr := range service.Volumes {
   ^
./main.go:134:7: error: invalid type for range clause
   for _, volumestr := range service.Volumes {
       ^
./main.go:115:59: error: incompatible type for field 3 in struct construction (cannot use type int32 as type int)
    ports = append(ports, api.ContainerPort{ContainerPort: int32(portNumber)})
                                                           ^

If i do

export GOROOT=/usr/lib/go
export GOPATH=$(pwd)
git pull
go get
go build .

i get

./main.go:52:18: error: reference to undefined identifier ‘config.ParseOptions’
  }, nil, &config.ParseOptions{})
                  ^
./main.go:52:30: error: missing ‘)’
  }, nil, &config.ParseOptions{})
                              ^
./main.go:61:6: error: reference to undefined field or method ‘ServiceConfigs’
  if p.ServiceConfigs == nil {
      ^
./main.go:64:11: error: reference to undefined field or method ‘ServiceConfigs’
  keys := p.ServiceConfigs.Keys()
           ^
./main.go:67:19: error: reference to undefined field or method ‘ServiceConfigs’
   service, ok := p.ServiceConfigs.Get(name)
                   ^
./main.go:103:3: error: range clause must have array, slice, string, map, or channel type
   for _, port := range service.Ports {
   ^
./main.go:121:3: error: range clause must have array, slice, string, map, or channel type
   for _, env := range service.Environment {
   ^
./main.go:134:3: error: range clause must have array, slice, string, map, or channel type
   for _, volumestr := range service.Volumes {
   ^
./main.go:66:2: error: range clause must have array, slice, string, map, or channel type
  for _, name := range keys {
  ^
./main.go:66:6: error: invalid type for range clause
  for _, name := range keys {
      ^
./main.go:49:15: error: too many arguments
  p := project.NewProject(&project.Context{
               ^
@germanramos
Copy link

This bug is fixed im my fork among many other features: https://github.com/germanramos/compose2kube

I am waiting for the pull request to be accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants