Closed nicholasSUSE closed 7 months ago
@Jono-SUSE-Rancher @snasovich
Hi, I need reviews on this PR however, I don't have permission to add reviewers. Please, can you help with that?
Also, there is a failing automated test but it has nothing to do with PR code changes and I can't restart the drone build, how should I proceed?
Hey @nicholasSUSE - I've added Andy, Sergey, and Bruno - whichever two get to take a look first.
I'd update the tf docs
cluster_v2.md
to reflect the new functionality ofsystem_default_registry
now and make sure to test it having an empty value/not being set which would cause tf to use the global system registry within Rancher and make sure that still works. Lgtm
Thank you for your review.
I have updated the documentation in a new commit.
I have tested the empty value for system_default_registry
@rohitsakala
I have tested both scenarios:
Setting the system_default_registry variable
system_default_registry = "${aws_instance.default_registry.public_dns}:5000"
And not setting.
The resourceRancher2AppV2Read
function, returns the right value for system_default_registry
.
The d.Get("system_default_registry")
method, checks the state from terraform and not the actual configuration from Rancher or Downstream cluster.
This way, whatever override we do with the new variable behavior will output the right value.
Issue:
https://github.com/rancher/terraform-provider-rancher2/issues/1187
Problem
The terraform resource
rancher2_app_v2
had no Argument for setting up a Custom System Registry, limiting clients to install an app only from a previously configured SystemDefaultRegistry.There was in place a computed attribute named
default_system_registry
.Solution
Transform the computed attribute
default_system_registry
into an optional argument for the resource too.Testing
The reproducing steps in the Github Issue are very hard and take a long time to execute.
In order to test without needing to set all the infrastructure (specially the private registry with all the images):
Testing With Terraform:
rancher2_app_v2
to create a new app installation passing the recently createdsystem_default_registry
argument pointing to a random string pretending to be the private registry DNS.Results when trying to install CIS Benchmark passing a random string as the value:![image](https://github.com/rancher/terraform-provider-rancher2/assets/127259813/75396c37-2892-4cf9-9e4f-276aa0349092)
Engineering Testing
Manual Testing
Part of the terraform code to execute the tests:
Automated Testing
QA Testing Considerations
Regressions Considerations