Documentation ¶
Index ¶
- Constants
- func EnsureExistAndReplace(input, match, replace string) (string, error)
- func GetNonEmptyLines(output string) []string
- func HasDifferentCRDVersion(config config.Config, crdVersion string) bool
- func HasDifferentWebhookVersion(config config.Config, webhookVersion string) bool
- func ImplementWebhooks(filename string) error
- func InsertCode(filename, target, code string) error
- func RandomSuffix() (string, error)
- func ReplaceInFile(path, old, new string) error
- func ReplaceRegexInFile(path, match, replace string) error
- func RunCmd(msg, cmd string, args ...string) error
- func UncommentCode(filename, target, prefix string) error
- func YesNo(reader *bufio.Reader) bool
Constants ¶
const (
// KubebuilderBinName define the name of the kubebuilder binary to be used in the tests
KubebuilderBinName = "kubebuilder"
)
Variables ¶
This section is empty.
Functions ¶
func EnsureExistAndReplace ¶ added in v3.2.0
EnsureExistAndReplace check if the content exists and then do the replace
func GetNonEmptyLines ¶ added in v3.2.0
GetNonEmptyLines converts given command output string into individual objects according to line breakers, and ignores the empty elements in it.
func HasDifferentCRDVersion ¶
HasDifferentCRDVersion returns true if any other CRD version is tracked in the project configuration.
func HasDifferentWebhookVersion ¶
HasDifferentWebhookVersion returns true if any other webhook version is tracked in the project configuration.
func ImplementWebhooks ¶ added in v3.2.0
ImplementWebhooks will mock an webhook data
func InsertCode ¶ added in v3.2.0
InsertCode searches target content in the file and insert `toInsert` after the target.
func RandomSuffix ¶ added in v3.2.0
RandomSuffix returns a 4-letter string.
func ReplaceInFile ¶ added in v3.2.0
ReplaceInFile replaces all instances of old with new in the file at path.
func ReplaceRegexInFile ¶ added in v3.2.0
ReplaceRegexInFile finds all strings that match `match` and replaces them with `replace` in the file at path.
func RunCmd ¶
RunCmd prints the provided message and command and then executes it binding stdout and stderr
func UncommentCode ¶ added in v3.2.0
UncommentCode searches for target in the file and remove the comment prefix of the target content. The target content may span multiple lines.
Types ¶
This section is empty.