mirror of
https://github.com/rancher/types.git
synced 2025-09-15 22:39:05 +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/extensions/v1beta1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -29,8 +30,18 @@ var (
|
||||
|
||||
Kind: IngressGroupVersionKind.Kind,
|
||||
}
|
||||
|
||||
IngressGroupVersionResource = schema.GroupVersionResource{
|
||||
Group: GroupName,
|
||||
Version: Version,
|
||||
Resource: "ingresses",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
resource.Put(IngressGroupVersionResource)
|
||||
}
|
||||
|
||||
func NewIngress(namespace, name string, obj v1beta1.Ingress) *v1beta1.Ingress {
|
||||
obj.APIVersion, obj.Kind = IngressGroupVersionKind.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/extensions/v1beta1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -28,8 +29,18 @@ var (
|
||||
Namespaced: false,
|
||||
Kind: PodSecurityPolicyGroupVersionKind.Kind,
|
||||
}
|
||||
|
||||
PodSecurityPolicyGroupVersionResource = schema.GroupVersionResource{
|
||||
Group: GroupName,
|
||||
Version: Version,
|
||||
Resource: "podsecuritypolicies",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
resource.Put(PodSecurityPolicyGroupVersionResource)
|
||||
}
|
||||
|
||||
func NewPodSecurityPolicy(namespace, name string, obj v1beta1.PodSecurityPolicy) *v1beta1.PodSecurityPolicy {
|
||||
obj.APIVersion, obj.Kind = PodSecurityPolicyGroupVersionKind.ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
|
Reference in New Issue
Block a user