Skip to content

Conversation

@7h3-3mp7y-m4n
Copy link
Contributor

@7h3-3mp7y-m4n 7h3-3mp7y-m4n commented Apr 9, 2025

Description

Added the docker login support

as mentioned here: https://github.com/oras-project/oras-go/blob/main/example_test.go#L106
#60

What does this PR do?

This PR supports dynamic login which uses $DOCKER_CONFIG/config.json for login..

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • New chore (expected functionality to be implemented)

Checklist:

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I've signed off with an email address that matches the commit author.

@7h3-3mp7y-m4n
Copy link
Contributor Author

I've tested it with my own local function, which goes like this

func ExampleGetFile_privateOCI() {
	testUrl := "oci://localhost:5001/provisioners/hello:v1#hello.yaml"
	buff, err := GetFile(context.Background(), testUrl)
	if err != nil {
		fmt.Println("failed to pull OCI image:", err)
		return
	}
	fmt.Println(len(buff) > 0)
	// Output:
	// true
}

It passes for me when I use the oras guide https://oras.land/docs/compatible_oci_registries#cncf-distribution
If we need to add a stable test, then we need to recreate this, and also, I believe, by adding helper docker commands and pushing and pulling it, so that will be hectic. But if we are planning for this, then I would like to work on that, too!

Screenshot 2025-04-10 at 2 45 36 AM Screenshot 2025-04-10 at 2 44 47 AM

@astromechza astromechza merged commit 2657218 into score-spec:main May 20, 2025
6 checks passed
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.

[bug] Support import of provisioners from _private_ OCI/image registry

3 participants