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
a44c2b9e
Unverified
Commit
a44c2b9e
authored
Nov 14, 2018
by
k8s-ci-robot
Committed by
GitHub
Nov 14, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70035 from liggitt/retain-quota-metadata
Avoid dropping resourcequota metadata in controller
parents
79dab474
fdd87a88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
resource_quota_controller.go
pkg/controller/resourcequota/resource_quota_controller.go
+5
-12
No files found.
pkg/controller/resourcequota/resource_quota_controller.go
View file @
a44c2b9e
...
...
@@ -347,24 +347,17 @@ func (rq *ResourceQuotaController) syncResourceQuota(resourceQuota *v1.ResourceQ
// Create a usage object that is based on the quota resource version that will handle updates
// by default, we preserve the past usage observation, and set hard to the current spec
usage
:=
v1
.
ResourceQuota
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
resourceQuota
.
Name
,
Namespace
:
resourceQuota
.
Namespace
,
ResourceVersion
:
resourceQuota
.
ResourceVersion
,
Labels
:
resourceQuota
.
Labels
,
Annotations
:
resourceQuota
.
Annotations
},
Status
:
v1
.
ResourceQuotaStatus
{
Hard
:
hardLimits
,
Used
:
used
,
},
usage
:=
resourceQuota
.
DeepCopy
()
usage
.
Status
=
v1
.
ResourceQuotaStatus
{
Hard
:
hardLimits
,
Used
:
used
,
}
dirty
=
dirty
||
!
quota
.
Equals
(
usage
.
Status
.
Used
,
resourceQuota
.
Status
.
Used
)
// there was a change observed by this controller that requires we update quota
if
dirty
{
_
,
err
=
rq
.
rqClient
.
ResourceQuotas
(
usage
.
Namespace
)
.
UpdateStatus
(
&
usage
)
_
,
err
=
rq
.
rqClient
.
ResourceQuotas
(
usage
.
Namespace
)
.
UpdateStatus
(
usage
)
return
err
}
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