voyagermesh / voyager

🚀 Secure L7/L4 (HAProxy) Ingress Controller for Kubernetes
https://voyagermesh.com
Apache License 2.0
1.35k stars 134 forks source link

Golang API Client not working #1517

Open henrikengelbrink opened 4 years ago

henrikengelbrink commented 4 years ago

Hello,

I'm currently trying to use the Golang API client for voyager to create a voyager ingress through my golang application.

I'm importing the golang client with the following line: voyagerClient "github.com/appscode/voyager/client/clientset/versioned"

Unfortunately, I get the following error:

github.com/appscode/voyager/apis/voyager/v1beta1: github.com/appscode/voyager@v0.0.0-20200620081623-d9c38862e7b6: parsing go.mod:
    module declares its path as: voyagermesh.dev/voyager
            but was required as: github.com/appscode/voyager

I'm not sure whether it is my fault or a bug with voyager. Do you have a documentation about how to use the golang client somewhere ?

Best, Henrik

hossainemruz commented 4 years ago

Try importing as

voyagerClient "voyagermesh.dev/voyager/client/clientset/versioned"
henrikengelbrink commented 4 years ago

@hossainemruz Thank you for your answer.

Import with your line results with the following error:

go: finding voyagermesh.dev/voyager latest
go: voyagermesh.dev/voyager@v0.0.0-20200620081623-d9c38862e7b6 requires
    github.com/Azure/go-autorest/autorest/azure/auth@v0.0.0-00010101000000-000000000000: invalid version: unknown revision 000000000000
hossainemruz commented 4 years ago

Try adding these in your go.mod file

replace github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.0.0+incompatible

replace github.com/Azure/go-autorest/autorest => github.com/Azure/go-autorest/autorest v0.9.0

replace github.com/Azure/go-autorest/autorest/adal => github.com/Azure/go-autorest/autorest/adal v0.5.0

replace github.com/Azure/go-autorest/autorest/azure/auth => github.com/Azure/go-autorest/autorest/azure/auth v0.2.0

replace github.com/Azure/go-autorest/autorest/date => github.com/Azure/go-autorest/autorest/date v0.1.0

replace github.com/Azure/go-autorest/autorest/mocks => github.com/Azure/go-autorest/autorest/mocks v0.2.0

replace github.com/Azure/go-autorest/autorest/to => github.com/Azure/go-autorest/autorest/to v0.2.0

replace github.com/Azure/go-autorest/autorest/validation => github.com/Azure/go-autorest/autorest/validation v0.1.0

replace github.com/Azure/go-autorest/logger => github.com/Azure/go-autorest/logger v0.1.0

replace github.com/Azure/go-autorest/tracing => github.com/Azure/go-autorest/tracing v0.5.0
henrikengelbrink commented 4 years ago

If I replace all the Azure dependencies, I get the following error:

go: finding voyagermesh.dev/voyager latest
go: voyagermesh.dev/voyager@v0.0.0-20200620081623-d9c38862e7b6 requires
    github.com/prometheus/haproxy_exporter@v0.0.0-00010101000000-000000000000: invalid version: unknown revision 000000000000
hossainemruz commented 4 years ago

Use the respective replace line in your go.mod file from here: https://github.com/voyagermesh/voyager/blob/d9c38862e7b69e297f4ca6262696779e628ed055/go.mod#L77

Perhaps, you can copy all the replace line of the linked file in your go.mod .

hossainemruz commented 4 years ago

@henrikengelbrink Please close the issue if your problem has been fixed.