Repository navigation
Remove old generators and add generation from store for output type stack/stack.yaml - #1032
Conversation
The generate command no longer supports the serving.knative.dev/v1 API version. Drop the Knative Serving generator, its env ordering helper, and references from the --api flag help text and examples. Functions should be generated with the openfaas.com CRDs instead. The schema/knative package is now unused and will be deleted separately. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
Remove the schema/knative/v1 package containing the ServingService CRD types, now that the generate command no longer emits Knative Serving resources. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
Only openfaas.com/v1 and openfaas.com/v2alpha2 are supported by the generate command. Any other API version was previously accepted and stamped straight into the generated CRD, producing YAML that would not apply. Reject unknown values in preRunGenerate with the list of supported versions. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
Scaffolding a stack.yaml for a store function is a common starting point for overriding a pre-built deployment, such as adding OAuth environment variables and secrets before running deploy. Add an --output flag accepting stack.yaml (or its stack alias), which emits an OpenFaaS stack.yaml for the store function instead of a Function CR. The generated file carries the store image, merged labels, annotations and environment, and sets skip_build so the pre-built image is used without a rebuild. The flag is only valid alongside --from-store, and is rejected otherwise. Output types are declared locally so empty values are omitted, keeping the scaffold minimal for editing afterwards. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
Move the check that --output stack.yaml requires --from-store out of runGenerate and into preRunGenerate, where the rest of the flag validation lives. Unknown output formats are now rejected rather than silently ignored, and the --name help no longer refers to a Function CR, which is not what stack output generates. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
AI Pull Request OverviewDisclaimer: This review was generated by automated AI and may contain errors. Do not trust its outputs without human verification. Summary
Approval rating (1-10)8/10. The change is focused and covered by targeted tests; no blocking correctness issues were found in the scoped diff. Summary per fileSummary per file
Overall AssessmentThe scoped changes are consistent with the PR goal of removing deprecated Knative generation and making unsupported Detailed ReviewDetailed ReviewNo blocking findings. The The The Knative schema deletion appears complete within the reviewed scope; the remaining scoped references only use the removed API string in a negative validation test. AI agent details. |
Summary
Remove the deprecated generators from
faas-cli generate:--apivalue other thanopenfaas.com/v1andopenfaas.com/v2alpha2, rather than stamping it straight into the generated CRD--output stack.yaml(aliasstack) forgenerate --from-store, which scaffolds an OpenFaaSstack.yamlwithskip_build: truefor a store image, ready to edit and thendeployWhy
Scaffolding a stack.yaml for a store function is a common starting point for overriding a pre-built deployment, such as adding OAuth environment variables and secrets before running
deploy.Notes
--api=serving.knative.dev/v1now errors with the list of supported versionsfprocessfrom store items is emitted throughenvironmentonly, matching how deploy and the watchdog consume itpreRunGenerate(API and output validation) andgenerateStackYAML, full suite passes