Upgraded from 0.17 to 1.0 of the operator-sdk today. I cannot init a new project and need to migrate my existing operator.
When I try to init a project so that I can migrate my old project I get the following error:
FATA[0001] failed to initialize project with version "3-alpha": exit status 2
if I do the following:
mkdir memcached-operator
cd memcached-operator
operator-sdk init --domain example.com --repo github.com/example-inc/memcached-operator
It looks like some of the project scaffolding was created but I have no idea if it is complete due to the error.
Here is my operator-sdk version:
operator-sdk version: "v1.0.0", commit: "d7d5e0cd6cf5468bb66e0849f08fda5bf557f4fa", kubernetes version: "v1.18.2", go version: "go1.14.7 darwin/amd64", GOOS: "darwin", GOARCH: "amd64"
Go version:
go version go1.15.2 darwin/amd64
Brew info:
operator-sdk: stable 1.0.0 (bottled), HEAD
SDK for building Kubernetes applications
https://coreos.com/operators/
/usr/local/Cellar/operator-sdk/1.0.0 (10 files, 165.2MB) *
Poured from bottle on 2020-09-16 at 12:59:51
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/operator-sdk.rb
License: Apache-2.0
==> Dependencies
Required: go ✔
==> Options
--HEAD
Install HEAD version
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
zsh completions have been installed to:
/usr/local/share/zsh/site-functions
==> Analytics
install: 1,523 (30 days), 5,156 (90 days), 17,410 (365 days)
install-on-request: 1,523 (30 days), 5,155 (90 days), 17,402 (365 days)
build-error: 0 (30 days)
I have also attached the init log.
Please help!!!
Thanks.
op.txt
Hi @AlperEnver,
The go version required to work with the tool is 1.13 and you are using an upper version which shows be the root cause of your issue.
Thank you so much for your response. I really appreciate it.
Can I please ask why the version in the operator-sdk version above is "go1.14.7 darwin/amd64" and my go version is "go1.15.2 darwin/amd64"?
Also do I need to uninstall go and explicitly install 1.13? I assume the operator-sdk cannot support multiple version of go?
Thanks again!
The operator-sdk is built/developer with and requires the version go 1.13. When you run operator-sdk version it shows the version setup locally that will be used by it. Could you please remove all go version installed locally and ensure that you are using 1.13 to try again?
Yes! I will let you know how it goes. Thanks again.
Hi, I installed go version 1.13 and was able to create/init my project and also create my api/controller. Thanks again for your help.