Hello,

With some effort, I figured it out myself. I'll reply my own question here for 
future reference:

The thing that made the difference is to use the right directory structure. If 
you check out a working copy of the heapster code below 
$GOPATH/src/k8s.io/heapster, things work smoothly. Perhaps this is obvious for 
experienced go developers, but it wasn't for me.


On my linux box, the following commands are sufficient to build heapster:

# Install go
apt install golang-go

# Edit .profile to set GOPATH and update PATH
cat >> ~/.profile <<EOF
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$PATH
EOF
source ~/.profile

mkdir -p ~/go/src/k8s.io

# Install godep tool
go get -u github.com/tools/godep

# Check out heapster repository
cd ~/go/src/k8s.io
git clone https://github.com/kubernetes/heapster.git

# Build
cd ~/go/src/k8s.io/heapster
make




regards,
Martijn

On Monday, 5 December 2016 15:24:33 UTC+1, [email protected]  wrote:
> Hey all
> 
> I'd like to make some changes to heapster and create a new docker image for 
> it. I'm completely new to golang and I can't seem to figure out the 
> dependency / build system. 
> 
> I have a linux system. I'm starting from 
> 
> git clone https://github.com/kubernetes/heapster.git
> make container
> 
> But then I get 
> 
> godep: [WARNING]: godep should only be used inside a valid go package 
> directory and
> godep: [WARNING]: may not function correctly. You are probably outside of 
> your $GOPATH.
> ...
> can't load package: package k8s.io/heapster/metrics
> ...
> 
> 
> So my questions are:
> 
> Is there any documentation on how to build heapster? I haven't been able to 
> find any.
> 
> Should I set up dependencies before running make? The use of godep seems to 
> suggest that the dependencies are managed by the makefile, but clearly it's 
> still missing a package.
> 
> What should be the right value for $GOPATH? Should I add the heapster working 
> copy to my $GOPATH, as the warnings seems to suggest? I've tried it, but it 
> seems to need a heapster/src directory which doesn't exist)
> 
> many thanks in advance,
> Martijn

-- 
You received this message because you are subscribed to the Google Groups 
"Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to