Skip to content

Commit

Permalink
apps: add instantiate expansion for deployment configs
Browse files Browse the repository at this point in the history
  • Loading branch information
mfojtik committed Aug 29, 2017
1 parent b220daf commit a2d4d48
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 0 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:method=Instantiate,verb=create,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:method=Instantiate,verb=create,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
13 changes: 13 additions & 0 deletions pkg/deploy/generated/clientset/typed/apps/v1/deploymentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type DeploymentConfigInterface interface {
List(opts meta_v1.ListOptions) (*v1.DeploymentConfigList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DeploymentConfig, err error)
Instantiate(*v1.DeploymentRequest) (*v1.DeploymentConfig, error)
DeploymentConfigExpansion
}

Expand Down Expand Up @@ -154,3 +155,15 @@ func (c *deploymentConfigs) Patch(name string, pt types.PatchType, data []byte,
Into(result)
return
}

// Instantiate takes the representation of a deploymentRequest and creates it. Returns the server's representation of the deploymentConfig, and an error, if there is any.
func (c *deploymentConfigs) Instantiate(deploymentRequest *v1.DeploymentRequest) (result *v1.DeploymentConfig, err error) {
result = &v1.DeploymentConfig{}
err = c.client.Post().
Namespace(c.ns).
Resource("deploymentconfigs").Name(deploymentRequest.Name).SubResource("instantiate").
Body(deploymentRequest).
Do().
Into(result)
return
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,14 @@ func (c *FakeDeploymentConfigs) Patch(name string, pt types.PatchType, data []by
}
return obj.(*apps_v1.DeploymentConfig), err
}

// 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 *FakeDeploymentConfigs) Instantiate(deploymentRequest *apps_v1.DeploymentRequest) (result *apps_v1.DeploymentConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(deploymentconfigsResource, c.ns, deploymentConfig), &apps_v1.DeploymentRequest{})

if obj == nil {
return nil, err
}
return obj.(*apps_v1.DeploymentConfig), err
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type DeploymentConfigInterface interface {
List(opts v1.ListOptions) (*apps.DeploymentConfigList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *apps.DeploymentConfig, err error)
Instantiate(*apps.DeploymentRequest) (*apps.DeploymentConfig, error)
DeploymentConfigExpansion
}

Expand Down Expand Up @@ -154,3 +155,15 @@ func (c *deploymentConfigs) Patch(name string, pt types.PatchType, data []byte,
Into(result)
return
}

// Instantiate takes the representation of a deploymentRequest and creates it. Returns the server's representation of the deploymentConfig, and an error, if there is any.
func (c *deploymentConfigs) Instantiate(deploymentRequest *apps.DeploymentRequest) (result *apps.DeploymentConfig, err error) {
result = &apps.DeploymentConfig{}
err = c.client.Post().
Namespace(c.ns).
Resource("deploymentconfigs").Name(deploymentRequest.Name).SubResource("instantiate").
Body(deploymentRequest).
Do().
Into(result)
return
}
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,14 @@ func (c *FakeDeploymentConfigs) Patch(name string, pt types.PatchType, data []by
}
return obj.(*apps.DeploymentConfig), err
}

// 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 *FakeDeploymentConfigs) Instantiate(deploymentRequest *apps.DeploymentRequest) (result *apps.DeploymentConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(deploymentconfigsResource, c.ns, deploymentConfig), &apps.DeploymentRequest{})

if obj == nil {
return nil, err
}
return obj.(*apps.DeploymentConfig), err
}

0 comments on commit a2d4d48

Please sign in to comment.