-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17517 from liggitt/dc-scale
Automatic merge from submit-queue. Fix deployment config scale subresource 3.6 and 3.7 shipped with the /apis/apps.openshift.io/deploymentconfigs/scale subresource returning apps.openshift.io/v1 Scale objects This is a non-standard Scale object that the HPA will never be able to make use of. The intent was to continue send the same thing as /oapi/v1/deploymentconfigs/scale: extensions/v1beta1 Scale objects This PR fixes the groupified API to send/receive the correct type. It also updates the UpdateScale() client method to send extensions/v1beta1 Scale objects
- Loading branch information
Showing
10 changed files
with
109 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
pkg/apps/generated/internalclientset/scheme/register_expansion.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package scheme | ||
|
||
import ( | ||
extensionsv1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" | ||
) | ||
|
||
func init() { | ||
// Needed for GetScale/UpdateScale | ||
extensionsv1beta1.AddToScheme(Scheme) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...apps/generated/internalclientset/typed/apps/internalversion/deploymentconfig_expansion.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package internalversion | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime" | ||
kapi "k8s.io/kubernetes/pkg/api" | ||
v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" | ||
) | ||
|
||
type DeploymentConfigExpansion interface { | ||
UpdateScale(deploymentConfigName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) | ||
} | ||
|
||
var scaleCodec = kapi.Codecs.LegacyCodec(v1beta1.SchemeGroupVersion) | ||
|
||
// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. | ||
func (c *deploymentConfigs) UpdateScale(deploymentConfigName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) { | ||
// FIXME: make non-homogenous subresource GV client generation work | ||
data, err := runtime.Encode(scaleCodec, scale) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
result = &v1beta1.Scale{} | ||
err = c.client.Put(). | ||
Namespace(c.ns). | ||
Resource("deploymentconfigs"). | ||
Name(deploymentConfigName). | ||
SubResource("scale"). | ||
Body(data). | ||
Do(). | ||
Into(result) | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...ated/internalclientset/typed/apps/internalversion/fake/fake_deploymentconfig_expansion.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package fake | ||
|
||
import ( | ||
testing "k8s.io/client-go/testing" | ||
v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" | ||
) | ||
|
||
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if t | ||
func (c *FakeDeploymentConfigs) UpdateScale(deploymentConfigName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) { | ||
obj, err := c.Fake. | ||
Invokes(testing.NewUpdateSubresourceAction(deploymentconfigsResource, "scale", c.ns, scale), &v1beta1.Scale{}) | ||
|
||
if obj == nil { | ||
return nil, err | ||
} | ||
return obj.(*v1beta1.Scale), err | ||
} |
2 changes: 0 additions & 2 deletions
2
pkg/apps/generated/internalclientset/typed/apps/internalversion/generated_expansion.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
package internalversion | ||
|
||
type DeploymentConfigExpansion interface{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters