-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c10d890
commit e0057ef
Showing
2,864 changed files
with
87,847 additions
and
90,869 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
Upstream-Name: ocm | ||
Upstream-Contact: [email protected] | ||
Source: https://github.com/open-component-model/ocm | ||
Source: https://ocm.software/ocm | ||
Disclaimer: The code in this project may include calls to APIs ("API Calls") of | ||
SAP or third-party products or services developed outside of this project | ||
("External Products"). | ||
|
@@ -28,6 +28,6 @@ Files: ** | |
Copyright: 2024 SAP SE or an SAP affiliate company and Open Component Model contributors | ||
License: Apache-2.0 | ||
|
||
Files: pkg/contexts/ocm/blobhandler/handlers/generic/npm/publish.go | ||
Files: api/ocm/extensions/blobhandler/handlers/generic/npm/publish.go | ||
Copyright: Copyright 2021 - cloverstd | ||
License: MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package clictx | ||
|
||
import ( | ||
"context" | ||
"io" | ||
|
||
"github.com/mandelsoft/vfs/pkg/vfs" | ||
|
||
"ocm.software/ocm/api/cli/internal" | ||
"ocm.software/ocm/api/datacontext" | ||
"ocm.software/ocm/api/ocm" | ||
) | ||
|
||
func WithContext(ctx context.Context) internal.Builder { | ||
return internal.Builder{}.WithContext(ctx) | ||
} | ||
|
||
func WithSharedAttributes(ctx datacontext.AttributesContext) internal.Builder { | ||
return internal.Builder{}.WithSharedAttributes(ctx) | ||
} | ||
|
||
func WithOCM(ctx ocm.Context) internal.Builder { | ||
return internal.Builder{}.WithOCM(ctx) | ||
} | ||
|
||
func WithFileSystem(fs vfs.FileSystem) internal.Builder { | ||
return internal.Builder{}.WithFileSystem(fs) | ||
} | ||
|
||
func WithOutput(w io.Writer) internal.Builder { | ||
return internal.Builder{}.WithOutput(w) | ||
} | ||
|
||
func WithErrorOutput(w io.Writer) internal.Builder { | ||
return internal.Builder{}.WithErrorOutput(w) | ||
} | ||
|
||
func WithInput(r io.Reader) internal.Builder { | ||
return internal.Builder{}.WithInput(r) | ||
} | ||
|
||
func New(mode ...datacontext.BuilderMode) internal.Context { | ||
return internal.Builder{}.New(mode...) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package config_test | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
|
||
clictx "ocm.software/ocm/api/cli" | ||
"ocm.software/ocm/api/cli/config" | ||
"ocm.software/ocm/api/oci/extensions/repositories/ocireg" | ||
ocmocireg "ocm.software/ocm/api/ocm/extensions/repositories/ocireg" | ||
) | ||
|
||
var DefaultContext = clictx.New() | ||
|
||
func normalize(i interface{}) ([]byte, error) { | ||
data, err := json.Marshal(i) | ||
if err != nil { | ||
return nil, err | ||
} | ||
var generic map[string]interface{} | ||
err = json.Unmarshal(data, &generic) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return json.Marshal(generic) | ||
} | ||
|
||
var _ = Describe("command config", func() { | ||
ocispec := ocireg.NewRepositorySpec("ghcr.io") | ||
|
||
ocidata, err := normalize(ocispec) | ||
Expect(err).To(Succeed()) | ||
|
||
ocmspec := ocmocireg.NewRepositorySpec("gcr.io", nil) | ||
ocmdata, err := normalize(ocmspec) | ||
Expect(err).To(Succeed()) | ||
|
||
specdata := "{\"ociRepositories\":{\"oci\":" + string(ocidata) + "},\"ocmRepositories\":{\"ocm\":" + string(ocmdata) + "},\"type\":\"" + config.OCMCmdConfigType + "\"}" | ||
|
||
Context("serialize", func() { | ||
It("serializes config", func() { | ||
cfg := config.New() | ||
err := cfg.AddOCIRepository("oci", ocispec) | ||
Expect(err).To(Succeed()) | ||
err = cfg.AddOCMRepository("ocm", ocmspec) | ||
Expect(err).To(Succeed()) | ||
|
||
data, err := normalize(cfg) | ||
|
||
Expect(err).To(Succeed()) | ||
Expect(data).To(Equal([]byte(specdata))) | ||
|
||
cfg2 := config.New() | ||
err = json.Unmarshal(data, cfg2) | ||
Expect(err).To(Succeed()) | ||
Expect(cfg2).To(Equal(cfg)) | ||
}) | ||
}) | ||
}) |
File renamed without changes.
Oops, something went wrong.