add iam crd

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2020-04-05 03:52:12 +08:00
parent 3c73471f79
commit 0e814bb5e4
879 changed files with 5869 additions and 139213 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -7,9 +7,7 @@ package github.com.openshift.api.project.v1;
import "k8s.io/api/core/v1/generated.proto";
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
import "k8s.io/apimachinery/pkg/util/intstr/generated.proto";
// Package-wide variables from generator "generated".
option go_package = "v1";
@@ -20,26 +18,25 @@ option go_package = "v1";
// membership, editors can create and manage the resources, and viewers can see but not access running
// containers. In a normal cluster project administrators are not able to alter their quotas - that is
// restricted to cluster administrators.
//
//
// Listing or watching projects will return only projects the user has the reader role on.
//
//
// An OpenShift project is an alternative representation of a Kubernetes namespace. Projects are exposed
// as editable to end users while namespaces are not. Direct creation of a project is typically restricted
// to administrators, while end users should use the requestproject resource.
message Project {
// Standard object's metadata.
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec defines the behavior of the Namespace.
optional ProjectSpec spec = 2;
// Status describes the current status of a Namespace
// +optional
optional ProjectStatus status = 3;
}
// ProjectList is a list of Project objects.
message ProjectList {
// Standard object's metadata.
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of projects
@@ -48,7 +45,6 @@ message ProjectList {
// ProjecRequest is the set of options necessary to fully qualify a project request
message ProjectRequest {
// Standard object's metadata.
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// DisplayName is the display name to apply to a project
@@ -67,6 +63,13 @@ message ProjectSpec {
// ProjectStatus is information about the current status of a Project
message ProjectStatus {
// Phase is the current lifecycle phase of the project
// +optional
optional string phase = 1;
// Represents the latest available observations of the project current state.
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
repeated k8s.io.api.core.v1.NamespaceCondition conditions = 2;
}

23
vendor/github.com/openshift/api/project/v1/legacy.go generated vendored Normal file
View File

@@ -0,0 +1,23 @@
package v1
import (
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
var (
legacyGroupVersion = schema.GroupVersion{Group: "", Version: "v1"}
legacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes, corev1.AddToScheme)
DeprecatedInstallWithoutGroup = legacySchemeBuilder.AddToScheme
)
func addLegacyKnownTypes(scheme *runtime.Scheme) error {
types := []runtime.Object{
&Project{},
&ProjectList{},
&ProjectRequest{},
}
scheme.AddKnownTypes(legacyGroupVersion, types...)
return nil
}

View File

@@ -1,49 +1,40 @@
package v1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
const (
GroupName = "project.openshift.io"
LegacyGroupName = ""
)
// SchemeGroupVersion is group version used to register these objects
var (
SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
LegacySchemeGroupVersion = schema.GroupVersion{Group: LegacyGroupName, Version: "v1"}
GroupName = "project.openshift.io"
GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, corev1.AddToScheme)
// Install is a function which adds this version to a scheme
Install = schemeBuilder.AddToScheme
LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes)
AddToSchemeInCoreGroup = LegacySchemeBuilder.AddToScheme
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
// SchemeGroupVersion generated code relies on this name
// Deprecated
SchemeGroupVersion = GroupVersion
// AddToScheme exists solely to keep the old generators creating valid code
// DEPRECATED
AddToScheme = schemeBuilder.AddToScheme
)
// Resource generated code relies on this being here, but it logically belongs to the group
// DEPRECATED
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
return schema.GroupResource{Group: GroupName, Resource: resource}
}
// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
scheme.AddKnownTypes(GroupVersion,
&Project{},
&ProjectList{},
&ProjectRequest{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
func addLegacyKnownTypes(scheme *runtime.Scheme) error {
types := []runtime.Object{
&Project{},
&ProjectList{},
&ProjectRequest{},
}
scheme.AddKnownTypes(LegacySchemeGroupVersion, types...)
metav1.AddToGroupVersion(scheme, GroupVersion)
return nil
}

View File

@@ -10,8 +10,8 @@ import (
// ProjectList is a list of Project objects.
type ProjectList struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is the list of projects
Items []Project `json:"items" protobuf:"bytes,2,rep,name=items"`
}
@@ -19,6 +19,13 @@ type ProjectList struct {
const (
// These are internal finalizer values to Origin
FinalizerOrigin corev1.FinalizerName = "openshift.io/origin"
// 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"
// ProjectRequesterAnnotation is the username that requested a given project. Its not guaranteed to be present,
// but it is set by the default project template.
ProjectRequesterAnnotation = "openshift.io/requester"
)
// ProjectSpec describes the attributes on a Project
@@ -30,7 +37,14 @@ type ProjectSpec struct {
// ProjectStatus is information about the current status of a Project
type ProjectStatus struct {
// Phase is the current lifecycle phase of the project
// +optional
Phase corev1.NamespacePhase `json:"phase,omitempty" protobuf:"bytes,1,opt,name=phase,casttype=k8s.io/api/core/v1.NamespacePhase"`
// Represents the latest available observations of the project current state.
// +optional
// +patchMergeKey=type
// +patchStrategy=merge
Conditions []corev1.NamespaceCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,2,rep,name=conditions"`
}
// +genclient
@@ -50,14 +64,14 @@ type ProjectStatus struct {
// as editable to end users while namespaces are not. Direct creation of a project is typically restricted
// to administrators, while end users should use the requestproject resource.
type Project struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec defines the behavior of the Namespace.
Spec ProjectSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
// Status describes the current status of a Namespace
// +optional
Status ProjectStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
@@ -69,9 +83,9 @@ type Project struct {
// ProjecRequest is the set of options necessary to fully qualify a project request
type ProjectRequest struct {
metav1.TypeMeta `json:",inline"`
// Standard object's metadata.
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// DisplayName is the display name to apply to a project
DisplayName string `json:"displayName,omitempty" protobuf:"bytes,2,opt,name=displayName"`
// Description is the description to apply to a project

View File

@@ -1,11 +1,11 @@
// +build !ignore_autogenerated
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1
import (
core_v1 "k8s.io/api/core/v1"
corev1 "k8s.io/api/core/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
@@ -15,7 +15,7 @@ func (in *Project) DeepCopyInto(out *Project) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
in.Status.DeepCopyInto(&out.Status)
return
}
@@ -33,16 +33,15 @@ func (in *Project) DeepCopy() *Project {
func (in *Project) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProjectList) DeepCopyInto(out *ProjectList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Project, len(*in))
@@ -67,9 +66,8 @@ func (in *ProjectList) DeepCopy() *ProjectList {
func (in *ProjectList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@@ -94,9 +92,8 @@ func (in *ProjectRequest) DeepCopy() *ProjectRequest {
func (in *ProjectRequest) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@@ -104,7 +101,7 @@ func (in *ProjectSpec) DeepCopyInto(out *ProjectSpec) {
*out = *in
if in.Finalizers != nil {
in, out := &in.Finalizers, &out.Finalizers
*out = make([]core_v1.FinalizerName, len(*in))
*out = make([]corev1.FinalizerName, len(*in))
copy(*out, *in)
}
return
@@ -123,6 +120,13 @@ func (in *ProjectSpec) DeepCopy() *ProjectSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProjectStatus) DeepCopyInto(out *ProjectStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]corev1.NamespaceCondition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}

View File

@@ -8,14 +8,13 @@ package v1
// they are on one line! For multiple line or blocks that you want to ignore use ---.
// Any context after a --- is ignored.
//
// Those methods can be generated by using hack/update-generated-swagger-docs.sh
// Those methods can be generated by using hack/update-swagger-docs.sh
// AUTO-GENERATED FUNCTIONS START HERE
var map_Project = map[string]string{
"": "Projects are the unit of isolation and collaboration in OpenShift. A project has one or more members, a quota on the resources that the project may consume, and the security controls on the resources in the project. Within a project, members may have different roles - project administrators can set membership, editors can create and manage the resources, and viewers can see but not access running containers. In a normal cluster project administrators are not able to alter their quotas - that is restricted to cluster administrators.\n\nListing or watching projects will return only projects the user has the reader role on.\n\nAn OpenShift project is an alternative representation of a Kubernetes namespace. Projects are exposed as editable to end users while namespaces are not. Direct creation of a project is typically restricted to administrators, while end users should use the requestproject resource.",
"metadata": "Standard object's metadata.",
"spec": "Spec defines the behavior of the Namespace.",
"status": "Status describes the current status of a Namespace",
"": "Projects are the unit of isolation and collaboration in OpenShift. A project has one or more members, a quota on the resources that the project may consume, and the security controls on the resources in the project. Within a project, members may have different roles - project administrators can set membership, editors can create and manage the resources, and viewers can see but not access running containers. In a normal cluster project administrators are not able to alter their quotas - that is restricted to cluster administrators.\n\nListing or watching projects will return only projects the user has the reader role on.\n\nAn OpenShift project is an alternative representation of a Kubernetes namespace. Projects are exposed as editable to end users while namespaces are not. Direct creation of a project is typically restricted to administrators, while end users should use the requestproject resource.",
"spec": "Spec defines the behavior of the Namespace.",
"status": "Status describes the current status of a Namespace",
}
func (Project) SwaggerDoc() map[string]string {
@@ -23,9 +22,8 @@ func (Project) SwaggerDoc() map[string]string {
}
var map_ProjectList = map[string]string{
"": "ProjectList is a list of Project objects.",
"metadata": "Standard object's metadata.",
"items": "Items is the list of projects",
"": "ProjectList is a list of Project objects.",
"items": "Items is the list of projects",
}
func (ProjectList) SwaggerDoc() map[string]string {
@@ -34,7 +32,6 @@ func (ProjectList) SwaggerDoc() map[string]string {
var map_ProjectRequest = map[string]string{
"": "ProjecRequest is the set of options necessary to fully qualify a project request",
"metadata": "Standard object's metadata.",
"displayName": "DisplayName is the display name to apply to a project",
"description": "Description is the description to apply to a project",
}
@@ -53,8 +50,9 @@ func (ProjectSpec) SwaggerDoc() map[string]string {
}
var map_ProjectStatus = map[string]string{
"": "ProjectStatus is information about the current status of a Project",
"phase": "Phase is the current lifecycle phase of the project",
"": "ProjectStatus is information about the current status of a Project",
"phase": "Phase is the current lifecycle phase of the project",
"conditions": "Represents the latest available observations of the project current state.",
}
func (ProjectStatus) SwaggerDoc() map[string]string {