-
Notifications
You must be signed in to change notification settings - Fork 901
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
Genereate openapi schema with k8s types included #2153
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2153 +/- ##
=======================================
Coverage 82.23% 82.23%
=======================================
Files 121 121
Lines 17953 17955 +2
=======================================
+ Hits 14763 14765 +2
Misses 2420 2420
Partials 770 770
Continue to review full report at Codecov.
|
BTW @zachaller We have an issue 1730 that can be fixed with this PR |
36f084e
to
8e9640c
Compare
…rojs Signed-off-by: zachaller <[email protected]>
9213954
to
e15496e
Compare
Signed-off-by: zachaller <[email protected]>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
--report-filename pkg/apis/api-rules/violation_exceptions.list | ||
pkg/apis/rollouts/... \ | ||
--go-header-file hack/custom-boilerplate.go.txt \ | ||
--input-dirs github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1,github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1,github.com/argoproj/argo-events/pkg/apis/eventsource/v1alpha1,github.com/argoproj/argo-events/pkg/apis/eventbus/v1alpha1,github.com/argoproj/argo-events/pkg/apis/sensor/v1alpha1,github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1,k8s.io/api/admission/v1,k8s.io/api/admissionregistration/v1,k8s.io/api/admissionregistration/v1beta1,k8s.io/api/authentication/v1,k8s.io/api/apiregistration/v1,k8s.io/api/apps/v1,k8s.io/api/apps/v1beta1,k8s.io/api/apps/v1beta2,k8s.io/api/autoscaling/v1beta1,k8s.io/api/autoscaling/v1,k8s.io/api/autoscaling/v2,k8s.io/api/batch/v1,k8s.io/api/batch/v1beta1,k8s.io/api/certificates/v1beta1,k8s.io/api/certificates/v1,k8s.io/api/core/v1,k8s.io/api/extensions/v1beta1,k8s.io/api/networking/v1,k8s.io/api/networking/v1beta1,k8s.io/api/policy/v1,k8s.io/api/policy/v1beta1,k8s.io/api/rbac/v1,k8s.io/api/rbac/b1beta1,k8s.io/api/rbac/v1alpha1,k8s.io/api/storage/v1,k8s.io/api/storage/v1alpha1,k8s.io/api/storage/v1beta1 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List form
github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1
github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1
github.com/argoproj/argo-events/pkg/apis/eventsource/v1alpha1
github.com/argoproj/argo-events/pkg/apis/eventbus/v1alpha1
github.com/argoproj/argo-events/pkg/apis/sensor/v1alpha1
github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1
k8s.io/api/admission/v1
k8s.io/api/admissionregistration/v1
k8s.io/api/admissionregistration/v1beta1
k8s.io/api/authentication/v1
k8s.io/api/apiregistration/v1
k8s.io/api/apps/v1
k8s.io/api/apps/v1beta1
k8s.io/api/apps/v1beta2
k8s.io/api/autoscaling/v1beta1
k8s.io/api/autoscaling/v1
k8s.io/api/autoscaling/v2
k8s.io/api/batch/v1
k8s.io/api/batch/v1beta1
k8s.io/api/certificates/v1beta1
k8s.io/api/certificates/v1
k8s.io/api/core/v1
k8s.io/api/extensions/v1beta1
k8s.io/api/networking/v1
k8s.io/api/networking/v1beta1
k8s.io/api/policy/v1
k8s.io/api/policy/v1beta1
k8s.io/api/rbac/v1
k8s.io/api/rbac/b1beta1
k8s.io/api/rbac/v1alpha1
k8s.io/api/storage/v1
k8s.io/api/storage/v1alpha1
k8s.io/api/storage/v1beta1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty against the import of argo-cd events and workflows into go.mod. Is this really necessary?
github.com/argoproj/argo-cd/v2 v2.4.7 | ||
github.com/argoproj/argo-events v1.7.0 | ||
github.com/argoproj/argo-workflows/v3 v3.3.8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes. We should really avoid this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the only reason I did this and I was going to bring this up at the community meeting is because kustomize only supporting 1 openapi schema at a time if end users ever had a kustomize deployment that shared an argoproj resources aka had a rollouts object and workflows object and wanted to patch them they could not do it. So not sure if we want to provide something for end users to work with all projects under the argoproj name or not and how we want to go about doing it.
One option is moving this into it's own codebase to generate the file then we just share it in documentation. This is what I wanted to discuss if other projects also wanted to partake in using this file or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also try to hack around it a bit by trying to setup a go env that openapi-gen would use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still going to try a bit to make it work within rollouts repo without including the other projects deps but it's proving more challenging than originally thought. I am trying to figure out how this works to help https://github.com/kubernetes/gengo/blob/master/parser/parse.go I also did this just as a poc for a seperate repo https://github.com/zachaller/argo-schema-generator which I think makes sense if other projects also want to partake.
Going to close this because we are going to create a new argoproj repo to host this. We will then be able to link the generated file via documentation from each of the projects. |
fixes #1730
Signed-off-by: zachaller [email protected]