mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
[refactor]: Internalize loader api
This PR intends to move the loader api to internal. Only the necessary methods which are needed for the api have been put into `pkg/loader.go`. Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
This commit is contained in:
24
api/pkg/loader/loader.go
Normal file
24
api/pkg/loader/loader.go
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright 2023 The Kubernetes Authors.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package pkg has all the helpers to interact with the api.
|
||||
package loader
|
||||
|
||||
import (
|
||||
"sigs.k8s.io/kustomize/api/internal/loader"
|
||||
"sigs.k8s.io/kustomize/kyaml/filesys"
|
||||
)
|
||||
|
||||
// NewFileLoaderAtCwd returns a loader that loads from PWD.
|
||||
// A convenience for kustomize edit commands.
|
||||
func NewFileLoaderAtCwd(fSys filesys.FileSystem) *loader.FileLoader {
|
||||
return loader.NewLoaderOrDie(
|
||||
loader.RestrictionRootOnly, fSys, filesys.SelfDir)
|
||||
}
|
||||
|
||||
// NewFileLoaderAtRoot returns a loader that loads from "/".
|
||||
// A convenience for tests.
|
||||
func NewFileLoaderAtRoot(fSys filesys.FileSystem) *loader.FileLoader {
|
||||
return loader.NewLoaderOrDie(
|
||||
loader.RestrictionRootOnly, fSys, filesys.Separator)
|
||||
}
|
||||
Reference in New Issue
Block a user