Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup-envtest has been changed in master (script removed) #39

Open
thiscantbeserious opened this issue Jun 8, 2021 · 6 comments
Open

Comments

@thiscantbeserious
Copy link
Contributor

thiscantbeserious commented Jun 8, 2021

See - the script was removed and it is now installable via go directly:

kubernetes-sigs/controller-runtime#1488

This also means that the current tests will fail since the setup-envtest.sh that is getting pulled simply contains "404"

Will see if I can do a pull request.

Would you rather just include the shell-script from the 0.8 release or call the go install in the Makefile?

@thiscantbeserious
Copy link
Contributor Author

Seems to work with the new go install ... however there seem to be breaking changes in the tests regarding Ginko and there seems to be an hardcoded path to another part of the toolchain as well ...

go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
setup-envtest use 1.20.2
Version: 1.20.2
OS/Arch: linux/amd64
Path: /home/doh/.local/share/kubebuilder-envtest/k8s/1.20.2-linux-amd64
go test ./... -coverprofile cover.out
?       github.com/seaweedfs/seaweedfs-operator [no test files]
?       github.com/seaweedfs/seaweedfs-operator/api/v1  [no test files]
Running Suite: Controller Suite
===============================
Random Seed: 1623166431
Will run 1 of 1 specs

Followed by:

  Unexpected error:
      <*fmt.wrapError | 0xc0003eac80>: {
          msg: "failed to start the controlplane. retried 5 times: fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory",
          err: <*fs.PathError | 0xc0002f68a0>{
              Op: "fork/exec",
              Path: "/usr/local/kubebuilder/bin/etcd",
              Err: <syscall.Errno>0x2,
          },
      }
      failed to start the controlplane. retried 5 times: fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory
  occurred

  /home/doh/git/seaweedfs-operator/controllers/suite_test.go:63
------------------------------


Ran 1 of 0 Specs in 0.004 seconds
FAIL! -- 0 Passed | 1 Failed | 0 Pending | 0 Skipped
You're using deprecated Ginkgo functionality:
=============================================
Ginkgo 2.0 is under active development and will introduce (a small number of) breaking changes.
To learn more, view the migration guide at https://github.com/onsi/ginkgo/blob/v2/docs/MIGRATING_TO_V2.md
To comment, chime in at https://github.com/onsi/ginkgo/issues/711

  You are passing a Done channel to a test node to test asynchronous behavior.  This is deprecated in Ginkgo V2.  Your test will run synchronously and the timeout will be ignored.
  Learn more at: https://github.com/onsi/ginkgo/blob/v2/docs/MIGRATING_TO_V2.md#removed-async-testing
    /home/doh/git/seaweedfs-operator/controllers/suite_test.go:53
  You are using a custom reporter.  Support for custom reporters will likely be removed in V2.  Most users were using them to generate junit or teamcity reports and this functionality will be merged into the core reporter.  In addition, Ginkgo 2.0 will support emitting a JSON-formatted report that users can then manipulate to generate custom reports.

  If this change will be impactful to you please leave a comment on https://github.com/onsi/ginkgo/issues/711
  Learn more at: https://github.com/onsi/ginkgo/blob/v2/docs/MIGRATING_TO_V2.md#removed-custom-reporters

--- FAIL: TestAPIs (0.00s)
FAIL
coverage: 0.0% of statements
FAIL    github.com/seaweedfs/seaweedfs-operator/controllers     0.038s
?       github.com/seaweedfs/seaweedfs-operator/controllers/label       [no test files]
?       github.com/seaweedfs/seaweedfs-operator/controllers/swadmin     [no test files]
FAIL
make: *** [Makefile:34: test] Error 1

So /usr/local/kubebuilder/bin/etcd -> needs to be adjusted for binary install (?)
and Test need to be adjusted for changes

@chrislusf
Copy link
Collaborator

chrislusf commented Jun 8, 2021

this operator was scaffolded by https://sdk.operatorframework.io/docs/building-operators/golang/quickstart/

Need to see what is the latest output and try to merge the changes.

My local version:

operator-sdk version
operator-sdk version: "v0.19.0", commit: "8e28aca60994c5cb1aec0251b85f0116cc4c9427", kubernetes version: "v1.18.2", go version: "go1.14.5 darwin/amd64"

According to https://sdk.operatorframework.io/docs/building-operators/golang/migration/ , we need to migrate the code. Could you please help?

@thiscantbeserious
Copy link
Contributor Author

thiscantbeserious commented Jun 9, 2021

Will see what I can do.

From a quick glance only the tests seem broken.

Successfully deployed it on a 3 node Kubernetes v1.21.1+k3s1 cluster with the included example config (go test simply commented out)

Self-Heals manually deleted deployments for master/filer/volume as long as the Seaweed resource is deployed.

This could really need a general cleanup, also since the scafolded template itself is somewhat confusing.

  • better README
  • better Makefile
  • better Docker support for buildx
  • few more / better examples in config (especially with a dededicated namespace)

I could also add a Jenkins config for auto-test, auto-tagging and deploy to Dockerhub - but I'd only do that if you plan to use it. Not a fan of tying myself to much to deeply to a single service like Github Actions (Jenkins configuration can be migrated elswhere)

@chrislusf
Copy link
Collaborator

Great! Just let me know if you need any help.

how to use Jenkins config on github?

@thiscantbeserious
Copy link
Contributor Author

Will do - mixed up Jenkins (we're using that for our builds) with Travis.

I've been doing that here:

https://github.com/thiscantbeserious/k8dash/blob/master/.travis.yml

In that case Jenkins is building on each commit - and then uploads the resulting images to Dockerhub tagged by commit-id.

However you could also use a fixed version number in a config-file of course.

All it needs is a little bit of setup in Travis to store your credentials.

https://www.travis-ci.com/github/thiscantbeserious/k8dash/builds/149534376

@chrislusf
Copy link
Collaborator

chrislusf commented Jun 9, 2021

I have added testing .travis.yml file and authorizations. I also invited you to maintain this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants