Closed MatousJobanek closed 3 months ago
having both ksctl and user-identity-mapper under cmd make it clear that we have 2 CLIs
user-identity-mapper is not really a cli that you would run locally on the daily basis. it's more to be used as a container.
Anyway, how would you change the make install
command so it installs only ksctl
binary? When you run make install
now, then it installs ksctl
as well as user-identity-mapper
, and there is no need to install user-identity-mapper
locally.
having both ksctl and user-identity-mapper under cmd make it clear that we have 2 CLIs
user-identity-mapper is not really a cli that you would run locally on the daily basis. it's more to be used as a container.
well, it's a CLI nonetheless, so it makes sense to keep it under the cmd
folder IMO
Anyway, how would you change the
make install
command so it installs onlyksctl
binary? When you runmake install
now, then it installsksctl
as well asuser-identity-mapper
, and there is no need to installuser-identity-mapper
locally.
Sure, then it's just a matter of updating the install makefile goal so we only have the ksctl
binary when running make install
, and have a separate makefile goal used when building the Docker image?
We don't need to build the user-identity-mapper
via a makefile target at all - this is done in the Docker image when it's being built:
https://github.com/kubesaw/ksctl/blob/3b26733db38131551bc1fe08ff9dd6853ca50e62/cmd/user-identity-mapper/Dockerfile#L16-L19
so again, how would you change the go install
command so it installs ksctl
only (using the go native functionality, which means also in the location of either GOBIN
or GOPATH
)? I tried that, but I'm doing some mistake there as I cannot achieve the expected outcome, or I'm missing some important flag. Any help is more than welcome :-)
We don't need to build the
user-identity-mapper
via a makefile target at all - this is done in the Docker image when it's being built:
right, so we already have all what we need for this CLI
so again, how would you change the
go install
command so it installsksctl
only (using the go native functionality, which means also in the location of eitherGOBIN
orGOPATH
)? I tried that, but I'm doing some mistake there as I cannot achieve the expected outcome, or I'm missing some important flag. Any help is more than welcome :-)
$(Q)CGO_ENABLED=0 \
go ${GO_COMMAND} ${V_FLAG} \
-ldflags "-X ${GO_PACKAGE_PATH}/pkg/version.Commit=${GIT_COMMIT_ID} -X
${GO_PACKAGE_PATH}/pkg/version.BuildTime=${BUILD_TIME}" \
${GO_EXTRA_FLAGS} ${GO_PACKAGE_PATH}/cmd/ksctl/...
with ${GO_PACKAGE_PATH}/cmd/ksctl/...
instead of ${GO_PACKAGE_PATH}/cmd/...
seems to work on my machine: I did not have a user-identity-mapper
binary after running make install
with ${GO_PACKAGE_PATH}/cmd/ksctl/... instead of ${GO_PACKAGE_PATH}/cmd/... seems to work on my machine: I did not have a user-identity-mapper binary after running make install
works for me too! I was about to suggest the same thing.
ok, there was some error between my chair and my keyboard. I was almost 100% sure that I tried that and it didn't built the ksctl binary properly. I maybe omitted the last three dots /...
:man_shrugging: :man_facepalming:
Anyway, thanks for your proposal
Closing this PR...
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 68.43%. Comparing base (
3b26733
) to head (dbd4849
).
KUBESAW-169
there is no need to install the user-identity-mapper binary locally (together with the ksctl binary), so the PR is moving the user-identity-mapper directory out of
cmd
folder