-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
start: Use RunPrivate
for checking pull secret for microshift
#3858
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me if the file is user-readable (do we want that?)
pkg/crc/machine/start.go
Outdated
@@ -1068,7 +1068,7 @@ func startMicroshift(ctx context.Context, sshRunner *crcssh.Runner, ocConfig oc. | |||
} | |||
|
|||
func ensurePullSecretPresentInVM(sshRunner *crcssh.Runner, pullSec cluster.PullSecretLoader) error { | |||
if pullSecret, _, err := sshRunner.RunPrivileged("Checking if pull secret already present in the VM", "cat", "/etc/crio/openshift-pull-secret"); err == nil { | |||
if pullSecret, _, err := sshRunner.RunPrivate("Checking if pull secret already present in the VM", "cat", "/etc/crio/openshift-pull-secret"); err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file can be read by a regular user, no need for sudo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah it does need sudo, updated.
1e29799
to
72d1a7c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit log could explain why we need sudo
, especially after the 1st iteration and the review comments.
openshift-pull-secret
is created with return sshRunner.CopyDataPrivileged([]byte(content), "/etc/crio/openshift-pull-secret", 0600)
As part of 211e9dd, I used `RunPrivileged` which end up exposing pull secret to debug logs. With this PR we are going to use `RunPrivate` to make sure we hide the pull secret info. `RunPrivate` is used with `sudo` command because normal user doesn't have read permission to `/etc/crio/openshift-pull-secret` file.
72d1a7c
to
742f276
Compare
@cfergeau Done |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfergeau The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@praveenkumar: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
As part of 211e9dd, I used
RunPrivileged
which end up exposing pull secret to debug logs. With this PR we are going to useRunPrivate
to make sure we hide the pull secret info.Fixes: Issue #3857