-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add replication controller status subresource #14672
Conversation
@kubernetes/rh-platform-management in case of any downstream issue. |
Unit, integration and GCE e2e test build/test passed for commit afe8a2159458d61f9b7ff18f7161ad05728104cc. |
afe8a21
to
ab5a3b8
Compare
Unit, integration and GCE e2e build/test failed for commit ab5a3b83426609d58de5063c9393891d951ed0bd. |
@k8s-bot test this |
Labelling this PR as size/L |
Unit, integration and GCE e2e test build/test passed for commit ab5a3b83426609d58de5063c9393891d951ed0bd. |
@thockin - can i get a quick review on this? |
ab5a3b8
to
ba4d833
Compare
Rebased again. @thockin - any eyeballs available or reassign? @smarterclayton - got cycles? |
GCE e2e test build/test passed for commit ba4d8335699f73e8eec65109fa07e40ceeb02cb6. |
newController := obj.(*api.ReplicationController) | ||
oldController := old.(*api.ReplicationController) | ||
// update is not allowed to set status | ||
newController.Status = oldController.Status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a backwards-incompatible API change. I don't think that we can do this in v1 unless we believe there is a security risk to the cluster to not change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had raised that concern prior to submitting the PR.
See @bgrant0607 comment here:
#4909 (comment)
I agree with his analysis.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a potential DoS vulnerability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I agree as well.
On Wed, Oct 7, 2015 at 10:03 AM, Derek Carr notifications@github.com
wrote:
In pkg/registry/controller/strategy.go
#14672 (comment)
:newController := obj.(*api.ReplicationController) oldController := old.(*api.ReplicationController)
- // update is not allowed to set status
- newController.Status = oldController.Status
I had raised that concern prior to submitting the PR.
See @bgrant0607 https://github.com/bgrant0607 comment here:
#4909 (comment)
#4909 (comment)I agree with his analysis.
—
Reply to this email directly or view it on GitHub
https://github.com/kubernetes/kubernetes/pull/14672/files#r41393580.
I'll take a look. |
@@ -1338,6 +1339,23 @@ func ValidateReplicationControllerUpdate(oldController, controller *api.Replicat | |||
allErrs := errs.ValidationErrorList{} | |||
allErrs = append(allErrs, ValidateObjectMetaUpdate(&controller.ObjectMeta, &oldController.ObjectMeta).Prefix("metadata")...) | |||
allErrs = append(allErrs, ValidateReplicationControllerSpec(&controller.Spec).Prefix("spec")...) | |||
allErrs = append(allErrs, ValidateReplicationControllerStatus(&controller.Status).Prefix("status")...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be ValidateReplicationControllerStatusUpdate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an internal helper function that is used by both
ValidateReplicationController(...)
ValidateReplicationControllerStatusUpdate(...)
to verify just the rc.status section of the resource.
the ValidateReplicationControllerStatusUpdate
function (which I added in this PR) is what you expect.
Mostly looks pretty reasonable, thanks. You need to regenerate the swagger spec again. |
No further comments from me. |
@derekwaynecarr Please mention me explicitly when you push the fixes. |
ba4d833
to
d05b382
Compare
d05b382
to
544b453
Compare
@bgrant0607 - made requested updates.
this should be good to go. Thanks! |
GCE e2e test build/test passed for commit d05b382d0852add12c8c7a50f2010c39aaa5bf78. |
GCE e2e build/test failed for commit 544b453. |
@k8s-bot - test this |
@@ -356,7 +356,8 @@ func (JobStatus) SwaggerDoc() map[string]string { | |||
} | |||
|
|||
var map_NodeUtilization = map[string]string{ | |||
"": "NodeUtilization describes what percentage of a particular resource is used on a node.", | |||
"": "NodeUtilization describes what percentage of a particular resource is used on a node.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been fixed in head.
LGTM |
@k8s-bot test this |
GCE e2e test build/test passed for commit 544b453. |
Please create a cherrypick PR for 1.1 after this merges. |
"nodes/status": nodeStatusStorage, | ||
"events": eventStorage, | ||
"replicationControllers": controllerStorage, | ||
"replicationControllers/status": controllerStatusStorage, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't we convert everything to all-lowercase?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Case conversion happens automatically. Internally we have camel case in
many parts of the code.
On Thursday, October 8, 2015, Tim Hockin notifications@github.com wrote:
In pkg/master/master.go
#14672 (comment)
:@@ -567,12 +567,13 @@ func (m *Master) init(c *Config) {
"podTemplates": podTemplateStorage,
"replicationControllers": controllerStorage,
"services": service.NewStorage(m.serviceRegistry, m.endpointRegistry, serviceClusterIPAllocator, serviceNodePortAllocator),
"endpoints": endpointsStorage,
"nodes": nodeStorage,
"nodes/status": nodeStatusStorage,
"events": eventStorage,
"replicationControllers": controllerStorage,
"replicationControllers/status": controllerStatusStorage,
didn't we convert everything to all-lowercase?
—
Reply to this email directly or view it on GitHub
https://github.com/kubernetes/kubernetes/pull/14672/files#r41474385.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugly, but true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we have dropped the old name, we can normalize the internal
constants. It would probably reduce confusion for code reviewers.
On Fri, Oct 9, 2015 at 12:16 PM, Brian Grant notifications@github.com
wrote:
In pkg/master/master.go
#14672 (comment)
:@@ -567,12 +567,13 @@ func (m *Master) init(c *Config) {
"podTemplates": podTemplateStorage,
"replicationControllers": controllerStorage,
"services": service.NewStorage(m.serviceRegistry, m.endpointRegistry, serviceClusterIPAllocator, serviceNodePortAllocator),
"endpoints": endpointsStorage,
"nodes": nodeStorage,
"nodes/status": nodeStatusStorage,
"events": eventStorage,
"replicationControllers": controllerStorage,
"replicationControllers/status": controllerStatusStorage,
Ugly, but true.
—
Reply to this email directly or view it on GitHub
https://github.com/kubernetes/kubernetes/pull/14672/files#r41648501.
Add replication controller status subresource
…f-#14672-upstream-release-1.1 Auto commit by PR queue bot
…rry-pick-of-#14672-upstream-release-1.1 Auto commit by PR queue bot
…rry-pick-of-#14672-upstream-release-1.1 Auto commit by PR queue bot
PR does the following:
Fixes #4909