Skip to content

Commit

Permalink
Change 'binary' to 'executable' in messages
Browse files Browse the repository at this point in the history
#1613 pointed out that
'binary' can be ambiguous. This commit changes all occurrences of
"binary" to "executable" in messages.
  • Loading branch information
cfergeau authored and guillaumerose committed Nov 4, 2020
1 parent dcddf19 commit 75d6aa7
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 54 deletions.
4 changes: 2 additions & 2 deletions cmd/crc-embedder/cmd/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func init() {

var embedCmd = &cobra.Command{
Use: "embed",
Short: "Embed data files in crc binary",
Long: `Embed the OpenShift bundle and the binaries needed at runtime in the crc binary`,
Short: "Embed data files in crc executable",
Long: `Embed the OpenShift bundle and the binaries needed at runtime in the crc executable`,
Run: func(cmd *cobra.Command, args []string) {
runEmbed(args)
},
Expand Down
4 changes: 2 additions & 2 deletions cmd/crc-embedder/cmd/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func init() {

var extractCmd = &cobra.Command{
Use: "extract",
Short: "Extract data file embedded in the crc binary",
Long: `Extract a data file which is embedded in the crc binary`,
Short: "Extract data file embedded in the crc executable",
Long: `Extract a data file which is embedded in the crc executable`,
Run: func(cmd *cobra.Command, args []string) {
runExtract(args)
},
Expand Down
4 changes: 2 additions & 2 deletions cmd/crc-embedder/cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ func init() {

var listCmd = &cobra.Command{
Use: "list",
Short: "List data files embedded in the crc binary",
Long: `List all the data files which were embedded in the crc binary`,
Short: "List data files embedded in the crc executable",
Long: `List all the data files which were embedded in the crc executable`,
Run: func(cmd *cobra.Command, args []string) {
runList(args)
},
Expand Down
2 changes: 1 addition & 1 deletion cmd/crc-embedder/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var rootCmd = &cobra.Command{
Use: "crc-embedder [list|embed|extract]",
Short: "Build helper for crc for binary embedding",
Long: `crc-embedder is a command line utility for listing or appending binary data
when building the crc binary for release`,
when building the crc executable for release`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
runPrerun()
},
Expand Down
4 changes: 2 additions & 2 deletions cmd/crc/cmd/oc_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ var (

var ocEnvCmd = &cobra.Command{
Use: "oc-env",
Short: "Add the 'oc' binary to PATH",
Long: `Add the OpenShift client binary 'oc' to PATH`,
Short: "Add the 'oc' executable to PATH",
Long: `Add the OpenShift client executable 'oc' to PATH`,
Run: func(cmd *cobra.Command, args []string) {
if err := runOcEnv(args); err != nil {
exit.WithMessage(1, err.Error())
Expand Down
2 changes: 1 addition & 1 deletion cmd/crc/cmd/podman_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
var podmanEnvCmd = &cobra.Command{
Use: "podman-env",
Short: "Setup podman environment",
Long: `Setup environment for 'podman' binary to access podman on CRC VM`,
Long: `Setup environment for 'podman' executable to access podman on CRC VM`,
Run: func(cmd *cobra.Command, args []string) {
if err := runPodmanEnv(args); err != nil {
exit.WithMessage(1, err.Error())
Expand Down
2 changes: 1 addition & 1 deletion cmd/crc/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ func (v *version) lines() []string {
}
return []string{
fmt.Sprintf("CodeReady Containers version: %s+%s\n", v.Version, v.Commit),
fmt.Sprintf("OpenShift version: %s (%sembedded in binary)\n", v.OpenshiftVersion, embedded),
fmt.Sprintf("OpenShift version: %s (%sembedded in executable)\n", v.OpenshiftVersion, embedded),
}
}
2 changes: 1 addition & 1 deletion cmd/crc/cmd/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestPlainVersion(t *testing.T) {
Embedded: false,
}, ""))
assert.Equal(t, `CodeReady Containers version: 1.13+aabbcc
OpenShift version: 4.5.4 (not embedded in binary)
OpenShift version: 4.5.4 (not embedded in executable)
`, out.String())
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/crc/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (c *Cache) CacheBinary() error {
} else {
extractedFiles = append(extractedFiles, assetTmpFile)
if filepath.Base(assetTmpFile) != c.binaryName {
logging.Warnf("Binary name is %s but extracted file name is %s", c.binaryName, filepath.Base(assetTmpFile))
logging.Warnf("Executable name is %s but extracted file name is %s", c.binaryName, filepath.Base(assetTmpFile))
}
}

Expand All @@ -148,7 +148,7 @@ func (c *Cache) CacheBinary() error {
}

func (c *Cache) getBinary(destDir string) (string, error) {
logging.Debugf("Trying to extract %s from crc binary", c.binaryName)
logging.Debugf("Trying to extract %s from crc executable", c.binaryName)
archiveName := filepath.Base(c.archiveURL)
destPath := filepath.Join(destDir, archiveName)
err := embed.Extract(archiveName, destPath)
Expand Down
34 changes: 17 additions & 17 deletions pkg/crc/preflight/preflight_checks_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,30 @@ import (
var genericPreflightChecks = [...]Check{
{
configKeySuffix: "check-oc-cached",
checkDescription: "Checking if oc binary is cached",
checkDescription: "Checking if oc executable is cached",
check: checkOcBinaryCached,
fixDescription: "Caching oc binary",
fixDescription: "Caching oc executable",
fix: fixOcBinaryCached,
},
{
configKeySuffix: "check-podman-cached",
checkDescription: "Checking if podman remote binary is cached",
checkDescription: "Checking if podman remote executable is cached",
check: checkPodmanBinaryCached,
fixDescription: "Caching podman remote binary",
fixDescription: "Caching podman remote executable",
fix: fixPodmanBinaryCached,
},
{
configKeySuffix: "check-goodhosts-cached",
checkDescription: "Checking if goodhosts binary is cached",
checkDescription: "Checking if goodhosts executable is cached",
check: checkGoodhostsBinaryCached,
fixDescription: "Caching goodhosts binary",
fixDescription: "Caching goodhosts executable",
fix: fixGoodhostsBinaryCached,
},
{
configKeySuffix: "check-bundle-cached",
checkDescription: "Checking if CRC bundle is cached in '$HOME/.crc'",
check: checkBundleCached,
fixDescription: "Unpacking bundle from the CRC binary",
fixDescription: "Unpacking bundle from the CRC executable",
fix: fixBundleCached,
flags: SetupOnly,
},
Expand Down Expand Up @@ -81,7 +81,7 @@ func fixBundleCached() error {

return embed.Extract(filepath.Base(constants.DefaultBundlePath), constants.DefaultBundlePath)
}
return fmt.Errorf("CRC bundle is not embedded in the binary")
return fmt.Errorf("CRC bundle is not embedded in the executable")
}

// Check if oc binary is cached or not
Expand All @@ -92,12 +92,12 @@ func checkOcBinaryCached() error {

oc := cache.NewOcCache()
if !oc.IsCached() {
return errors.New("oc binary is not cached")
return errors.New("oc executable is not cached")
}
if err := oc.CheckVersion(); err != nil {
return err
}
logging.Debug("oc binary already cached")
logging.Debug("oc executable already cached")
return nil
}

Expand All @@ -106,7 +106,7 @@ func fixOcBinaryCached() error {
if err := oc.EnsureIsCached(); err != nil {
return fmt.Errorf("Unable to download oc %v", err)
}
logging.Debug("oc binary cached")
logging.Debug("oc executable cached")
return nil
}

Expand All @@ -120,27 +120,27 @@ func checkPodmanBinaryCached() error {
func fixPodmanBinaryCached() error {
podman := cache.NewPodmanCache()
if err := podman.EnsureIsCached(); err != nil {
return fmt.Errorf("Unable to download podman remote binary %v", err)
return fmt.Errorf("Unable to download podman remote executable %v", err)
}
logging.Debug("podman remote binary cached")
logging.Debug("podman remote executable cached")
return nil
}

// Check if goodhost binary is cached or not
func checkGoodhostsBinaryCached() error {
goodhost := cache.NewGoodhostsCache()
if !goodhost.IsCached() {
return errors.New("goodhost binary is not cached")
return errors.New("goodhost executable is not cached")
}
logging.Debug("goodhost binary already cached")
logging.Debug("goodhost executable already cached")
return checkSuid(goodhost.GetBinaryPath())
}

func fixGoodhostsBinaryCached() error {
goodhost := cache.NewGoodhostsCache()
if err := goodhost.EnsureIsCached(); err != nil {
return fmt.Errorf("Unable to download goodhost binary %v", err)
return fmt.Errorf("Unable to download goodhost executable %v", err)
}
logging.Debug("goodhost binary cached")
logging.Debug("goodhost executable cached")
return setSuid(goodhost.GetBinaryPath())
}
4 changes: 2 additions & 2 deletions pkg/crc/preflight/preflight_checks_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
func checkHyperKitInstalled() error {
h := cache.NewHyperKitCache()
if !h.IsCached() {
return fmt.Errorf("%s binary is not cached", h.GetBinaryName())
return fmt.Errorf("%s executable is not cached", h.GetBinaryName())
}
hyperkitPath := h.GetBinaryPath()
err := unix.Access(hyperkitPath, unix.X_OK)
Expand Down Expand Up @@ -49,7 +49,7 @@ func checkMachineDriverHyperKitInstalled() error {

logging.Debugf("Checking if %s is installed", hyperkitDriver.GetBinaryName())
if !hyperkitDriver.IsCached() {
return fmt.Errorf("%s binary is not cached", hyperkitDriver.GetBinaryName())
return fmt.Errorf("%s executable is not cached", hyperkitDriver.GetBinaryName())
}

if err := hyperkitDriver.CheckVersion(); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/crc/preflight/preflight_checks_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ func checkMachineDriverLibvirtInstalled() error {
logging.Debugf("Checking if %s is installed", machineDriverLibvirt.GetBinaryName())

if !machineDriverLibvirt.IsCached() {
return fmt.Errorf("%s binary is not cached", machineDriverLibvirt.GetBinaryName())
return fmt.Errorf("%s executable is not cached", machineDriverLibvirt.GetBinaryName())
}
if err := machineDriverLibvirt.CheckVersion(); err != nil {
return err
Expand All @@ -282,7 +282,7 @@ func checkOldMachineDriverLibvirtInstalled() error {
logging.Debugf("Checking if an older libvirt driver %s is installed", libvirt.MachineDriverCommand)
oldLibvirtDriverPath := filepath.Join("/usr/local/bin/", libvirt.MachineDriverCommand)
if _, err := os.Stat(oldLibvirtDriverPath); !os.IsNotExist(err) {
return fmt.Errorf("Found old system-wide crc-machine-driver binary")
return fmt.Errorf("Found old system-wide crc-machine-driver executable")
}
logging.Debugf("No older %s installation found", libvirt.MachineDriverCommand)

Expand Down
10 changes: 5 additions & 5 deletions pkg/crc/preflight/preflight_checks_tray_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func checkTrayVersion() error {
}

func fixTrayVersion() error {
logging.Debug("Downloading/extracting tray binary")
logging.Debug("Downloading/extracting tray executable")
// get the tray app
err := downloadOrExtractTrayApp()
if err != nil {
Expand All @@ -159,13 +159,13 @@ func fixTrayVersion() error {

func checkTrayBinaryPresent() error {
if !os.FileExists(constants.TrayBinaryPath) {
return fmt.Errorf("Tray binary does not exist")
return fmt.Errorf("Tray executable does not exist")
}
return nil
}

func fixTrayBinaryPresent() error {
logging.Debug("Downloading/extracting tray binary")
logging.Debug("Downloading/extracting tray executable")
return downloadOrExtractTrayApp()
}

Expand Down Expand Up @@ -194,10 +194,10 @@ func downloadOrExtractTrayApp() error {
_ = goos.RemoveAll(tmpArchivePath)
}()

logging.Debug("Trying to extract tray from crc binary")
logging.Debug("Trying to extract tray from crc executable")
err = embed.Extract(filepath.Base(constants.GetCRCMacTrayDownloadURL()), tmpArchivePath)
if err != nil {
logging.Debug("Could not extract tray from crc binary", err)
logging.Debug("Could not extract tray from crc executable", err)
logging.Debug("Downloading crc tray")
_, err = dl.Download(constants.GetCRCMacTrayDownloadURL(), tmpArchivePath, 0600)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions pkg/crc/preflight/preflight_checks_tray_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func checkTrayBinaryExists() error {
if os.FileExists(constants.TrayBinaryPath) {
return nil
}
return fmt.Errorf("Tray binary does not exists")
return fmt.Errorf("Tray executable does not exists")
}

func fixTrayBinaryExists() error {
Expand All @@ -162,10 +162,10 @@ func fixTrayBinaryExists() error {
_ = goos.RemoveAll(tmpArchivePath)
}()

logging.Debug("Trying to extract tray from crc binary")
logging.Debug("Trying to extract tray from crc executable")
err = embed.Extract(filepath.Base(constants.GetCRCWindowsTrayDownloadURL()), tmpArchivePath)
if err != nil {
logging.Debug("Could not extract tray from crc binary", err)
logging.Debug("Could not extract tray from crc executable", err)
logging.Debug("Downloading crc tray")
_, err = dl.Download(constants.GetCRCWindowsTrayDownloadURL(), tmpArchivePath, 0600)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/crc/preflight/preflight_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var dnsPreflightChecks = [...]Check{

var traySetupChecks = [...]Check{
{
checkDescription: "Checking if tray binary is installed",
checkDescription: "Checking if tray executable is installed",
check: checkTrayBinaryPresent,
fixDescription: "Installing and setting up tray",
fix: fixTrayBinaryPresent,
Expand Down
4 changes: 2 additions & 2 deletions pkg/crc/preflight/preflight_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ var hypervPreflightChecks = [...]Check{

var traySetupChecks = [...]Check{
{
checkDescription: "Checking if tray binary is present",
checkDescription: "Checking if tray executable is present",
check: checkTrayBinaryExists,
fixDescription: "Caching tray binary",
fixDescription: "Caching tray executable",
fix: fixTrayBinaryExists,
flags: SetupOnly,
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/crc/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func ValidateBundle(bundle string) error {
logging.Warnf("Using unsupported bundle %s", userProvidedBundleVersion)
return nil
}
return fmt.Errorf("%s bundle is not supported by this binary, please use %s", userProvidedBundleVersion, constants.GetDefaultBundle())
return fmt.Errorf("%s bundle is not supported by this crc executable, please use %s", userProvidedBundleVersion, constants.GetDefaultBundle())
}
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions test/integration/crcsuite/crcsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func FeatureContext(s *godog.Suite) {

// init CRCBinary if no location provided by user
if CRCBinary == "" {
fmt.Println("Expecting the CRC binary to be in $HOME/go/bin.")
fmt.Println("Expecting the CRC executable to be in $HOME/go/bin.")
usr, _ := user.Current()
CRCBinary = filepath.Join(usr.HomeDir, "go", "bin")
}
Expand All @@ -88,7 +88,7 @@ func FeatureContext(s *godog.Suite) {
}

if bundleURL == "embedded" {
fmt.Println("Expecting the bundle to be embedded in the CRC binary.")
fmt.Println("Expecting the bundle to be embedded in the CRC executable.")
bundleEmbedded = true
if bundleVersion == "" {
fmt.Println("User must specify --bundle-version if bundle is embedded")
Expand Down
2 changes: 1 addition & 1 deletion test/integration/crcsuite/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,6 @@ func ParseFlags() {

flag.StringVar(&bundleURL, "bundle-location", "embedded", "Path to the bundle to be used in tests")
flag.StringVar(&pullSecretFile, "pull-secret-file", "", "Path to the file containing pull secret")
flag.StringVar(&CRCBinary, "crc-binary", "", "Path to the CRC binary to be tested")
flag.StringVar(&CRCBinary, "crc-binary", "", "Path to the CRC executable to be tested")
flag.StringVar(&bundleVersion, "bundle-version", "", "Version of the bundle used in tests")
}
8 changes: 4 additions & 4 deletions test/integration/features/basic.feature
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Feature: Basic test
@linux
Scenario: CRC setup on Linux
When executing "crc setup" succeeds
Then stderr should contain "Caching oc binary"
Then stderr should contain "Caching oc executable"
And stderr should contain "Checking if CRC bundle is cached in '$HOME/.crc'"
And stderr should contain "Checking if running as non-root"
And stderr should contain "Checking if Virtualization is enabled"
Expand Down Expand Up @@ -67,7 +67,7 @@ Feature: Basic test
@darwin
Scenario: CRC setup on Mac
When executing "crc setup" succeeds
Then stderr should contain "Caching oc binary"
Then stderr should contain "Caching oc executable"
And stderr should contain "Checking if running as non-root"
And stderr should contain "Checking if HyperKit is installed"
And stderr should contain "Checking if crc-driver-hyperkit is installed"
Expand All @@ -79,8 +79,8 @@ Feature: Basic test
@windows
Scenario: CRC setup on Windows
When executing "crc setup" succeeds
Then stderr should contain "Caching oc binary"
Then stderr should contain "Unpacking bundle from the CRC binary" if bundle is embedded
Then stderr should contain "Caching oc executable"
Then stderr should contain "Unpacking bundle from the CRC executable" if bundle is embedded
Then stderr should contain "Checking Windows 10 release"
Then stderr should contain "Checking if Hyper-V is installed"
Then stderr should contain "Checking if user is a member of the Hyper-V Administrators group"
Expand Down

0 comments on commit 75d6aa7

Please sign in to comment.