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

feat: add OIDC configuration to containerRegistry #459

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

thcdrt
Copy link
Contributor

@thcdrt thcdrt commented Aug 31, 2023

Description

Add Managed Private Registry OIDC configuration (relative to ovh/public-cloud-roadmap#83)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A: make testacc TESTARGS="-run TestAccCloudProjectContainerRegistryOIDCDataSource_basic"
  • Test B: make testacc TESTARGS="-run TestAccCloudProjectContainerRegistryOIDC_full"

Test Configuration:

  • Terraform version: terraform version: Terraform v1.2.6
  • Existing HCL configuration you used:
data "ovh_cloud_project_capabilities_containerregistry_filter" "regcap_small" {
  service_name = "xxxxxxxxxxx"
  plan_name    = "SMALL"
  region       = "GRA"
}

resource "ovh_cloud_project_containerregistry" "reg" {
  service_name = data.ovh_cloud_project_capabilities_containerregistry_filter.regcap_small.service_name
  plan_id      = data.ovh_cloud_project_capabilities_containerregistry_filter.regcap_small.id
  region       = data.ovh_cloud_project_capabilities_containerregistry_filter.regcap_small.region
  name         = "test-terraform-oidc"
}

resource "ovh_cloud_project_containerregistry_oidc" "oidc" {
  service_name = ovh_cloud_project_containerregistry.reg.service_name
  registry_id  = ovh_cloud_project_containerregistry.reg.id

  delete_users = false
  oidc_name = "keycloak"
  oidc_endpoint = "https://keycloak-url.com/realms/my-realm"
  oidc_client_id = "harbor"
  oidc_client_secret = "xxxxxx"
  oidc_scope = "openid,profile,email,offline_access"

  oidc_groups_claim = "groups"
  oidc_admin_group = "harbor-admin"
  oidc_verify_cert = "true"
  oidc_auto_onboard = "true"
  oidc_user_claim = "preferred_username"

  depends_on = [
    ovh_cloud_project_containerregistry.reg
  ]
}

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or issues
  • I have added acceptance tests that prove my fix is effective or that my feature works
  • New and existing acceptance tests pass locally with my changes
  • I ran succesfully go mod vendor if I added or modify go.mod file

@thcdrt thcdrt force-pushed the add-managed-private-registry-oidc branch 16 times, most recently from 6b72ed0 to 45317fd Compare September 5, 2023 09:40
* `oidc_name` - The name of the OIDC provider.
* `oidc_endpoint` - The URL of an OIDC-compliant server.
* `oidc_client_id` - The client ID with which Harbor is registered as client application with the OIDC provider.
* `oidc_client_secret` - The secret for the Harbor client application.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't I delete it as it's not part of the Data schema anymore ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if fields are not in the datasource, yes delete it/them :)

@thcdrt thcdrt force-pushed the add-managed-private-registry-oidc branch from 45317fd to e50c295 Compare September 6, 2023 15:31
* `oidc_name` - The name of the OIDC provider.
* `oidc_endpoint` - The URL of an OIDC-compliant server.
* `oidc_client_id` - The client ID with which Harbor is registered as client application with the OIDC provider.
* `oidc_client_secret` - The secret for the Harbor client application.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if fields are not in the datasource, yes delete it/them :)

@thcdrt thcdrt force-pushed the add-managed-private-registry-oidc branch from e50c295 to 057813b Compare September 7, 2023 07:54
@thcdrt thcdrt force-pushed the add-managed-private-registry-oidc branch from 057813b to b412507 Compare September 7, 2023 08:10
Copy link
Collaborator

@scraly scraly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks :)

@scraly scraly added the 0.34.0 label Sep 7, 2023
@scraly scraly merged commit 3748118 into ovh:master Sep 7, 2023
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.

3 participants