Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
ec0d104f
Commit
ec0d104f
authored
Dec 13, 2016
by
Nikolay Mahotkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reformatting changes
* Run gofmt on all changed files so they formatted properly now
parent
fdac5e8a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
44 deletions
+42
-44
tiller.proto
_proto/hapi/services/tiller.proto
+2
-2
rollback.go
cmd/helm/rollback.go
+1
-1
option.go
pkg/helm/option.go
+2
-2
client.go
pkg/kube/client.go
+34
-36
tiller.pb.go
pkg/proto/hapi/services/tiller.pb.go
+3
-3
No files found.
_proto/hapi/services/tiller.proto
View file @
ec0d104f
...
...
@@ -206,8 +206,8 @@ message RollbackReleaseRequest {
bool
disable_hooks
=
3
;
// Version is the version of the release to deploy.
int32
version
=
4
;
// Performs pods restart for resources if applicable
bool
restart
=
5
;
// Performs pods restart for resources if applicable
bool
restart
=
5
;
}
// RollbackReleaseResponse is the response to an update request.
...
...
cmd/helm/rollback.go
View file @
ec0d104f
...
...
@@ -35,7 +35,7 @@ type rollbackCmd struct {
name
string
revision
int32
dryRun
bool
restart
bool
restart
bool
disableHooks
bool
out
io
.
Writer
client
helm
.
Interface
...
...
pkg/helm/option.go
View file @
ec0d104f
...
...
@@ -40,8 +40,8 @@ type options struct {
dryRun
bool
// if set, re-use an existing name
reuseName
bool
//
restart
bool
// if set, performs pod restart during upgrade/rollback
restart
bool
// if set, skip running hooks
disableHooks
bool
// name of release
...
...
pkg/kube/client.go
View file @
ec0d104f
...
...
@@ -27,21 +27,21 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apimachinery/registered"
apps
"k8s.io/kubernetes/pkg/apis/apps/v1beta1"
"k8s.io/kubernetes/pkg/apis/batch"
"k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
"k8s.io/kubernetes/pkg/client/unversioned/clientcmd"
"k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/kubectl"
cmdutil
"k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/kubectl/resource"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util/strategicpatch"
"k8s.io/kubernetes/pkg/watch"
"k8s.io/kubernetes/pkg/labels"
"k8s.io/kubernetes/pkg/fields"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
apps
"k8s.io/kubernetes/pkg/apis/apps/v1beta1"
"k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
)
// ErrNoObjectsVisited indicates that during a visit operation, no matching objects were found.
...
...
@@ -326,11 +326,11 @@ func updateResource(c *Client, target *resource.Info, currentObj runtime.Object,
helper
:=
resource
.
NewHelper
(
target
.
Client
,
target
.
Mapping
)
_
,
err
=
helper
.
Patch
(
target
.
Namespace
,
target
.
Name
,
api
.
StrategicMergePatchType
,
patch
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
}
if
restart
{
if
restart
{
kind
:=
target
.
Mapping
.
GroupVersionKind
.
Kind
client
,
_
:=
c
.
ClientSet
()
...
...
@@ -353,36 +353,34 @@ func updateResource(c *Client, target *resource.Info, currentObj runtime.Object,
return
err
}
func
restartPods
(
client
*
internalclientset
.
Clientset
,
namespace
string
,
selector
map
[
string
]
string
)
error
{
pods
,
err
:=
client
.
Pods
(
namespace
)
.
List
(
api
.
ListOptions
{
FieldSelector
:
fields
.
Everything
(),
LabelSelector
:
labels
.
Set
(
selector
)
.
AsSelector
(),
})
if
err
!=
nil
{
return
err
}
// Restart pods
for
_
,
pod
:=
range
pods
.
Items
{
log
.
Printf
(
"Restarting pod: %v/%v"
,
pod
.
Namespace
,
pod
.
Name
)
// Delete each pod for get them restarted with changed spec.
err
:=
client
.
Pods
(
pod
.
Namespace
)
.
Delete
(
pod
.
Name
,
&
api
.
DeleteOptions
{
Preconditions
:
&
api
.
Preconditions
{
UID
:
&
pod
.
UID
,
},
})
if
err
!=
nil
{
return
err
}
}
return
nil
}
pods
,
err
:=
client
.
Pods
(
namespace
)
.
List
(
api
.
ListOptions
{
FieldSelector
:
fields
.
Everything
(),
LabelSelector
:
labels
.
Set
(
selector
)
.
AsSelector
(),
})
if
err
!=
nil
{
return
err
}
// Restart pods
for
_
,
pod
:=
range
pods
.
Items
{
log
.
Printf
(
"Restarting pod: %v/%v"
,
pod
.
Namespace
,
pod
.
Name
)
// Delete each pod for get them restarted with changed spec.
err
:=
client
.
Pods
(
pod
.
Namespace
)
.
Delete
(
pod
.
Name
,
&
api
.
DeleteOptions
{
Preconditions
:
&
api
.
Preconditions
{
UID
:
&
pod
.
UID
,
},
})
if
err
!=
nil
{
return
err
}
}
return
nil
}
func
watchUntilReady
(
info
*
resource
.
Info
)
error
{
w
,
err
:=
resource
.
NewHelper
(
info
.
Client
,
info
.
Mapping
)
.
WatchSingle
(
info
.
Namespace
,
info
.
Name
,
info
.
ResourceVersion
)
...
...
pkg/proto/hapi/services/tiller.pb.go
View file @
ec0d104f
...
...
@@ -246,8 +246,8 @@ type UpdateReleaseRequest struct {
DryRun
bool
`protobuf:"varint,4,opt,name=dry_run,json=dryRun" json:"dry_run,omitempty"`
// DisableHooks causes the server to skip running any hooks for the upgrade.
DisableHooks
bool
`protobuf:"varint,5,opt,name=disable_hooks,json=disableHooks" json:"disable_hooks,omitempty"`
// Performs pods restart for resources if applicable
Restart
bool
`protobuf:"varint,6,opt,name=restart,json=restart" json:"restart,omitempty"`
// Performs pods restart for resources if applicable
Restart
bool
`protobuf:"varint,6,opt,name=restart,json=restart" json:"restart,omitempty"`
}
func
(
m
*
UpdateReleaseRequest
)
Reset
()
{
*
m
=
UpdateReleaseRequest
{}
}
...
...
@@ -296,7 +296,7 @@ type RollbackReleaseRequest struct {
// Version is the version of the release to deploy.
Version
int32
`protobuf:"varint,4,opt,name=version" json:"version,omitempty"`
// Performs pods restart for resources if applicable
Restart
bool
`protobuf:"varint,5,opt,name=restart,json=restart" json:"restart,omitempty"`
Restart
bool
`protobuf:"varint,5,opt,name=restart,json=restart" json:"restart,omitempty"`
}
func
(
m
*
RollbackReleaseRequest
)
Reset
()
{
*
m
=
RollbackReleaseRequest
{}
}
...
...
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