Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions pkg/deployments/deployment_action_container.go
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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
}
2 changes: 1 addition & 1 deletion pkg/machines/kubernetes_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading