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
a38ad775
Unverified
Commit
a38ad775
authored
Sep 25, 2018
by
k8s-ci-robot
Committed by
GitHub
Sep 25, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #68641 from seans3/kubectl-extract-2
Removes dependency on internal version of resource
parents
807d942f
8f06514f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
BUILD
pkg/kubectl/BUILD
+0
-1
rollout_status.go
pkg/kubectl/rollout_status.go
+6
-5
No files found.
pkg/kubectl/BUILD
View file @
a38ad775
...
...
@@ -114,7 +114,6 @@ go_library(
deps = [
"//pkg/api/legacyscheme:go_default_library",
"//pkg/api/v1/pod:go_default_library",
"//pkg/apis/apps:go_default_library",
"//pkg/apis/core:go_default_library",
"//pkg/apis/core/v1:go_default_library",
"//pkg/apis/extensions:go_default_library",
...
...
pkg/kubectl/rollout_status.go
View file @
a38ad775
...
...
@@ -25,7 +25,6 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/kubernetes"
clientappsv1
"k8s.io/client-go/kubernetes/typed/apps/v1"
"k8s.io/kubernetes/pkg/apis/apps"
"k8s.io/kubernetes/pkg/controller/deployment/util"
"k8s.io/kubernetes/pkg/kubectl/scheme"
)
...
...
@@ -38,11 +37,13 @@ type StatusViewer interface {
// StatusViewerFor returns a StatusViewer for the resource specified by kind.
func
StatusViewerFor
(
kind
schema
.
GroupKind
,
c
kubernetes
.
Interface
)
(
StatusViewer
,
error
)
{
switch
kind
{
case
extensionsv1beta1
.
SchemeGroupVersion
.
WithKind
(
"Deployment"
)
.
GroupKind
(),
apps
.
Kind
(
"Deployment"
)
:
case
extensionsv1beta1
.
SchemeGroupVersion
.
WithKind
(
"Deployment"
)
.
GroupKind
(),
appsv1
.
SchemeGroupVersion
.
WithKind
(
"Deployment"
)
.
GroupKind
()
:
return
&
DeploymentStatusViewer
{
c
.
AppsV1
()},
nil
case
extensionsv1beta1
.
SchemeGroupVersion
.
WithKind
(
"DaemonSet"
)
.
GroupKind
(),
apps
.
Kind
(
"DaemonSet"
)
:
case
extensionsv1beta1
.
SchemeGroupVersion
.
WithKind
(
"DaemonSet"
)
.
GroupKind
(),
appsv1
.
SchemeGroupVersion
.
WithKind
(
"DaemonSet"
)
.
GroupKind
()
:
return
&
DaemonSetStatusViewer
{
c
.
AppsV1
()},
nil
case
apps
.
Kind
(
"StatefulSet"
)
:
case
apps
v1
.
SchemeGroupVersion
.
WithKind
(
"StatefulSet"
)
.
GroupKind
(
)
:
return
&
StatefulSetStatusViewer
{
c
.
AppsV1
()},
nil
}
return
nil
,
fmt
.
Errorf
(
"no status viewer has been implemented for %v"
,
kind
)
...
...
@@ -141,7 +142,7 @@ func (s *StatefulSetStatusViewer) Status(obj runtime.Unstructured, revision int6
if
sts
.
Spec
.
Replicas
!=
nil
&&
sts
.
Status
.
ReadyReplicas
<
*
sts
.
Spec
.
Replicas
{
return
fmt
.
Sprintf
(
"Waiting for %d pods to be ready...
\n
"
,
*
sts
.
Spec
.
Replicas
-
sts
.
Status
.
ReadyReplicas
),
false
,
nil
}
if
sts
.
Spec
.
UpdateStrategy
.
Type
==
apps
.
RollingUpdateStatefulSetStrategyType
&&
sts
.
Spec
.
UpdateStrategy
.
RollingUpdate
!=
nil
{
if
sts
.
Spec
.
UpdateStrategy
.
Type
==
apps
v1
.
RollingUpdateStatefulSetStrategyType
&&
sts
.
Spec
.
UpdateStrategy
.
RollingUpdate
!=
nil
{
if
sts
.
Spec
.
Replicas
!=
nil
&&
sts
.
Spec
.
UpdateStrategy
.
RollingUpdate
.
Partition
!=
nil
{
if
sts
.
Status
.
UpdatedReplicas
<
(
*
sts
.
Spec
.
Replicas
-
*
sts
.
Spec
.
UpdateStrategy
.
RollingUpdate
.
Partition
)
{
return
fmt
.
Sprintf
(
"Waiting for partitioned roll out to finish: %d out of %d new pods have been updated...
\n
"
,
...
...
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