1
0
mirror of https://github.com/rancher/types.git synced 2025-09-27 13:12:58 +00:00

Generate code for new init() method

This commit is contained in:
Craig Jellick
2019-04-23 19:57:55 -07:00
parent 3bbca006fb
commit 6e74872544
109 changed files with 1199 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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