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
032fa206
Commit
032fa206
authored
Dec 18, 2017
by
Balaji Subramaniam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix policy conflict in the CPU manager node e2e test.
parent
98277ff2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
3 deletions
+18
-3
cpu_manager_test.go
test/e2e_node/cpu_manager_test.go
+18
-3
No files found.
test/e2e_node/cpu_manager_test.go
View file @
032fa206
...
@@ -26,7 +26,6 @@ import (
...
@@ -26,7 +26,6 @@ import (
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/api/resource"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/kubernetes/pkg/features"
runtimeapi
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
runtimeapi
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
"k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig"
"k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig"
"k8s.io/kubernetes/pkg/kubelet/cm/cpumanager"
"k8s.io/kubernetes/pkg/kubelet/cm/cpumanager"
...
@@ -137,7 +136,16 @@ func getCPUSiblingList(cpuRes int64) string {
...
@@ -137,7 +136,16 @@ func getCPUSiblingList(cpuRes int64) string {
return
string
(
out
)
return
string
(
out
)
}
}
func
deleteStateFile
()
{
err
:=
exec
.
Command
(
"/bin/sh"
,
"-c"
,
"rm -f /var/lib/kubelet/cpu_manager_state"
)
.
Run
()
framework
.
ExpectNoError
(
err
,
"error deleting state file"
)
}
func
setOldKubeletConfig
(
f
*
framework
.
Framework
,
oldCfg
*
kubeletconfig
.
KubeletConfiguration
)
{
func
setOldKubeletConfig
(
f
*
framework
.
Framework
,
oldCfg
*
kubeletconfig
.
KubeletConfiguration
)
{
// Delete the CPU Manager state file so that the old Kubelet configuration
// can take effect.i
deleteStateFile
()
if
oldCfg
!=
nil
{
if
oldCfg
!=
nil
{
framework
.
ExpectNoError
(
setKubeletConfiguration
(
f
,
oldCfg
))
framework
.
ExpectNoError
(
setKubeletConfiguration
(
f
,
oldCfg
))
}
}
...
@@ -155,8 +163,15 @@ func enableCPUManagerInKubelet(f *framework.Framework) (oldCfg *kubeletconfig.Ku
...
@@ -155,8 +163,15 @@ func enableCPUManagerInKubelet(f *framework.Framework) (oldCfg *kubeletconfig.Ku
newCfg
.
FeatureGates
=
make
(
map
[
string
]
bool
)
newCfg
.
FeatureGates
=
make
(
map
[
string
]
bool
)
}
}
// Enable CPU Manager using feature gate.
// After graduation of the CPU Manager feature to Beta, the CPU Manager
newCfg
.
FeatureGates
[
string
(
features
.
CPUManager
)]
=
true
// "none" policy is ON by default. But when we set the CPU Manager policy to
// "static" in this test and the Kubelet is restarted so that "static"
// policy can take effect, there will always be a conflict with the state
// checkpointed in the disk (i.e., the policy checkpointed in the disk will
// be "none" whereas we are trying to restart Kubelet with "static"
// policy). Therefore, we delete the state file so that we can proceed
// with the tests.
deleteStateFile
()
// Set the CPU Manager policy to static.
// Set the CPU Manager policy to static.
newCfg
.
CPUManagerPolicy
=
string
(
cpumanager
.
PolicyStatic
)
newCfg
.
CPUManagerPolicy
=
string
(
cpumanager
.
PolicyStatic
)
...
...
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