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

Issue generating CRDs with controller-gen 0.4.0 #502

Closed
chrispatmore opened this issue Oct 8, 2020 · 3 comments · Fixed by #505
Closed

Issue generating CRDs with controller-gen 0.4.0 #502

chrispatmore opened this issue Oct 8, 2020 · 3 comments · Fixed by #505
Assignees

Comments

@chrispatmore
Copy link

Hey, I have been using controller-gen 0.3.0 to generate my CRD. And with no changes the CRD fails to generate when using 0.4.0

The problem is that the validation for stats.conditions in my CRD is being completely removed and replaced with type: Any

I have been using this package https://github.com/operator-framework/operator-lib/blob/v0.1.0/status/conditions.go
for the status conditions field in my api

import (
	"github.com/operator-framework/operator-lib/status"
)
Conditions status.Conditions `json:"conditions"`

error
CustomResourceDefinition.apiextensions.k8s.io "<group>" is invalid: spec.validation.openAPIV3Schema.properties[status].properties[conditions].type: Unsupported value: "Any": supported values: "array", "boolean", "integer", "number", "object", "string"

Is there a way to fix this error and get things working again?

@alvaroaleman
Copy link
Member

Same problem, works fine with 0.3.0: kubernetes/test-infra#19522 (comment)

@alvaroaleman
Copy link
Member

/king bug

@alvaroaleman
Copy link
Member

/assign

maxsmythe added a commit to maxsmythe/controller-tools that referenced this issue Nov 26, 2020
This marker will avoid trying to do any type detection
on any struct field on which it is set. This gives
users a safety valve when they hit an edge case where
type inference does the wrong thing for them.

This fixes kubernetes-sigs#291, which was recently re-broken by fixing kubernetes-sigs#502

Signed-off-by: Max Smythe <smythe@google.com>
maxsmythe added a commit to maxsmythe/controller-tools that referenced this issue Nov 26, 2020
This marker will avoid trying to do any type detection
on any struct field on which it is set. This gives
users a safety valve when they hit an edge case where
type inference does the wrong thing for them.

This fixes kubernetes-sigs#291, which was recently re-broken by fixing kubernetes-sigs#502

Signed-off-by: Max Smythe <smythe@google.com>
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

Successfully merging a pull request may close this issue.

2 participants