OCM-22845 | feat: return available_channels in the rhcs_version data source#1090
Open
BraeTroutman wants to merge 2 commits intoterraform-redhat:mainfrom
Open
OCM-22845 | feat: return available_channels in the rhcs_version data source#1090BraeTroutman wants to merge 2 commits intoterraform-redhat:mainfrom
rhcs_version data source#1090BraeTroutman wants to merge 2 commits intoterraform-redhat:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
b9fa316 to
85d66a7
Compare
85d66a7 to
49a441b
Compare
Contributor
Author
|
/retest-required |
Contributor
There was a problem hiding this comment.
@BraeTroutman Can we add a test case in the subsystem tests, where available_channels is missing or empty in API response to validate edge behavior for this new field?
49a441b to
0c7750c
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Summary
Adds a new
available_channelsfield to therhcs_versiondata source, that will allow users of said data source to view the channels on which a particular version is available. This is a direct propogation from theavailable_channelsfield from theversionsREST API object on the CS sideDetailed Description of the Issue
Users of the rhcs TF provider have the ability to list and filter OCP versions available from the OCM API. This resource,
rhcs_versions, currently only returns two computed values:nameandid, which can be used in a cluster or machinepool creation.Now that we have the channel property coming to clusters, users should also be able to see the channels available to a version, so that they can manage the channels they assign to a cluster (if any) in the same declarative way that they manage versions.
Related Issues and PRs
#Type of Change
Previous Behavior
the
rhcs_versionsdata source only computesidandnamefieldsBehavior After This Change
the
available_channelscomputed field is added to the versions datasource in bothitemanditemstypes. Behavior of filtering anditemvsitemspopulation should be unchanged (i.e. they're still populated in the same way. This is tested in the classic subsystem tests)How to Test (Step-by-Step)
Preconditions
ocm tokenis also valid.Test Steps
make installto install the local TF providermkdir version-channels-tfExpected Results
When running terraform apply:
Currently all versions should have available_channels, so there should be no situation in which this output would be empty: that possibility is nevertheless accounted for in subsystem tests in which the list of available channels is expected to be empty
Proof of the Fix
Breaking Changes
Breaking Change Details / Migration Plan
Developer Verification Checklist
[JIRA-TICKET] | [TYPE]: <MESSAGE>.make testpasses.make fmtpasses.make buildpasses.