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

Tracing: Add credentialsSecret for basic authentication to remote endpoint #7238

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

kmjayadeep
Copy link
Contributor

Changes

In the current implementation, we only supported tracing collectors without authentication. In this PR, an additional field credentialsSecret is added to the tracing configmap. The username and password provided in this secret will be used to authenticate against collector endpoint. This allows users to connect to third party opentelemetry compatible collectors.

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

Tracing config now includes an additional optional field `credentialsSecret` where users can specify the name of a secret. The username and password fields from the secret will be used to authenticate against Tracing collector endpoint.

@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 19, 2023
@tekton-robot
Copy link
Collaborator

Hi @kmjayadeep. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 requested review from dibyom and jerop October 19, 2023 12:24
@kmjayadeep
Copy link
Contributor Author

/kind misc

@tekton-robot tekton-robot added the kind/misc Categorizes issue or PR as a miscellaneuous one. label Oct 19, 2023
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/tracing/tracing.go 69.0% 69.2% 0.3

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.

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 19, 2023
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/tracing/tracing.go 69.0% 69.2% 0.3

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/reconciler/taskrun/controller.go 87.5% 71.9% -15.6
pkg/tracing/tracing.go 69.0% 69.2% 0.3
test/controller.go 30.7% 29.5% -1.2

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/reconciler/taskrun/controller.go 87.5% 71.9% -15.6
pkg/tracing/tracing.go 69.0% 69.2% 0.3
test/controller.go 30.7% 29.5% -1.2

@kmjayadeep kmjayadeep force-pushed the tracing-secret2 branch 2 times, most recently from 8de2c3e to 0a36b0b Compare October 22, 2023 22:32
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/reconciler/taskrun/controller.go 87.5% 71.9% -15.6
pkg/tracing/tracing.go 69.0% 69.2% 0.3
test/controller.go 30.7% 29.5% -1.2

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/reconciler/pipelinerun/controller.go 83.3% 68.8% -14.6
pkg/reconciler/taskrun/controller.go 87.5% 71.9% -15.6
pkg/tracing/tracing.go 69.0% 69.2% 0.3
test/controller.go 30.7% 29.5% -1.2

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/reconciler/pipelinerun/controller.go 83.3% 68.8% -14.6
pkg/reconciler/taskrun/controller.go 87.5% 71.9% -15.6
pkg/tracing/tracing.go 69.0% 69.2% 0.3
test/controller.go 30.7% 29.5% -1.2

@tekton-robot
Copy link
Collaborator

[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 Oct 23, 2023
pkg/tracing/tracing.go Show resolved Hide resolved
config/controller.yaml Show resolved Hide resolved
@@ -59,9 +61,10 @@ func NewController(opts *pipeline.Options, clock clock.PassiveClock) func(contex
pipelineRunInformer := pipelineruninformer.Get(ctx)
resolutionInformer := resolutioninformer.Get(ctx)
verificationpolicyInformer := verificationpolicyinformer.Get(ctx)
tracerProvider := tracing.New(TracerProviderName)
secretinformer := secretinformer.Get(ctx)
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to add an e2e test to make sure the secret informorer/lister we added are working properly?

Copy link
Member

Choose a reason for hiding this comment

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

@Yongxuanzhang there is a unit test that exercises this through the secrets fake informer, I think that provides good coverage for that - wdyt?

Copy link
Member

Choose a reason for hiding this comment

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

It would be good to have a unit test that verifies the case of secret being updated though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added a new test case to cover that - TestHandlerSecretUpdate

Copy link
Member

Choose a reason for hiding this comment

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

Thank you!!

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/reconciler/pipelinerun/controller.go 83.3% 68.8% -14.6
pkg/reconciler/taskrun/controller.go 87.5% 71.9% -15.6
pkg/tracing/tracing.go 69.0% 69.2% 0.3
test/controller.go 29.5% 28.5% -1.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/reconciler/pipelinerun/controller.go 83.3% 68.8% -14.6
pkg/reconciler/taskrun/controller.go 87.5% 71.9% -15.6
pkg/tracing/tracing.go 69.0% 69.2% 0.3
test/controller.go 29.5% 28.5% -1.1

@kmjayadeep kmjayadeep force-pushed the tracing-secret2 branch 2 times, most recently from ab33ce5 to 758350a Compare November 24, 2023 13:45
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/reconciler/pipelinerun/controller.go 83.3% 68.8% -14.6
pkg/reconciler/taskrun/controller.go 87.5% 71.9% -15.6
pkg/tracing/tracing.go 69.0% 69.2% 0.3
test/controller.go 29.5% 28.5% -1.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/reconciler/pipelinerun/controller.go 83.3% 68.8% -14.6
pkg/reconciler/taskrun/controller.go 87.5% 71.9% -15.6
pkg/tracing/tracing.go 69.0% 78.8% 9.9
test/controller.go 29.5% 28.5% -1.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/reconciler/pipelinerun/controller.go 83.3% 68.8% -14.6
pkg/reconciler/taskrun/controller.go 87.5% 71.9% -15.6
pkg/tracing/tracing.go 69.0% 78.8% 9.9
test/controller.go 29.5% 28.5% -1.1

@kmjayadeep kmjayadeep force-pushed the tracing-secret2 branch 2 times, most recently from b488dca to 294ac64 Compare November 30, 2023 13:34
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/reconciler/pipelinerun/controller.go 83.3% 81.5% -1.9
pkg/reconciler/taskrun/controller.go 87.5% 85.2% -2.3
pkg/tracing/tracing.go 69.0% 77.2% 8.2
test/controller.go 29.5% 28.5% -1.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/reconciler/pipelinerun/controller.go 83.3% 81.5% -1.9
pkg/reconciler/taskrun/controller.go 87.5% 85.2% -2.3
pkg/tracing/tracing.go 69.0% 77.2% 8.2
test/controller.go 29.5% 28.5% -1.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 60.0% -1.1
pkg/reconciler/pipelinerun/controller.go 83.3% 81.5% -1.9
pkg/reconciler/taskrun/controller.go 87.5% 85.2% -2.3
pkg/tracing/tracing.go 69.0% 77.2% 8.2
test/controller.go 29.5% 28.5% -1.1

…point

An additional field credentialsSecret is added to the tracing configmap. The username and password provided in this secret will be used to authenticate against collector endpoint. This allows users to connect to third party opentelemetry compatible collectors.

Signed-off-by: Jayadeep KM <[email protected]>
@kmjayadeep
Copy link
Contributor Author

@Yongxuanzhang Could you please review again? I think i resolved all the review points

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 85.0% 23.9
pkg/reconciler/pipelinerun/controller.go 83.3% 81.5% -1.9
pkg/reconciler/taskrun/controller.go 87.5% 85.2% -2.3
pkg/tracing/tracing.go 69.0% 77.2% 8.2
test/controller.go 29.5% 28.5% -1.1

@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/config/tracing.go 61.1% 85.0% 23.9
pkg/reconciler/pipelinerun/controller.go 83.3% 81.5% -1.9
pkg/reconciler/taskrun/controller.go 87.5% 85.2% -2.3
pkg/tracing/tracing.go 69.0% 77.2% 8.2
test/controller.go 29.5% 28.5% -1.1

@Yongxuanzhang
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 30, 2023
@tekton-robot tekton-robot merged commit b4ee65d into tektoncd:main Nov 30, 2023
13 checks passed
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/misc Categorizes issue or PR as a miscellaneuous one. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants