Skip to content

Commit

Permalink
fix pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard87 committed Dec 13, 2023
1 parent b706a27 commit 112775e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 34 deletions.
7 changes: 3 additions & 4 deletions pkg/pipeline/radix-application_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ func (ctx *pipelineContext) createConfigMap(configFileContent string, prepareBui
}
cm := corev1.ConfigMap{
ObjectMeta: metav1.ObjectMeta{
Name: env.GetRadixConfigMapName(),
Namespace: env.GetAppNamespace(),
Labels: map[string]string{kube.RadixJobNameLabel: ctx.GetEnv().GetRadixPipelineJobName()},
OwnerReferences: []metav1.OwnerReference{*ctx.ownerReference},
Name: env.GetRadixConfigMapName(),
Namespace: env.GetAppNamespace(),
Labels: map[string]string{kube.RadixJobNameLabel: ctx.GetEnv().GetRadixPipelineJobName()},
},
Data: map[string]string{
pipelineDefaults.PipelineConfigMapContent: configFileContent,
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipeline/validation/task_validations.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func ValidateTask(task *pipelinev1.Task) error {
err := stderrors.Join(errs...)

if err != nil {
return errors.WithMessagef(err, "Task %s is invalid", task.GetName())
return fmt.Errorf("task %s is invalid: %w", task.GetName(), err)
}

return nil
Expand Down
29 changes: 0 additions & 29 deletions pkg/utils/test/setup.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
package test

import (
"context"

"github.com/equinor/radix-operator/pkg/apis/radix/v1"
"github.com/equinor/radix-operator/pkg/apis/utils"
radixclient "github.com/equinor/radix-operator/pkg/client/clientset/versioned"
radixclientfake "github.com/equinor/radix-operator/pkg/client/clientset/versioned/fake"
tektonclient "github.com/tektoncd/pipeline/pkg/client/clientset/versioned"
tektonclientfake "github.com/tektoncd/pipeline/pkg/client/clientset/versioned/fake"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
kubeclientfake "k8s.io/client-go/kubernetes/fake"
)
Expand All @@ -20,27 +15,3 @@ func Setup() (kubernetes.Interface, radixclient.Interface, tektonclient.Interfac
tknclient := tektonclientfake.NewSimpleClientset()
return kubeclient, rxclient, tknclient
}

func (params *TestParams) ApplyRd(radixClient radixclient.Interface) (*v1.RadixDeployment, error) {
rd := utils.ARadixDeployment().
WithDeploymentName(params.DeploymentName).
WithAppName(params.AppName).
WithEnvironment(params.Environment).
WithComponents().
WithJobComponents().
BuildRD()
_, err := radixClient.RadixV1().RadixDeployments(rd.Namespace).Create(context.Background(), rd, metav1.CreateOptions{})
if err != nil {
return nil, err
}

return rd, nil
}

type TestParams struct {
AppName string
Environment string
Namespace string
JobComponentName string
DeploymentName string
}

0 comments on commit 112775e

Please sign in to comment.