mirror of
https://github.com/rancher/types.git
synced 2025-07-19 07:46:25 +00:00
Fix backward CRD group name
This commit is contained in:
parent
4ab7475968
commit
62e4fa6ac7
@ -2,13 +2,13 @@ package schema
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
"github.com/rancher/types/io.cattle.authorization/v1"
|
||||
"github.com/rancher/types/apis/authorization.cattle.io/v1"
|
||||
)
|
||||
|
||||
var (
|
||||
Version = types.APIVersion{
|
||||
Version: "v1",
|
||||
Group: "io.cattle.authorization",
|
||||
Group: "authorization.cattle.io",
|
||||
Path: "/v1-authz",
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ import (
|
||||
var (
|
||||
PodSecurityPolicyTemplateGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v1",
|
||||
Group: "io.cattle.authorization",
|
||||
Group: "authorization.cattle.io",
|
||||
Kind: "PodSecurityPolicyTemplate",
|
||||
}
|
||||
PodSecurityPolicyTemplateResource = metav1.APIResource{
|
@ -15,7 +15,7 @@ import (
|
||||
var (
|
||||
ProjectGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v1",
|
||||
Group: "io.cattle.authorization",
|
||||
Group: "authorization.cattle.io",
|
||||
Kind: "Project",
|
||||
}
|
||||
ProjectResource = metav1.APIResource{
|
@ -15,7 +15,7 @@ import (
|
||||
var (
|
||||
ProjectRoleBindingGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v1",
|
||||
Group: "io.cattle.authorization",
|
||||
Group: "authorization.cattle.io",
|
||||
Kind: "ProjectRoleBinding",
|
||||
}
|
||||
ProjectRoleBindingResource = metav1.APIResource{
|
@ -15,7 +15,7 @@ import (
|
||||
var (
|
||||
RoleTemplateGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v1",
|
||||
Group: "io.cattle.authorization",
|
||||
Group: "authorization.cattle.io",
|
||||
Kind: "RoleTemplate",
|
||||
}
|
||||
RoleTemplateResource = metav1.APIResource{
|
@ -3,14 +3,14 @@ package schema
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
m "github.com/rancher/norman/types/mapping/mapper"
|
||||
"github.com/rancher/types/apis/cluster.cattle.io/v1"
|
||||
"github.com/rancher/types/commonmappers"
|
||||
"github.com/rancher/types/io.cattle.cluster/v1"
|
||||
)
|
||||
|
||||
var (
|
||||
Version = types.APIVersion{
|
||||
Version: "v1",
|
||||
Group: "io.cattle.cluster",
|
||||
Group: "cluster.cattle.io",
|
||||
Path: "/v1-cluster",
|
||||
SubContexts: map[string]bool{
|
||||
"projects": true,
|
@ -15,7 +15,7 @@ import (
|
||||
var (
|
||||
ClusterGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v1",
|
||||
Group: "io.cattle.cluster",
|
||||
Group: "cluster.cattle.io",
|
||||
Kind: "Cluster",
|
||||
}
|
||||
ClusterResource = metav1.APIResource{
|
@ -15,7 +15,7 @@ import (
|
||||
var (
|
||||
ClusterNodeGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v1",
|
||||
Group: "io.cattle.cluster",
|
||||
Group: "cluster.cattle.io",
|
||||
Kind: "ClusterNode",
|
||||
}
|
||||
ClusterNodeResource = metav1.APIResource{
|
@ -3,15 +3,15 @@ package schema
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
m "github.com/rancher/norman/types/mapping/mapper"
|
||||
"github.com/rancher/types/apis/workload.cattle.io/v1/schema/mapper"
|
||||
"github.com/rancher/types/commonmappers"
|
||||
"github.com/rancher/types/io.cattle.workload/v1/schema/mapper"
|
||||
"k8s.io/api/core/v1"
|
||||
)
|
||||
|
||||
var (
|
||||
Version = types.APIVersion{
|
||||
Version: "v1",
|
||||
Group: "io.cattle.workload",
|
||||
Group: "workload.cattle.io",
|
||||
Path: "/v1-app",
|
||||
SubContexts: map[string]bool{
|
||||
"projects": true,
|
@ -12,14 +12,15 @@ import (
|
||||
var (
|
||||
basePackage = "github.com/rancher/types"
|
||||
baseCattle = "client"
|
||||
baseK8s = "apis"
|
||||
)
|
||||
|
||||
func Generate(schemas *types.Schemas) {
|
||||
version := getVersion(schemas)
|
||||
groupParts := strings.Split(version.Group, ".")
|
||||
group := strings.Split(version.Group, ".")[0]
|
||||
|
||||
cattleOutputPackage := path.Join(basePackage, baseCattle, groupParts[len(groupParts)-1], version.Version)
|
||||
k8sOutputPackage := path.Join(basePackage, version.Group, version.Version)
|
||||
cattleOutputPackage := path.Join(basePackage, baseCattle, group, version.Version)
|
||||
k8sOutputPackage := path.Join(basePackage, baseK8s, version.Group, version.Version)
|
||||
|
||||
if err := generator.Generate(schemas, cattleOutputPackage, k8sOutputPackage); err != nil {
|
||||
panic(err)
|
||||
|
6
main.go
6
main.go
@ -3,10 +3,10 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
authzSchema "github.com/rancher/types/apis/authorization.cattle.io/v1/schema"
|
||||
clusterSchema "github.com/rancher/types/apis/cluster.cattle.io/v1/schema"
|
||||
workloadSchema "github.com/rancher/types/apis/workload.cattle.io/v1/schema"
|
||||
"github.com/rancher/types/generator"
|
||||
authzSchema "github.com/rancher/types/io.cattle.authorization/v1/schema"
|
||||
clusterSchema "github.com/rancher/types/io.cattle.cluster/v1/schema"
|
||||
workloadSchema "github.com/rancher/types/io.cattle.workload/v1/schema"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
Loading…
Reference in New Issue
Block a user