-
Notifications
You must be signed in to change notification settings - Fork 71
SREP-3117: Add E2E tests for RHOBS Synthetic Monitoring on HyperShift #461
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
Draft
Mhodesty
wants to merge
12
commits into
openshift:master
Choose a base branch
from
Mhodesty:SREP-3117
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
77222ef
Create e2e tests for RMO on hypershift.
Mhodesty c409f2b
Clean up unused labels and functions that remained after troubleshoot…
Mhodesty 326dbb7
switched healthchecks to feature flags.
Mhodesty 2163fe4
make generate results and update rhobs api paths.
Mhodesty c6417de
updated to read env var from saas file.
Mhodesty da20425
removed defined api endpoints into app-interface.
Mhodesty e92d65c
moved the environment setting to it's own function.
Mhodesty a9d3107
Remove dead code for clusterDeployment simulation.
Mhodesty 248638f
update skip health check variable for better clarity.
Mhodesty 2d82ded
Update readme with details for new tests.
Mhodesty 07a4434
add emergency kill switch for case where RMO breaks the rhobsAPI but …
Mhodesty cc18b77
Cleaned up code according to coderabbit suggestions.
Mhodesty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,6 +133,9 @@ func (r *HostedControlPlaneReconciler) getRHOBSConfig(ctx context.Context) RHOBS | |
| if strings.TrimSpace(configMap.Data["only-public-clusters"]) == "true" { | ||
| cfg.OnlyPublicClusters = true | ||
| } | ||
| if strings.TrimSpace(configMap.Data["skip-infrastructure-health-check"]) == "true" { | ||
| cfg.SkipInfrastructureHealthCheck = true | ||
| } | ||
|
|
||
| return cfg | ||
| } | ||
|
|
@@ -261,7 +264,7 @@ func (r *HostedControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.R | |
| } | ||
|
|
||
| // Ensure cluster is ready to be monitored before deploying any probing objects | ||
| hcpReady, err := r.hcpReady(ctx, hostedcontrolplane) | ||
| hcpReady, err := r.hcpReady(ctx, hostedcontrolplane, rhobsConfig) | ||
| if err != nil { | ||
| log.Error(err, "HCP readiness check failed") | ||
| return utilreconcile.RequeueWith(fmt.Errorf("HCP readiness check failed: %v", err)) | ||
|
|
@@ -271,7 +274,7 @@ func (r *HostedControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.R | |
| return utilreconcile.RequeueAfter(healthcheckIntervalSeconds * time.Second), nil | ||
| } | ||
|
|
||
| vpcEndpointReady, err := r.isVpcEndpointReady(ctx, hostedcontrolplane) | ||
| vpcEndpointReady, err := r.isVpcEndpointReady(ctx, hostedcontrolplane, rhobsConfig) | ||
| if err != nil { | ||
| log.Error(err, "VPC Endpoint check failed") | ||
| return utilreconcile.RequeueWith(err) | ||
|
|
@@ -283,7 +286,7 @@ func (r *HostedControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.R | |
|
|
||
| // Cluster ready - deploy kube-apiserver monitoring objects | ||
| log.Info("Deploying internal monitoring objects") | ||
| err = r.deployInternalMonitoringObjects(ctx, log, hostedcontrolplane) | ||
| err = r.deployInternalMonitoringObjects(ctx, log, hostedcontrolplane, rhobsConfig) | ||
| if err != nil { | ||
| log.Error(err, "failed to deploy internal monitoring components") | ||
| return utilreconcile.RequeueWith(err) | ||
|
|
@@ -322,7 +325,12 @@ func (r *HostedControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.R | |
| } | ||
|
|
||
| // deployInternalMonitoringObjects creates or updates the objects needed to monitor the kube-apiserver using cluster-internal routes | ||
| func (r *HostedControlPlaneReconciler) deployInternalMonitoringObjects(ctx context.Context, log logr.Logger, hostedcontrolplane *hypershiftv1beta1.HostedControlPlane) error { | ||
| func (r *HostedControlPlaneReconciler) deployInternalMonitoringObjects(ctx context.Context, log logr.Logger, hostedcontrolplane *hypershiftv1beta1.HostedControlPlane, cfg RHOBSConfig) error { | ||
| // Skip internal monitoring for test environments (e.g., osde2e tests without real kube-apiserver infrastructure) | ||
| if cfg.SkipInfrastructureHealthCheck { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should have a separate, dedicated flag/config for this |
||
| return nil | ||
| } | ||
|
|
||
| // Create or update route object | ||
| expectedRoute := r.buildInternalMonitoringRoute(hostedcontrolplane) | ||
| err := r.Create(ctx, &expectedRoute) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.