Skip to content

Commit

Permalink
Removal of deprecated, unused functions. (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
cardil authored Jul 25, 2022
1 parent b82e1da commit c8b6d66
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
10 changes: 0 additions & 10 deletions pkg/environment/magic.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,6 @@ func (mr *MagicGlobalEnvironment) Environment(opts ...EnvOpts) (context.Context,
return ctx, env
}

func (mr *MagicEnvironment) Images() map[string]string {
ctx := mr.c
if refs, err := ProduceImages(ctx); err != nil {
logging.FromContext(ctx).Fatal(err)
return nil
} else {
return refs
}
}

func (mr *MagicEnvironment) TemplateConfig(base map[string]interface{}) map[string]interface{} {
cfg := make(map[string]interface{})
for k, v := range base {
Expand Down
38 changes: 0 additions & 38 deletions pkg/manifest/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,18 @@ import (
"context"
"encoding/json"
"io/fs"
"os"
"path"
"runtime"
"strings"

"k8s.io/client-go/util/retry"
"knative.dev/pkg/injection/clients/dynamicclient"
"knative.dev/pkg/logging"
testlog "knative.dev/reconciler-test/pkg/logging"

"knative.dev/reconciler-test/pkg/environment"
"knative.dev/reconciler-test/pkg/feature"
)

// CfgFn is the function signature of configuration mutation options.
type CfgFn func(map[string]interface{})

// Deprecated: use InstallYamlFS instead.
func InstallYaml(ctx context.Context, dir string, base map[string]interface{}) (Manifest, error) {
log := loggingFrom(ctx, "InstallYaml")
log.Warn("InstallYaml is deprecated and will be removed, " +
"use InstallYamlFS instead.")
return InstallYamlFS(ctx, os.DirFS(dir), base)
}

func InstallYamlFS(ctx context.Context, fsys fs.FS, base map[string]interface{}) (Manifest, error) {
env := environment.FromContext(ctx)
images, err := environment.ProduceImages(ctx)
Expand Down Expand Up @@ -95,31 +82,6 @@ func InstallYamlFS(ctx context.Context, fsys fs.FS, base map[string]interface{})
return manifest, nil
}

// Deprecated: use InstallYamlFS instead.
func InstallLocalYaml(ctx context.Context, base map[string]interface{}) (Manifest, error) {
log := loggingFrom(ctx, "InstallLocalYaml")
pwd, _ := os.Getwd()
log.Debug("PWD: ", pwd)
_, filename, _, _ := runtime.Caller(1)
log.Debug("FILENAME: ", filename)

return InstallYamlFS(ctx, os.DirFS(path.Dir(filename)), base)
}

// Deprecated: use ImagesFromFS instead.
func ImagesLocalYaml() []string {
ctx := testlog.NewContext()
log := loggingFrom(ctx, "ImagesLocalYaml")
log.Warn("ImagesLocalYaml is deprecated and will be removed, " +
"use ImagesFromFS instead.")
pwd, _ := os.Getwd()
log.Debug("PWD: ", pwd)
_, filename, _, _ := runtime.Caller(1)
log.Debug("FILENAME: ", filename)

return ImagesFromFS(ctx, os.DirFS(path.Dir(filename)))
}

func ImagesFromFS(ctx context.Context, fsys fs.FS) []string {
log := logging.FromContext(ctx)
var images []string
Expand Down

0 comments on commit c8b6d66

Please sign in to comment.