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

add openshift monitoring label to targetNamespace #1530

Merged
merged 1 commit into from Jun 5, 2023

Conversation

jkandasa
Copy link
Member

@jkandasa jkandasa commented Jun 1, 2023

Changes

  • Moved reconcile target namespace logic to a common place.
  • adds monitoring label into targetNamespace if it is a OpenShift platform
  • Fixes: SRVKP-3139 - Metrics not working

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Release Notes

NONE

@tekton-robot tekton-robot added the release-note-none Denotes a PR that doesnt merit a release note. label Jun 1, 2023
@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 1, 2023
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/targetnamespace.go 62.5% 72.2% 9.7

Copy link
Contributor

@khrm khrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 1, 2023
pkg/reconciler/common/targetnamespace.go Outdated Show resolved Hide resolved
pkg/reconciler/common/targetnamespace.go Outdated Show resolved Hide resolved
@jkandasa jkandasa marked this pull request as draft June 1, 2023 07:05
@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 1, 2023
@jkandasa
Copy link
Member Author

jkandasa commented Jun 1, 2023

I see metrics enable/disable code found in https://github.com/tektoncd/operator/blob/main/pkg/reconciler/openshift/tektonpipeline/extension.go#L67
I have to revisit this PR
updated the PR

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 1, 2023
@jkandasa jkandasa force-pushed the fix_openshift_metrics branch 2 times, most recently from 7c1bb2d to 940ecd7 Compare June 1, 2023 13:35
@jkandasa jkandasa marked this pull request as ready for review June 1, 2023 13:37
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 1, 2023
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/targetnamespace.go 62.5% 69.5% 7.0

@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/targetnamespace.go 62.5% 69.5% 7.0

Signed-off-by: Jeeva Kandasamy <jkandasa@redhat.com>
@tekton-robot
Copy link
Contributor

The following is the coverage report on the affected files.
Say /test pull-tekton-operator-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/common/targetnamespace.go 62.5% 86.4% 23.9

@piyush-garg
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 5, 2023
@jkandasa
Copy link
Member Author

jkandasa commented Jun 5, 2023

/cherry-pick release-v0.67.x

@tekton-robot
Copy link
Contributor

@jkandasa: once the present PR merges, I will cherry-pick it on top of release-v0.67.x in a new PR and assign it to you.

In response to this:

/cherry-pick release-v0.67.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot merged commit 51fff50 into tektoncd:main Jun 5, 2023
8 checks passed
@tekton-robot
Copy link
Contributor

@jkandasa: new pull request created: #1541

In response to this:

/cherry-pick release-v0.67.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jkandasa jkandasa deleted the fix_openshift_metrics branch June 5, 2023 08:41
khrm added a commit to khrm/operator that referenced this pull request Jun 6, 2023
There is an issue introduced in PR: tektoncd#1530 (https://github.com/tektoncd/operator/pull/1530/files#diff-7f51fd839c96e48ad11d43ad6e8e502cccfb00405087d1c8e116fc6245fad615R92)

```
panic: Unable to fetch k8s.io/client-go/kubernetes.Interface from context. This context is not the application context (which is typically given to constructors via sharedmain).

goroutine 2705 [running]:
go.uber.org/zap/zapcore.CheckWriteAction.OnWrite(0x0?, 0x1e4bde2?, {0x0?, 0x0?, 0xc0023ea000?})
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/zapcore/entry.go:198 +0x65
go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc000335ad0, {0x0, 0x0, 0x0})
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/zapcore/entry.go:264 +0x3ec
go.uber.org/zap.(*SugaredLogger).log(0xc001166940, 0x4, {0x0?, 0x1ac1701?}, {0xc000e25450?, 0x40dc07?, 0x3497c2e1ffdc0d75?}, {0x0, 0x0, 0x0})
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/sugar.go:295 +0xee
go.uber.org/zap.(*SugaredLogger).Panic(...)
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/sugar.go:153
knative.dev/pkg/client/injection/kube/client.Get({0x2149358, 0xc0017f2bd0})
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/client/injection/kube/client/client.go:201 +0x1b7
github.com/tektoncd/operator/pkg/reconciler/openshift/tektonpipeline.openshiftExtension.PreReconcile({0xc0007d4320?}, {0x2149358, 0xc0017f2bd0}, {0x2163a08?, 0xc000d89180?})
        /go/src/github.com/tektoncd/operator/pkg/reconciler/openshift/tektonpipeline/extension.go:92 +0x426
github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonpipeline.(*Reconciler).ReconcileKind(0xc0009a1100, {0x2149358, 0xc0017f2bd0}, 0xc000d89180)
        /go/src/github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonpipeline/reconcile.go:87 +0x687
github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonpipeline.(*reconcilerImpl).Reconcile(0xc000410280, {0x2149358, 0xc0017f2ba0}, {0xc00188d1f8, 0x8})
        /go/src/github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonpipeline/reconciler.go:236 +0x582
knative.dev/pkg/controller.(*Impl).processNextWorkItem(0xc0008ed1a0)
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/controller/controller.go:542 +0x58d
knative.dev/pkg/controller.(*Impl).RunContext.func3()
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/controller/controller.go:491 +0x68
created by knative.dev/pkg/controller.(*Impl).RunContext
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/controller/controller.go:489 +0x312

```
tekton-robot pushed a commit that referenced this pull request Jun 6, 2023
There is an issue introduced in PR: #1530 (https://github.com/tektoncd/operator/pull/1530/files#diff-7f51fd839c96e48ad11d43ad6e8e502cccfb00405087d1c8e116fc6245fad615R92)

```
panic: Unable to fetch k8s.io/client-go/kubernetes.Interface from context. This context is not the application context (which is typically given to constructors via sharedmain).

goroutine 2705 [running]:
go.uber.org/zap/zapcore.CheckWriteAction.OnWrite(0x0?, 0x1e4bde2?, {0x0?, 0x0?, 0xc0023ea000?})
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/zapcore/entry.go:198 +0x65
go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc000335ad0, {0x0, 0x0, 0x0})
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/zapcore/entry.go:264 +0x3ec
go.uber.org/zap.(*SugaredLogger).log(0xc001166940, 0x4, {0x0?, 0x1ac1701?}, {0xc000e25450?, 0x40dc07?, 0x3497c2e1ffdc0d75?}, {0x0, 0x0, 0x0})
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/sugar.go:295 +0xee
go.uber.org/zap.(*SugaredLogger).Panic(...)
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/sugar.go:153
knative.dev/pkg/client/injection/kube/client.Get({0x2149358, 0xc0017f2bd0})
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/client/injection/kube/client/client.go:201 +0x1b7
github.com/tektoncd/operator/pkg/reconciler/openshift/tektonpipeline.openshiftExtension.PreReconcile({0xc0007d4320?}, {0x2149358, 0xc0017f2bd0}, {0x2163a08?, 0xc000d89180?})
        /go/src/github.com/tektoncd/operator/pkg/reconciler/openshift/tektonpipeline/extension.go:92 +0x426
github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonpipeline.(*Reconciler).ReconcileKind(0xc0009a1100, {0x2149358, 0xc0017f2bd0}, 0xc000d89180)
        /go/src/github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonpipeline/reconcile.go:87 +0x687
github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonpipeline.(*reconcilerImpl).Reconcile(0xc000410280, {0x2149358, 0xc0017f2ba0}, {0xc00188d1f8, 0x8})
        /go/src/github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonpipeline/reconciler.go:236 +0x582
knative.dev/pkg/controller.(*Impl).processNextWorkItem(0xc0008ed1a0)
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/controller/controller.go:542 +0x58d
knative.dev/pkg/controller.(*Impl).RunContext.func3()
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/controller/controller.go:491 +0x68
created by knative.dev/pkg/controller.(*Impl).RunContext
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/controller/controller.go:489 +0x312

```
tekton-robot pushed a commit to tekton-robot/operator that referenced this pull request Jun 6, 2023
There is an issue introduced in PR: tektoncd#1530 (https://github.com/tektoncd/operator/pull/1530/files#diff-7f51fd839c96e48ad11d43ad6e8e502cccfb00405087d1c8e116fc6245fad615R92)

```
panic: Unable to fetch k8s.io/client-go/kubernetes.Interface from context. This context is not the application context (which is typically given to constructors via sharedmain).

goroutine 2705 [running]:
go.uber.org/zap/zapcore.CheckWriteAction.OnWrite(0x0?, 0x1e4bde2?, {0x0?, 0x0?, 0xc0023ea000?})
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/zapcore/entry.go:198 +0x65
go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc000335ad0, {0x0, 0x0, 0x0})
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/zapcore/entry.go:264 +0x3ec
go.uber.org/zap.(*SugaredLogger).log(0xc001166940, 0x4, {0x0?, 0x1ac1701?}, {0xc000e25450?, 0x40dc07?, 0x3497c2e1ffdc0d75?}, {0x0, 0x0, 0x0})
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/sugar.go:295 +0xee
go.uber.org/zap.(*SugaredLogger).Panic(...)
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/sugar.go:153
knative.dev/pkg/client/injection/kube/client.Get({0x2149358, 0xc0017f2bd0})
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/client/injection/kube/client/client.go:201 +0x1b7
github.com/tektoncd/operator/pkg/reconciler/openshift/tektonpipeline.openshiftExtension.PreReconcile({0xc0007d4320?}, {0x2149358, 0xc0017f2bd0}, {0x2163a08?, 0xc000d89180?})
        /go/src/github.com/tektoncd/operator/pkg/reconciler/openshift/tektonpipeline/extension.go:92 +0x426
github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonpipeline.(*Reconciler).ReconcileKind(0xc0009a1100, {0x2149358, 0xc0017f2bd0}, 0xc000d89180)
        /go/src/github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonpipeline/reconcile.go:87 +0x687
github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonpipeline.(*reconcilerImpl).Reconcile(0xc000410280, {0x2149358, 0xc0017f2ba0}, {0xc00188d1f8, 0x8})
        /go/src/github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonpipeline/reconciler.go:236 +0x582
knative.dev/pkg/controller.(*Impl).processNextWorkItem(0xc0008ed1a0)
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/controller/controller.go:542 +0x58d
knative.dev/pkg/controller.(*Impl).RunContext.func3()
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/controller/controller.go:491 +0x68
created by knative.dev/pkg/controller.(*Impl).RunContext
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/controller/controller.go:489 +0x312

```
tekton-robot pushed a commit that referenced this pull request Jun 6, 2023
There is an issue introduced in PR: #1530 (https://github.com/tektoncd/operator/pull/1530/files#diff-7f51fd839c96e48ad11d43ad6e8e502cccfb00405087d1c8e116fc6245fad615R92)

```
panic: Unable to fetch k8s.io/client-go/kubernetes.Interface from context. This context is not the application context (which is typically given to constructors via sharedmain).

goroutine 2705 [running]:
go.uber.org/zap/zapcore.CheckWriteAction.OnWrite(0x0?, 0x1e4bde2?, {0x0?, 0x0?, 0xc0023ea000?})
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/zapcore/entry.go:198 +0x65
go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc000335ad0, {0x0, 0x0, 0x0})
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/zapcore/entry.go:264 +0x3ec
go.uber.org/zap.(*SugaredLogger).log(0xc001166940, 0x4, {0x0?, 0x1ac1701?}, {0xc000e25450?, 0x40dc07?, 0x3497c2e1ffdc0d75?}, {0x0, 0x0, 0x0})
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/sugar.go:295 +0xee
go.uber.org/zap.(*SugaredLogger).Panic(...)
        /go/src/github.com/tektoncd/operator/vendor/go.uber.org/zap/sugar.go:153
knative.dev/pkg/client/injection/kube/client.Get({0x2149358, 0xc0017f2bd0})
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/client/injection/kube/client/client.go:201 +0x1b7
github.com/tektoncd/operator/pkg/reconciler/openshift/tektonpipeline.openshiftExtension.PreReconcile({0xc0007d4320?}, {0x2149358, 0xc0017f2bd0}, {0x2163a08?, 0xc000d89180?})
        /go/src/github.com/tektoncd/operator/pkg/reconciler/openshift/tektonpipeline/extension.go:92 +0x426
github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonpipeline.(*Reconciler).ReconcileKind(0xc0009a1100, {0x2149358, 0xc0017f2bd0}, 0xc000d89180)
        /go/src/github.com/tektoncd/operator/pkg/reconciler/kubernetes/tektonpipeline/reconcile.go:87 +0x687
github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonpipeline.(*reconcilerImpl).Reconcile(0xc000410280, {0x2149358, 0xc0017f2ba0}, {0xc00188d1f8, 0x8})
        /go/src/github.com/tektoncd/operator/pkg/client/injection/reconciler/operator/v1alpha1/tektonpipeline/reconciler.go:236 +0x582
knative.dev/pkg/controller.(*Impl).processNextWorkItem(0xc0008ed1a0)
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/controller/controller.go:542 +0x58d
knative.dev/pkg/controller.(*Impl).RunContext.func3()
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/controller/controller.go:491 +0x68
created by knative.dev/pkg/controller.(*Impl).RunContext
        /go/src/github.com/tektoncd/operator/vendor/knative.dev/pkg/controller/controller.go:489 +0x312

```
@rupalibehera
Copy link
Member

we need to cherry-pick this to release-v0.65.x

@jkandasa
Copy link
Member Author

/cherry-pick release-v0.65.x

@tekton-robot
Copy link
Contributor

@jkandasa: #1530 failed to apply on top of branch "release-v0.65.x":

Applying: add openshift monitoring label to targetnamespace
Using index info to reconstruct a base tree...
M	pkg/reconciler/kubernetes/tektonhub/tektonhub.go
M	pkg/reconciler/kubernetes/tektonpipeline/reconcile.go
M	pkg/reconciler/openshift/tektonpipeline/extension.go
M	pkg/reconciler/shared/tektonconfig/tektonconfig.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/reconciler/shared/tektonconfig/tektonconfig.go
CONFLICT (content): Merge conflict in pkg/reconciler/shared/tektonconfig/tektonconfig.go
Auto-merging pkg/reconciler/openshift/tektonpipeline/extension.go
Auto-merging pkg/reconciler/kubernetes/tektonpipeline/reconcile.go
Auto-merging pkg/reconciler/kubernetes/tektonhub/tektonhub.go
CONFLICT (content): Merge conflict in pkg/reconciler/kubernetes/tektonhub/tektonhub.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 add openshift monitoring label to targetnamespace
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-v0.65.x

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants