Skip to content

Commit

Permalink
apps: generate apps expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
mfojtik committed Aug 28, 2017
1 parent 311b38c commit edf8d47
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/deploy/apis/apps/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const (
)

// +genclient
// +genclient:createInstantiateVerb=subresource=instantiate,input=DeploymentRequest

// DeploymentConfig represents a configuration for a single deployment (represented as a
// ReplicationController). It also contains details about changes which resulted in the current
Expand Down
1 change: 1 addition & 0 deletions pkg/deploy/apis/apps/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
)

// +genclient
// +genclient:createInstantiateVerb=subresource=instantiate,input=DeploymentRequest

// Deployment Configs define the template for a pod and manages deploying new images or configuration changes.
// A single deployment configuration is usually analogous to a single micro-service. Can support many different
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
package v1

type DeploymentConfigExpansion interface{}
type DeploymentConfigExpansion interface {
Instantiate(*v1.DeploymentRequest) (*v1.DeploymentConfig, error)
}

// Instantiate takes the representation of a deploymentConfig and creates it. Returns the server's representation of the deploymentConfig, and an error, if there is any.
func (c *deploymentConfigs) Instantiate(deploymentConfig *v1.DeploymentRequest) (result *v1.DeploymentConfig, err error) {
result = &v1.DeploymentConfig{}
err = c.client.Post().
Resource("deploymentconfigs").Name(deploymentConfig.Name).SubResource("instantiate").
Body(deploymentConfig).
Do().
Into(result)
return
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
package internalversion

type DeploymentConfigExpansion interface{}
type DeploymentConfigExpansion interface {
Instantiate(*apps.DeploymentRequest) (*apps.DeploymentConfig, error)
}

// Instantiate takes the representation of a deploymentConfig and creates it. Returns the server's representation of the deploymentConfig, and an error, if there is any.
func (c *deploymentConfigs) Instantiate(deploymentConfig *apps.DeploymentRequest) (result *apps.DeploymentConfig, err error) {
result = &apps.DeploymentConfig{}
err = c.client.Post().
Resource("deploymentconfigs").Name(deploymentConfig.Name).SubResource("instantiate").
Body(deploymentConfig).
Do().
Into(result)
return
}

0 comments on commit edf8d47

Please sign in to comment.