Skip to content

make install fails following Quickstart for Go-based Operators #4453

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

Closed
adambkaplan opened this issue Jan 29, 2021 · 8 comments · Fixed by #4402
Closed

make install fails following Quickstart for Go-based Operators #4453

adambkaplan opened this issue Jan 29, 2021 · 8 comments · Fixed by #4402
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@adambkaplan
Copy link

adambkaplan commented Jan 29, 2021

When following the quickstart guide using operator-sdk v1.3 (modified for the operator I'm trying to build), I get the following error from make install:

        * accumulateFile error: "accumulating resources from 'bases/operator.shipwright.io_shipwrightbuilds.yaml': evalsymlink failure on '/var/home/adkaplan/go/src/github.com/shipwright-io/operator/config/crd/bases/operator.shipwright.io_shipwrightbuilds.yaml' : lstat /var/home/adkaplan/go/src/github.com/shipwright-io/operator/config/crd/bases/operator.shipwright.io_shipwrightbuilds.yaml: no such file or directory"
        * loader.New error: "error loading bases/operator.shipwright.io_shipwrightbuilds.yaml with git: url lacks host: bases/operator.shipwright.io_shipwrightbuilds.yaml, dir: evalsymlink failure on '/var/home/adkaplan/go/src/github.com/shipwright-io/operator/config/crd/bases/operator.shipwright.io_shipwrightbuilds.yaml' : lstat /var/home/adkaplan/go/src/github.com/shipwright-io/operator/config/crd/bases/operator.shipwright.io_shipwrightbuilds.yaml: no such file or directory, get: invalid source string: bases/operator.shipwright.io_shipwrightbuilds.yaml"

I see a file in confg/crc/bases called operator.shipwright-io_shipwrightbuildren.yaml instead.

Steps to reproduce

  1. Init repo with operator-sdk:
$ operator-sdk init --domain=shipwright.io --repo=github.com/shipwright-io/operator
  1. Create an API
$ operator-sdk create api --group operator --version v1alpha1 --kind ShipwrightBuild --resource=true --controller=true
  1. Create the image and push via make docker-build and make docker-push
  2. Run make install
@jmrodri
Copy link
Member

jmrodri commented Jan 29, 2021

@adambkaplan I was able to recreate the problem. It seems to happen when make manifests is run. The operator.shipwright-io_shipwrightbuildren.yaml file is being created instead of operator.shipwright-io_shipwrightbuilds.yaml as if something was doing bad pluralization.

The workaround I was able to do was:

  1. Rename the file mv operator.shipwright.io_shipwrightbuildren.yaml operator.shipwright.io_shipwrightbuilds.yaml
  2. Edi the file to reference builds: vi config/crd/bases/operator.shipwright.io_shipwrightbuilds.yaml change all references to buildren to builds.
  3. Run make install

@jmrodri
Copy link
Member

jmrodri commented Jan 29, 2021

I created a repo with 3 commits showing the 3 steps I've taken to recreate the issue:
jmrodri/shipwright@149fafb

The third commit: make manifests is causing the problem.

@jmrodri
Copy link
Member

jmrodri commented Jan 29, 2021

We're using controller-gen v0.4.1 which depends on gobuffalo/flect v0.2.0 for pluralization logic. gobuffalo/flect v0.2.0 has a problem:

[jesusr@transam flecttest]$ ./flecttest 
builds
shipwrightbuildren

With gobuffalo/flect v0.2.2, it is fixed.

[jesusr@transam flecttest]$ ./flecttest 
builds
shipwrightbuilds

@jmrodri
Copy link
Member

jmrodri commented Jan 29, 2021

Looks like the fix was done after the v0.4.1 release kubernetes-sigs/controller-tools#522

@camilamacedo86
Copy link
Contributor

It will be fixed when we update/align SDK with upstream: WIP #4402

@estroz
Copy link
Member

estroz commented Feb 1, 2021

@adambkaplan what plugin version are you using (the layout field in your PROJECT file)? #4402 won't actually fix this unless you are using the proper version of controller-gen (v0.4.1) which is only supported by the go/v3 plugin (introduced in operator-sdk v1.3.0). v0.4.0+ creatse v1 CRDs and webhooks by default, so you can use v0.4.1 if you add crdVersions={v1beta1} to your Makefile and webhookVersions={v1beta1} to your api/<version>/<kind>_webhook.go markers. Really kubernetes-sigs/controller-tools#522 should be backported to v0.3.0.

@camilamacedo86 can you remove the Closes #4453 from #4402?

Since this is fixed upstream I'm going to close this issue.

@estroz estroz closed this as completed Feb 1, 2021
@estroz
Copy link
Member

estroz commented Feb 1, 2021

Actually re-opening this to make sure this is fixed, since you mentioned operator-sdk v1.3 was used.

@estroz estroz reopened this Feb 1, 2021
@estroz
Copy link
Member

estroz commented Feb 1, 2021

/assign @jmrodri
/kind bug

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 1, 2021
@estroz estroz added this to the v1.5.0 milestone Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants