Skip to content

Webhook can't be created due to wrong URL

Here is my git-hook.yaml

apiVersion: tools.pongzt.com/v1alpha1
kind: GitHook
metadata:
  name: leflair-githook
spec:
  gitProvider: gitlab
  eventTypes:
  - push
  - issue_comment
  - pull_request
  projectUrl: "https://gitlab.com/rscinfra/leflair"
  accessToken:
    secretKeyRef:
      name: gitsecret
      key: accessToken
  secretToken:
    secretKeyRef:
      name: gitsecret
      key: secretToken
  runspec:
    pipelineRef:
      name: tekton-kaniko-gke-pipeline
    serviceAccount: tekton-sa

But it can't create a webhook

2019-09-05T00:45:07.303Z	ERROR	controller-runtime.controller	Reconciler error	{"controller": "githook-application", "request": "default/leflair-githook", "error": "Failed to add webhook to the Project:leflair due to POST https://gitlab.com/api/v4/projects/rscinfra/leflair/hooks: 422 {error: Invalid url given}"}

I would like to check the baseURL used as I suspect that it is API URL issue but still need to learn how to build this project.