Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Description property to CDPipeline #105

Merged
merged 1 commit into from
Jan 14, 2025
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
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
Loading