-
Notifications
You must be signed in to change notification settings - Fork 2
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
Updates Metric Router validation condition #611
base: main
Are you sure you want to change the base?
Conversation
/run pipeline |
/run pipeline |
/run pipeline |
/run pipeline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional information is needed in the PR description and release notes contents.
The code makes a previously optional object required. So it is possible that previously running code will require a code change. A reference in the PR comments helps users identity what changed.
modules/metrics_routing/variables.tf
Outdated
targets = list(object({ | ||
id = string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this right?
targets are required for all actions, whilst the new validation implies that targets are only required for send
, thus optional for any other action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only reason why I have removed the optional from target is because in terraform registry it is required but at the same time the target is only required when the action is send
. If a user wants to drop the metrics then they don't need a target. The example in the terraform registry shows that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other way I could think of is to keep the target as optional but remove the empty list as default and since there is validation then it makes sure that whenever the action is send
the user has to input targets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have made the target as optional & since there is validation for when the target is mandatory it makes sure the user inputs the target when required.
I have updated the PR description and release notes. |
/run pipeline |
Need to remove the number of routes validation from the metrics routing submodule as per the discussion in playback. |
/run pipeline |
Description
Added validation for
permitted_target_regions
& length ofinclusion_filters
in the metrics_router_routes variable. Also added validation to ensure the user inputs the target id when the action is send.Additionally updated these variables:
target_region
,action
,permitted_target_regions
,primary_metadata_region
,backup_metadata_region
,private_api_endpoint_only
input to optional.Release required?
x.x.X
)x.X.x
)X.x.x
)Release notes content
The PR makes it optional to input the
target_region
to metric router target as well asaction
is made as optional input withsend
being set as default. It also updates thepermitted_target_regions
,primary_metadata_region
,backup_metadata_region
,private_api_endpoint_only
input as optional.It also adds validation for
permitted_target_regions
& restrict the length ofinclusion_filters
in the metrics_router_routes variable. Also ensure the user inputs the target id when the action is send.Run the pipeline
If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.
Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:
Checklist for reviewers
For mergers