terraform-redhat / terraform-provider-rhcs

Terraform provider for Red Hat Cloud Services
Apache License 2.0
45 stars 80 forks source link

OCM-7317 | feat: add support for registry config #790

Closed andreadecorte closed 1 month ago

andreadecorte commented 1 month ago

What this PR does / why we need it: This PR adds support to configure the registries in HCP clusters.

The new feature is optional.

The input format is aligned with the one exposed by the APIs (which is coming from OCP API themselves, to facilitate user adoption).

Validation in the provider is kept to a minimum initially, as it is done on backend side.

Code is covered by unit testing and subsystem tests.

There is an additional Make target to generate code coverage from unit tests.

Example of input:

resource "rhcs_cluster_rosa_hcp" "rosa_hcp_cluster" {
  ...

  registry_config = {
    registry_sources = {
      allowed_registries = null
      blocked_registries = ["blocked.io", "blocked2.io"]
      insecure_registries = null
    }
    allowed_registries_for_import = [
    {
      domain_name = "registry.io"
      insecure = false
    }
    ]
  }
}

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story (OCM-xxxx): Fixes OCM-7317

Change type

Checklist

chenz4027 commented 1 month ago

/lgtm

openshift-ci[bot] commented 1 month ago

@chenz4027: changing LGTM is restricted to collaborators

In response to [this](https://github.com/terraform-redhat/terraform-provider-rhcs/pull/790#issuecomment-2354034656): >/lgtm Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
gdbranco commented 1 month ago

/approve /lgtm

openshift-ci[bot] commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gdbranco

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](https://github.com/terraform-redhat/terraform-provider-rhcs/blob/main/OWNERS)~~ [gdbranco] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
andreadecorte commented 1 month ago

/retest

andreadecorte commented 1 month ago

/test rosa-sts-private-critical-high-presubmit

andreadecorte commented 1 month ago

/test rosa-sts-private-critical-high-presubmit

openshift-ci[bot] commented 1 month ago

@andreadecorte: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/rosa-sts-private-critical-high-presubmit c1ef9584208129ae900a5da1034d7ccc36d5baa3 link true /test rosa-sts-private-critical-high-presubmit

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
gdbranco commented 1 month ago

Merging considering the error is flaky related to dependency violation during teardown