mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-23 19:08:44 +00:00
Merge pull request #74733 from wk8/wk8/misc_fixes
Not asking for sudo passwords for password-less sudo users any more
This commit is contained in:
@@ -154,10 +154,17 @@ if [ "${remote}" = true ] ; then
|
|||||||
exit $?
|
exit $?
|
||||||
|
|
||||||
else
|
else
|
||||||
# Refresh sudo credentials for local run
|
# Refresh sudo credentials if needed
|
||||||
if ! ping -c 1 -q metadata.google.internal &> /dev/null; then
|
if ping -c 1 -q metadata.google.internal &> /dev/null; then
|
||||||
echo "Updating sudo credentials"
|
echo 'Running on CGE, not asking for sudo credentials'
|
||||||
sudo -v || exit 1
|
elif sudo --non-interactive "$(which bash)" -c true 2> /dev/null; then
|
||||||
|
# if we can run bash without a password, it's a pretty safe bet that either
|
||||||
|
# we can run any command without a password, or that sudo credentials
|
||||||
|
# are already cached - and they've just been re-cached
|
||||||
|
echo 'No need to refresh sudo credentials'
|
||||||
|
else
|
||||||
|
echo 'Updating sudo credentials'
|
||||||
|
sudo --validate || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Do not use any network plugin by default. User could override the flags with
|
# Do not use any network plugin by default. User could override the flags with
|
||||||
|
@@ -24,9 +24,17 @@
|
|||||||
# TODO(random-liu): Use standard tool to start kubelet in production way (such
|
# TODO(random-liu): Use standard tool to start kubelet in production way (such
|
||||||
# as systemd, supervisord etc.)
|
# as systemd, supervisord etc.)
|
||||||
|
|
||||||
# Refresh sudo credentials if not running on GCE.
|
# Refresh sudo credentials if needed
|
||||||
if ! ping -c 1 -q metadata.google.internal &> /dev/null; then
|
if ping -c 1 -q metadata.google.internal &> /dev/null; then
|
||||||
sudo -v || exit 1
|
echo 'Running on CGE, not asking for sudo credentials'
|
||||||
|
elif sudo --non-interactive "$(which bash)" -c true 2> /dev/null; then
|
||||||
|
# if we can run bash without a password, it's a pretty safe bet that either
|
||||||
|
# we can run any command without a password, or that sudo credentials
|
||||||
|
# are already cached - and they've just been re-cached
|
||||||
|
echo 'No need to refresh sudo credentials'
|
||||||
|
else
|
||||||
|
echo 'Updating sudo credentials'
|
||||||
|
sudo --validate || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# FOCUS is ginkgo focus to select which tests to run. By default, FOCUS is
|
# FOCUS is ginkgo focus to select which tests to run. By default, FOCUS is
|
||||||
|
@@ -60,7 +60,7 @@ func setDesiredConfiguration(initialConfig *kubeletconfig.KubeletConfiguration)
|
|||||||
var _ = framework.KubeDescribe("Node Container Manager [Serial]", func() {
|
var _ = framework.KubeDescribe("Node Container Manager [Serial]", func() {
|
||||||
f := framework.NewDefaultFramework("node-container-manager")
|
f := framework.NewDefaultFramework("node-container-manager")
|
||||||
Describe("Validate Node Allocatable [NodeFeature:NodeAllocatable]", func() {
|
Describe("Validate Node Allocatable [NodeFeature:NodeAllocatable]", func() {
|
||||||
It("set's up the node and runs the test", func() {
|
It("sets up the node and runs the test", func() {
|
||||||
framework.ExpectNoError(runTest(f))
|
framework.ExpectNoError(runTest(f))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user