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
3faf2145
Commit
3faf2145
authored
May 05, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #24924 from mqliang/pv-prepare-update
Automatic merge from submit-queue fix PrepareForUpdate bug for PV and PVC
parents
caa96f4c
0109c08b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
strategy.go
pkg/registry/horizontalpodautoscaler/strategy.go
+1
-1
strategy.go
pkg/registry/persistentvolume/strategy.go
+2
-2
strategy.go
pkg/registry/persistentvolumeclaim/strategy.go
+2
-2
No files found.
pkg/registry/horizontalpodautoscaler/strategy.go
View file @
3faf2145
...
@@ -70,7 +70,7 @@ func (autoscalerStrategy) AllowCreateOnUpdate() bool {
...
@@ -70,7 +70,7 @@ func (autoscalerStrategy) AllowCreateOnUpdate() bool {
// PrepareForUpdate clears fields that are not allowed to be set by end users on update.
// PrepareForUpdate clears fields that are not allowed to be set by end users on update.
func
(
autoscalerStrategy
)
PrepareForUpdate
(
obj
,
old
runtime
.
Object
)
{
func
(
autoscalerStrategy
)
PrepareForUpdate
(
obj
,
old
runtime
.
Object
)
{
newHPA
:=
obj
.
(
*
extensions
.
HorizontalPodAutoscaler
)
newHPA
:=
obj
.
(
*
extensions
.
HorizontalPodAutoscaler
)
oldHPA
:=
o
bj
.
(
*
extensions
.
HorizontalPodAutoscaler
)
oldHPA
:=
o
ld
.
(
*
extensions
.
HorizontalPodAutoscaler
)
// Update is not allowed to set status
// Update is not allowed to set status
newHPA
.
Status
=
oldHPA
.
Status
newHPA
.
Status
=
oldHPA
.
Status
}
}
...
...
pkg/registry/persistentvolume/strategy.go
View file @
3faf2145
...
@@ -64,7 +64,7 @@ func (persistentvolumeStrategy) AllowCreateOnUpdate() bool {
...
@@ -64,7 +64,7 @@ func (persistentvolumeStrategy) AllowCreateOnUpdate() bool {
// PrepareForUpdate sets the Status fields which is not allowed to be set by an end user updating a PV
// PrepareForUpdate sets the Status fields which is not allowed to be set by an end user updating a PV
func
(
persistentvolumeStrategy
)
PrepareForUpdate
(
obj
,
old
runtime
.
Object
)
{
func
(
persistentvolumeStrategy
)
PrepareForUpdate
(
obj
,
old
runtime
.
Object
)
{
newPv
:=
obj
.
(
*
api
.
PersistentVolume
)
newPv
:=
obj
.
(
*
api
.
PersistentVolume
)
oldPv
:=
o
bj
.
(
*
api
.
PersistentVolume
)
oldPv
:=
o
ld
.
(
*
api
.
PersistentVolume
)
newPv
.
Status
=
oldPv
.
Status
newPv
.
Status
=
oldPv
.
Status
}
}
...
@@ -86,7 +86,7 @@ var StatusStrategy = persistentvolumeStatusStrategy{Strategy}
...
@@ -86,7 +86,7 @@ var StatusStrategy = persistentvolumeStatusStrategy{Strategy}
// PrepareForUpdate sets the Spec field which is not allowed to be changed when updating a PV's Status
// PrepareForUpdate sets the Spec field which is not allowed to be changed when updating a PV's Status
func
(
persistentvolumeStatusStrategy
)
PrepareForUpdate
(
obj
,
old
runtime
.
Object
)
{
func
(
persistentvolumeStatusStrategy
)
PrepareForUpdate
(
obj
,
old
runtime
.
Object
)
{
newPv
:=
obj
.
(
*
api
.
PersistentVolume
)
newPv
:=
obj
.
(
*
api
.
PersistentVolume
)
oldPv
:=
o
bj
.
(
*
api
.
PersistentVolume
)
oldPv
:=
o
ld
.
(
*
api
.
PersistentVolume
)
newPv
.
Spec
=
oldPv
.
Spec
newPv
.
Spec
=
oldPv
.
Spec
}
}
...
...
pkg/registry/persistentvolumeclaim/strategy.go
View file @
3faf2145
...
@@ -64,7 +64,7 @@ func (persistentvolumeclaimStrategy) AllowCreateOnUpdate() bool {
...
@@ -64,7 +64,7 @@ func (persistentvolumeclaimStrategy) AllowCreateOnUpdate() bool {
// PrepareForUpdate sets the Status field which is not allowed to be set by end users on update
// PrepareForUpdate sets the Status field which is not allowed to be set by end users on update
func
(
persistentvolumeclaimStrategy
)
PrepareForUpdate
(
obj
,
old
runtime
.
Object
)
{
func
(
persistentvolumeclaimStrategy
)
PrepareForUpdate
(
obj
,
old
runtime
.
Object
)
{
newPvc
:=
obj
.
(
*
api
.
PersistentVolumeClaim
)
newPvc
:=
obj
.
(
*
api
.
PersistentVolumeClaim
)
oldPvc
:=
o
bj
.
(
*
api
.
PersistentVolumeClaim
)
oldPvc
:=
o
ld
.
(
*
api
.
PersistentVolumeClaim
)
newPvc
.
Status
=
oldPvc
.
Status
newPvc
.
Status
=
oldPvc
.
Status
}
}
...
@@ -86,7 +86,7 @@ var StatusStrategy = persistentvolumeclaimStatusStrategy{Strategy}
...
@@ -86,7 +86,7 @@ var StatusStrategy = persistentvolumeclaimStatusStrategy{Strategy}
// PrepareForUpdate sets the Spec field which is not allowed to be changed when updating a PV's Status
// PrepareForUpdate sets the Spec field which is not allowed to be changed when updating a PV's Status
func
(
persistentvolumeclaimStatusStrategy
)
PrepareForUpdate
(
obj
,
old
runtime
.
Object
)
{
func
(
persistentvolumeclaimStatusStrategy
)
PrepareForUpdate
(
obj
,
old
runtime
.
Object
)
{
newPv
:=
obj
.
(
*
api
.
PersistentVolumeClaim
)
newPv
:=
obj
.
(
*
api
.
PersistentVolumeClaim
)
oldPv
:=
o
bj
.
(
*
api
.
PersistentVolumeClaim
)
oldPv
:=
o
ld
.
(
*
api
.
PersistentVolumeClaim
)
newPv
.
Spec
=
oldPv
.
Spec
newPv
.
Spec
=
oldPv
.
Spec
}
}
...
...
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