Skip to content

Commit

Permalink
Merge pull request #28 from slok/slok/v1.30
Browse files Browse the repository at this point in the history
Fix dockerfile workdir
  • Loading branch information
slok authored Mar 27, 2024
2 parents 36cad9c + 9a6a1a9 commit be67967
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmd/kube-code-generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func run(ctx context.Context, args []string, stdout, stderr io.Writer) error {
return fmt.Errorf("could not get go module: %w", err)
}
goCodeGenOutPkg := utilgomod.GetGoPackageFromDir(goModule, cmdCfg.GoCodeOutPath)
logger.Infof("Go generated code package inferred", "module", goCodeGenOutPkg)
logger.WithValues(log.Kv{"module": goCodeGenOutPkg}).Infof("Go generated code package inferred")

if filepath.IsAbs(cmdCfg.APIsPath) {
return fmt.Errorf("APIs path should be relative")
Expand Down Expand Up @@ -104,7 +104,7 @@ func generateGoCode(ctx context.Context, cmdCfg CmdConfig, logger log.Logger, ge
boilerplatePath = f.Name()
}

logger.Infof("Generating Go clients code...")
logger.Infof("Generating Go code...")
err = generate.NewClientGenerator(logger, cmdCfg.CodeGenPath, generate.StdBashExecutor).
WithWatch().
WithBoilerplate(boilerplatePath).
Expand Down
5 changes: 2 additions & 3 deletions docker/prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,15 @@ RUN wget http://github.com/kubernetes/code-generator/archive/kubernetes-${CODEGE
rm -rf ../controller-tools-${CONTROLLER_GEN_VERSION}


# Create user
# Create user and workdir.
ARG uid=1000
ARG gid=1000
RUN addgroup --gid $gid app && \
adduser --gecos "First Last,RoomNumber,WorkPhone,HomePhone" --disabled-password --uid $uid --ingroup app app && \
chown app:app -R /go
RUN mkdir /app && chown app:app -R /app

USER app

RUN mkdir /app && chown app:app -R /app
WORKDIR /app

ENV KUBE_CODE_GENERATOR_CODEGEN_PATH=/tmp/k8s-code-generator
Expand Down

0 comments on commit be67967

Please sign in to comment.