-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
UPSTREAM: <carry>: Short-circuit HPA oapi/v1.DC #18380
UPSTREAM: <carry>: Short-circuit HPA oapi/v1.DC #18380
Conversation
@deads2k will get you an |
8bcd888
to
0c79992
Compare
@@ -360,6 +360,20 @@ func (a *HorizontalController) reconcileAutoscaler(hpav1Shared *autoscalingv1.Ho | |||
} | |||
|
|||
mappings, err := a.mapper.RESTMappings(targetGK) | |||
// TODO(directxman12): this is a dirty, dirty hack because legacy oapi isn't part of |
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.
Here's a weird niggle. To make rebases easier, please move the logic to a file called patch_dc.go
and then after the error simply do mappings = hackOutOapiDeploymentConfig(mappings)
That way when it conflicts (and there are always conflicts), we have a single line to fix up
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.
ah, ack, will do.
// TODO(directxman12): this is a dirty, dirty hack because oapi just appears in discovery as "/v1", like | ||
// the kube core API. We can remove it if/when we get rid of the legacy oapi group entirely. It makes me | ||
// cry a bit inside, but such is life. | ||
glog.Infof("DEBUG: %#v == %#v: %v", gvr, dcGVR, gvr == dcGVR) |
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.
The hack is ok, but not the info level debug message. Similar comment about making this a one liner with a patch_dc.go
file.
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.
whoops, that must've slipped in, sorry.
The legacy oapi v1 group-version very much confuses anything not designed to explicitly work with it. Since we now don't do any custom HPA setup, we need to teach the scale client and the HPA what to do with the oapi version of DC, since it won't even show up in its discovery process.
0c79992
to
eea8aa3
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k, DirectXMan12 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest |
Automatic merge from submit-queue. |
Automatic merge from submit-queue (batch tested with PRs 18666, 18810, 18430, 18517, 18653). Add migrate command for legacy HPAs There are current broken HPAs floating around that either use the legacy oapi DeploymentConfig defintion (`v1.DeploymentConfig`) or the incorrect API group, due to the webconsole (all scalables, but with the group as `extensions/v1beta1`). This introduces a migrate command that corrects the ScaleTargetRef of those HPAs to have correct API groups that are usable by generic scale clients. Related to #18377, #18380, openshift/origin-web-console#2776 cc @deads2k @liggitt @spadgett
The legacy oapi v1 group-version very much confuses anything not
designed to explicitly work with it. Since we now don't do any custom
HPA setup, we need to teach the scale client and the HPA what to do
with the oapi version of DC, since it won't even show up in its
discovery process.
Related to #18377