Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
1db59900
Commit
1db59900
authored
May 09, 2018
by
ravisantoshgudimetla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move scheduling api to beta
parent
0c3edc6f
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
231 additions
and
4 deletions
+231
-4
aggregator.go
cmd/kube-apiserver/app/aggregator.go
+1
-0
.golint_failures
hack/.golint_failures
+2
-0
init.sh
hack/lib/init.sh
+1
-0
install.go
pkg/apis/scheduling/install/install.go
+3
-1
doc.go
pkg/apis/scheduling/v1beta1/doc.go
+22
-0
register.go
pkg/apis/scheduling/v1beta1/register.go
+45
-0
master.go
pkg/master/master.go
+2
-0
storage_scheduling.go
pkg/registry/scheduling/rest/storage_scheduling.go
+6
-3
roundtrip_test.go
staging/src/k8s.io/api/roundtrip_test.go
+2
-0
doc.go
staging/src/k8s.io/api/scheduling/v1beta1/doc.go
+21
-0
register.go
staging/src/k8s.io/api/scheduling/v1beta1/register.go
+52
-0
types.go
staging/src/k8s.io/api/scheduling/v1beta1/types.go
+66
-0
etcd_storage_path_test.go
test/integration/etcd/etcd_storage_path_test.go
+8
-0
No files found.
cmd/kube-apiserver/app/aggregator.go
View file @
1db59900
...
...
@@ -263,6 +263,7 @@ var apiVersionPriorities = map[schema.GroupVersion]priority{
{
Group
:
"admissionregistration.k8s.io"
,
Version
:
"v1"
}
:
{
group
:
16700
,
version
:
15
},
{
Group
:
"admissionregistration.k8s.io"
,
Version
:
"v1beta1"
}
:
{
group
:
16700
,
version
:
12
},
{
Group
:
"admissionregistration.k8s.io"
,
Version
:
"v1alpha1"
}
:
{
group
:
16700
,
version
:
9
},
{
Group
:
"scheduling.k8s.io"
,
Version
:
"v1beta1"
}
:
{
group
:
16600
,
version
:
12
},
{
Group
:
"scheduling.k8s.io"
,
Version
:
"v1alpha1"
}
:
{
group
:
16600
,
version
:
9
},
// Append a new group to the end of the list if unsure.
// You can use min(existing group)-100 as the initial value for a group.
...
...
hack/.golint_failures
View file @
1db59900
...
...
@@ -65,6 +65,7 @@ pkg/apis/rbac/v1beta1
pkg/apis/rbac/validation
pkg/apis/scheduling
pkg/apis/scheduling/v1alpha1
pkg/apis/scheduling/v1beta1
pkg/apis/settings
pkg/apis/settings/v1alpha1
pkg/apis/storage
...
...
@@ -441,6 +442,7 @@ staging/src/k8s.io/api/rbac/v1
staging/src/k8s.io/api/rbac/v1alpha1
staging/src/k8s.io/api/rbac/v1beta1
staging/src/k8s.io/api/scheduling/v1alpha1
staging/src/k8s.io/api/scheduling/v1beta1
staging/src/k8s.io/api/settings/v1alpha1
staging/src/k8s.io/api/storage/v1
staging/src/k8s.io/api/storage/v1alpha1
...
...
hack/lib/init.sh
View file @
1db59900
...
...
@@ -81,6 +81,7 @@ rbac.authorization.k8s.io/v1 \
rbac.authorization.k8s.io/v1beta1 \
rbac.authorization.k8s.io/v1alpha1 \
scheduling.k8s.io/v1alpha1 \
scheduling.k8s.io/v1beta1 \
settings.k8s.io/v1alpha1 \
storage.k8s.io/v1beta1 \
storage.k8s.io/v1 \
...
...
pkg/apis/scheduling/install/install.go
View file @
1db59900
...
...
@@ -24,6 +24,7 @@ import (
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/apis/scheduling"
"k8s.io/kubernetes/pkg/apis/scheduling/v1alpha1"
"k8s.io/kubernetes/pkg/apis/scheduling/v1beta1"
)
func
init
()
{
...
...
@@ -33,6 +34,7 @@ func init() {
// Install registers the API group and adds types to a scheme
func
Install
(
scheme
*
runtime
.
Scheme
)
{
utilruntime
.
Must
(
scheduling
.
AddToScheme
(
scheme
))
utilruntime
.
Must
(
v1beta1
.
AddToScheme
(
scheme
))
utilruntime
.
Must
(
v1alpha1
.
AddToScheme
(
scheme
))
utilruntime
.
Must
(
scheme
.
SetVersionPriority
(
v1alpha1
.
SchemeGroupVersion
))
utilruntime
.
Must
(
scheme
.
SetVersionPriority
(
v1
beta1
.
SchemeGroupVersion
,
v1
alpha1
.
SchemeGroupVersion
))
}
pkg/apis/scheduling/v1beta1/doc.go
0 → 100644
View file @
1db59900
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/scheduling
// +k8s:conversion-gen-external-types=k8s.io/api/scheduling/v1beta1
// +groupName=scheduling.k8s.io
// +k8s:defaulter-gen=TypeMeta
// +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/scheduling/v1beta1
package
v1beta1
// import "k8s.io/kubernetes/pkg/apis/scheduling/v1beta1"
pkg/apis/scheduling/v1beta1/register.go
0 → 100644
View file @
1db59900
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
v1beta1
import
(
schedulingv1beta1
"k8s.io/api/scheduling/v1beta1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// GroupName is the group name use in this package
const
GroupName
=
"scheduling.k8s.io"
// SchemeGroupVersion is group version used to register these objects
var
SchemeGroupVersion
=
schema
.
GroupVersion
{
Group
:
GroupName
,
Version
:
"v1beta1"
}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func
Resource
(
resource
string
)
schema
.
GroupResource
{
return
SchemeGroupVersion
.
WithResource
(
resource
)
.
GroupResource
()
}
var
(
localSchemeBuilder
=
&
schedulingv1beta1
.
SchemeBuilder
AddToScheme
=
localSchemeBuilder
.
AddToScheme
)
func
init
()
{
// We only register manually written functions here. The registration of the
// generated functions takes place in the generated files. The separation
// makes the code compile even when the generated files are missing.
localSchemeBuilder
.
Register
(
RegisterDefaults
)
}
pkg/master/master.go
View file @
1db59900
...
...
@@ -48,6 +48,7 @@ import (
rbacv1alpha1
"k8s.io/api/rbac/v1alpha1"
rbacv1beta1
"k8s.io/api/rbac/v1beta1"
schedulingv1alpha1
"k8s.io/api/scheduling/v1alpha1"
schedulingapiv1beta1
"k8s.io/api/scheduling/v1beta1"
settingsv1alpha1
"k8s.io/api/settings/v1alpha1"
storageapiv1
"k8s.io/api/storage/v1"
storageapiv1alpha1
"k8s.io/api/storage/v1alpha1"
...
...
@@ -484,6 +485,7 @@ func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig {
rbacv1beta1
.
SchemeGroupVersion
,
storageapiv1
.
SchemeGroupVersion
,
storageapiv1beta1
.
SchemeGroupVersion
,
schedulingapiv1beta1
.
SchemeGroupVersion
,
)
// disable alpha versions explicitly so we have a full list of what's possible to serve
ret
.
DisableVersions
(
...
...
pkg/registry/scheduling/rest/storage_scheduling.go
View file @
1db59900
...
...
@@ -33,6 +33,7 @@ import (
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/apis/scheduling"
schedulingapiv1alpha1
"k8s.io/kubernetes/pkg/apis/scheduling/v1alpha1"
schedulingapiv1beta1
"k8s.io/kubernetes/pkg/apis/scheduling/v1beta1"
schedulingclient
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/scheduling/internalversion"
priorityclassstore
"k8s.io/kubernetes/pkg/registry/scheduling/priorityclass/storage"
)
...
...
@@ -47,13 +48,15 @@ func (p RESTStorageProvider) NewRESTStorage(apiResourceConfigSource serverstorag
apiGroupInfo
:=
genericapiserver
.
NewDefaultAPIGroupInfo
(
scheduling
.
GroupName
,
legacyscheme
.
Scheme
,
legacyscheme
.
ParameterCodec
,
legacyscheme
.
Codecs
)
if
apiResourceConfigSource
.
VersionEnabled
(
schedulingapiv1alpha1
.
SchemeGroupVersion
)
{
apiGroupInfo
.
VersionedResourcesStorageMap
[
schedulingapiv1alpha1
.
SchemeGroupVersion
.
Version
]
=
p
.
v1alpha1Storage
(
apiResourceConfigSource
,
restOptionsGetter
)
apiGroupInfo
.
VersionedResourcesStorageMap
[
schedulingapiv1alpha1
.
SchemeGroupVersion
.
Version
]
=
p
.
storage
(
apiResourceConfigSource
,
restOptionsGetter
)
}
if
apiResourceConfigSource
.
VersionEnabled
(
schedulingapiv1beta1
.
SchemeGroupVersion
)
{
apiGroupInfo
.
VersionedResourcesStorageMap
[
schedulingapiv1beta1
.
SchemeGroupVersion
.
Version
]
=
p
.
storage
(
apiResourceConfigSource
,
restOptionsGetter
)
}
return
apiGroupInfo
,
true
}
func
(
p
RESTStorageProvider
)
v1alpha1S
torage
(
apiResourceConfigSource
serverstorage
.
APIResourceConfigSource
,
restOptionsGetter
generic
.
RESTOptionsGetter
)
map
[
string
]
rest
.
Storage
{
func
(
p
RESTStorageProvider
)
s
torage
(
apiResourceConfigSource
serverstorage
.
APIResourceConfigSource
,
restOptionsGetter
generic
.
RESTOptionsGetter
)
map
[
string
]
rest
.
Storage
{
storage
:=
map
[
string
]
rest
.
Storage
{}
// priorityclasses
priorityClassStorage
:=
priorityclassstore
.
NewREST
(
restOptionsGetter
)
...
...
staging/src/k8s.io/api/roundtrip_test.go
View file @
1db59900
...
...
@@ -46,6 +46,7 @@ import (
rbacv1alpha1
"k8s.io/api/rbac/v1alpha1"
rbacv1beta1
"k8s.io/api/rbac/v1beta1"
schedulingv1alpha1
"k8s.io/api/scheduling/v1alpha1"
schedulingv1beta1
"k8s.io/api/scheduling/v1beta1"
settingsv1alpha1
"k8s.io/api/settings/v1alpha1"
storagev1
"k8s.io/api/storage/v1"
storagev1alpha1
"k8s.io/api/storage/v1alpha1"
...
...
@@ -87,6 +88,7 @@ var groups = []runtime.SchemeBuilder{
rbacv1beta1
.
SchemeBuilder
,
rbacv1
.
SchemeBuilder
,
schedulingv1alpha1
.
SchemeBuilder
,
schedulingv1beta1
.
SchemeBuilder
,
settingsv1alpha1
.
SchemeBuilder
,
storagev1alpha1
.
SchemeBuilder
,
storagev1beta1
.
SchemeBuilder
,
...
...
staging/src/k8s.io/api/scheduling/v1beta1/doc.go
0 → 100644
View file @
1db59900
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// +k8s:deepcopy-gen=package
// +k8s:openapi-gen=true
// +groupName=scheduling.k8s.io
package
v1beta1
// import "k8s.io/api/scheduling/v1beta1"
staging/src/k8s.io/api/scheduling/v1beta1/register.go
0 → 100644
View file @
1db59900
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
v1beta1
import
(
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// GroupName is the group name use in this package
const
GroupName
=
"scheduling.k8s.io"
// SchemeGroupVersion is group version used to register these objects
var
SchemeGroupVersion
=
schema
.
GroupVersion
{
Group
:
GroupName
,
Version
:
"v1beta1"
}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func
Resource
(
resource
string
)
schema
.
GroupResource
{
return
SchemeGroupVersion
.
WithResource
(
resource
)
.
GroupResource
()
}
var
(
// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
SchemeBuilder
=
runtime
.
NewSchemeBuilder
(
addKnownTypes
)
localSchemeBuilder
=
&
SchemeBuilder
AddToScheme
=
localSchemeBuilder
.
AddToScheme
)
// Adds the list of known types to the given scheme.
func
addKnownTypes
(
scheme
*
runtime
.
Scheme
)
error
{
scheme
.
AddKnownTypes
(
SchemeGroupVersion
,
&
PriorityClass
{},
&
PriorityClassList
{},
)
metav1
.
AddToGroupVersion
(
scheme
,
SchemeGroupVersion
)
return
nil
}
staging/src/k8s.io/api/scheduling/v1beta1/types.go
0 → 100644
View file @
1db59900
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
v1beta1
import
(
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +genclient:nonNamespaced
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PriorityClass defines mapping from a priority class name to the priority
// integer value. The value can be any valid integer.
type
PriorityClass
struct
{
metav1
.
TypeMeta
`json:",inline"`
// Standard object's metadata.
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
// +optional
metav1
.
ObjectMeta
`json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// The value of this priority class. This is the actual priority that pods
// receive when they have the name of this class in their pod spec.
Value
int32
`json:"value" protobuf:"bytes,2,opt,name=value"`
// globalDefault specifies whether this PriorityClass should be considered as
// the default priority for pods that do not have any priority class.
// Only one PriorityClass can be marked as `globalDefault`. However, if more than
// one PriorityClasses exists with their `globalDefault` field set to true,
// the smallest value of such global default PriorityClasses will be used as the default priority.
// +optional
GlobalDefault
bool
`json:"globalDefault,omitempty" protobuf:"bytes,3,opt,name=globalDefault"`
// description is an arbitrary string that usually provides guidelines on
// when this priority class should be used.
// +optional
Description
string
`json:"description,omitempty" protobuf:"bytes,4,opt,name=description"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// PriorityClassList is a collection of priority classes.
type
PriorityClassList
struct
{
metav1
.
TypeMeta
`json:",inline"`
// Standard list metadata
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
// +optional
metav1
.
ListMeta
`json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// items is the list of PriorityClasses
Items
[]
PriorityClass
`json:"items" protobuf:"bytes,2,rep,name=items"`
}
test/integration/etcd/etcd_storage_path_test.go
View file @
1db59900
...
...
@@ -424,6 +424,14 @@ var etcdStorageData = map[schema.GroupVersionResource]struct {
gvr
(
"scheduling.k8s.io"
,
"v1alpha1"
,
"priorityclasses"
)
:
{
stub
:
`{"metadata":{"name":"pc1"},"Value":1000}`
,
expectedEtcdPath
:
"/registry/priorityclasses/pc1"
,
expectedGVK
:
gvkP
(
"scheduling.k8s.io"
,
"v1beta1"
,
"PriorityClass"
),
},
// --
// k8s.io/kubernetes/pkg/apis/scheduling/v1beta1
gvr
(
"scheduling.k8s.io"
,
"v1beta1"
,
"priorityclasses"
)
:
{
stub
:
`{"metadata":{"name":"pc2"},"Value":1000}`
,
expectedEtcdPath
:
"/registry/priorityclasses/pc2"
,
},
// --
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment