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
453498fe
Commit
453498fe
authored
Feb 20, 2019
by
Bobby (Babak) Salamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Graduate PriorityClass to GA
parent
f04ce297
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
257 additions
and
5 deletions
+257
-5
aggregator.go
cmd/kube-apiserver/app/aggregator.go
+1
-0
init.sh
hack/lib/init.sh
+1
-0
update-generated-protobuf-dockerized.sh
hack/update-generated-protobuf-dockerized.sh
+1
-0
install.go
pkg/apis/scheduling/install/install.go
+4
-1
doc.go
pkg/apis/scheduling/v1/doc.go
+23
-0
register.go
pkg/apis/scheduling/v1/register.go
+46
-0
describe.go
pkg/kubectl/describe/versioned/describe.go
+1
-1
master.go
pkg/master/master.go
+2
-0
storage_scheduling.go
pkg/registry/scheduling/rest/storage_scheduling.go
+25
-3
roundtrip_test.go
staging/src/k8s.io/api/roundtrip_test.go
+2
-0
doc.go
staging/src/k8s.io/api/scheduling/v1/doc.go
+22
-0
register.go
staging/src/k8s.io/api/scheduling/v1/register.go
+55
-0
types.go
staging/src/k8s.io/api/scheduling/v1/types.go
+66
-0
data.go
test/integration/etcd/data.go
+8
-0
No files found.
cmd/kube-apiserver/app/aggregator.go
View file @
453498fe
...
...
@@ -269,6 +269,7 @@ var apiVersionPriorities = map[schema.GroupVersion]priority{
{
Group
:
"apiextensions.k8s.io"
,
Version
:
"v1beta1"
}
:
{
group
:
16700
,
version
:
9
},
{
Group
:
"admissionregistration.k8s.io"
,
Version
:
"v1"
}
:
{
group
:
16700
,
version
:
15
},
{
Group
:
"admissionregistration.k8s.io"
,
Version
:
"v1beta1"
}
:
{
group
:
16700
,
version
:
12
},
{
Group
:
"scheduling.k8s.io"
,
Version
:
"v1"
}
:
{
group
:
16600
,
version
:
15
},
{
Group
:
"scheduling.k8s.io"
,
Version
:
"v1beta1"
}
:
{
group
:
16600
,
version
:
12
},
{
Group
:
"scheduling.k8s.io"
,
Version
:
"v1alpha1"
}
:
{
group
:
16600
,
version
:
9
},
{
Group
:
"coordination.k8s.io"
,
Version
:
"v1"
}
:
{
group
:
16500
,
version
:
15
},
...
...
hack/lib/init.sh
View file @
453498fe
...
...
@@ -85,6 +85,7 @@ rbac.authorization.k8s.io/v1beta1 \
rbac.authorization.k8s.io/v1alpha1 \
scheduling.k8s.io/v1alpha1 \
scheduling.k8s.io/v1beta1 \
scheduling.k8s.io/v1 \
settings.k8s.io/v1alpha1 \
storage.k8s.io/v1beta1 \
storage.k8s.io/v1 \
...
...
hack/update-generated-protobuf-dockerized.sh
View file @
453498fe
...
...
@@ -72,6 +72,7 @@ PACKAGES=(
k8s.io/api/imagepolicy/v1alpha1
k8s.io/api/scheduling/v1alpha1
k8s.io/api/scheduling/v1beta1
k8s.io/api/scheduling/v1
k8s.io/api/settings/v1alpha1
k8s.io/api/storage/v1alpha1
k8s.io/api/storage/v1beta1
...
...
pkg/apis/scheduling/install/install.go
View file @
453498fe
...
...
@@ -23,6 +23,7 @@ import (
utilruntime
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/apis/scheduling"
"k8s.io/kubernetes/pkg/apis/scheduling/v1"
"k8s.io/kubernetes/pkg/apis/scheduling/v1alpha1"
"k8s.io/kubernetes/pkg/apis/scheduling/v1beta1"
)
...
...
@@ -34,7 +35,9 @@ 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
(
v1
.
AddToScheme
(
scheme
))
utilruntime
.
Must
(
v1beta1
.
AddToScheme
(
scheme
))
utilruntime
.
Must
(
v1alpha1
.
AddToScheme
(
scheme
))
utilruntime
.
Must
(
scheme
.
SetVersionPriority
(
v1beta1
.
SchemeGroupVersion
,
v1alpha1
.
SchemeGroupVersion
))
// TODO(bsalamat): update this in 1.15 to use v1 API.
utilruntime
.
Must
(
scheme
.
SetVersionPriority
(
v1beta1
.
SchemeGroupVersion
,
v1
.
SchemeGroupVersion
,
v1alpha1
.
SchemeGroupVersion
))
}
pkg/apis/scheduling/v1/doc.go
0 → 100644
View file @
453498fe
/*
Copyright 2019 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/v1
// +groupName=scheduling.k8s.io
// +k8s:defaulter-gen=TypeMeta
// +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/scheduling/v1
package
v1
// import "k8s.io/kubernetes/pkg/apis/scheduling/v1"
pkg/apis/scheduling/v1/register.go
0 → 100644
View file @
453498fe
/*
Copyright 2019 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
v1
import
(
schedulingv1
"k8s.io/api/scheduling/v1"
"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
:
"v1"
}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func
Resource
(
resource
string
)
schema
.
GroupResource
{
return
SchemeGroupVersion
.
WithResource
(
resource
)
.
GroupResource
()
}
var
(
localSchemeBuilder
=
&
schedulingv1
.
SchemeBuilder
// AddToScheme applies all the stored functions to the scheme.
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/kubectl/describe/versioned/describe.go
View file @
453498fe
...
...
@@ -3711,7 +3711,7 @@ type PriorityClassDescriber struct {
}
func
(
s
*
PriorityClassDescriber
)
Describe
(
namespace
,
name
string
,
describerSettings
describe
.
DescriberSettings
)
(
string
,
error
)
{
pc
,
err
:=
s
.
Scheduling
()
.
PriorityClasses
()
.
Get
(
name
,
metav1
.
GetOptions
{})
pc
,
err
:=
s
.
Scheduling
V1beta1
()
.
PriorityClasses
()
.
Get
(
name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
return
""
,
err
}
...
...
pkg/master/master.go
View file @
453498fe
...
...
@@ -50,6 +50,7 @@ import (
rbacv1
"k8s.io/api/rbac/v1"
rbacv1alpha1
"k8s.io/api/rbac/v1alpha1"
rbacv1beta1
"k8s.io/api/rbac/v1beta1"
schedulingapiv1
"k8s.io/api/scheduling/v1"
schedulingv1alpha1
"k8s.io/api/scheduling/v1alpha1"
schedulingapiv1beta1
"k8s.io/api/scheduling/v1beta1"
settingsv1alpha1
"k8s.io/api/settings/v1alpha1"
...
...
@@ -493,6 +494,7 @@ func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig {
storageapiv1
.
SchemeGroupVersion
,
storageapiv1beta1
.
SchemeGroupVersion
,
schedulingapiv1beta1
.
SchemeGroupVersion
,
schedulingapiv1
.
SchemeGroupVersion
,
)
// enable non-deprecated beta resources in extensions/v1beta1 explicitly so we have a full list of what's possible to serve
ret
.
EnableResources
(
...
...
pkg/registry/scheduling/rest/storage_scheduling.go
View file @
453498fe
...
...
@@ -32,6 +32,7 @@ import (
serverstorage
"k8s.io/apiserver/pkg/server/storage"
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/apis/scheduling"
schedulingapiv1
"k8s.io/kubernetes/pkg/apis/scheduling/v1"
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"
...
...
@@ -48,15 +49,36 @@ 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
.
s
torage
(
apiResourceConfigSource
,
restOptionsGetter
)
apiGroupInfo
.
VersionedResourcesStorageMap
[
schedulingapiv1alpha1
.
SchemeGroupVersion
.
Version
]
=
p
.
v1alpha1S
torage
(
apiResourceConfigSource
,
restOptionsGetter
)
}
if
apiResourceConfigSource
.
VersionEnabled
(
schedulingapiv1beta1
.
SchemeGroupVersion
)
{
apiGroupInfo
.
VersionedResourcesStorageMap
[
schedulingapiv1beta1
.
SchemeGroupVersion
.
Version
]
=
p
.
storage
(
apiResourceConfigSource
,
restOptionsGetter
)
apiGroupInfo
.
VersionedResourcesStorageMap
[
schedulingapiv1beta1
.
SchemeGroupVersion
.
Version
]
=
p
.
v1beta1Storage
(
apiResourceConfigSource
,
restOptionsGetter
)
}
if
apiResourceConfigSource
.
VersionEnabled
(
schedulingapiv1
.
SchemeGroupVersion
)
{
apiGroupInfo
.
VersionedResourcesStorageMap
[
schedulingapiv1
.
SchemeGroupVersion
.
Version
]
=
p
.
v1Storage
(
apiResourceConfigSource
,
restOptionsGetter
)
}
return
apiGroupInfo
,
true
}
func
(
p
RESTStorageProvider
)
storage
(
apiResourceConfigSource
serverstorage
.
APIResourceConfigSource
,
restOptionsGetter
generic
.
RESTOptionsGetter
)
map
[
string
]
rest
.
Storage
{
func
(
p
RESTStorageProvider
)
v1alpha1Storage
(
apiResourceConfigSource
serverstorage
.
APIResourceConfigSource
,
restOptionsGetter
generic
.
RESTOptionsGetter
)
map
[
string
]
rest
.
Storage
{
storage
:=
map
[
string
]
rest
.
Storage
{}
// priorityclasses
priorityClassStorage
:=
priorityclassstore
.
NewREST
(
restOptionsGetter
)
storage
[
"priorityclasses"
]
=
priorityClassStorage
return
storage
}
func
(
p
RESTStorageProvider
)
v1beta1Storage
(
apiResourceConfigSource
serverstorage
.
APIResourceConfigSource
,
restOptionsGetter
generic
.
RESTOptionsGetter
)
map
[
string
]
rest
.
Storage
{
storage
:=
map
[
string
]
rest
.
Storage
{}
// priorityclasses
priorityClassStorage
:=
priorityclassstore
.
NewREST
(
restOptionsGetter
)
storage
[
"priorityclasses"
]
=
priorityClassStorage
return
storage
}
func
(
p
RESTStorageProvider
)
v1Storage
(
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 @
453498fe
...
...
@@ -44,6 +44,7 @@ import (
rbacv1
"k8s.io/api/rbac/v1"
rbacv1alpha1
"k8s.io/api/rbac/v1alpha1"
rbacv1beta1
"k8s.io/api/rbac/v1beta1"
schedulingv1
"k8s.io/api/scheduling/v1"
schedulingv1alpha1
"k8s.io/api/scheduling/v1alpha1"
schedulingv1beta1
"k8s.io/api/scheduling/v1beta1"
settingsv1alpha1
"k8s.io/api/settings/v1alpha1"
...
...
@@ -88,6 +89,7 @@ var groups = []runtime.SchemeBuilder{
rbacv1
.
SchemeBuilder
,
schedulingv1alpha1
.
SchemeBuilder
,
schedulingv1beta1
.
SchemeBuilder
,
schedulingv1
.
SchemeBuilder
,
settingsv1alpha1
.
SchemeBuilder
,
storagev1alpha1
.
SchemeBuilder
,
storagev1beta1
.
SchemeBuilder
,
...
...
staging/src/k8s.io/api/scheduling/v1/doc.go
0 → 100644
View file @
453498fe
/*
Copyright 2019 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
v1
// import "k8s.io/api/scheduling/v1"
staging/src/k8s.io/api/scheduling/v1/register.go
0 → 100644
View file @
453498fe
/*
Copyright 2019 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
v1
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
:
"v1"
}
// 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 is a collection of functions that add things to a scheme.
SchemeBuilder
=
runtime
.
NewSchemeBuilder
(
addKnownTypes
)
localSchemeBuilder
=
&
SchemeBuilder
// AddToScheme applies all the stored functions to the scheme.
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/v1/types.go
0 → 100644
View file @
453498fe
/*
Copyright 2019 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
v1
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/data.go
View file @
453498fe
...
...
@@ -420,6 +420,14 @@ func GetEtcdStorageData() map[schema.GroupVersionResource]StorageData {
},
// --
// k8s.io/kubernetes/pkg/apis/scheduling/v1
gvr
(
"scheduling.k8s.io"
,
"v1"
,
"priorityclasses"
)
:
{
Stub
:
`{"metadata":{"name":"pc3"},"Value":1000}`
,
ExpectedEtcdPath
:
"/registry/priorityclasses/pc3"
,
ExpectedGVK
:
gvkP
(
"scheduling.k8s.io"
,
"v1beta1"
,
"PriorityClass"
),
},
// --
// k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1
// depends on aggregator using the same ungrouped RESTOptionsGetter as the kube apiserver, not SimpleRestOptionsFactory in aggregator.go
gvr
(
"apiregistration.k8s.io"
,
"v1beta1"
,
"apiservices"
)
:
{
...
...
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