app

package
v0.0.0-...-877fc11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2024 License: Apache-2.0 Imports: 68 Imported by: 0

README

Open Component Model Command Line Tool

Config File

The command line tool can be configured by a configuration file. If not specified on the command line, the file ~/.ocmconfig is read.

The configuration file is a yaml file following format by the configuration context.

It consists of list of configuration specifications according to the registered configurations types provided by the used library. Every entry must provide an appropriate type field specifying the dedicated configuration format.

The basic layout looks as follows:

type: generic.config.ocm.software/v1
configurations:
  - type: credentials.config.ocm.software
    repositories:
      - repository:
          type: DockerConfig/v1
          dockerConfigFile: "~/.docker/config.json"
          propagateConsumerIdentity: true

The example above just lists a configuration specification supported by the credentials context, which configures the docker configuration file as credential repository to use. Additionally it is configured to assign the contained credentials to their OCI repositories managed by the OCI context.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCliCommand

func NewCliCommand(ctx clictx.Context, mod ...func(clictx.Context, *cobra.Command)) *cobra.Command

NewCliCommand creates a new command WITHOUT observing configuration options. The result is a command configured by pure defaults. This is especially true for plugin settings.

func NewCliCommandForArgs

func NewCliCommandForArgs(ctx clictx.Context, args []string, mod ...func(clictx.Context, *cobra.Command)) (*cobra.Command, error)

NewCliCommandForArgs is the regular way to instantiate a new CLI command. It observes settings provides by options for the main command. This especially means, that help texts are configured according to the config settings provided by options.

func NewVersionCommand

func NewVersionCommand(ctx clictx.Context) *cobra.Command

Types

type CLIOptions

type CLIOptions struct {
	keyoption.Option

	Completed   bool
	Config      []string
	ConfigSets  []string
	Credentials []string
	Context     clictx.Context
	Settings    []string
	Verbose     bool
	LogOpts     logopts.Options
	Version     bool
}

func Prepare

func Prepare(ctx clictx.Context, args []string) (*CLIOptions, []string, error)

Prepare pre-prepares CLI options by evaluation the main options and providing an appropriately configured cli context.

func (*CLIOptions) AddFlags

func (o *CLIOptions) AddFlags(fs *pflag.FlagSet)

func (*CLIOptions) Close

func (o *CLIOptions) Close() error

func (*CLIOptions) Complete

func (o *CLIOptions) Complete() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL