apps: add missing consts and vars#89
Conversation
| DeployerPodStartedAtAnnotation = "openshift.io/deployer-pod.started-at" | ||
| DeployerPodCompletedAtAnnotation = "openshift.io/deployer-pod.completed-at" | ||
| DeploymentReplicasAnnotation = "openshift.io/deployment.replicas" | ||
| DesiredReplicasAnnotation = "kubectl.kubernetes.io/desired-replicas" |
There was a problem hiding this comment.
I don't think are openshift API is a good match for this prefix
There was a problem hiding this comment.
I don't think are API is a good match for this prefix
I assumed that this is an indication of what is, not what will be. I would like a code reference though. I thought this was only done by/for the rollout command.
There was a problem hiding this comment.
defining kubectl.kubernetes.io in openshift API
There was a problem hiding this comment.
There's nothing wrong with defining the constant here. The point of a constant is that you can copy them anywhere, because they have to be constant.
| DeployerPodCreatedAtAnnotation = "openshift.io/deployer-pod.created-at" | ||
| DeployerPodStartedAtAnnotation = "openshift.io/deployer-pod.started-at" | ||
| DeployerPodCompletedAtAnnotation = "openshift.io/deployer-pod.completed-at" | ||
| DeploymentReplicasAnnotation = "openshift.io/deployment.replicas" |
There was a problem hiding this comment.
This one seems internal, I am not even sure from the top of my head why we have it
There was a problem hiding this comment.
well, I don't see it used by anything ;-)
There was a problem hiding this comment.
I see it being set, not used
There was a problem hiding this comment.
I see it being set, not used
Set where? Leave it out of this pull for now then.
There was a problem hiding this comment.
Wow, isn't that set incorrectly?
Add a TODO to revisit its meaning.
There was a problem hiding this comment.
I don't think we need that annotation at all, nor should upstream (they are actively using similar one). If there is a change and you see the DC template and the RC it seems pretty straight forward to distinguish a scale update from config update.
Don't add it, I am gonna drop its occurrences.
| From corev1.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"` | ||
| } | ||
|
|
||
| type DeploymentStatus string |
There was a problem hiding this comment.
we were usually keeping those close to the enum definition, is this a new pattern in opeshift/api?
There was a problem hiding this comment.
it is types vs. const I don't feel strong about where this definition will live
There was a problem hiding this comment.
These two parts form an enum in Go. Defining an enum in 2 files seems weird to me; maybe that's by my notion of enums from stronger types languages like C++.
There was a problem hiding this comment.
it is types vs. const I don't feel strong about where this definition will live
I think @tnozicka is correct. We consistently place it here to help those without IDEs.
There was a problem hiding this comment.
No problem, I will move it
| @@ -0,0 +1,71 @@ | |||
| package v1 | |||
|
|
|||
| const ( | |||
There was a problem hiding this comment.
@mfojtik can you break these out into which objects they're placed on and see about some doc? Something like "this set of annotations are set on a replicationcontroller created by the DC controller".
It will help us know which are inputs and which are outputs.
There was a problem hiding this comment.
sure, it will take some time to do that investigation, but I guess it is worth
There was a problem hiding this comment.
@deads2k done. added comments for each const and also brief desc of what sets it and what consume it.
6f6f8c6 to
1a3901b
Compare
| // records the time in RFC3339 format of when the deployer pod for this particular | ||
| // deployment was started. | ||
| // This is set by deployer controller, but not consumed by any command or internally. | ||
| DeployerPodStartedAtAnnotation = "openshift.io/deployer-pod.started-at" |
There was a problem hiding this comment.
why? or you just want to move it to appsutil?
There was a problem hiding this comment.
@tnozicka I think these are providing "future" value for us, not for users or anyone integrating with OpenShift... I think the intention here was to improve the deployer process by knowing the times here so we can calculate the timeouts better. That to me is an internal thing.
There was a problem hiding this comment.
+1, appsutil only since it's internal
| // records the time in RFC3339 format of when the deployer pod for this particular | ||
| // deployment was created. | ||
| // This is set by deployer controller, but not consumed by any command or internally. | ||
| DeployerPodCreatedAtAnnotation = "openshift.io/deployer-pod.created-at" |
|
|
||
| // DeployerPodCompletedAtAnnotation is an annotation on deployment that records | ||
| // the time in RFC3339 format of when the deployer pod finished. | ||
| // This is set by deployer controller, but not consumed by any command or internally. |
| // DesiredReplicasAnnotation represents the desired number of replicas for a | ||
| // new deployment. | ||
| // This is set by deployer controller, but not consumed by any command or internally. | ||
| DesiredReplicasAnnotation = "kubectl.kubernetes.io/desired-replicas" |
There was a problem hiding this comment.
+1, I'd remove it from the whole code base
| const ( | ||
| // DeploymentStatusReasonAnnotation represents the reason for deployment being in a given state | ||
| // Used for specifying the reason for cancellation or failure of a deployment | ||
| // This is set by deployer controller and consumed in retry and history commands. |
There was a problem hiding this comment.
I am slightly afraid such comments get outdated over time
There was a problem hiding this comment.
they are for review only ;-) i will remove them before merge
| // DeploymentAnnotation is an annotation on a deployer Pod. The annotation value is the name | ||
| // of the deployment (a ReplicationController) on which the deployer Pod acts. | ||
| // This is set by deployer controller and consumed internally and in oc adm top command. | ||
| DeploymentAnnotation = "openshift.io/deployment.name" |
There was a problem hiding this comment.
This is really a replication controller name annotation inside deployer pod... We already have ownerRef there so I vote for removing this from api and replacing the origin code to use ownerRefs over this annotation.
There was a problem hiding this comment.
This is really a replication controller name annotation inside deployer pod... We already have ownerRef there so I vote for removing this from api and replacing the origin code to use ownerRefs over this annotation.
Deprecate this one too.
| // DeploymentConfigAnnotation is an annotation name used to correlate a deployment with the | ||
| // DeploymentConfig on which the deployment is based. | ||
| // This is set by deployer controller and consumed internally and in oc adm prune command. | ||
| DeploymentConfigAnnotation = "openshift.io/deployment-config.name" |
There was a problem hiding this comment.
I suspect this one will be the same as above...
|
|
||
| // DeploymentCancelledAnnotation indicates that the deployment has been cancelled | ||
| // The annotation value does not matter and its mere presence indicates cancellation. | ||
| // This is set by deployment config controller or oc rollout cancel command. |
There was a problem hiding this comment.
RC, I will write it there
1a3901b to
bab084e
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, mfojtik The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This adds missing consts and vars. The name of consts are harmonized to match the values.
/cc @openshift/api-review