Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "cache warmer", PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if err := logging.Configure(logLevel, logFormat, logTimestamp); err != nil { return err } if val, ok := os.LookupEnv("KANIKO_REGISTRY_MAP"); ok { err := opts.RegistryMaps.Set(val) if err != nil { return err } } for _, target := range opts.RegistryMirrors { err := opts.RegistryMaps.Set(fmt.Sprintf("%s=%s", name.DefaultRegistry, target)) if err != nil { return err } } if len(opts.RegistryMaps) > 0 { for src, dsts := range opts.RegistryMaps { logrus.Debugf("registry-map remaps %s to %s.", src, strings.Join(dsts, ", ")) } } if len(opts.Images) == 0 && opts.DockerfilePath == "" { return errors.New("you must select at least one image to cache or a dockerfilepath to parse") } if opts.DockerfilePath != "" { if err := validateDockerfilePath(); err != nil { return fmt.Errorf("error validating dockerfile path: %w", err) } } return nil }, Run: func(cmd *cobra.Command, args []string) { if _, err := os.Stat(opts.CacheDir); os.IsNotExist(err) { err = os.MkdirAll(opts.CacheDir, 0o755) if err != nil { exit(fmt.Errorf("failed to create cache directory: %w", err)) } } if err := warmer.WarmCache(opts); err != nil { exit(fmt.Errorf("failed warming cache: %w", err)) } }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.