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

WIP: OCI Support for modules #1

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

WIP: OCI Support for modules #1

wants to merge 9 commits into from

Conversation

eunanio
Copy link
Owner

@eunanio eunanio commented Nov 17, 2024

Summary

This PR adds a native OCI support to tofu. Allowing the user to use any oci registry as a source for tofu modules. This change includes support for registry authentication via docker login and the ability to publish existing modules.

Usage

As a module source

module "s3-oci" {
  source = "oci://registry.gitlab.com/mysql-rds:v1.0.0"
  bucket_name = "test.company.bucket.com"
}

Publish a new oci module

# tofu oci push <tag> <path>
tofu oci push registry.gitlab.com/mysql-rds:v1.0.0 ./modules/mysql-rds

Pull a module from registry

# tofu oci pull <tag>
tofu oci pull registry.gitlab.com/mysql-rds:v1.0.0

Authentication

This implementation uses your docker credentials for authenticating oci requests. This should make it easier to integrate with CI/CD like github actions.

Resolves #31463

Target Release

1.10.0

Checklist

  • I have read the contribution guide.
  • I have not used an AI coding assistant to create this PR.
  • I have written all code in this PR myself OR I have marked all code I have not written myself (including modified code, e.g. copied from other places and then modified) with a comment indicating where it came from.
  • I (and other contributors to this PR) have not looked at the Terraform source code while implementing this PR.

Go checklist

  • I have run golangci-lint on my change and receive no errors relevant to my code.
  • I have run existing tests to ensure my code doesn't break anything.
  • I have added tests for all relevant use cases of my code, and those tests are passing.
  • I have only exported functions, variables and structs that should be used from other packages.
  • I have added meaningful comments to all exported functions, variables, and structs.

Website/documentation checklist

  • I have locally started the website as described here and checked my changes.

Copy link

Reminder for the PR assignee: If this is a user-visible change, please update the changelog as part of the PR.

Signed-off-by: Eunan <25510708+eunanio@users.noreply.github.com>
Signed-off-by: Eunan <25510708+eunanio@users.noreply.github.com>
Signed-off-by: Eunan <25510708+eunanio@users.noreply.github.com>
Signed-off-by: Eunan <25510708+eunanio@users.noreply.github.com>
Signed-off-by: Eunan <25510708+eunanio@users.noreply.github.com>
Signed-off-by: Eunan <25510708+eunanio@users.noreply.github.com>
Signed-off-by: Eunan <25510708+eunanio@users.noreply.github.com>
Signed-off-by: Eunan <25510708+eunanio@users.noreply.github.com>
Signed-off-by: Eunan <25510708+eunanio@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support OCI registries as module & provider source
1 participant