diff --git a/pkg/deployments/deployment_action_container.go b/pkg/deployments/deployment_action_container.go index c1d1ebbc..0b002226 100644 --- a/pkg/deployments/deployment_action_container.go +++ b/pkg/deployments/deployment_action_container.go @@ -1,12 +1,14 @@ package deployments type DeploymentActionContainer struct { - FeedID string `json:"FeedId,omitempty"` - Image string `json:"Image,omitempty"` + FeedID string `json:"FeedId,omitempty"` + Image string `json:"Image,omitempty"` + GitUrl string `json:"GitUrl,omitempty"` + Dockerfile string `json:"Dockerfile,omitempty"` } // NewDeploymentActionContainer creates and initializes a new Kubernetes endpoint. -func NewDeploymentActionContainer(feedID *string, image *string) *DeploymentActionContainer { +func NewDeploymentActionContainer(feedID *string, image *string, gitUrl *string, dockerfile *string) *DeploymentActionContainer { deploymentActionContainer := &DeploymentActionContainer{} if feedID != nil && len(*feedID) > 0 { @@ -17,5 +19,13 @@ func NewDeploymentActionContainer(feedID *string, image *string) *DeploymentActi deploymentActionContainer.Image = *image } + if gitUrl != nil && len(*gitUrl) > 0 { + deploymentActionContainer.GitUrl = *gitUrl + } + + if dockerfile != nil && len(*dockerfile) > 0 { + deploymentActionContainer.Dockerfile = *dockerfile + } + return deploymentActionContainer } diff --git a/pkg/machines/kubernetes_endpoint_test.go b/pkg/machines/kubernetes_endpoint_test.go index d4a5a635..25312136 100644 --- a/pkg/machines/kubernetes_endpoint_test.go +++ b/pkg/machines/kubernetes_endpoint_test.go @@ -69,7 +69,7 @@ func TestKubernetesEndpointMarshalJSON(t *testing.T) { resource := NewKubernetesEndpoint(url) resource.Authentication = kubernetesCertificateAuthentication resource.ClusterCertificate = "cluster-certificate" - resource.Container = deployments.NewDeploymentActionContainer(&feedID, nil) + resource.Container = deployments.NewDeploymentActionContainer(&feedID, nil, nil, nil) resource.ContainerOptions = "foobar" resource.DefaultWorkerPoolID = "default-worker-pool-id" resource.ID = id