-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into remove-GetInexpensiveContentVersionIdentity
- Loading branch information
Showing
153 changed files
with
5,643 additions
and
987 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.12.0-dev | ||
0.13.0-dev |
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,39 @@ | ||
package addhdlrs | ||
|
||
import ( | ||
"github.com/spf13/pflag" | ||
|
||
"github.com/open-component-model/ocm/cmds/ocm/pkg/options" | ||
"github.com/open-component-model/ocm/pkg/contexts/ocm" | ||
) | ||
|
||
type ResourceSpecHandlerBase struct { | ||
options options.OptionSet | ||
} | ||
|
||
var _ options.Options = (*ResourceSpecHandlerBase)(nil) | ||
|
||
func NewBase(opts ...options.Options) ResourceSpecHandlerBase { | ||
return ResourceSpecHandlerBase{options: opts} | ||
} | ||
|
||
func (*ResourceSpecHandlerBase) RequireInputs() bool { | ||
return false | ||
} | ||
|
||
func (h *ResourceSpecHandlerBase) WithCLIOptions(opts ...options.Options) ResourceSpecHandlerBase { | ||
h.options = append(h.options, opts...) | ||
return *h | ||
} | ||
|
||
func (h *ResourceSpecHandlerBase) GetOptions() options.OptionSet { | ||
return h.options | ||
} | ||
|
||
func (h *ResourceSpecHandlerBase) AddFlags(opts *pflag.FlagSet) { | ||
h.options.AddFlags(opts) | ||
} | ||
|
||
func (h *ResourceSpecHandlerBase) GetTargetOpts() []ocm.TargetOption { | ||
return options.FindOptions[ocm.TargetOption](h.options) | ||
} |
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,46 @@ | ||
package addhdlrs | ||
|
||
import ( | ||
"github.com/mandelsoft/goutils/generics" | ||
"github.com/spf13/pflag" | ||
|
||
"github.com/open-component-model/ocm/pkg/contexts/ocm" | ||
) | ||
|
||
type Options struct { | ||
Replace bool | ||
} | ||
|
||
var _ ocm.ModificationOption = (*Options)(nil) | ||
|
||
func (o *Options) AddFlags(fs *pflag.FlagSet) { | ||
f := fs.Lookup("replace") | ||
if f != nil { | ||
if bp := generics.Cast[*bool](f.Value); bp != nil { | ||
return | ||
} | ||
} | ||
fs.BoolVarP(&o.Replace, "replace", "R", false, "replace existing elements") | ||
} | ||
|
||
func (o *Options) ApplyBlobModificationOption(opts *ocm.BlobModificationOptions) { | ||
o.ApplyTargetOption(&opts.TargetOptions) | ||
} | ||
|
||
func (o *Options) ApplyModificationOption(opts *ocm.ModificationOptions) { | ||
o.ApplyTargetOption(&opts.TargetOptions) | ||
} | ||
|
||
func (o *Options) ApplyTargetOption(opts *ocm.TargetOptions) { | ||
if !o.Replace { | ||
opts.TargetElement = ocm.AppendElement | ||
} | ||
} | ||
|
||
func (o *Options) Description() string { | ||
return ` | ||
The <code>--replace</code> option allows users to specify whether adding an | ||
element with the same name and extra identity but different version as an | ||
existing element append (false) or replace (true) the existing element. | ||
` | ||
} |
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
Oops, something went wrong.