From e2d1a02b87ff3a2b729caf7b29804c64081b473b Mon Sep 17 00:00:00 2001 From: Vadim Kharin Date: Fri, 5 Jun 2026 17:34:11 +0300 Subject: [PATCH 1/3] feat: add support for pipeline services --- codefresh/cfclient/pipeline.go | 5 +++++ codefresh/resource_pipeline.go | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/codefresh/cfclient/pipeline.go b/codefresh/cfclient/pipeline.go index f4f71a7..663b1c3 100644 --- a/codefresh/cfclient/pipeline.go +++ b/codefresh/cfclient/pipeline.go @@ -125,6 +125,7 @@ type Spec struct { Contexts []interface{} `json:"contexts,omitempty"` Steps *Steps `json:"steps,omitempty"` Stages *Stages `json:"stages,omitempty"` + Services *Services `json:"services,omitempty"` Mode string `json:"mode,omitempty"` FailFast *bool `json:"fail_fast,omitempty"` RuntimeEnvironment RuntimeEnvironment `json:"runtimeEnvironment,omitempty"` @@ -148,6 +149,10 @@ type Hooks struct { Hooks string } +type Services struct { + Services string +} + func (d Steps) MarshalJSON() ([]byte, error) { bytes := []byte(d.Steps) return bytes, nil diff --git a/codefresh/resource_pipeline.go b/codefresh/resource_pipeline.go index 9c57fc5..70b4727 100644 --- a/codefresh/resource_pipeline.go +++ b/codefresh/resource_pipeline.go @@ -1332,7 +1332,7 @@ func mapResourceToPipeline(d *schema.ResourceData) (*cfclient.Pipeline, error) { // For this purpose we use yq that preserves the order of attributes when converting to json. func extractSpecAttributesFromOriginalYamlString(originalYamlString string, pipeline *cfclient.Pipeline) error { - for _, attribute := range []string{"stages", "steps", "hooks"} { + for _, attribute := range []string{"stages", "steps", "hooks", "services"} { attributeJson, err := datautil.Yq(fmt.Sprintf(".%s", attribute), originalYamlString, "json") if err != nil { return fmt.Errorf("error while extracting '%s' from original YAML string: %v", attribute, err) @@ -1358,6 +1358,10 @@ func extractSpecAttributesFromOriginalYamlString(originalYamlString string, pipe Hooks: attributeJson, } } + case "services": + pipeline.Spec.Services = &cfclient.Services{ + Services: attributeJson, + } } mode, err := datautil.Yq(".mode", originalYamlString, "yaml") From 99edf32365f6ec7ab320ec17eef13b9cb2f7545d Mon Sep 17 00:00:00 2001 From: Vadim Kharin Date: Mon, 8 Jun 2026 11:01:04 +0300 Subject: [PATCH 2/3] feat: add support for pipeline services --- codefresh/resource_pipeline.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codefresh/resource_pipeline.go b/codefresh/resource_pipeline.go index 70b4727..44c450d 100644 --- a/codefresh/resource_pipeline.go +++ b/codefresh/resource_pipeline.go @@ -1357,11 +1357,11 @@ func extractSpecAttributesFromOriginalYamlString(originalYamlString string, pipe pipeline.Spec.Hooks = &cfclient.Hooks{ Hooks: attributeJson, } - } case "services": pipeline.Spec.Services = &cfclient.Services{ Services: attributeJson, } + } } mode, err := datautil.Yq(".mode", originalYamlString, "yaml") From fe214b8ec6e8a09bec21a5ce4e0ca66fdd3ac9e7 Mon Sep 17 00:00:00 2001 From: Vadim Kharin Date: Mon, 8 Jun 2026 16:24:47 +0300 Subject: [PATCH 3/3] feat: add support for pipeline services --- codefresh/cfclient/pipeline.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/codefresh/cfclient/pipeline.go b/codefresh/cfclient/pipeline.go index 663b1c3..93f6e30 100644 --- a/codefresh/cfclient/pipeline.go +++ b/codefresh/cfclient/pipeline.go @@ -166,6 +166,10 @@ func (d Hooks) MarshalJSON() ([]byte, error) { bytes := []byte(d.Hooks) return bytes, nil } +func (d Services) MarshalJSON() ([]byte, error) { + bytes := []byte(d.Services) + return bytes, nil +} func (d *Steps) UnmarshalJSON(data []byte) error { d.Steps = string(data) return nil @@ -178,6 +182,10 @@ func (d *Hooks) UnmarshalJSON(data []byte) error { d.Hooks = string(data) return nil } +func (d *Services) UnmarshalJSON(data []byte) error { + d.Services = string(data) + return nil +} type Pipeline struct { Metadata Metadata `json:"metadata,omitempty"`