From d23856b784e5d8e6c08cc49987bf67791c7c61c8 Mon Sep 17 00:00:00 2001 From: Tomofumi Hayashi Date: Sat, 25 May 2024 01:40:12 +0900 Subject: [PATCH] Not exposed APIReadyCheckFunc to outside of package APIReadyCheckFunc is used only in api, hence it can be decapitalize to make its scope only in this package. This fix changes its scope. In addition, api.APIReadyCheckFunc seems to be redundant so the name is changed. Change the comment to fit to golang style, too. --- pkg/server/api/shim.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/server/api/shim.go b/pkg/server/api/shim.go index 497a9e5ae..b7568da58 100644 --- a/pkg/server/api/shim.go +++ b/pkg/server/api/shim.go @@ -40,8 +40,8 @@ type ShimNetConf struct { LogToStderr bool `json:"logToStderr,omitempty"` } -// Define a type for API readiness check functions -type APIReadyCheckFunc func(string) error +// readyCheckFunc defines a type for API readiness check functions +type readyCheckFunc func(string) error // CmdAdd implements the CNI spec ADD command handler func CmdAdd(args *skel.CmdArgs) error { @@ -74,7 +74,7 @@ func CmdDel(args *skel.CmdArgs) error { return nil } -func postRequest(args *skel.CmdArgs, readinessCheck APIReadyCheckFunc) (*Response, string, error) { +func postRequest(args *skel.CmdArgs, readinessCheck readyCheckFunc) (*Response, string, error) { multusShimConfig, err := shimConfig(args.StdinData) if err != nil { return nil, "", fmt.Errorf("invalid CNI configuration passed to multus-shim: %w", err)