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

Fix deployment spec when replica set to 0 #423

Merged
merged 2 commits into from
Nov 29, 2023

Conversation

kim-tsao
Copy link
Contributor

What does this PR do?:

Removes the if statement that was used to set the replica field in the deployment spec since it should always be set to a value. If field is unset, it should have a default value of 0.

Which issue(s)/story(ies) does this PR fixes:

https://issues.redhat.com/browse/RHTAPBUGS-12

PR acceptance criteria:

  • [X ] Unit/Functional tests

Updated the unit tests to include the expected component attributes values for deployment/replicas

  • Documentation

  • Client Impact

How to test changes / Special notes to the reviewer:

Manually tested:

  1. Built the HAS image and deployed on a local cluster. Created a token with read and write permissions to write into a test org
  2. Deployed the sample Application and Component. Verified the replica was set to 1 in the generated deployment
  3. Updated the Component CR to set replicas to 0. Verified the replica was set to 0 in the generated deployment
  4. Updated the Component CR to remove the replica field. This did not trigger an update since existing deployment was equivalent. Internally, the deployed CR instance had the replica field removed but the deployment/replicas: 0 attribute remained

Signed-off-by: Kim Tsao <ktsao@redhat.com>
Copy link

codecov bot commented Nov 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (46ad293) 81.34% compared to head (9bdc923) 81.34%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #423      +/-   ##
==========================================
- Coverage   81.34%   81.34%   -0.01%     
==========================================
  Files          32       32              
  Lines        4788     4787       -1     
==========================================
- Hits         3895     3894       -1     
  Misses        702      702              
  Partials      191      191              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

openshift-ci bot commented Nov 29, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnmcollier, kim-tsao

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:
  • OWNERS [johnmcollier,kim-tsao]

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 removed the lgtm label Nov 29, 2023
Copy link

openshift-ci bot commented Nov 29, 2023

New changes are detected. LGTM label has been removed.

Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@kim-tsao kim-tsao merged commit 181ed5d into redhat-appstudio:main Nov 29, 2023
14 checks passed
@kim-tsao kim-tsao mentioned this pull request Dec 4, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants