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

[serverless-1.33] Backport PaC fix #774

Merged
merged 3 commits into from
May 30, 2024
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: 0 additions & 1 deletion hack/install-gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ spec:
gitlab_rails['gitlab_shell_ssh_port'] = 30022
gitlab_rails['gitlab_email_enabled'] = false
puma['worker_processes'] = 0
sidekiq['max_concurrency'] = 1
prometheus_monitoring['enable'] = false
gitlab_rails['env'] = {
'MALLOC_CONF' => 'dirty_decay_ms:1000,muzzy_decay_ms:1000'
Expand Down
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 @@ -238,7 +234,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
11 changes: 8 additions & 3 deletions 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 All @@ -230,8 +235,8 @@ func createPipelineRunTemplatePAC(f fn.Function, labels map[string]string) error

S2iImageScriptsUrl: s2iImageScriptsUrl,

RepoUrl: "{{ repo_url }}",
Revision: "{{ revision }}",
RepoUrl: "\"{{ repo_url }}\"",
Revision: "\"{{ revision }}\"",
}

var template string
Expand Down
Loading