Documentation ¶
Overview ¶
Package gcsupload uploads artifacts to a GCS path resolved from job configuration
Index ¶
- Constants
- func BindOptions(options *Options, fs *flag.FlagSet)
- func Encode(options Options) (string, error)
- type Options
- func (o *Options) BindOptions(flags *flag.FlagSet)
- func (o *Options) Complete(args []string)
- func (o *Options) ConfigVar() string
- func (o *Options) LoadConfig(config string) error
- func (o Options) Run(spec *downwardapi.JobSpec, extra map[string]gcs.UploadFunc) error
- func (o *Options) Validate() error
Constants ¶
View Source
const ( // JSONConfigEnvVar is the environment variable that // utilities expect to find a full JSON configuration // in when run. JSONConfigEnvVar = "GCSUPLOAD_OPTIONS" )
Variables ¶
This section is empty.
Functions ¶
func BindOptions ¶
BindOptions adds flags to the FlagSet that populate the GCS upload options struct given.
Types ¶
type Options ¶
type Options struct { // Items are files or directories to upload Items []string `json:"items,omitempty"` // SubDir is appended to the GCS path SubDir string `json:"sub_dir,omitempty"` *kube.GCSConfiguration // GcsCredentialsFile is the path to the JSON // credentials for pushing to GCS GcsCredentialsFile string `json:"gcs_credentials_file,omitempty"` DryRun bool `json:"dry_run"` // contains filtered or unexported fields }
Options exposes the configuration necessary for defining where in GCS an upload will land.
func (*Options) BindOptions ¶
BindOptions binds flags to options
func (*Options) ConfigVar ¶
ConfigVar exposes the environment variable used to store serialized configuration
func (*Options) LoadConfig ¶
LoadConfig loads options from serialized config
func (Options) Run ¶
func (o Options) Run(spec *downwardapi.JobSpec, extra map[string]gcs.UploadFunc) error
Run will upload files to GCS as prescribed by the options. Any extra files can be passed as a parameter and will have the prefix prepended to their destination in GCS, so the caller can operate relative to the base of the GCS dir.
Click to show internal directories.
Click to hide internal directories.