Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/config/wordlist.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
NeoNephos
accessmethod
accessmethoddescriptor
accessmethods
Expand Down Expand Up @@ -99,6 +100,7 @@ finalizer
finalizers
foldername
forwardspec
fulcio
gapped
gav
getinexpensivecontentversionidentity
Expand Down Expand Up @@ -145,6 +147,7 @@ ioutils
ipcei
iterable
json
jsonNormalisation
jsonschema
keyless
keypair
Expand Down Expand Up @@ -181,7 +184,6 @@ mvn
mvnrepository
namespace
namespaces
NeoNephos
newcomponentaccess
newcomponentversionaccess
newrepository
Expand All @@ -201,6 +203,7 @@ ocm
ocmbot
ocmcli
ocmconfig
oidc
oncefunc
oo
oras
Expand Down Expand Up @@ -229,6 +232,7 @@ pubsub
readme
readonly
refcount
rekor
relativeocireference
releasenotes
releaser
Expand Down Expand Up @@ -268,13 +272,13 @@ struct
subchart
subcharts
subst
tcp
tempfile
templated
templater
templaters
templating
tgz
tcp
tls
todo
toi
Expand All @@ -291,6 +295,7 @@ uploader
uploaderdescriptor
uploaders
uploadhandlers
uppercamelcase
url
urls
utf
Expand All @@ -307,7 +312,3 @@ yaml
yitsushi
yml
yyyy
jsonNormalisation
rekor
oidc
fulcio
6 changes: 6 additions & 0 deletions api/ocm/extensions/accessmethods/git/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,19 @@ import (
const (
Type = "git"
TypeV1Alpha1 = Type + runtime.VersionSeparator + "v1alpha1"

UpperType = "Git"
UpperTypeV1Alpha1 = UpperType + runtime.VersionSeparator + "v1alpha1"
)

func init() {
// If we remove the default registration, also the docs are gone.
// so we leave the default registration in.
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](Type, accspeccpi.WithDescription(usage)))
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](TypeV1Alpha1, accspeccpi.WithFormatSpec(formatV1), accspeccpi.WithConfigHandler(ConfigHandler())))

accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](UpperType))
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](UpperTypeV1Alpha1))
}

// AccessSpec describes the access for a GitHub registry.
Expand Down
6 changes: 6 additions & 0 deletions api/ocm/extensions/accessmethods/github/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ import (
const (
Type = "gitHub"
TypeV1 = Type + runtime.VersionSeparator + "v1"

UpperType = "GitHub"
UpperTypeV1 = UpperType + runtime.VersionSeparator + "v1"
)

const (
Expand All @@ -44,6 +47,9 @@ func init() {
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](TypeV1, accspeccpi.WithFormatSpec(formatV1), accspeccpi.WithConfigHandler(ConfigHandler())))
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](LegacyType))
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](LegacyTypeV1))

accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](UpperType))
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](UpperTypeV1))
}

func Is(spec accspeccpi.AccessSpec) bool {
Comment thread
frewilhelm marked this conversation as resolved.
Expand Down
6 changes: 6 additions & 0 deletions api/ocm/extensions/accessmethods/maven/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@ import (
const (
Type = "maven"
TypeV1 = Type + runtime.VersionSeparator + "v1"

UpperType = "Maven"
UpperTypeV1 = UpperType + runtime.VersionSeparator + "v1"
)

func init() {
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](Type, accspeccpi.WithDescription(usage)))
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](TypeV1, accspeccpi.WithFormatSpec(formatV1), accspeccpi.WithConfigHandler(ConfigHandler())))

accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](UpperType))
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](UpperTypeV1))
}

// AccessSpec describes the access for a Maven artifact.
Expand Down
6 changes: 6 additions & 0 deletions api/ocm/extensions/accessmethods/npm/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ import (
const (
Type = "npm"
TypeV1 = Type + runtime.VersionSeparator + "v1"

UpperType = "NPM"
UpperTypeV1 = UpperType + runtime.VersionSeparator + "v1"
)

func init() {
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](Type, accspeccpi.WithDescription(usage)))
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](TypeV1, accspeccpi.WithFormatSpec(formatV1), accspeccpi.WithConfigHandler(ConfigHandler())))

accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](UpperType))
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](UpperTypeV1))
}

// AccessSpec describes the access for a NPM registry.
Expand Down
6 changes: 6 additions & 0 deletions api/ocm/extensions/accessmethods/wget/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ import (
const (
Type = "wget"
TypeV1 = Type + runtime.VersionSeparator + "v1"

UpperType = "Wget"
UpperTypeV1 = UpperType + runtime.VersionSeparator + "v1"
)

func init() {
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](Type, accspeccpi.WithDescription(usage)))
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](TypeV1, accspeccpi.WithFormatSpec(formatV1), accspeccpi.WithConfigHandler(ConfigHandler())))

accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](UpperType))
accspeccpi.RegisterAccessType(accspeccpi.NewAccessSpecType[*AccessSpec](UpperTypeV1))
Comment thread
morri-son marked this conversation as resolved.
}

func Is(spec accspeccpi.AccessSpec) bool {
Expand Down
11 changes: 9 additions & 2 deletions cmds/ocm/commands/ocmcmds/common/inputs/inputtype.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,16 @@ func newGenericInputSpec(data []byte, unmarshaler runtime.Unmarshaler) (*Generic
func Usage(scheme InputTypeScheme) string {
s := `
The resource specification supports the following blob input types, specified
with the field <code>type</code> in the <code>input</code> field:`
with the field <code>type</code> in the <code>input</code> field:

UpperCamelCase type names (e.g. <code>Helm</code>) are aliases for the corresponding
lowercase types (e.g. <code>helm</code>). See the lowercase entry for full documentation.`
for _, t := range scheme.KnownTypeNames() {
s = fmt.Sprintf("%s\n\n- Input type <code>%s</code>\n\n%s", s, t, utils.IndentLines(scheme.GetInputType(t).Usage(), " "))
it := scheme.GetInputType(t)
if dit, ok := it.(*DefaultInputType); ok && dit.usage == "" {
continue
}
s = fmt.Sprintf("%s\n\n- Input type <code>%s</code>\n\n%s", s, t, utils.IndentLines(it.Usage(), " "))
}
return s + "\n"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const (

func init() {
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(TYPE, &Spec{}, usage, ConfigHandler()))
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(UPPER_TYPE, &Spec{}, usage, ConfigHandler()))
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(UPPER_TYPE, &Spec{}, "", ConfigHandler()))
}

const usage = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ func init() {
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(TYPE, &Spec{},
Usage("The path must denote a file relative the resources file. "), ConfigHandler()))
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(UPPER_TYPE, &Spec{},
Usage("The path must denote a file relative the resources file. "), ConfigHandler()))
"", ConfigHandler()))
}
6 changes: 5 additions & 1 deletion cmds/ocm/commands/ocmcmds/common/inputs/types/git/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ import (
"ocm.software/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
)

const TYPE = "git"
const (
TYPE = "git"
UPPER_TYPE = "Git"
)

func init() {
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(TYPE, &Spec{}, usage, ConfigHandler()))
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(UPPER_TYPE, &Spec{}, "", ConfigHandler()))
}

const usage = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const (

func init() {
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(TYPE, &Spec{}, usage, ConfigHandler()))
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(UPPER_TYPE, &Spec{}, usage, ConfigHandler()))
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(UPPER_TYPE, &Spec{}, "", ConfigHandler()))
}

const usage = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ import (
"ocm.software/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
)

const TYPE = "maven"
const (
TYPE = "maven"
UPPER_TYPE = "Maven"
)

func init() {
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(TYPE, &Spec{}, usage, ConfigHandler()))
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(UPPER_TYPE, &Spec{}, "", ConfigHandler()))
}

const usage = `
Expand Down
6 changes: 5 additions & 1 deletion cmds/ocm/commands/ocmcmds/common/inputs/types/npm/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ import (
"ocm.software/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
)

const TYPE = "npm"
const (
TYPE = "npm"
UPPER_TYPE = "NPM"
)

func init() {
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(TYPE, &Spec{}, usage, ConfigHandler()))
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(UPPER_TYPE, &Spec{}, "", ConfigHandler()))
}

const usage = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func init() {
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(TYPE, &Spec{},
usage, ConfigHandler()))
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(UPPER_TYPE, &Spec{},
usage, ConfigHandler()))
"", ConfigHandler()))
}

const usage = `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ import (
"ocm.software/ocm/cmds/ocm/commands/ocmcmds/common/inputs"
)

const TYPE = "wget"
const (
TYPE = "wget"
UPPER_TYPE = "Wget"
)

func init() {
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(TYPE, &Spec{}, usage, ConfigHandler()))
inputs.DefaultInputTypeScheme.Register(inputs.NewInputType(UPPER_TYPE, &Spec{}, "", ConfigHandler()))
}

const usage = `
Expand Down
Loading
Loading