1
0
mirror of https://github.com/rancher/types.git synced 2025-08-31 21:00:16 +00:00

Generate code for new init() method

This commit is contained in:
dax
2019-04-20 14:13:40 -07:00
committed by Craig Jellick
parent 0aaea5ae1a
commit 233ec77bbc
112 changed files with 1249 additions and 1 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/batch/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -29,8 +30,18 @@ var (
Kind: JobGroupVersionKind.Kind,
}
JobGroupVersionResource = schema.GroupVersionResource{
Group: GroupName,
Version: Version,
Resource: "jobs",
}
)
func init() {
resource.Put(JobGroupVersionResource)
}
func NewJob(namespace, name string, obj v1.Job) *v1.Job {
obj.APIVersion, obj.Kind = JobGroupVersionKind.ToAPIVersionAndKind()
obj.Name = name