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
3bc47924
Commit
3bc47924
authored
Aug 23, 2017
by
Di Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug on kubectl deleting uninitialized resources
parent
4a6bbb9f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
delete.go
pkg/kubectl/delete.go
+5
-0
scale.go
pkg/kubectl/scale.go
+6
-0
No files found.
pkg/kubectl/delete.go
View file @
3bc47924
...
...
@@ -404,6 +404,11 @@ func (reaper *DeploymentReaper) Stop(namespace, name string, timeout time.Durati
if
err
!=
nil
{
return
err
}
if
deployment
.
Initializers
!=
nil
{
var
falseVar
=
false
nonOrphanOption
:=
metav1
.
DeleteOptions
{
OrphanDependents
:
&
falseVar
}
return
deployments
.
Delete
(
name
,
&
nonOrphanOption
)
}
// Use observedGeneration to determine if the deployment controller noticed the pause.
if
err
:=
deploymentutil
.
WaitForObservedDeploymentInternal
(
func
()
(
*
extensions
.
Deployment
,
error
)
{
...
...
pkg/kubectl/scale.go
View file @
3bc47924
...
...
@@ -305,6 +305,9 @@ func (scaler *ReplicaSetScaler) Scale(namespace, name string, newSize uint, prec
if
err
!=
nil
{
return
err
}
if
rs
.
Initializers
!=
nil
{
return
nil
}
err
=
wait
.
Poll
(
waitForReplicas
.
Interval
,
waitForReplicas
.
Timeout
,
client
.
ReplicaSetHasDesiredReplicas
(
scaler
.
c
,
rs
))
if
err
==
wait
.
ErrWaitTimeout
{
...
...
@@ -373,6 +376,9 @@ func (scaler *StatefulSetScaler) Scale(namespace, name string, newSize uint, pre
if
err
!=
nil
{
return
err
}
if
job
.
Initializers
!=
nil
{
return
nil
}
err
=
wait
.
Poll
(
waitForReplicas
.
Interval
,
waitForReplicas
.
Timeout
,
client
.
StatefulSetHasDesiredReplicas
(
scaler
.
c
,
job
))
if
err
==
wait
.
ErrWaitTimeout
{
return
fmt
.
Errorf
(
"timed out waiting for %q to be synced"
,
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