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
5ee1831f
Commit
5ee1831f
authored
Jun 18, 2017
by
Mayank Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use appsv1beta1 for statefulsets and controller
history
parent
a57c33bd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
controller_history.go
pkg/controller/history/controller_history.go
+5
-5
stateful_set_status_updater.go
pkg/controller/statefulset/stateful_set_status_updater.go
+1
-1
No files found.
pkg/controller/history/controller_history.go
View file @
5ee1831f
...
...
@@ -256,7 +256,7 @@ func (rh *realHistory) CreateControllerRevision(parent metav1.Object, revision *
}
// Update the revisions name and labels
clone
.
Name
=
ControllerRevisionName
(
parent
.
GetName
(),
hash
)
created
,
err
:=
rh
.
client
.
Apps
()
.
ControllerRevisions
(
parent
.
GetNamespace
())
.
Create
(
clone
)
created
,
err
:=
rh
.
client
.
Apps
V1beta1
()
.
ControllerRevisions
(
parent
.
GetNamespace
())
.
Create
(
clone
)
if
errors
.
IsAlreadyExists
(
err
)
{
probe
++
continue
...
...
@@ -276,7 +276,7 @@ func (rh *realHistory) UpdateControllerRevision(revision *apps.ControllerRevisio
return
nil
}
clone
.
Revision
=
newRevision
updated
,
updateErr
:=
rh
.
client
.
Apps
()
.
ControllerRevisions
(
clone
.
Namespace
)
.
Update
(
clone
)
updated
,
updateErr
:=
rh
.
client
.
Apps
V1beta1
()
.
ControllerRevisions
(
clone
.
Namespace
)
.
Update
(
clone
)
if
updateErr
==
nil
{
return
nil
}
...
...
@@ -297,7 +297,7 @@ func (rh *realHistory) UpdateControllerRevision(revision *apps.ControllerRevisio
}
func
(
rh
*
realHistory
)
DeleteControllerRevision
(
revision
*
apps
.
ControllerRevision
)
error
{
return
rh
.
client
.
Apps
()
.
ControllerRevisions
(
revision
.
Namespace
)
.
Delete
(
revision
.
Name
,
nil
)
return
rh
.
client
.
Apps
V1beta1
()
.
ControllerRevisions
(
revision
.
Namespace
)
.
Delete
(
revision
.
Name
,
nil
)
}
func
(
rh
*
realHistory
)
AdoptControllerRevision
(
parent
metav1
.
Object
,
parentKind
schema
.
GroupVersionKind
,
revision
*
apps
.
ControllerRevision
)
(
*
apps
.
ControllerRevision
,
error
)
{
...
...
@@ -306,7 +306,7 @@ func (rh *realHistory) AdoptControllerRevision(parent metav1.Object, parentKind
return
nil
,
fmt
.
Errorf
(
"attempt to adopt revision owned by %v"
,
owner
)
}
// Use strategic merge patch to add an owner reference indicating a controller ref
return
rh
.
client
.
Apps
()
.
ControllerRevisions
(
parent
.
GetNamespace
())
.
Patch
(
revision
.
GetName
(),
return
rh
.
client
.
Apps
V1beta1
()
.
ControllerRevisions
(
parent
.
GetNamespace
())
.
Patch
(
revision
.
GetName
(),
types
.
StrategicMergePatchType
,
[]
byte
(
fmt
.
Sprintf
(
`{"metadata":{"ownerReferences":[{"apiVersion":"%s","kind":"%s","name":"%s","uid":"%s","controller":true,"blockOwnerDeletion":true}],"uid":"%s"}}`
,
parentKind
.
GroupVersion
()
.
String
(),
parentKind
.
Kind
,
...
...
@@ -315,7 +315,7 @@ func (rh *realHistory) AdoptControllerRevision(parent metav1.Object, parentKind
func
(
rh
*
realHistory
)
ReleaseControllerRevision
(
parent
metav1
.
Object
,
revision
*
apps
.
ControllerRevision
)
(
*
apps
.
ControllerRevision
,
error
)
{
// Use strategic merge patch to add an owner reference indicating a controller ref
released
,
err
:=
rh
.
client
.
Apps
()
.
ControllerRevisions
(
revision
.
GetNamespace
())
.
Patch
(
revision
.
GetName
(),
released
,
err
:=
rh
.
client
.
Apps
V1beta1
()
.
ControllerRevisions
(
revision
.
GetNamespace
())
.
Patch
(
revision
.
GetName
(),
types
.
StrategicMergePatchType
,
[]
byte
(
fmt
.
Sprintf
(
`{"metadata":{"ownerReferences":[{"$patch":"delete","uid":"%s"}],"uid":"%s"}}`
,
parent
.
GetUID
(),
revision
.
UID
)))
...
...
pkg/controller/statefulset/stateful_set_status_updater.go
View file @
5ee1831f
...
...
@@ -56,7 +56,7 @@ func (ssu *realStatefulSetStatusUpdater) UpdateStatefulSetStatus(
// don't wait due to limited number of clients, but backoff after the default number of steps
return
retry
.
RetryOnConflict
(
retry
.
DefaultRetry
,
func
()
error
{
set
.
Status
=
*
status
_
,
updateErr
:=
ssu
.
client
.
Apps
()
.
StatefulSets
(
set
.
Namespace
)
.
UpdateStatus
(
set
)
_
,
updateErr
:=
ssu
.
client
.
Apps
V1beta1
()
.
StatefulSets
(
set
.
Namespace
)
.
UpdateStatus
(
set
)
if
updateErr
==
nil
{
return
nil
}
...
...
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