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
6f2351b9
Commit
6f2351b9
authored
Dec 15, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18618 from mesosphere/sur-697-annotations
Auto commit by PR queue bot
parents
a581f041
1fd3bc08
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
29 deletions
+8
-29
annotations.go
contrib/mesos/pkg/scheduler/meta/annotations.go
+1
-0
labels.go
contrib/mesos/pkg/scheduler/meta/labels.go
+0
-22
pod_task.go
contrib/mesos/pkg/scheduler/podtask/pod_task.go
+3
-3
pod_task_test.go
contrib/mesos/pkg/scheduler/podtask/pod_task_test.go
+2
-2
mesos.go
test/e2e/mesos.go
+2
-2
No files found.
contrib/mesos/pkg/scheduler/meta/annotations.go
View file @
6f2351b9
...
...
@@ -34,4 +34,5 @@ const (
PortNameMappingKeyFormat
=
PortNameMappingKeyPrefix
+
"%s_%s"
ContainerPortKeyFormat
=
"k8s.mesosphere.io/containerPort_%s_%s_%d"
StaticPodFilenameKey
=
"k8s.mesosphere.io/staticPodFilename"
RolesKey
=
"k8s.mesosphere.io/roles"
)
contrib/mesos/pkg/scheduler/meta/labels.go
deleted
100644 → 0
View file @
a581f041
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
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
meta
// kubernetes api object labels
const
(
RolesKey
=
"k8s.mesosphere.io/roles"
)
contrib/mesos/pkg/scheduler/podtask/pod_task.go
View file @
6f2351b9
...
...
@@ -170,10 +170,10 @@ func (t *T) Has(f FlagType) (exists bool) {
}
// Roles returns the valid roles under which this pod task can be scheduled.
// If the pod has roles
label
s defined they are being used
// If the pod has roles
annotation
s defined they are being used
// else default pod roles are being returned.
func
(
t
*
T
)
Roles
()
[]
string
{
if
r
,
ok
:=
t
.
Pod
.
ObjectMeta
.
Label
s
[
annotation
.
RolesKey
];
ok
{
func
(
t
*
T
)
Roles
()
(
result
[]
string
)
{
if
r
,
ok
:=
t
.
Pod
.
ObjectMeta
.
Annotation
s
[
annotation
.
RolesKey
];
ok
{
roles
:=
strings
.
Split
(
r
,
","
)
for
i
,
r
:=
range
roles
{
...
...
contrib/mesos/pkg/scheduler/podtask/pod_task_test.go
View file @
6f2351b9
...
...
@@ -56,7 +56,7 @@ func TestRoles(t *testing.T) {
assert
:=
assert
.
New
(
t
)
for
i
,
tt
:=
range
[]
struct
{
labels
map
[
string
]
string
annotations
map
[
string
]
string
frameworkRoles
[]
string
want
[]
string
}{
...
...
@@ -105,7 +105,7 @@ func TestRoles(t *testing.T) {
},
}
{
task
:=
fakePodTask
(
"test"
,
tt
.
frameworkRoles
,
starRole
)
task
.
Pod
.
ObjectMeta
.
Labels
=
tt
.
label
s
task
.
Pod
.
ObjectMeta
.
Annotations
=
tt
.
annotation
s
assert
.
True
(
reflect
.
DeepEqual
(
task
.
Roles
(),
tt
.
want
),
"test #%d got %#v want %#v"
,
i
,
task
.
Roles
(),
tt
.
want
)
}
}
...
...
test/e2e/mesos.go
View file @
6f2351b9
...
...
@@ -73,7 +73,7 @@ var _ = Describe("Mesos", func() {
fmt
.
Sprintf
(
"number of static pods in namespace %s is %d"
,
ns
,
numpods
))
})
It
(
"schedules pods
labell
ed with roles on correct slaves"
,
func
()
{
It
(
"schedules pods
annotat
ed with roles on correct slaves"
,
func
()
{
// launch a pod to find a node which can launch a pod. We intentionally do
// not just take the node list and choose the first of them. Depending on the
// cluster and the scheduler it might be that a "normal" pod cannot be
...
...
@@ -86,7 +86,7 @@ var _ = Describe("Mesos", func() {
},
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
podName
,
Label
s
:
map
[
string
]
string
{
Annotation
s
:
map
[
string
]
string
{
"k8s.mesosphere.io/roles"
:
"public"
,
},
},
...
...
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