mirror of
https://github.com/rancher/types.git
synced 2025-09-09 00:48:56 +00:00
Generate code for new init() method
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/rancher/norman/controller"
|
||||
"github.com/rancher/norman/objectclient"
|
||||
"github.com/rancher/norman/resource"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
@@ -28,8 +29,18 @@ var (
|
||||
|
||||
Kind: ClusterAuthTokenGroupVersionKind.Kind,
|
||||
}
|
||||
|
||||
ClusterAuthTokenGroupVersionResource = schema.GroupVersionResource{
|
||||
Group: GroupName,
|
||||
Version: Version,
|
||||
Resource: "clusterauthtokens",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
resource.Put(ClusterAuthTokenGroupVersionResource)
|
||||
}
|
||||
|
||||
func NewClusterAuthToken(namespace, name string, obj ClusterAuthToken) *ClusterAuthToken {
|
||||
obj.APIVersion, obj.Kind = ClusterAuthTokenGroupVersionKind.ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
|
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"github.com/rancher/norman/controller"
|
||||
"github.com/rancher/norman/objectclient"
|
||||
"github.com/rancher/norman/resource"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
@@ -28,8 +29,18 @@ var (
|
||||
|
||||
Kind: ClusterUserAttributeGroupVersionKind.Kind,
|
||||
}
|
||||
|
||||
ClusterUserAttributeGroupVersionResource = schema.GroupVersionResource{
|
||||
Group: GroupName,
|
||||
Version: Version,
|
||||
Resource: "clusteruserattributes",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
resource.Put(ClusterUserAttributeGroupVersionResource)
|
||||
}
|
||||
|
||||
func NewClusterUserAttribute(namespace, name string, obj ClusterUserAttribute) *ClusterUserAttribute {
|
||||
obj.APIVersion, obj.Kind = ClusterUserAttributeGroupVersionKind.ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
|
Reference in New Issue
Block a user