-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Enable CRD validation generation for Helm and Ansible #3770
Comments
IMO, we should rely on upstream support for schema validation specifications. See Helm v3's new support, for example: helm/helm#5081 |
I will check it as discussed in the meeting triage. |
Hi @joelanford, I could check this chart schema(helm/helm#5350). See its doc:
So, for Helm, we could address it by using this schema. Also, if we would like to parse the YAML file and get the attributes and its types to create a package main
import (
"fmt"
"reflect"
"sigs.k8s.io/yaml"
)
var file = `---
foo1:
bar:
- bar
- rab
- plop
foo2: bar
foo3: 1
foo4: true
foo5: 1.4
foo8:
- bar
- rab
- plop
`
func main() {
var data map[string]interface{}
yaml.Unmarshal([]byte(file), &data)
for key, value := range data {
valueType := reflect.TypeOf(value).Kind().String()
fmt.Println("Attribute:", key, "Type:", valueType )
}
} Result:
|
The EP operator-framework/enhancements#25 for OLM also shows requires to parse the chart values to create the manifests. |
I have a working branch that uses While developing it, I noticed that Kubernetes API server is fairly strict on what it expects to be present or not present in the CRD validation section when converting from This is a UX problem because the CRD generation appears to work correctly, but an error is surfaced much later when one actually attempts to create the CRD in a cluster. IMO that is a bad user experience, and one we should try to avoid. |
The end goal of this issue would be we have a makefile target manifests for Ansible/Go. I will update the first comment to clarifies it. It cames in the survey so, I am removing the milestone for we have the chance to discuss it again in the bug triage. |
I think this is what I used experimenting with Helm: https://github.com/karuppiah7890/helm-schema-gen |
If someone cares about this and would like to help us investigate or implement, please reach out to the maintainers to continue the discussion about how this could work. |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
Stale issues rot after 30d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle rotten |
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
@openshift-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I am re-open this one. I think that would be very helpful if we would be able to move forward with. |
Rotten issues close after 30d of inactivity. Reopen the issue by commenting /close |
@openshift-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Feature Request
Is your feature request related to a problem? Please describe.
When we scaffold a project using a chart for example, the CRs will be automatically created with the chart values but the CRD will not be created with these data.
For Go, the CRDs are updated when we run
make manifests
via controller-gen and because of this, the projects pass by default in thescorecard-test olm-crds-have-validation
which is not achievable with Helm or Ansible.For reference using helm operator-sdk-sample:
Describe the solution you'd like
Have a target similar to make manifests for Helm/Ansible.
Maybe we could implement a similar feature which would:
The text was updated successfully, but these errors were encountered: