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
467333cc
Commit
467333cc
authored
Jul 12, 2016
by
Anirudh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create event only if creation of PVC failed.
parent
bea382c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
pet.go
pkg/controller/petset/pet.go
+5
-2
No files found.
pkg/controller/petset/pet.go
View file @
467333cc
...
@@ -231,7 +231,9 @@ func (p *apiServerPetClient) getPVC(pvcName, pvcNamespace string) (*api.Persiste
...
@@ -231,7 +231,9 @@ func (p *apiServerPetClient) getPVC(pvcName, pvcNamespace string) (*api.Persiste
if
errors
.
IsNotFound
(
err
)
{
if
errors
.
IsNotFound
(
err
)
{
found
=
false
found
=
false
}
}
if
err
!=
nil
||
!
found
{
if
!
found
{
return
nil
,
found
,
nil
}
else
if
err
!=
nil
{
return
nil
,
found
,
err
return
nil
,
found
,
err
}
}
return
pvc
,
true
,
nil
return
pvc
,
true
,
nil
...
@@ -249,7 +251,8 @@ func (p *apiServerPetClient) SyncPVCs(pet *pcb) error {
...
@@ -249,7 +251,8 @@ func (p *apiServerPetClient) SyncPVCs(pet *pcb) error {
for
i
,
pvc
:=
range
pet
.
pvcs
{
for
i
,
pvc
:=
range
pet
.
pvcs
{
_
,
exists
,
err
:=
p
.
getPVC
(
pvc
.
Name
,
pet
.
parent
.
Namespace
)
_
,
exists
,
err
:=
p
.
getPVC
(
pvc
.
Name
,
pet
.
parent
.
Namespace
)
if
!
exists
{
if
!
exists
{
if
err
:=
p
.
createPVC
(
&
pet
.
pvcs
[
i
]);
err
!=
nil
{
var
err
error
if
err
=
p
.
createPVC
(
&
pet
.
pvcs
[
i
]);
err
!=
nil
{
errMsg
+=
fmt
.
Sprintf
(
"Failed to create %v: %v"
,
pvc
.
Name
,
err
)
errMsg
+=
fmt
.
Sprintf
(
"Failed to create %v: %v"
,
pvc
.
Name
,
err
)
}
}
p
.
event
(
pet
.
parent
,
"Create"
,
fmt
.
Sprintf
(
"pvc: %v"
,
pvc
.
Name
),
err
)
p
.
event
(
pet
.
parent
,
"Create"
,
fmt
.
Sprintf
(
"pvc: %v"
,
pvc
.
Name
),
err
)
...
...
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