mirror of
https://github.com/rancher/types.git
synced 2025-09-12 21:13:18 +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/api/apps/v1beta2"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -29,8 +30,18 @@ var (
|
||||
|
||||
Kind: DaemonSetGroupVersionKind.Kind,
|
||||
}
|
||||
|
||||
DaemonSetGroupVersionResource = schema.GroupVersionResource{
|
||||
Group: GroupName,
|
||||
Version: Version,
|
||||
Resource: "daemonsets",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
resource.Put(DaemonSetGroupVersionResource)
|
||||
}
|
||||
|
||||
func NewDaemonSet(namespace, name string, obj v1beta2.DaemonSet) *v1beta2.DaemonSet {
|
||||
obj.APIVersion, obj.Kind = DaemonSetGroupVersionKind.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/api/apps/v1beta2"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -29,8 +30,18 @@ var (
|
||||
|
||||
Kind: DeploymentGroupVersionKind.Kind,
|
||||
}
|
||||
|
||||
DeploymentGroupVersionResource = schema.GroupVersionResource{
|
||||
Group: GroupName,
|
||||
Version: Version,
|
||||
Resource: "deployments",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
resource.Put(DeploymentGroupVersionResource)
|
||||
}
|
||||
|
||||
func NewDeployment(namespace, name string, obj v1beta2.Deployment) *v1beta2.Deployment {
|
||||
obj.APIVersion, obj.Kind = DeploymentGroupVersionKind.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/api/apps/v1beta2"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -29,8 +30,18 @@ var (
|
||||
|
||||
Kind: ReplicaSetGroupVersionKind.Kind,
|
||||
}
|
||||
|
||||
ReplicaSetGroupVersionResource = schema.GroupVersionResource{
|
||||
Group: GroupName,
|
||||
Version: Version,
|
||||
Resource: "replicasets",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
resource.Put(ReplicaSetGroupVersionResource)
|
||||
}
|
||||
|
||||
func NewReplicaSet(namespace, name string, obj v1beta2.ReplicaSet) *v1beta2.ReplicaSet {
|
||||
obj.APIVersion, obj.Kind = ReplicaSetGroupVersionKind.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/api/apps/v1beta2"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -29,8 +30,18 @@ var (
|
||||
|
||||
Kind: StatefulSetGroupVersionKind.Kind,
|
||||
}
|
||||
|
||||
StatefulSetGroupVersionResource = schema.GroupVersionResource{
|
||||
Group: GroupName,
|
||||
Version: Version,
|
||||
Resource: "statefulsets",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
resource.Put(StatefulSetGroupVersionResource)
|
||||
}
|
||||
|
||||
func NewStatefulSet(namespace, name string, obj v1beta2.StatefulSet) *v1beta2.StatefulSet {
|
||||
obj.APIVersion, obj.Kind = StatefulSetGroupVersionKind.ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
|
Reference in New Issue
Block a user