-
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 #17520 from liggitt/dc-scale-38
Fix deploymentconfig scale
- Loading branch information
Showing
9 changed files
with
103 additions
and
29 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
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 ( | ||
v1beta1 "k8s.io/api/extensions/v1beta1" | ||
"k8s.io/apimachinery/pkg/runtime" | ||
kapi "k8s.io/kubernetes/pkg/api" | ||
) | ||
|
||
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 ( | ||
v1beta1 "k8s.io/api/extensions/v1beta1" | ||
testing "k8s.io/client-go/testing" | ||
) | ||
|
||
// 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