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

Failed to run `make bundle with v1.18.0 #5574

Closed
Madhu-1 opened this issue Mar 1, 2022 · 6 comments
Closed

Failed to run `make bundle with v1.18.0 #5574

Madhu-1 opened this issue Mar 1, 2022 · 6 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@Madhu-1
Copy link
Contributor

Madhu-1 commented Mar 1, 2022

Bug Report

What did you do?

Running make bundle on the project with the latest operator SDK is failing

What did you expect to see?

After updating the operator SDK version the existing make bundle should not be breaking

  • We have update the labels on the all the yaml files in our project
  • Update operator-sdk from 1.17.0 to 1.18.0 and make bundle is failing
[🎩︎]mrajanna@fedora kubernetes-csi-addons $]make bundle
sed 's/@PACKAGE_NAME@/csi-addons/g' < config/manifests/bases/clusterserviceversion.yaml.in > config/manifests/bases/csi-addons.clusterserviceversion.yaml
go build -o /home/mrajanna/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/controller-gen ./vendor/sigs.k8s.io/controller-tools/cmd/controller-gen
go build -o /home/mrajanna/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/kustomize ./vendor/sigs.k8s.io/kustomize/kustomize/v4
/home/mrajanna/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/controller-gen rbac:roleName=manager-role crd webhook paths="{./api/...,./cmd/...,./controllers/...,./sidecar/...}" output:crd:artifacts:config=config/crd/bases
cd config/manager && /home/mrajanna/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/kustomize edit set image controller=quay.io/csiaddons/k8s-controller:latest rbac-proxy=gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
/home/mrajanna/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/kustomize build config/crd > deploy/controller/crds.yaml
/home/mrajanna/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/kustomize build config/rbac > deploy/controller/rbac.yaml
/home/mrajanna/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/kustomize build config/manager > deploy/controller/setup-controller.yaml
go build -o /home/mrajanna/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/operator-sdk ./vendor/github.com/operator-framework/operator-sdk/cmd/operator-sdk
/home/mrajanna/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/kustomize build config/manifests | /home/mrajanna/workspace/src/github.com/csi-addons/kubernetes-csi-addons/bin/operator-sdk generate bundle --manifests --metadata --package=csi-addons 
Generating bundle manifests
FATA[0000] Error generating bundle manifests: could not find manager deployment, should have label control-plane=controller-manager 
make: *** [Makefile:96: bundle] Error 1

What did you see instead? Under which circumstances?

Environment

Operator type: go

Kubernetes cluster type:

$ operator-sdk version v1.18.0

$ go version (if language is Go) go1.17.4

$ kubectl version

Possible Solution

Additional context

@nixpanic
Copy link

nixpanic commented Mar 1, 2022

It seems that the change was introduced with #5567. The labels to detect the manager container are hard-codedL

// findManagerEnvironment returns the environment passed to the controller manager container.
func (c bundleCmd) findManagerEnvironment(col *collector.Manifests) ([]corev1.EnvVar, error) {
const (
managerLabel = "control-plane"
managerLabelValue = "controller-manager"
managerContainerName = "manager"
)

In csi-addons/kubernetes-csi-addons#122 we replaced those labels with our own, as to not cause confusion or conflicts with components that use the standard labels.This might not have been the best approach, but it seemed the most practical.

A recommendation or suggested workaround that makes sense from an operator-framework point of view would be much appreciated.

@camilamacedo86
Copy link
Contributor

camilamacedo86 commented Mar 2, 2022

Hi @ryantking,

Following some questions, in order to be able to check this one. I hope that can help out.

Why do we need to use the labels to get the manifests? The logic to ensure that all will be mapped via RELATED_IMAGE should not be valid for all images used? Are we not doing the same for the kube-rbac-proxy? If not, why not?

Also, wdyt about creating a sample under testdata dir to scaffold the bundle using this option for we are able to visualize to check its results and be able to easier verify in the review that changes will not affect this feature? (e.g go/v3/digests-operator with an API only) We do not need to call this one in the e2e tests.

c/c @jmrodri

@dvaldivia
Copy link

is there a way around this for operators generating bundles using operator-sdk but not created by it?

@theishshah theishshah added this to the v1.20.0 milestone Mar 14, 2022
@theishshah theishshah added the kind/bug Categorizes issue or PR as related to a bug. label Mar 14, 2022
@acornett21
Copy link
Contributor

I'm interested in a resolution for this as well, as this is a breaking change for all ACK operators.

@jberkhahn jberkhahn modified the milestones: v1.20.0, v1.19.0 Mar 16, 2022
pohly added a commit to pohly/pmem-CSI that referenced this issue Mar 23, 2022
No particular reason for it, just staying up-to-date.

operator-sdk cannot be updated because of
intel#1069 =
operator-framework/operator-sdk#5574
@pohly
Copy link

pohly commented Mar 23, 2022

Hardcoding these labels in operator-sdk seems like a limitation that should be addressed, in particular because the defaults don't follow the recommended naming scheme.

But that aside, which objects should have this label? Looking at the examples under testdata it seems that all (?) have it?

wallrj added a commit to wallrj/cert-manager-olm that referenced this issue Mar 29, 2022
Add a hack to work around a new inflexible requirement for there to be a
Deployment having label "control-plane: controller-manager" with a container
called "manager".

operator-framework/operator-sdk#5574

Signed-off-by: Richard Wall <[email protected]>
@theishshah theishshah modified the milestones: v1.19.0, v1.20.0 Apr 8, 2022
pohly added a commit to pohly/pmem-CSI that referenced this issue Apr 13, 2022
No particular reason for it, just staying up-to-date.

operator-sdk cannot be updated because of
intel#1069 =
operator-framework/operator-sdk#5574

OLM cannot be updated because of
operator-framework/operator-sdk#5410
@ryantking
Copy link
Contributor

This is fixed in v1.19.1.

iamniting added a commit to iamniting/lvm-operator that referenced this issue Apr 14, 2022
pohly added a commit to pohly/pmem-CSI that referenced this issue Apr 14, 2022
pohly added a commit to pohly/pmem-CSI that referenced this issue Apr 18, 2022
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

No branches or pull requests

9 participants