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
a02ee64d
Commit
a02ee64d
authored
Nov 30, 2016
by
Tomas Smetana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue #37377: Report an event on successful PVC provisioning
cc: @jsafrane
parent
50fb2845
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
provision_test.go
pkg/controller/volume/persistentvolume/provision_test.go
+3
-3
pv_controller.go
pkg/controller/volume/persistentvolume/pv_controller.go
+2
-0
No files found.
pkg/controller/volume/persistentvolume/provision_test.go
View file @
a02ee64d
...
@@ -113,7 +113,7 @@ func TestProvisionSync(t *testing.T) {
...
@@ -113,7 +113,7 @@ func TestProvisionSync(t *testing.T) {
newClaimArray
(
"claim11-1"
,
"uid11-1"
,
"1Gi"
,
""
,
v1
.
ClaimPending
,
storageutil
.
StorageClassAnnotation
),
newClaimArray
(
"claim11-1"
,
"uid11-1"
,
"1Gi"
,
""
,
v1
.
ClaimPending
,
storageutil
.
StorageClassAnnotation
),
// Binding will be completed in the next syncClaim
// Binding will be completed in the next syncClaim
newClaimArray
(
"claim11-1"
,
"uid11-1"
,
"1Gi"
,
""
,
v1
.
ClaimPending
,
storageutil
.
StorageClassAnnotation
,
annStorageProvisioner
),
newClaimArray
(
"claim11-1"
,
"uid11-1"
,
"1Gi"
,
""
,
v1
.
ClaimPending
,
storageutil
.
StorageClassAnnotation
,
annStorageProvisioner
),
noevents
,
noerrors
,
wrapTestWithProvisionCalls
([]
provisionCall
{
provision1Success
},
testSyncClaim
),
[]
string
{
"Normal ProvisioningSucceeded"
}
,
noerrors
,
wrapTestWithProvisionCalls
([]
provisionCall
{
provision1Success
},
testSyncClaim
),
},
},
{
{
// Provision failure - plugin not found
// Provision failure - plugin not found
...
@@ -185,7 +185,7 @@ func TestProvisionSync(t *testing.T) {
...
@@ -185,7 +185,7 @@ func TestProvisionSync(t *testing.T) {
newClaimArray
(
"claim11-8"
,
"uid11-8"
,
"1Gi"
,
""
,
v1
.
ClaimPending
,
storageutil
.
StorageClassAnnotation
),
newClaimArray
(
"claim11-8"
,
"uid11-8"
,
"1Gi"
,
""
,
v1
.
ClaimPending
,
storageutil
.
StorageClassAnnotation
),
// Binding will be completed in the next syncClaim
// Binding will be completed in the next syncClaim
newClaimArray
(
"claim11-8"
,
"uid11-8"
,
"1Gi"
,
""
,
v1
.
ClaimPending
,
storageutil
.
StorageClassAnnotation
,
annStorageProvisioner
),
newClaimArray
(
"claim11-8"
,
"uid11-8"
,
"1Gi"
,
""
,
v1
.
ClaimPending
,
storageutil
.
StorageClassAnnotation
,
annStorageProvisioner
),
noevents
,
[]
string
{
"Normal ProvisioningSucceeded"
}
,
[]
reactorError
{
[]
reactorError
{
// Inject error to the first
// Inject error to the first
// kubeclient.PersistentVolumes.Create() call. All other calls
// kubeclient.PersistentVolumes.Create() call. All other calls
...
@@ -306,7 +306,7 @@ func TestProvisionSync(t *testing.T) {
...
@@ -306,7 +306,7 @@ func TestProvisionSync(t *testing.T) {
claimWithClass
(
"silver"
,
newClaimArray
(
"claim11-13"
,
"uid11-13"
,
"1Gi"
,
""
,
v1
.
ClaimPending
)),
claimWithClass
(
"silver"
,
newClaimArray
(
"claim11-13"
,
"uid11-13"
,
"1Gi"
,
""
,
v1
.
ClaimPending
)),
// Binding will be completed in the next syncClaim
// Binding will be completed in the next syncClaim
claimWithClass
(
"silver"
,
newClaimArray
(
"claim11-13"
,
"uid11-13"
,
"1Gi"
,
""
,
v1
.
ClaimPending
,
annStorageProvisioner
)),
claimWithClass
(
"silver"
,
newClaimArray
(
"claim11-13"
,
"uid11-13"
,
"1Gi"
,
""
,
v1
.
ClaimPending
,
annStorageProvisioner
)),
noevents
,
noerrors
,
wrapTestWithProvisionCalls
([]
provisionCall
{
provision2Success
},
testSyncClaim
),
[]
string
{
"Normal ProvisioningSucceeded"
}
,
noerrors
,
wrapTestWithProvisionCalls
([]
provisionCall
{
provision2Success
},
testSyncClaim
),
},
},
{
{
// Provision error - non existing class
// Provision error - non existing class
...
...
pkg/controller/volume/persistentvolume/pv_controller.go
View file @
a02ee64d
...
@@ -1382,6 +1382,8 @@ func (ctrl *PersistentVolumeController) provisionClaimOperation(claimObj interfa
...
@@ -1382,6 +1382,8 @@ func (ctrl *PersistentVolumeController) provisionClaimOperation(claimObj interfa
}
}
}
else
{
}
else
{
glog
.
V
(
2
)
.
Infof
(
"volume %q provisioned for claim %q"
,
volume
.
Name
,
claimToClaimKey
(
claim
))
glog
.
V
(
2
)
.
Infof
(
"volume %q provisioned for claim %q"
,
volume
.
Name
,
claimToClaimKey
(
claim
))
msg
:=
fmt
.
Sprintf
(
"Successfully provisioned volume %s using %s"
,
volume
.
Name
,
plugin
.
GetPluginName
())
ctrl
.
eventRecorder
.
Event
(
claim
,
v1
.
EventTypeNormal
,
"ProvisioningSucceeded"
,
msg
)
}
}
}
}
...
...
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