Skip to content

Commit

Permalink
Fix PaC build (#2314)
Browse files Browse the repository at this point in the history
* fix: default NS for PaC

Signed-off-by: Matej Vašek <mvasek@redhat.com>

* fix: make error non-fatal

Signed-off-by: Matej Vašek <mvasek@redhat.com>

* fix: pass correct image to PaC

Signed-off-by: Matej Vašek <mvasek@redhat.com>

* chore: enable gitlab test

---------

Signed-off-by: Matej Vašek <mvasek@redhat.com>
  • Loading branch information
matejvasek committed May 22, 2024
1 parent 33073d6 commit feb06f5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 2 additions & 5 deletions pkg/pipelines/tekton/gitlab_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ import (
)

func TestGitlab(t *testing.T) {
// this test is unreliable and fails majority of the time with unrelated problem
// skip this for now until the issue is fixed
// https://github.com/knative/func/issues/2185
t.Skip()
var err error
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()
Expand Down Expand Up @@ -237,7 +233,8 @@ func setupGitlabEnv(ctx context.Context, t *testing.T, baseURL, username, passwo
}
_, _, err = glabCli.Settings.UpdateSettings(newSettings)
if err != nil {
t.Fatal(err)
// just log the error, it appears that despite the error the setting is updated
t.Log(err)
}
// For some reason the setting update does not kick in immediately.

Expand Down
2 changes: 1 addition & 1 deletion pkg/pipelines/tekton/pac/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// NewTektonPacClientAndResolvedNamespace returns PipelinesascodeV1alpha1Client,namespace,error
func NewTektonPacClientAndResolvedNamespace(namespace string) (*pacv1alpha1.PipelinesascodeV1alpha1Client, string, error) {
var err error
if namespace != "" {
if namespace == "" {
namespace, err = k8s.GetDefaultNamespace()
if err != nil {
return nil, "", err
Expand Down
7 changes: 6 additions & 1 deletion pkg/pipelines/tekton/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,17 @@ func createPipelineRunTemplatePAC(f fn.Function, labels map[string]string) error
s2iImageScriptsUrl = quarkusS2iImageScriptsUrl
}

image := f.Deploy.Image
if image == "" {
image = f.Image
}

data := templateData{
FunctionName: f.Name,
Annotations: f.Deploy.Annotations,
Labels: labels,
ContextDir: contextDir,
FunctionImage: f.Deploy.Image,
FunctionImage: image,
Registry: f.Registry,
BuilderImage: getBuilderImage(f),
BuildEnvs: buildEnvs,
Expand Down

0 comments on commit feb06f5

Please sign in to comment.