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
1 change: 1 addition & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
golangci_lint_version: ${{ env.GOLANGCI_LINT_VERSION }}
golangci_lint_flags: --config ${{ github.workspace }}/.golangci.yml
fail_level: error
filter_mode: nofilter

# This job is used to check if the go linting is completed successfully
# It is used to set as required check for the branch protection rules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ type KubernetesApplicationSpec struct {

// The label will be configured to variant manifests used to distinguish them.
VariantLabel KubernetesVariantLabel `json:"variantLabel"`

}

func (s *KubernetesApplicationSpec) UnmarshalJSON(data []byte) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ import (
)

// baselineDeployment builds a pre-created baseline Deployment for test setup.
func baselineDeployment(namespace string) *unstructured.Unstructured {
func baselineDeployment() *unstructured.Unstructured {
return &unstructured.Unstructured{
Object: map[string]any{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": map[string]any{
"name": "simple-baseline",
"namespace": namespace,
"namespace": "default",
"labels": map[string]any{
"app": "simple",
"pipecd.dev/managed-by": "piped",
Expand Down Expand Up @@ -465,7 +465,7 @@ func TestPlugin_executeK8sMultiBaselineCleanStage(t *testing.T) {
deploymentRes := schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"}

// Pre-create the baseline deployment (simulating what K8S_BASELINE_ROLLOUT would have done).
_, err := dynamicClient.Resource(deploymentRes).Namespace("default").Create(ctx, baselineDeployment("default"), metav1.CreateOptions{})
_, err := dynamicClient.Resource(deploymentRes).Namespace("default").Create(ctx, baselineDeployment(), metav1.CreateOptions{})
require.NoError(t, err)

_, err = dynamicClient.Resource(deploymentRes).Namespace("default").Get(ctx, "simple-baseline", metav1.GetOptions{})
Expand Down Expand Up @@ -517,7 +517,7 @@ func TestPlugin_executeK8sMultiBaselineCleanStage_multipleTargets(t *testing.T)
deploymentRes := schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"}

for _, c := range []*cluster{clusterUS, clusterEU} {
_, err := c.cli.Resource(deploymentRes).Namespace("default").Create(ctx, baselineDeployment("default"), metav1.CreateOptions{})
_, err := c.cli.Resource(deploymentRes).Namespace("default").Create(ctx, baselineDeployment(), metav1.CreateOptions{})
require.NoError(t, err)
}

Expand Down Expand Up @@ -571,7 +571,7 @@ func TestPlugin_executeK8sMultiBaselineCleanStage_withCreateService(t *testing.T
serviceRes := schema.GroupVersionResource{Group: "", Version: "v1", Resource: "services"}

// Pre-create both baseline deployment and service.
_, err := dynamicClient.Resource(deploymentRes).Namespace("default").Create(ctx, baselineDeployment("default"), metav1.CreateOptions{})
_, err := dynamicClient.Resource(deploymentRes).Namespace("default").Create(ctx, baselineDeployment(), metav1.CreateOptions{})
require.NoError(t, err)
_, err = dynamicClient.Resource(serviceRes).Namespace("default").Create(ctx, baselineService("default"), metav1.CreateOptions{})
require.NoError(t, err)
Expand Down Expand Up @@ -626,7 +626,7 @@ func TestPlugin_executeK8sMultiBaselineCleanStage_withoutCreateService(t *testin
deploymentRes := schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"}

// Pre-create only a baseline deployment (no service).
_, err := dynamicClient.Resource(deploymentRes).Namespace("default").Create(ctx, baselineDeployment("default"), metav1.CreateOptions{})
_, err := dynamicClient.Resource(deploymentRes).Namespace("default").Create(ctx, baselineDeployment(), metav1.CreateOptions{})
require.NoError(t, err)

plugin := &Plugin{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,4 +677,3 @@ func TestPlugin_executeK8sMultiCanaryCleanStage_withoutCreateService(t *testing.
})
require.True(t, ok)
}

Loading