forked from LaconicNetwork/kompose
added OpenShifts fork of Kubernetes
reason for this is that openshift/kubernetes backported k8s.io/kubernetes/pkg/securitycontextconstraints/util that is currently required by something that github.com/openshift/origin/pkg/deploy/api/v1 depends on
This commit is contained in:
+91
@@ -0,0 +1,91 @@
|
||||
// +build !ignore_autogenerated_openshift
|
||||
|
||||
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
unversioned "k8s.io/kubernetes/pkg/api/unversioned"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
)
|
||||
|
||||
func init() {
|
||||
if err := api.Scheme.AddGeneratedDeepCopyFuncs(
|
||||
DeepCopy_api_Project,
|
||||
DeepCopy_api_ProjectList,
|
||||
DeepCopy_api_ProjectRequest,
|
||||
DeepCopy_api_ProjectSpec,
|
||||
DeepCopy_api_ProjectStatus,
|
||||
); err != nil {
|
||||
// if one of the deep copy functions is malformed, detect it immediately.
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_api_Project(in Project, out *Project, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_api_ProjectSpec(in.Spec, &out.Spec, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_api_ProjectStatus(in.Status, &out.Status, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ProjectList(in ProjectList, out *ProjectList, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := unversioned.DeepCopy_unversioned_ListMeta(in.ListMeta, &out.ListMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if in.Items != nil {
|
||||
in, out := in.Items, &out.Items
|
||||
*out = make([]Project, len(in))
|
||||
for i := range in {
|
||||
if err := DeepCopy_api_Project(in[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ProjectRequest(in ProjectRequest, out *ProjectRequest, c *conversion.Cloner) error {
|
||||
if err := unversioned.DeepCopy_unversioned_TypeMeta(in.TypeMeta, &out.TypeMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := api.DeepCopy_api_ObjectMeta(in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
out.DisplayName = in.DisplayName
|
||||
out.Description = in.Description
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ProjectSpec(in ProjectSpec, out *ProjectSpec, c *conversion.Cloner) error {
|
||||
if in.Finalizers != nil {
|
||||
in, out := in.Finalizers, &out.Finalizers
|
||||
*out = make([]api.FinalizerName, len(in))
|
||||
for i := range in {
|
||||
(*out)[i] = in[i]
|
||||
}
|
||||
} else {
|
||||
out.Finalizers = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func DeepCopy_api_ProjectStatus(in ProjectStatus, out *ProjectStatus, c *conversion.Cloner) error {
|
||||
out.Phase = in.Phase
|
||||
return nil
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const (
|
||||
displayNameOldAnnotation = "displayName"
|
||||
displayNameAnnotation = "openshift.io/display-name"
|
||||
)
|
||||
|
||||
// DisplayNameAndNameForProject returns a formatted string containing the name
|
||||
// of the project and includes the display name if it differs.
|
||||
func DisplayNameAndNameForProject(project *Project) string {
|
||||
displayName := project.Annotations[displayNameAnnotation]
|
||||
if len(displayName) == 0 {
|
||||
displayName = project.Annotations[displayNameOldAnnotation]
|
||||
}
|
||||
if len(displayName) > 0 && displayName != project.Name {
|
||||
return fmt.Sprintf("%s (%s)", displayName, project.Name)
|
||||
}
|
||||
return project.Name
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
const GroupName = ""
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
|
||||
|
||||
// Kind takes an unqualified kind and returns back a Group qualified GroupKind
|
||||
func Kind(kind string) unversioned.GroupKind {
|
||||
return SchemeGroupVersion.WithKind(kind).GroupKind()
|
||||
}
|
||||
|
||||
// Resource takes an unqualified resource and returns back a Group qualified GroupResource
|
||||
func Resource(resource string) unversioned.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
func AddToScheme(scheme *runtime.Scheme) {
|
||||
// Add the API to Scheme.
|
||||
addKnownTypes(scheme)
|
||||
}
|
||||
|
||||
// Adds the list of known types to api.Scheme.
|
||||
func addKnownTypes(scheme *runtime.Scheme) {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&Project{},
|
||||
&ProjectList{},
|
||||
&ProjectRequest{},
|
||||
)
|
||||
}
|
||||
|
||||
func (obj *ProjectRequest) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *Project) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *ProjectList) GetObjectKind() unversioned.ObjectKind { return &obj.TypeMeta }
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
kapi "k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
)
|
||||
|
||||
// ProjectList is a list of Project objects.
|
||||
type ProjectList struct {
|
||||
unversioned.TypeMeta
|
||||
unversioned.ListMeta
|
||||
Items []Project
|
||||
}
|
||||
|
||||
const (
|
||||
// These are internal finalizer values to Origin
|
||||
FinalizerOrigin kapi.FinalizerName = "openshift.io/origin"
|
||||
)
|
||||
|
||||
// ProjectSpec describes the attributes on a Project
|
||||
type ProjectSpec struct {
|
||||
// Finalizers is an opaque list of values that must be empty to permanently remove object from storage
|
||||
Finalizers []kapi.FinalizerName
|
||||
}
|
||||
|
||||
// ProjectStatus is information about the current status of a Project
|
||||
type ProjectStatus struct {
|
||||
Phase kapi.NamespacePhase
|
||||
}
|
||||
|
||||
// +genclient=true
|
||||
|
||||
// Project is a logical top-level container for a set of origin resources
|
||||
type Project struct {
|
||||
unversioned.TypeMeta
|
||||
kapi.ObjectMeta
|
||||
|
||||
Spec ProjectSpec
|
||||
Status ProjectStatus
|
||||
}
|
||||
|
||||
type ProjectRequest struct {
|
||||
unversioned.TypeMeta
|
||||
kapi.ObjectMeta
|
||||
DisplayName string
|
||||
Description string
|
||||
}
|
||||
|
||||
// These constants represent annotations keys affixed to projects
|
||||
const (
|
||||
// ProjectDisplayName is an annotation that stores the name displayed when querying for projects
|
||||
ProjectDisplayName = "openshift.io/display-name"
|
||||
// ProjectDescription is an annotatoion that holds the description of the project
|
||||
ProjectDescription = "openshift.io/description"
|
||||
// ProjectNodeSelector is an annotation that holds the node selector;
|
||||
// the node selector annotation determines which nodes will have pods from this project scheduled to them
|
||||
ProjectNodeSelector = "openshift.io/node-selector"
|
||||
// ProjectRequester is the username that requested a given project. Its not guaranteed to be present,
|
||||
// but it is set by the default project template.
|
||||
ProjectRequester = "openshift.io/requester"
|
||||
)
|
||||
Reference in New Issue
Block a user