refactor(recipe): rename Recipe2 -> Recipe

This commit is contained in:
2024-07-08 13:19:40 +02:00
parent f638b6a16b
commit f14d49cc64
21 changed files with 85 additions and 85 deletions

View File

@ -18,7 +18,7 @@ import (
// GetComposeFiles gets the list of compose files for an app (or recipe if you
// don't already have an app) which should be merged into a composetypes.Config
// while respecting the COMPOSE_FILE env var.
func (r Recipe2) GetComposeFiles(appEnv map[string]string) ([]string, error) {
func (r Recipe) GetComposeFiles(appEnv map[string]string) ([]string, error) {
composeFileEnvVar, ok := appEnv["COMPOSE_FILE"]
if !ok {
if err := ensurePathExists(r.ComposePath); err != nil {
@ -59,7 +59,7 @@ func (r Recipe2) GetComposeFiles(appEnv map[string]string) ([]string, error) {
return composeFiles, nil
}
func (r Recipe2) GetComposeConfig(env map[string]string) (*composetypes.Config, error) {
func (r Recipe) GetComposeConfig(env map[string]string) (*composetypes.Config, error) {
pattern := fmt.Sprintf("%s/compose**yml", r.Dir)
composeFiles, err := filepath.Glob(pattern)
if err != nil {
@ -86,7 +86,7 @@ func (r Recipe2) GetComposeConfig(env map[string]string) (*composetypes.Config,
}
// GetVersionLabelLocal retrieves the version label on the local recipe config
func (r Recipe2) GetVersionLabelLocal() (string, error) {
func (r Recipe) GetVersionLabelLocal() (string, error) {
var label string
config, err := r.GetComposeConfig(nil)
if err != nil {
@ -109,7 +109,7 @@ func (r Recipe2) GetVersionLabelLocal() (string, error) {
}
// UpdateTag updates an image tag in-place on file system local compose files.
func (r Recipe2) UpdateTag(image, tag string) (bool, error) {
func (r Recipe) UpdateTag(image, tag string) (bool, error) {
fullPattern := fmt.Sprintf("%s/compose**yml", r.Dir)
image = formatter.StripTagMeta(image)
@ -179,7 +179,7 @@ func (r Recipe2) UpdateTag(image, tag string) (bool, error) {
}
// UpdateLabel updates a label in-place on file system local compose files.
func (r Recipe2) UpdateLabel(pattern, serviceName, label string) error {
func (r Recipe) UpdateLabel(pattern, serviceName, label string) error {
fullPattern := fmt.Sprintf("%s/%s", r.Dir, pattern)
composeFiles, err := filepath.Glob(fullPattern)
if err != nil {