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

CSV Field Markers are not collected if they are in another go file #3744

Closed
shivanshs9 opened this issue Aug 17, 2020 · 6 comments · Fixed by #4445 or #4507
Closed

CSV Field Markers are not collected if they are in another go file #3744

shivanshs9 opened this issue Aug 17, 2020 · 6 comments · Fixed by #4445 or #4507
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. language/go Issue is related to a Go operator project olm-integration Issue relates to the OLM integration
Milestone

Comments

@shivanshs9
Copy link

Bug Report

What did you do?
In my operator project, CRD status struct is in another go file, called <CRD>_status.go. I've annotated some of its fields with operator-sdk CSV markers, like:

type ClusterStatus struct {
	// +operator-sdk:csv:customresourcedefinitions:type=status,displayName="Phase",xDescriptors="urn:alm:descriptor:io.kubernetes.phase"
	Phase ClusterPhase `json:"phase"`
	// [other fields]
}

Then I ran make bundle to generate the bundle manifests.

What did you expect to see?
The generated CSV would have both specDescriptors and statusDescriptors for this API.

What did you see instead? Under which circumstances?
The generated CSV only has the specDescriptors of this API and no statusDescriptors field.

Environment

operator-sdk version
operator-sdk version: "v1.0.0", commit: "d7d5e0cd6cf5468bb66e0849f08fda5bf557f4fa", kubernetes version: "v1.18.2", go version: "go1.13.11 linux/amd64", GOOS: "linux", GOARCH: "amd64"
  • operator-sdk version: v1.0.0
  • go version: go1.13.11
  • Kubernetes version information: v1.18.2
  • Kubernetes cluster kind:

  • Are you writing your operator in ansible, helm, or go? go

Possible Solution

Additional context
Add any other context about the problem here.

@estroz estroz self-assigned this Aug 17, 2020
@estroz estroz added the triage/support Indicates an issue that is a support question. label Aug 17, 2020
@estroz estroz added this to the Backlog milestone Aug 17, 2020
@estroz
Copy link
Member

estroz commented Aug 18, 2020

@shivanshs9 is ClusterStatus referenced in your API type, like

type Cluster struct {
	v1.TypeMeta   `json:",inline"`
	v1.ObjectMeta `json:"metadata,omitempty"`

	ClusterSpec   `json:"spec,omitempty"`
	ClusterStatus `json:"status,omitempty"`
}

@shivanshs9
Copy link
Author

@estroz Yes, it is indeed referred there. Plus, the CSV works in OpenShift when I manually add the statusDescriptors after generating it.

@estroz
Copy link
Member

estroz commented Nov 6, 2020

@shivanshs9 does the scenario in #4196 describe the yours as well?

@shivanshs9
Copy link
Author

@shivanshs9 does the scenario in #4196 describe the yours as well?

@estroz not exactly, since in my case, only statusDescriptors weren't being collected. But I did use a different version, v1.0.0. Haven't tested yet with v1.1.0

@estroz estroz modified the milestones: Backlog, v1.3.0 Dec 1, 2020
@estroz estroz added kind/bug Categorizes issue or PR as related to a bug. language/go Issue is related to a Go operator project olm-integration Issue relates to the OLM integration and removed triage/support Indicates an issue that is a support question. labels Dec 14, 2020
@estroz estroz modified the milestones: v1.3.0, v1.5.0 Dec 18, 2020
@IBMRob
Copy link

IBMRob commented Dec 22, 2020

We are also suffering from this problem, We have a number of common structures (in a common_types.go file) which are used in multiple CRDs. None of the specDescriptors in the common structures are being generated into the appropriate CRDs.

This is causing us a major head-ache because we can't share structures across multiple CRDs meaning we need to duplicate lots of code.

@estroz
Copy link
Member

estroz commented Feb 8, 2021

Reopening this as it has not been resolved by #4445

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. language/go Issue is related to a Go operator project olm-integration Issue relates to the OLM integration
Projects
None yet
3 participants