Skip to content

Commit

Permalink
Rename function to search-replace
Browse files Browse the repository at this point in the history
  • Loading branch information
phanimarupaka committed Mar 22, 2021
1 parent b719411 commit 94e98dd
Show file tree
Hide file tree
Showing 18 changed files with 9 additions and 9 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# search: Simple Example
# search-replace: Simple Example

The `search-replace` function performs search and optionally replace fields
across all resources.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
annotations:
config.k8s.io/function: |
container:
image: gcr.io/kpt-fn/search:unstable
image: gcr.io/kpt-fn/search-replace:unstable
data:
by-path: metadata.name
by-value: the-deployment
Expand Down
2 changes: 1 addition & 1 deletion functions/go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ FUNCTIONS := \
set-namespace \
starlark \
apply-setters \
search
search-replace

# Targets for running all function tests
FUNCTION_TESTS := $(patsubst %,%-TEST,$(FUNCTIONS))
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/GoogleContainerTools/kpt-functions-catalog/functions/go/search
module github.com/GoogleContainerTools/kpt-functions-catalog/functions/go/search-replace

go 1.15

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func main() {
resourceList.FunctionConfig = map[string]interface{}{}
cmd := framework.Command(resourceList, func() error {
resourceList.Result = &framework.Result{
Name: "search",
Name: "search-replace",
}
items, err := run(resourceList)
if err != nil {
Expand All @@ -34,7 +34,7 @@ func main() {

// run resolves the function params and runs the function on resources
func run(resourceList *framework.ResourceList) ([]framework.Item, error) {
sr, err := getSearchParams(resourceList.FunctionConfig)
sr, err := getSearchReplaceParams(resourceList.FunctionConfig)
if err != nil {
return nil, err
}
Expand All @@ -50,8 +50,8 @@ func usage() string {
return `` // TODO: pmarupaka add usage docs
}

// getSearchParams retrieve the search parameters from input config
func getSearchParams(fc interface{}) (SearchReplace, error) {
// getSearchReplaceParams retrieve the search parameters from input config
func getSearchReplaceParams(fc interface{}) (SearchReplace, error) {
var fcd SearchReplace
f, ok := fc.(map[string]interface{})
if !ok {
Expand Down Expand Up @@ -111,7 +111,7 @@ func searchResultsToItems(sr SearchReplace) []framework.Item {
func getErrorItem(errMsg string) []framework.Item {
return []framework.Item{
{
Message: fmt.Sprintf("failed to perform search operation: %q", errMsg),
Message: fmt.Sprintf("failed to perform search-replace operation: %q", errMsg),
Severity: framework.Error,
},
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 94e98dd

Please sign in to comment.