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

tests/infra/Prometheus: create token for test executor to interact with Prometheus resources #13534

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dasionov
Copy link
Contributor

@dasionov dasionov commented Dec 16, 2024

What this PR does

Before this PR

This Pr fixes what #13372 tried to accomplish.
The kubeconfig doesn't use a token for the admin, which renders the config.BearerToken empty.

After this PR

The test now creates a dedicated ServiceAccount and uses a generated token for authentication. This token is explicitly associated with the required permissions to access Prometheus-related resources and subresources. This replaces the incorrect reliance on BearerToken and ensures proper authentication.

Fixes #

Release note

None

@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/S labels Dec 16, 2024
@dasionov
Copy link
Contributor Author

dasionov commented Dec 16, 2024

/cc @xpivarc

if this fix doesn't look good enough, we can try to switch to a http.Client with the TLSClientConfig that we extract from the executor kubeconfig, and remove the exec command completely..

@kubevirt-bot kubevirt-bot requested a review from xpivarc December 16, 2024 16:54
@dosubot dosubot bot added the sig/observability Denotes an issue or PR that relates to observability. label Dec 16, 2024
@dasionov dasionov marked this pull request as draft December 16, 2024 16:54
@kubevirt-bot kubevirt-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 16, 2024
@dasionov dasionov marked this pull request as ready for review December 17, 2024 16:02
@kubevirt-bot kubevirt-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 17, 2024
@dasionov dasionov marked this pull request as draft December 18, 2024 11:39
@kubevirt-bot kubevirt-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 18, 2024
@dasionov dasionov force-pushed the fix_qurantined_prometheus_test branch from 4f164a2 to a4432d4 Compare December 18, 2024 12:39
@dasionov dasionov marked this pull request as ready for review December 18, 2024 12:39
@kubevirt-bot kubevirt-bot added size/M and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S labels Dec 18, 2024
@kubevirt-bot kubevirt-bot requested a review from vladikr December 18, 2024 12:40
@dosubot dosubot bot added the sig/testing label Dec 18, 2024
@dasionov dasionov changed the title tests/prometheus: use executor cert-data and key-data instead of token tests/infra/Prometheus: create token for test executor to interact with Prometheus resources Dec 18, 2024
@dasionov dasionov force-pushed the fix_qurantined_prometheus_test branch 2 times, most recently from 09d6048 to 37fea97 Compare December 18, 2024 13:18
This commit sets up a ServiceAccount for the test executor to use
when making requests to the Kubernetes API to interact with the
Prometheus resource and its subresources. This ensures the tests
can authenticate properly and access the required endpoints.

Signed-off-by: Daniel Sionov <[email protected]>
@dasionov dasionov force-pushed the fix_qurantined_prometheus_test branch from 37fea97 to 7fd7487 Compare December 18, 2024 14:11
@dasionov
Copy link
Contributor Author

/test pull-kubevirt-e2e-k8s-1.30-sig-monitoring

@kubevirt-bot
Copy link
Contributor

@dasionov: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-kubevirt-apidocs
  • /test pull-kubevirt-build
  • /test pull-kubevirt-build-arm64
  • /test pull-kubevirt-build-s390x
  • /test pull-kubevirt-check-unassigned-tests
  • /test pull-kubevirt-client-python
  • /test pull-kubevirt-code-lint
  • /test pull-kubevirt-e2e-k8s-1.30-ipv6-sig-network
  • /test pull-kubevirt-e2e-k8s-1.30-sig-compute
  • /test pull-kubevirt-e2e-k8s-1.30-sig-network
  • /test pull-kubevirt-e2e-k8s-1.30-sig-operator
  • /test pull-kubevirt-e2e-k8s-1.30-sig-storage
  • /test pull-kubevirt-e2e-k8s-1.31-sig-compute
  • /test pull-kubevirt-e2e-k8s-1.31-sig-compute-migrations
  • /test pull-kubevirt-e2e-k8s-1.31-sig-compute-serial
  • /test pull-kubevirt-e2e-k8s-1.31-sig-monitoring
  • /test pull-kubevirt-e2e-k8s-1.31-sig-network
  • /test pull-kubevirt-e2e-k8s-1.31-sig-operator
  • /test pull-kubevirt-e2e-k8s-1.31-sig-performance
  • /test pull-kubevirt-e2e-k8s-1.31-sig-storage
  • /test pull-kubevirt-e2e-kind-1.30-vgpu
  • /test pull-kubevirt-e2e-kind-sriov
  • /test pull-kubevirt-e2e-windows2016
  • /test pull-kubevirt-fossa
  • /test pull-kubevirt-generate
  • /test pull-kubevirt-manifests
  • /test pull-kubevirt-prom-rules-verify
  • /test pull-kubevirt-unit-test
  • /test pull-kubevirt-unit-test-s390x
  • /test pull-kubevirt-verify-go-mod

The following commands are available to trigger optional jobs:

  • /test build-kubevirt-builder
  • /test pull-kubevirt-check-tests-for-flakes
  • /test pull-kubevirt-conformance-arm64
  • /test pull-kubevirt-e2e-arm64
  • /test pull-kubevirt-e2e-k8s-1.29-sig-compute-realtime
  • /test pull-kubevirt-e2e-k8s-1.29-sig-compute-root
  • /test pull-kubevirt-e2e-k8s-1.29-sig-network-multus-v4
  • /test pull-kubevirt-e2e-k8s-1.29-sig-performance-kwok
  • /test pull-kubevirt-e2e-k8s-1.29-sig-storage-root
  • /test pull-kubevirt-e2e-k8s-1.29-single-node
  • /test pull-kubevirt-e2e-k8s-1.29-swap-enabled
  • /test pull-kubevirt-e2e-k8s-1.31-sig-compute-conformance
  • /test pull-kubevirt-e2e-k8s-1.32-sig-compute
  • /test pull-kubevirt-e2e-k8s-1.32-sig-compute-serial
  • /test pull-kubevirt-e2e-k8s-1.32-sig-network
  • /test pull-kubevirt-e2e-k8s-1.32-sig-operator
  • /test pull-kubevirt-e2e-k8s-1.32-sig-storage
  • /test pull-kubevirt-fuzz
  • /test pull-kubevirt-gosec
  • /test pull-kubevirt-goveralls
  • /test pull-kubevirt-metrics-lint
  • /test pull-kubevirt-unit-test-arm64
  • /test pull-kubevirt-verify-rpms

Use /test all to run the following jobs that were automatically triggered:

  • pull-kubevirt-apidocs
  • pull-kubevirt-build
  • pull-kubevirt-build-arm64
  • pull-kubevirt-build-s390x
  • pull-kubevirt-check-tests-for-flakes
  • pull-kubevirt-check-unassigned-tests
  • pull-kubevirt-client-python
  • pull-kubevirt-code-lint
  • pull-kubevirt-conformance-arm64
  • pull-kubevirt-e2e-arm64
  • pull-kubevirt-e2e-k8s-1.31-sig-compute
  • pull-kubevirt-e2e-k8s-1.31-sig-compute-migrations
  • pull-kubevirt-e2e-k8s-1.31-sig-compute-serial
  • pull-kubevirt-e2e-k8s-1.31-sig-network
  • pull-kubevirt-e2e-k8s-1.31-sig-operator
  • pull-kubevirt-e2e-k8s-1.31-sig-storage
  • pull-kubevirt-e2e-k8s-1.32-sig-compute
  • pull-kubevirt-e2e-k8s-1.32-sig-network
  • pull-kubevirt-e2e-k8s-1.32-sig-operator
  • pull-kubevirt-e2e-k8s-1.32-sig-storage
  • pull-kubevirt-fossa
  • pull-kubevirt-fuzz
  • pull-kubevirt-generate
  • pull-kubevirt-goveralls
  • pull-kubevirt-manifests
  • pull-kubevirt-prom-rules-verify
  • pull-kubevirt-unit-test
  • pull-kubevirt-unit-test-arm64
  • pull-kubevirt-unit-test-s390x
  • pull-kubevirt-verify-go-mod

In response to this:

/test pull-kubevirt-e2e-k8s-1.30-sig-monitoring

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-sigs/prow repository.

@dasionov dasionov force-pushed the fix_qurantined_prometheus_test branch from b11a5bd to 82e225e Compare December 30, 2024 11:22
@dasionov
Copy link
Contributor Author

/test pull-kubevirt-e2e-k8s-1.31-sig-monitoring

@dasionov dasionov force-pushed the fix_qurantined_prometheus_test branch from 82e225e to 5b6c953 Compare December 30, 2024 13:41
@dasionov
Copy link
Contributor Author

/test pull-kubevirt-e2e-k8s-1.31-sig-monitoring

@dasionov dasionov force-pushed the fix_qurantined_prometheus_test branch from 5b6c953 to dd15c32 Compare December 30, 2024 17:58
@dasionov
Copy link
Contributor Author

/test pull-kubevirt-e2e-k8s-1.31-sig-monitoring

@dasionov dasionov force-pushed the fix_qurantined_prometheus_test branch from dd15c32 to 68e815c Compare December 30, 2024 19:24
@dasionov
Copy link
Contributor Author

/test pull-kubevirt-e2e-k8s-1.31-sig-monitoring

@dasionov dasionov force-pushed the fix_qurantined_prometheus_test branch from 68e815c to 3097377 Compare January 1, 2025 12:47
@dasionov
Copy link
Contributor Author

dasionov commented Jan 1, 2025

/test pull-kubevirt-e2e-k8s-1.31-sig-monitoring

@dasionov
Copy link
Contributor Author

dasionov commented Jan 1, 2025

/test pull-kubevirt-e2e-k8s-1.31-sig-compute

@dasionov dasionov force-pushed the fix_qurantined_prometheus_test branch from 9fc6cee to 3097377 Compare January 1, 2025 21:09
@dasionov
Copy link
Contributor Author

dasionov commented Jan 1, 2025

/test pull-kubevirt-e2e-k8s-1.31-sig-monitoring

@dasionov dasionov force-pushed the fix_qurantined_prometheus_test branch from 3097377 to 4489123 Compare January 2, 2025 14:14
@xpivarc
Copy link
Member

xpivarc commented Jan 2, 2025

/test ?

@kubevirt-bot
Copy link
Contributor

@xpivarc: The following commands are available to trigger required jobs:

  • /test pull-kubevirt-apidocs
  • /test pull-kubevirt-build
  • /test pull-kubevirt-build-arm64
  • /test pull-kubevirt-build-s390x
  • /test pull-kubevirt-check-unassigned-tests
  • /test pull-kubevirt-client-python
  • /test pull-kubevirt-code-lint
  • /test pull-kubevirt-e2e-k8s-1.30-ipv6-sig-network
  • /test pull-kubevirt-e2e-k8s-1.30-sig-compute
  • /test pull-kubevirt-e2e-k8s-1.30-sig-network
  • /test pull-kubevirt-e2e-k8s-1.30-sig-operator
  • /test pull-kubevirt-e2e-k8s-1.30-sig-storage
  • /test pull-kubevirt-e2e-k8s-1.31-sig-compute
  • /test pull-kubevirt-e2e-k8s-1.31-sig-compute-migrations
  • /test pull-kubevirt-e2e-k8s-1.31-sig-compute-serial
  • /test pull-kubevirt-e2e-k8s-1.31-sig-monitoring
  • /test pull-kubevirt-e2e-k8s-1.31-sig-network
  • /test pull-kubevirt-e2e-k8s-1.31-sig-operator
  • /test pull-kubevirt-e2e-k8s-1.31-sig-performance
  • /test pull-kubevirt-e2e-k8s-1.31-sig-storage
  • /test pull-kubevirt-e2e-kind-1.30-vgpu
  • /test pull-kubevirt-e2e-kind-sriov
  • /test pull-kubevirt-e2e-windows2016
  • /test pull-kubevirt-fossa
  • /test pull-kubevirt-generate
  • /test pull-kubevirt-manifests
  • /test pull-kubevirt-prom-rules-verify
  • /test pull-kubevirt-unit-test
  • /test pull-kubevirt-unit-test-s390x
  • /test pull-kubevirt-verify-go-mod

The following commands are available to trigger optional jobs:

  • /test build-kubevirt-builder
  • /test pull-kubevirt-check-tests-for-flakes
  • /test pull-kubevirt-conformance-arm64
  • /test pull-kubevirt-e2e-arm64
  • /test pull-kubevirt-e2e-k8s-1.29-sig-compute-realtime
  • /test pull-kubevirt-e2e-k8s-1.29-sig-compute-root
  • /test pull-kubevirt-e2e-k8s-1.29-sig-network-multus-v4
  • /test pull-kubevirt-e2e-k8s-1.29-sig-performance-kwok
  • /test pull-kubevirt-e2e-k8s-1.29-sig-storage-root
  • /test pull-kubevirt-e2e-k8s-1.29-single-node
  • /test pull-kubevirt-e2e-k8s-1.29-swap-enabled
  • /test pull-kubevirt-e2e-k8s-1.31-sig-compute-conformance
  • /test pull-kubevirt-e2e-k8s-1.32-sig-compute
  • /test pull-kubevirt-e2e-k8s-1.32-sig-compute-serial
  • /test pull-kubevirt-e2e-k8s-1.32-sig-network
  • /test pull-kubevirt-e2e-k8s-1.32-sig-operator
  • /test pull-kubevirt-e2e-k8s-1.32-sig-storage
  • /test pull-kubevirt-fuzz
  • /test pull-kubevirt-gosec
  • /test pull-kubevirt-goveralls
  • /test pull-kubevirt-metrics-lint
  • /test pull-kubevirt-unit-test-arm64
  • /test pull-kubevirt-verify-rpms

Use /test all to run the following jobs that were automatically triggered:

  • pull-kubevirt-apidocs
  • pull-kubevirt-build
  • pull-kubevirt-build-arm64
  • pull-kubevirt-build-s390x
  • pull-kubevirt-check-tests-for-flakes
  • pull-kubevirt-check-unassigned-tests
  • pull-kubevirt-client-python
  • pull-kubevirt-code-lint
  • pull-kubevirt-conformance-arm64
  • pull-kubevirt-e2e-arm64
  • pull-kubevirt-e2e-k8s-1.31-sig-compute
  • pull-kubevirt-e2e-k8s-1.31-sig-compute-migrations
  • pull-kubevirt-e2e-k8s-1.31-sig-compute-serial
  • pull-kubevirt-e2e-k8s-1.31-sig-network
  • pull-kubevirt-e2e-k8s-1.31-sig-operator
  • pull-kubevirt-e2e-k8s-1.31-sig-storage
  • pull-kubevirt-e2e-k8s-1.32-sig-compute
  • pull-kubevirt-e2e-k8s-1.32-sig-network
  • pull-kubevirt-e2e-k8s-1.32-sig-operator
  • pull-kubevirt-e2e-k8s-1.32-sig-storage
  • pull-kubevirt-fossa
  • pull-kubevirt-fuzz
  • pull-kubevirt-generate
  • pull-kubevirt-goveralls
  • pull-kubevirt-manifests
  • pull-kubevirt-prom-rules-verify
  • pull-kubevirt-unit-test
  • pull-kubevirt-unit-test-arm64
  • pull-kubevirt-unit-test-s390x
  • pull-kubevirt-verify-go-mod

In response to this:

/test ?

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-sigs/prow repository.

@xpivarc
Copy link
Member

xpivarc commented Jan 2, 2025

/test pull-kubevirt-e2e-k8s-1.31-sig-monitoring

@dasionov dasionov force-pushed the fix_qurantined_prometheus_test branch from 4489123 to 7c0c5a3 Compare January 2, 2025 15:50
@dasionov dasionov force-pushed the fix_qurantined_prometheus_test branch from 7c0c5a3 to 5e822ab Compare January 2, 2025 16:07
@dasionov
Copy link
Contributor Author

dasionov commented Jan 2, 2025

/test pull-kubevirt-e2e-k8s-1.31-sig-monitoring

1 similar comment
@dasionov
Copy link
Contributor Author

dasionov commented Jan 2, 2025

/test pull-kubevirt-e2e-k8s-1.31-sig-monitoring

Copy link
Member

@xpivarc xpivarc left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 3, 2025
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xpivarc

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 3, 2025
@kubevirt-commenter-bot
Copy link

Required labels detected, running phase 2 presubmits:
/test pull-kubevirt-e2e-windows2016
/test pull-kubevirt-e2e-kind-1.30-vgpu
/test pull-kubevirt-e2e-kind-sriov
/test pull-kubevirt-e2e-k8s-1.30-ipv6-sig-network
/test pull-kubevirt-e2e-k8s-1.30-sig-network
/test pull-kubevirt-e2e-k8s-1.30-sig-storage
/test pull-kubevirt-e2e-k8s-1.30-sig-compute
/test pull-kubevirt-e2e-k8s-1.30-sig-operator
/test pull-kubevirt-e2e-k8s-1.31-sig-network
/test pull-kubevirt-e2e-k8s-1.31-sig-storage
/test pull-kubevirt-e2e-k8s-1.31-sig-compute
/test pull-kubevirt-e2e-k8s-1.31-sig-operator

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. area/monitoring dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/observability Denotes an issue or PR that relates to observability. sig/testing size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants