gliderlabs / logspout

Log routing for Docker container logs
MIT License
4.66k stars 680 forks source link

Custom module - Go not pulling latest commit from repo dependency #506

Closed palu3492 closed 3 years ago

palu3492 commented 3 years ago

I'm having a problem building the Docker image for my custom logspout module. While building, Go grabs my GitHub repo as a dependency but It is not grabbing the latest commit. You'll see below the commit hash Go is finding but that is not the latest pushed commit. I'm not familiar enough with Go to know if this is a Go issue or a logspout building issue. If I wait long enough, Go will eventually start finding the latest commit.

Is this is a known issue? Is this a Go issue? Is there a solution for this?

Output while running docker build:

#8 32.65 go: downloading github.com/palu3492/logspout-module v0.0.0-20210422141159-e7bc744eb1b5
#8 32.78 go: extracting github.com/palu3492/logspout-module v0.0.0-20210422141159-e7bc744eb1b5

Modules.go:

package main

import (
    _ "github.com/palu3492/logspout-module"
    _ "github.com/gliderlabs/logspout/transports/tcp"
    _ "github.com/gliderlabs/logspout/transports/tls"
    _ "github.com/gliderlabs/logspout/transports/udp"
)

Docker build command: docker build --no-cache -t palu3492/logspout-module:latest .

palu3492 commented 3 years ago

I'm now adding my custom adapter directly in logspout and building logspout, so I'm no longer experiencing this issue.

This could have been caused by having my adapter source nested within the logspout directory when I was building my module. I noticed logspout's go.sum was being updated with my repo, which is weird. Anyway, no longer an issue.