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:
@@ -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
|
||||
|
Reference in New Issue
Block a user