origin
origin copied to clipboard
Not working in macOS Monterey
[provide a description of the issue]
Version
oc version v3.10, v3.8 macOS mentorey 12.0.1
Steps To Reproduce
- Just run
oc version
and recieve this issue in screen short
Current Result

Expected Result
oc version works well, and I can do my business job
Additional Information
[try to run $ oc adm diagnostics
(or oadm diagnostics
) command if possible]
[if you are reporting issue related to builds, provide build logs with BUILD_LOGLEVEL=5
]
[consider attaching output of the $ oc get all -o json -n <namespace>
command to the issue]
[visit https://docs.openshift.org/latest/welcome/index.html]
Not exaclty a fix, but the version you can install with brew (openshift-cli) seems to work fine. I got the same error with this version.
Not exaclty a fix, but the version you can install with brew (openshift-cli) seems to work fine. I got the same error with this version.
this worked for me
I have installed Openshift-Cli with homebrew (v 4.6), but my server uses version 3.6.0 and I still get the issue with the message that is
Error from server (NotAcceptable): the server was unable to respond with a content type that the client supports (get pods)
Not exaclty a fix, but the version you can install with brew (openshift-cli) seems to work fine. I got the same error with this version.
Really strange but this also worked for me. I had previously installed by simply downloading from github releases and then copying over to usr/local/bin
.
I had to delete the executable that I had copied over before installing from homebrew though.
https://github.com/golang/go/wiki/MacOS12BSDThreadRegisterIssue
I have a hacky "fix" which works for me. Im only using a tiny subset of functionality though (getting tokens for pushing images and a couple of info commands) so not sure if this makes the entire oc
binary work.
Im also on an intel mac so not sure if this will work for arm. docker is used to build all the tools so you will need docker up and running too.
git clone https://github.com/openshift/origin.git
cd origin
git checkout v3.11.0
Then patch hack/lib/build/binaries.sh
to comment out the go install command
diff --git a/hack/lib/build/binaries.sh b/hack/lib/build/binaries.sh
index 7a5cbb5eb3..3fa2a028c3 100644
--- a/hack/lib/build/binaries.sh
+++ b/hack/lib/build/binaries.sh
@@ -233,13 +233,13 @@ os::build::internal::build_binaries() {
fi
if [[ ${#nonstatics[@]} -gt 0 ]]; then
- GOOS=${platform%/*} GOARCH=${platform##*/} go install \
- -pkgdir "${pkgdir}/${platform}" \
- -tags "${OS_GOFLAGS_TAGS-} ${!platform_gotags_envvar:-}" \
- -ldflags="${local_ldflags}" \
- "${goflags[@]:+${goflags[@]}}" \
- -gcflags "${gogcflags}" \
- "${nonstatics[@]}"
+ # GOOS=${platform%/*} GOARCH=${platform##*/} go install \
+ # -pkgdir "${pkgdir}/${platform}" \
+ # -tags "${OS_GOFLAGS_TAGS-} ${!platform_gotags_envvar:-}" \
+ # -ldflags="${local_ldflags}" \
+ # "${goflags[@]:+${goflags[@]}}" \
+ # -gcflags "${gogcflags}" \
+ # "${nonstatics[@]}"
# GOBIN is not supported on cross-compile in Go 1.5+ - move to the correct target
if [[ $platform != $host_platform ]]; then
OS_BUILD_ENV_GOLANG=1.11 OS_ONLY_BUILD_PLATFORMS=darwin ./hack/build-release.sh
This will build the binaries for mac and dump them in _output/local/bin/darwin/ARCH
❯ l _output/local/bin/darwin/amd64/
.rwxr-xr-x 206M lee 16 Nov 10:57 hyperkube
.rwxr-xr-x 260M lee 16 Nov 10:57 hypershift
.rwxr-xr-x 107M lee 16 Nov 10:57 kubectl
.rwxr-xr-x 2.1M lee 16 Nov 10:57 oadm
.rwxr-xr-x 107M lee 16 Nov 10:57 oc
.rwxr-xr-x 240M lee 16 Nov 10:57 openshift
.rwxr-xr-x 28M lee 16 Nov 10:57 openshift-node-config
.rwxr-xr-x 66M lee 16 Nov 10:57 template-service-broker
oc version
oc v3.11.0+0cbc58b
kubernetes v1.11.0+d4cacc0
features: Basic-Auth
Hope that helps!
https://github.com/golang/go/wiki/MacOS12BSDThreadRegisterIssue
I have a hacky "fix" which works for me. Im only using a tiny subset of functionality though (getting tokens for pushing images and a couple of info commands) so not sure if this makes the entire
oc
binary work.Im also on an intel mac so not sure if this will work for arm. docker is used to build all the tools so you will need docker up and running too.
git clone https://github.com/openshift/origin.git cd origin git checkout v3.11.0
Then patch
hack/lib/build/binaries.sh
to comment out the go install commanddiff --git a/hack/lib/build/binaries.sh b/hack/lib/build/binaries.sh index 7a5cbb5eb3..3fa2a028c3 100644 --- a/hack/lib/build/binaries.sh +++ b/hack/lib/build/binaries.sh @@ -233,13 +233,13 @@ os::build::internal::build_binaries() { fi if [[ ${#nonstatics[@]} -gt 0 ]]; then - GOOS=${platform%/*} GOARCH=${platform##*/} go install \ - -pkgdir "${pkgdir}/${platform}" \ - -tags "${OS_GOFLAGS_TAGS-} ${!platform_gotags_envvar:-}" \ - -ldflags="${local_ldflags}" \ - "${goflags[@]:+${goflags[@]}}" \ - -gcflags "${gogcflags}" \ - "${nonstatics[@]}" + # GOOS=${platform%/*} GOARCH=${platform##*/} go install \ + # -pkgdir "${pkgdir}/${platform}" \ + # -tags "${OS_GOFLAGS_TAGS-} ${!platform_gotags_envvar:-}" \ + # -ldflags="${local_ldflags}" \ + # "${goflags[@]:+${goflags[@]}}" \ + # -gcflags "${gogcflags}" \ + # "${nonstatics[@]}" # GOBIN is not supported on cross-compile in Go 1.5+ - move to the correct target if [[ $platform != $host_platform ]]; then
OS_BUILD_ENV_GOLANG=1.11 OS_ONLY_BUILD_PLATFORMS=darwin ./hack/build-release.sh
This will build the binaries for mac and dump them in
_output/local/bin/darwin/ARCH
❯ l _output/local/bin/darwin/amd64/ .rwxr-xr-x 206M lee 16 Nov 10:57 hyperkube .rwxr-xr-x 260M lee 16 Nov 10:57 hypershift .rwxr-xr-x 107M lee 16 Nov 10:57 kubectl .rwxr-xr-x 2.1M lee 16 Nov 10:57 oadm .rwxr-xr-x 107M lee 16 Nov 10:57 oc .rwxr-xr-x 240M lee 16 Nov 10:57 openshift .rwxr-xr-x 28M lee 16 Nov 10:57 openshift-node-config .rwxr-xr-x 66M lee 16 Nov 10:57 template-service-broker
oc version oc v3.11.0+0cbc58b kubernetes v1.11.0+d4cacc0 features: Basic-Auth
Hope that helps!
Thanks for this, really! Took me hours to get here. 🥳 🚀
Hi Everyone,
I am running to this error while doing this OS_BUILD_ENV_GOLANG=1.11 OS_ONLY_BUILD_PLATFORMS=darwin ./hack/build-go.sh
I can't find build-release.sh in hack directory.
what am I missing here? Can someone please help me?
/oc_3.11/origin/hack/lib/constants.sh: line 83: KUBE_GIT_MAJOR: unbound variable
[ERROR] hack/lib/constants.sh:83: ldflags+=($(os::build::ldflag "${OS_GO_PACKAGE}/vendor/k8s.io/component-base/version.gitMajor" "${KUBE_GIT_MAJOR}"))
exited with status 1.
[ERROR] hack/lib/build/binaries.sh:160: version_ldflags=$(os::build::ldflags)
exited with status 1.
[ERROR] hack/lib/build/binaries.sh:144: ( os::build::internal::build_binaries "${binaries[@]+"${binaries[@]}"}" )
exited with status 1.
[ERROR] hack/build-go.sh exited with code 1 after 00h 00m 02s
git diff of hack/lib/build/binaries.sh
if [[ ${#nonstatics[@]} -gt 0 ]]; then
- GOOS=${platform%/*} GOARCH=${platform##*/} go install \
- -tags "${OS_GOFLAGS_TAGS-} ${!platform_gotags_envvar:-}" \
- -ldflags="${local_ldflags}" \
- "${goflags[@]:+${goflags[@]}}" \
- -gcflags "${gogcflags}" \
- "${nonstatics[@]}"
+ # GOOS=${platform%/*} GOARCH=${platform##*/} go install \
+ # -tags "${OS_GOFLAGS_TAGS-} ${!platform_gotags_envvar:-}" \
+ # -ldflags="${local_ldflags}" \
+ # "${goflags[@]:+${goflags[@]}}" \
+ # -gcflags "${gogcflags}" \
+ # "${nonstatics[@]}"
@Themodem thanks for the workaround! After doing brew install go
then following your steps, I now have an 'oc' binary that works.
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen
.
If this issue is safe to close now please do so with /close
.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen
.
If this issue is safe to close now please do so with /close
.
/lifecycle rotten /remove-lifecycle stale
/remove-lifecycle rotten
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen
.
If this issue is safe to close now please do so with /close
.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen
.
If this issue is safe to close now please do so with /close
.
/lifecycle rotten /remove-lifecycle stale
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting /reopen
.
Mark the issue as fresh by commenting /remove-lifecycle rotten
.
Exclude this issue from closing again by commenting /lifecycle frozen
.
/close
@openshift-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting
/reopen
. Mark the issue as fresh by commenting/remove-lifecycle rotten
. Exclude this issue from closing again by commenting/lifecycle frozen
./close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.