Skip to content

Commit 19c3b93

Browse files
committed
bump(k8s): tools: align to new upstream function for getting openapi targets for codegen
New function was introduced in kubernetes/kube-openapi@24f99be
1 parent f5fa6c3 commit 19c3b93

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tools/codegen/pkg/openapi/openapi.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ package openapi
33
import (
44
"bytes"
55
"fmt"
6+
"log"
67
"os"
78
"path/filepath"
89

910
"github.com/openshift/api/tools/codegen/pkg/generation"
1011
"github.com/openshift/api/tools/codegen/pkg/utils"
12+
"k8s.io/gengo/v2"
1113
gengenerator "k8s.io/gengo/v2/generator"
1214
"k8s.io/gengo/v2/parser"
1315
"k8s.io/gengo/v2/types"
@@ -46,7 +48,12 @@ func generateOpenAPIDefinitions(globalParser *parser.Parser, universe types.Univ
4648
klog.V(2).Infof("Generating openapi into %s", outputPackagePath)
4749

4850
myTargets := func(context *gengenerator.Context) []gengenerator.Target {
49-
return generators.GetTargets(context, arguments)
51+
boilerplate, err := gengo.GoBoilerplate(arguments.GoHeaderFile, gengo.StdBuildTag, gengo.StdGeneratedBy)
52+
if err != nil {
53+
log.Fatalf("Failed loading boilerplate: %v", err)
54+
}
55+
56+
return generators.GetOpenAPITargets(context, arguments, boilerplate)
5057
}
5158

5259
if err := generation.Execute(

0 commit comments

Comments
 (0)