Skip to content

MGMT-13941: Don't wait for console if disabled - #5022

Merged
openshift-merge-robot merged 1 commit into
openshift:masterfrom
jhernand:dont_wait_for_console_before_marking_cluster_deployment_as_complete
Mar 16, 2023
Merged

MGMT-13941: Don't wait for console if disabled#5022
openshift-merge-robot merged 1 commit into
openshift:masterfrom
jhernand:dont_wait_for_console_before_marking_cluster_deployment_as_complete

Conversation

@jhernand

@jhernand jhernand commented Mar 7, 2023

Copy link
Copy Markdown
Contributor

Currently the cluster deployment controller waits for the console to be available before marking the cluster deployment as completed. This fails when the console capability is disabled. To avoid that this patch changes the controller so that it doesn't wait when the console is disabled.

Related: https://issues.redhat.com/browse/OCPBUGS-8335
Related: https://issues.redhat.com/browse/MGMT-13941

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 7, 2023
@openshift-ci-robot

Copy link
Copy Markdown

@jhernand: This pull request references Jira Issue OCPBUGS-8335, which is invalid:

  • expected the bug to target the "4.14.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Currently the cluster deployment controller waits for the console to be available before marking the cluster deployment as completed. This fails when the console capability is disabled. To avoid that this patch changes the controller so that it doesn't wait when the console is disabled.

Related: https://issues.redhat.com/browse/OCPBUGS-8335

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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.

@openshift-ci openshift-ci Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 7, 2023
@jhernand

jhernand commented Mar 7, 2023

Copy link
Copy Markdown
Contributor Author

@tsorya please review.

@openshift-ci
openshift-ci Bot requested review from danmanor and javipolo March 7, 2023 12:48
@openshift-ci

openshift-ci Bot commented Mar 7, 2023

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhernand

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

The pull request process is described here

Details 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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 7, 2023
Comment thread internal/bminventory/inventory.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just in matter of running less code though it can be less readable.

if isConsoleMonitored && !b.clusterApi.IsOperatorAvailable(&cluster, operators.OperatorConsole.Name)

@tsorya tsorya Mar 7, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it is actually a little bit wrong. In case we don't have console why we need to run this logic?
This code returns
&models.Credentials{ Username: DefaultUser, Password: string(password), ConsoleURL: common.GetConsoleUrl(cluster.Name, cluster.BaseDNSDomain), }
and console url is part of it but console is not enabled so what those creds should be used for?
I am not sure we need this part in case there is no console

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The password is used to create the "kubeadmincreds" secret. The console URL is returned by the API and I assume it is used by the UI. I don't see it used in any other place in this project.

I am updating the code so that the ConsoleURL field is only populated when the console is enabled. Please check again.

@jhernand
jhernand force-pushed the dont_wait_for_console_before_marking_cluster_deployment_as_complete branch from 29fc87e to 4c783e4 Compare March 7, 2023 13:35
@tsorya

tsorya commented Mar 7, 2023

Copy link
Copy Markdown
Contributor

Seems cool, any option to add test for it?

@codecov

codecov Bot commented Mar 7, 2023

Copy link
Copy Markdown

Codecov Report

Merging #5022 (94abbc1) into master (108f952) will increase coverage by 3.66%.
The diff coverage is 64.28%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5022      +/-   ##
==========================================
+ Coverage   67.31%   70.98%   +3.66%     
==========================================
  Files         204      214      +10     
  Lines       30830    34835    +4005     
==========================================
+ Hits        20754    24728    +3974     
+ Misses       8238     8214      -24     
- Partials     1838     1893      +55     
Impacted Files Coverage Δ
internal/cluster/cluster.go 66.44% <0.00%> (-0.90%) ⬇️
internal/bminventory/inventory.go 86.00% <100.00%> (+16.36%) ⬆️

... and 23 files with indirect coverage changes

@jhernand
jhernand force-pushed the dont_wait_for_console_before_marking_cluster_deployment_as_complete branch from 4c783e4 to 911061c Compare March 7, 2023 18:47
Currently the cluster deployment controller waits for the console to be
available before marking the cluster deployment as completed. This fails
when the console capability is disabled. To avoid that this patch
changes the controller so that it doesn't wait when the console is
disabled.

Related: https://issues.redhat.com/browse/OCPBUGS-8335
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
@jhernand
jhernand force-pushed the dont_wait_for_console_before_marking_cluster_deployment_as_complete branch from 911061c to 94abbc1 Compare March 8, 2023 08:35
@jhernand

jhernand commented Mar 8, 2023

Copy link
Copy Markdown
Contributor Author

Seems cool, any option to add test for it?

Added two tests to verify the new behavior.

@openshift-ci openshift-ci Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 8, 2023
@jhernand

Copy link
Copy Markdown
Contributor Author

@tsorya in the latest version of the patch I added two tests to verify the new behavior. Does that look good?

@tsorya

tsorya commented Mar 13, 2023

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Mar 13, 2023
@jhernand jhernand changed the title OCPBUGS-8335: Don't wait for console if disabled MGMT-13941: Don't wait for console if disabled Mar 15, 2023
@openshift-ci-robot

openshift-ci-robot commented Mar 15, 2023

Copy link
Copy Markdown

@jhernand: An error was encountered searching for bug MGMT-13941 on the Jira server at https://issues.redhat.com/. No known errors were detected, please see the full error message for details.

Full error message. You do not have the permission to see the specified issue.: request failed. Please analyze the request body for more details. Status code: 401:

Please contact an administrator to resolve this issue, then request a bug refresh with /jira refresh.

Details

In response to this:

Currently the cluster deployment controller waits for the console to be available before marking the cluster deployment as completed. This fails when the console capability is disabled. To avoid that this patch changes the controller so that it doesn't wait when the console is disabled.

Related: https://issues.redhat.com/browse/OCPBUGS-8335

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. and removed jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 15, 2023
@openshift-ci-robot

Copy link
Copy Markdown

@jhernand: The referenced Jira(s) [MGMT-13941] could not be located, all automatically applied jira labels will be removed.

Details

In response to this:

Currently the cluster deployment controller waits for the console to be available before marking the cluster deployment as completed. This fails when the console capability is disabled. To avoid that this patch changes the controller so that it doesn't wait when the console is disabled.

Related: https://issues.redhat.com/browse/OCPBUGS-8335

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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.

@openshift-ci-robot

openshift-ci-robot commented Mar 15, 2023

Copy link
Copy Markdown

@jhernand: This pull request references MGMT-13941 which is a valid jira issue.

Details

In response to this:

Currently the cluster deployment controller waits for the console to be available before marking the cluster deployment as completed. This fails when the console capability is disabled. To avoid that this patch changes the controller so that it doesn't wait when the console is disabled.

Related: https://issues.redhat.com/browse/OCPBUGS-8335
Related: https://issues.redhat.com/browse/MGMT-13941

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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.

@openshift-ci-robot

Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 1b21722 and 2 for PR HEAD 94abbc1 in total

@jhernand

Copy link
Copy Markdown
Contributor Author

/test e2e-agent-compact

1 similar comment
@jhernand

Copy link
Copy Markdown
Contributor Author

/test e2e-agent-compact

@openshift-ci-robot

Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD be24cbf and 1 for PR HEAD 94abbc1 in total

jhernand added a commit to jhernand/assisted-service that referenced this pull request Mar 15, 2023
Currently the cluster deployment controller waits for the console to be
available before marking the cluster deployment as completed. This fails
when the console capability is disabled. To avoid that this patch
changes the controller so that it doesn't wait when the console is
disabled.

Note that this is a clone of MGMT-13941 (which in turn is a clone of
OCPBUGS-8335) for ACM 2.7.

Related: https://issues.redhat.com/browse/OCPBUGS-8335
Related: https://issues.redhat.com/browse/MGMT-13941
Related: openshift#5022
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
@openshift-ci-robot

Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 854aff2 and 0 for PR HEAD 94abbc1 in total

@openshift-ci-robot

Copy link
Copy Markdown

/hold

Revision 94abbc1 was retested 3 times: holding

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 15, 2023
@jhernand

Copy link
Copy Markdown
Contributor Author

/override ci/prow/e2e-agent-compact

@openshift-ci

openshift-ci Bot commented Mar 16, 2023

Copy link
Copy Markdown
Contributor

@jhernand: Overrode contexts on behalf of jhernand: ci/prow/e2e-agent-compact

Details

In response to this:

/override ci/prow/e2e-agent-compact

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.

@jhernand

Copy link
Copy Markdown
Contributor Author

/unhold

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 16, 2023
@openshift-ci

openshift-ci Bot commented Mar 16, 2023

Copy link
Copy Markdown
Contributor

@jhernand: all tests passed!

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@openshift-merge-robot
openshift-merge-robot merged commit 077a3bd into openshift:master Mar 16, 2023
@jhernand
jhernand deleted the dont_wait_for_console_before_marking_cluster_deployment_as_complete branch March 16, 2023 14:41
openshift-merge-robot pushed a commit that referenced this pull request Mar 16, 2023
Currently the cluster deployment controller waits for the console to be
available before marking the cluster deployment as completed. This fails
when the console capability is disabled. To avoid that this patch
changes the controller so that it doesn't wait when the console is
disabled.

Note that this is a clone of MGMT-13941 (which in turn is a clone of
OCPBUGS-8335) for ACM 2.7.

Related: https://issues.redhat.com/browse/OCPBUGS-8335
Related: https://issues.redhat.com/browse/MGMT-13941
Related: #5022

Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
jhernand added a commit to jhernand/assisted-service that referenced this pull request Mar 24, 2023
Currently the cluster deployment controller waits for the console to be
available before marking the cluster deployment as completed. This fails
when the console capability is disabled. To avoid that this patch
changes the controller so that it doesn't wait when the console is
disabled.

Note that this is a clone of MGMT-14096 (which in turn is a clone of
OCPBUGS-8335) for ACM 2.6.

Related: https://issues.redhat.com/browse/OCPBUGS-8335
Related: https://issues.redhat.com/browse/MGMT-14096
Related: openshift#5022
Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
openshift-merge-robot pushed a commit that referenced this pull request Mar 27, 2023
Currently the cluster deployment controller waits for the console to be
available before marking the cluster deployment as completed. This fails
when the console capability is disabled. To avoid that this patch
changes the controller so that it doesn't wait when the console is
disabled.

Note that this is a clone of MGMT-14096 (which in turn is a clone of
OCPBUGS-8335) for ACM 2.6.

Related: https://issues.redhat.com/browse/OCPBUGS-8335
Related: https://issues.redhat.com/browse/MGMT-14096
Related: #5022

Signed-off-by: Juan Hernandez <juan.hernandez@redhat.com>
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants