Skip to content

Commit

Permalink
fix: add missing doc.go for proper groupName inference
Browse files Browse the repository at this point in the history
Most go code generators such as kube-openapi rely on gengo [1] to infer the
annotated tags.
When dealing with package annotations, gengo extracts them from
the doc.go file [2].

The types defined in apis/metal3.io/v1alpha1 do have a package annotated
with +groupName. However, the annotation is in the groupversion_info.go
file instead.

You can see comments that refer to this issue [3] [4]

[1] https://github.com/kubernetes/gengo/
[2] https://github.com/kubernetes/gengo/blob/2b36238f13e9b8aebe4c286c2ffb2fc71f4be3c5/types/types.go#L121-L126
[3] kubernetes/code-generator#150 (comment)
[4] kubernetes/code-generator#135

Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
manusa committed Oct 4, 2024
1 parent 1e8acc4 commit 6b123cc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions apis/metal3.io/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Package v1alpha1 contains API Schema definitions for the metal3.io v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=metal3.io
package v1alpha1

0 comments on commit 6b123cc

Please sign in to comment.