romanovskyj / gongfig

Import and export Kong configuration tool written in Go
Apache License 2.0
25 stars 5 forks source link

Plugins exported as NULL and tests not passing? #54

Closed tallsam closed 5 years ago

tallsam commented 5 years ago

Hi,

The tool is working great except it is only exporting a series of nulls for the plugins array:

    "plugins": [
        null,
        null,
        null
    ],  

It doesn't seem to change depending on how the plugin is applied (to a service, to a route).

I'm using kong 0.14.1, as an interim upgrade on the way to 1.1.x

As a side note, I'm getting errors when I run the tests on

$ go version
go version go1.12.7 linux/amd64
$ go test -v ./... -coverprofile=coverage.txt -covermode=atomic
?       gongfig [no test files]
=== RUN   TestGetServicesAndRoutesPreparedConfig
--- PASS: TestGetServicesAndRoutesPreparedConfig (0.00s)
=== RUN   TestGetCertificatesPreparedConfig
--- FAIL: TestGetCertificatesPreparedConfig (0.00s)
panic: interface conversion: interface {} is nil, not actions.Certificate [recovered]
    panic: interface conversion: interface {} is nil, not actions.Certificate

goroutine 27 [running]:
testing.tRunner.func1(0xc00010cd00)
    /home/sam/go/src/go/src/testing/testing.go:830 +0x392
panic(0x7be7a0, 0xc0000139e0)
    /home/sam/go/src/go/src/runtime/panic.go:522 +0x1b5
gongfig/pkg/actions.TestGetCertificatesPreparedConfig(0xc00010cd00)
    /home/sam/go/src/gongfig/pkg/actions/export_test.go:97 +0x32a
testing.tRunner(0xc00010cd00, 0x83cee8)
    /home/sam/go/src/go/src/testing/testing.go:865 +0xc0
created by testing.(*T).Run
    /home/sam/go/src/go/src/testing/testing.go:916 +0x35a
FAIL    gongfig/pkg/actions 0.009s
romanovskyj commented 5 years ago

Hi @tallsam , The issue with the build was that https://github.com/jinzhu/copier changed its api so it is no longer worked. I fixed it with changing copier to deepcopy and build goes successfully.

As for plugins - tests are now passing, let me know if you still experience this issue, or if not, I close this issue

romanovskyj commented 5 years ago

@tallsam, As I did not get an answer from you, I am closing the issue, however, do not hesitate to reopen it if you still experience it even after the fix.