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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Local Path Provisioner
Commits
fb27d148
Commit
fb27d148
authored
May 21, 2020
by
Arie Peterson
Committed by
Sheng Yang
Jul 6, 2020
Browse files
Options
Downloads
Patches
Plain Diff
Create local volumes instead of hostPath
parent
7322467a
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
+5
-7
5 additions, 7 deletions
provisioner.go
with
5 additions
and
7 deletions
provisioner.go
+
5
−
7
View file @
fb27d148
...
...
@@ -198,7 +198,6 @@ func (p *LocalPathProvisioner) Provision(opts pvController.ProvisionOptions) (*v
}
fs
:=
v1
.
PersistentVolumeFilesystem
hostPathType
:=
v1
.
HostPathDirectoryOrCreate
return
&
v1
.
PersistentVolume
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
name
,
...
...
@@ -211,9 +210,8 @@ func (p *LocalPathProvisioner) Provision(opts pvController.ProvisionOptions) (*v
v1
.
ResourceName
(
v1
.
ResourceStorage
)
:
pvc
.
Spec
.
Resources
.
Requests
[
v1
.
ResourceName
(
v1
.
ResourceStorage
)],
},
PersistentVolumeSource
:
v1
.
PersistentVolumeSource
{
HostPath
:
&
v1
.
HostPath
VolumeSource
{
Local
:
&
v1
.
Local
VolumeSource
{
Path
:
path
,
Type
:
&
hostPathType
,
},
},
NodeAffinity
:
&
v1
.
VolumeNodeAffinity
{
...
...
@@ -263,11 +261,11 @@ func (p *LocalPathProvisioner) getPathAndNodeForPV(pv *v1.PersistentVolume) (pat
err
=
errors
.
Wrapf
(
err
,
"failed to delete volume %v"
,
pv
.
Name
)
}()
hostPath
:=
pv
.
Spec
.
PersistentVolumeSource
.
HostPath
if
hostPath
==
nil
{
return
""
,
""
,
fmt
.
Errorf
(
"no
HostPath
set"
)
local
:=
pv
.
Spec
.
PersistentVolumeSource
.
Local
if
local
==
nil
{
return
""
,
""
,
fmt
.
Errorf
(
"no
Local
set"
)
}
path
=
hostPath
.
Path
path
=
local
.
Path
nodeAffinity
:=
pv
.
Spec
.
NodeAffinity
if
nodeAffinity
==
nil
{
...
...
This diff is collapsed.
Click to expand it.
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