Issue with Forking Tyk


#1

Im currently trying to fork tyk, to my repo, and build it and im getting the following error:

./tyk_reverse_proxy_clone.go:147: spec.APIDefinition.Proxy.TargetList undefined (type struct { PreserveHostHeader bool "bson:\"preserve_host_header\" json:\"preserve_host_header\""; ListenPath string "bson:\"listen_path\" json:\"listen_path\""; TargetURL string "bson:\"target_url\" json:\"target_url\""; StripListenPath bool "bson:\"strip_listen_path\" json:\"strip_listen_path\""; EnableLoadBalancing bool "bson:\"enable_load_balancing\" json:\"enable_load_balancing\""; Targets []string "bson:\"target_list\" json:\"target_list\""; StructuredTargetList tykcommon.HostList "bson:\"-\" json:\"-\""; CheckHostAgainstUptimeTests bool "bson:\"check_host_against_uptime_tests\" json:\"check_host_against_uptime_tests\""; ServiceDiscovery tykcommon.ServiceDiscoveryConfiguration "bson:\"service_discovery\" json:\"service_discovery\"" } has no field or method TargetList)

Anyone have any clue? I cannot find anything. If my gopath has github.com/TykTechnologies/tyk it will build fine, but if i do something like github.com/Foo/tyk it will not build any longer.


#2

Hi Eric, are you using an updated version of tykcommon?
How are you building Tyk?


#3

I could be. I’m using go get to get the dependencies, then running go build to build the binary


#4

The build process seems fine, can you run:
go get -u github.com/TykTechnologies/tykcommon
And test again?


#5

Got the same error. So im building in github.com/Foo/tyk.
Whenever i build in github.com/TykTechnologies/tyk it works fine.


#6

I see, APIDefinition.Proxy.TargetList is not in tykcommon anymore, the field is APIDefinition.Proxy.StructuredTargetList.
I think you could try to update your fork, or fork tykcommon and use a previous version.