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
79ea511e
Commit
79ea511e
authored
Feb 07, 2018
by
Harsh Desai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass pvc namespace and annotations to Portworx Create API
Closes #59606 Signed-off-by:
Harsh Desai
<
harsh@portworx.com
>
parent
2172a2a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
portworx_util.go
pkg/volume/portworx/portworx_util.go
+18
-6
No files found.
pkg/volume/portworx/portworx_util.go
View file @
79ea511e
...
...
@@ -30,12 +30,13 @@ import (
)
const
(
osdMgmtPort
=
"9001"
osdDriverVersion
=
"v1"
pxdDriverName
=
"pxd"
pvcClaimLabel
=
"pvc"
pxServiceName
=
"portworx-service"
pxDriverName
=
"pxd-sched"
osdMgmtPort
=
"9001"
osdDriverVersion
=
"v1"
pxdDriverName
=
"pxd"
pvcClaimLabel
=
"pvc"
pvcNamespaceLabel
=
"namespace"
pxServiceName
=
"portworx-service"
pxDriverName
=
"pxd-sched"
)
type
PortworxVolumeUtil
struct
{
...
...
@@ -80,9 +81,20 @@ func (util *PortworxVolumeUtil) CreateVolume(p *portworxVolumeProvisioner) (stri
// Add claim Name as a part of Portworx Volume Labels
locator
.
VolumeLabels
[
pvcClaimLabel
]
=
p
.
options
.
PVC
.
Name
locator
.
VolumeLabels
[
pvcNamespaceLabel
]
=
p
.
options
.
PVC
.
Namespace
for
k
,
v
:=
range
p
.
options
.
PVC
.
Annotations
{
if
_
,
present
:=
spec
.
VolumeLabels
[
k
];
present
{
glog
.
Warningf
(
"not saving annotation: %s=%s in spec labels due to an existing key"
,
k
,
v
)
continue
}
spec
.
VolumeLabels
[
k
]
=
v
}
volumeID
,
err
:=
driver
.
Create
(
locator
,
source
,
spec
)
if
err
!=
nil
{
glog
.
Errorf
(
"Error creating Portworx Volume : %v"
,
err
)
return
""
,
0
,
nil
,
err
}
glog
.
Infof
(
"Successfully created Portworx volume for PVC: %v"
,
p
.
options
.
PVC
.
Name
)
...
...
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