Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Local Path Provisioner
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Local Path Provisioner
Commits
8a3dd7a5
Commit
8a3dd7a5
authored
2 years ago
by
Jeremy Scott
Committed by
Derek Su
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Implement which container logs to select
parent
e5f0d0be
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
provisioner.go
+7
-2
7 additions, 2 deletions
provisioner.go
with
7 additions
and
2 deletions
provisioner.go
+
7
−
2
View file @
8a3dd7a5
...
@@ -709,13 +709,18 @@ func createPersistentVolumeSource(volumeType string, path string) (pvs v1.Persis
...
@@ -709,13 +709,18 @@ func createPersistentVolumeSource(volumeType string, path string) (pvs v1.Persis
return
pvs
,
nil
return
pvs
,
nil
}
}
// saveHelperPodLogs takes what is in stdout/stderr from the helper
// pod and logs it to the provisioner's logs. Returns an error if we
// can't retrieve the helper pod logs.
func
saveHelperPodLogs
(
pod
*
v1
.
Pod
)
(
err
error
)
{
func
saveHelperPodLogs
(
pod
*
v1
.
Pod
)
(
err
error
)
{
defer
func
()
{
defer
func
()
{
err
=
errors
.
Wrapf
(
err
,
"failed to save %s logs"
,
pod
.
Name
)
err
=
errors
.
Wrapf
(
err
,
"failed to save %s logs"
,
pod
.
Name
)
}()
}()
// save helper pod logs
// save helper pod logs
podLogOpts
:=
v1
.
PodLogOptions
{}
podLogOpts
:=
v1
.
PodLogOptions
{
Container
:
"helper-pod"
,
}
config
,
err
:=
rest
.
InClusterConfig
()
config
,
err
:=
rest
.
InClusterConfig
()
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"unable to retrieve in cluster config: %s"
,
err
.
Error
())
return
fmt
.
Errorf
(
"unable to retrieve in cluster config: %s"
,
err
.
Error
())
...
@@ -734,7 +739,7 @@ func saveHelperPodLogs(pod *v1.Pod) (err error) {
...
@@ -734,7 +739,7 @@ func saveHelperPodLogs(pod *v1.Pod) (err error) {
buf
:=
new
(
bytes
.
Buffer
)
buf
:=
new
(
bytes
.
Buffer
)
_
,
err
=
io
.
Copy
(
buf
,
podLogs
)
_
,
err
=
io
.
Copy
(
buf
,
podLogs
)
if
err
!=
nil
{
if
err
!=
nil
{
return
fmt
.
Errorf
(
"error in copy information from podLogs to buf: %s"
,
err
.
Error
())
return
fmt
.
Errorf
(
"error in copy
ing
information from podLogs to buf: %s"
,
err
.
Error
())
}
}
podLogs
.
Close
()
podLogs
.
Close
()
...
...
This diff is collapsed.
Click to expand it.
Dmitriy Safronov
@zimniy
mentioned in commit
efb6f814
·
1 year ago
mentioned in commit
efb6f814
mentioned in commit efb6f814ad74ca2777067c4072113cb83ddb84c1
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment