Skip to content

Commit

Permalink
feat: Add Description property to CDPipeline (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
zmotso authored and MykolaMarusenko committed Jan 14, 2025
1 parent bc9bf18 commit d38761a
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 6 deletions.
7 changes: 5 additions & 2 deletions api/v1/cdpipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ import (
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// CDPipelineSpec defines the desired state of CDPipeline.
type CDPipelineSpec struct {
// +kubebuilder:validation:MinLength=2

// Name of CD pipeline
Name string `json:"name"`

// Description of CD pipeline.
// +optional
// +kubebuilder:example="This is a CD pipeline for deploying applications"
Description string `json:"description,omitempty"`

// Type of workload to be deployed, e.g., container, custom.
// +kubebuilder:default="container"
DeploymentType string `json:"deploymentType"`
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/v2.edp.epam.com_cdpipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ spec:
default: container
description: Type of workload to be deployed, e.g., container, custom.
type: string
description:
description: Description of CD pipeline.
example: This is a CD pipeline for deploying applications
type: string
inputDockerStreams:
description: A list of docker streams
items:
Expand Down
4 changes: 4 additions & 0 deletions deploy-templates/crds/v2.edp.epam.com_cdpipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ spec:
default: container
description: Type of workload to be deployed, e.g., container, custom.
type: string
description:
description: Description of CD pipeline.
example: This is a CD pipeline for deploying applications
type: string
inputDockerStreams:
description: A list of docker streams
items:
Expand Down
7 changes: 7 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ CDPipelineSpec defines the desired state of CDPipeline.
A list of applications which will promote after successful release.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>description</b></td>
<td>string</td>
<td>
Description of CD pipeline.<br/>
</td>
<td>false</td>
</tr></tbody>
</table>

Expand Down
4 changes: 2 additions & 2 deletions pkg/webhook/stage_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import (
"context"
"errors"
"fmt"
"github.com/epam/edp-cd-pipeline-operator/v2/controllers/stage/chain/util"
corev1 "k8s.io/api/core/v1"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/webhook"

pipelineApi "github.com/epam/edp-cd-pipeline-operator/v2/api/v1"
"github.com/epam/edp-cd-pipeline-operator/v2/controllers/stage/chain/util"
)

const listLimit = 1000
Expand Down
4 changes: 2 additions & 2 deletions pkg/webhook/stage_webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ package webhook

import (
"context"
"github.com/epam/edp-cd-pipeline-operator/v2/controllers/stage/chain/util"
corev1 "k8s.io/api/core/v1"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/fake"

pipelineApi "github.com/epam/edp-cd-pipeline-operator/v2/api/v1"
"github.com/epam/edp-cd-pipeline-operator/v2/controllers/stage/chain/util"
codebaseApi "github.com/epam/edp-codebase-operator/v2/api/v1"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
inputDockerStreams:
- test-main
name: mypipeline
description: mypipeline description

---
apiVersion: v2.edp.epam.com/v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ spec:
inputDockerStreams:
- test-main
name: mypipeline
description: mypipeline description

---
apiVersion: v2.edp.epam.com/v1
Expand Down

0 comments on commit d38761a

Please sign in to comment.