mirror of
https://github.com/rancher/norman.git
synced 2025-09-28 16:08:19 +00:00
rename field to privateTypes
This commit is contained in:
@@ -14,7 +14,7 @@ var (
|
||||
baseK8s = "apis"
|
||||
)
|
||||
|
||||
func DefaultGenerate(schemas *types.Schemas, pkgPath string, publicAPI bool, foreignTypes map[string]bool) error {
|
||||
func DefaultGenerate(schemas *types.Schemas, pkgPath string, publicAPI bool, privateTypes map[string]bool) error {
|
||||
version := getVersion(schemas)
|
||||
group := strings.Split(version.Group, ".")[0]
|
||||
|
||||
@@ -24,7 +24,7 @@ func DefaultGenerate(schemas *types.Schemas, pkgPath string, publicAPI bool, for
|
||||
}
|
||||
k8sOutputPackage := path.Join(pkgPath, baseK8s, version.Group, version.Version)
|
||||
|
||||
if err := Generate(schemas, foreignTypes, cattleOutputPackage, k8sOutputPackage); err != nil {
|
||||
if err := Generate(schemas, privateTypes, cattleOutputPackage, k8sOutputPackage); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@@ -361,7 +361,7 @@ func GenerateControllerForTypes(version *types.APIVersion, k8sOutputPackage stri
|
||||
return gofmt(baseDir, k8sOutputPackage)
|
||||
}
|
||||
|
||||
func Generate(schemas *types.Schemas, foreignTypes map[string]bool, cattleOutputPackage, k8sOutputPackage string) error {
|
||||
func Generate(schemas *types.Schemas, privateTypes map[string]bool, cattleOutputPackage, k8sOutputPackage string) error {
|
||||
baseDir := args.DefaultSourceTree()
|
||||
cattleDir := path.Join(baseDir, cattleOutputPackage)
|
||||
k8sDir := path.Join(baseDir, k8sOutputPackage)
|
||||
@@ -382,7 +382,7 @@ func Generate(schemas *types.Schemas, foreignTypes map[string]bool, cattleOutput
|
||||
continue
|
||||
}
|
||||
|
||||
_, backendType := foreignTypes[schema.ID]
|
||||
_, privateType := privateTypes[schema.ID]
|
||||
|
||||
if cattleDir != "" {
|
||||
if err := generateType(cattleDir, schema, schemas); err != nil {
|
||||
@@ -390,7 +390,7 @@ func Generate(schemas *types.Schemas, foreignTypes map[string]bool, cattleOutput
|
||||
}
|
||||
}
|
||||
|
||||
if backendType ||
|
||||
if privateType ||
|
||||
(contains(schema.CollectionMethods, http.MethodGet) &&
|
||||
!strings.HasPrefix(schema.PkgName, "k8s.io") &&
|
||||
!strings.Contains(schema.PkgName, "/vendor/")) {
|
||||
@@ -403,7 +403,7 @@ func Generate(schemas *types.Schemas, foreignTypes map[string]bool, cattleOutput
|
||||
}
|
||||
}
|
||||
|
||||
if !backendType {
|
||||
if !privateType {
|
||||
cattleClientTypes = append(cattleClientTypes, schema)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user