func printWarningIfLikelyHasMistake()

in gce-containers-startup/runtime/runtime.go [359:382]


func printWarningIfLikelyHasMistake(command []string, args []string) {
	var commandAndArgs []string
	if command != nil {
		commandAndArgs = append(commandAndArgs, command...)
	}
	if args != nil {
		commandAndArgs = append(commandAndArgs, args...)
	}
	if len(commandAndArgs) == 1 && containsWhitespace(commandAndArgs[0]) {
		fields := strings.Fields(commandAndArgs[0])
		if len(fields) > 1 {
			log.Printf("Warning: executable \"%s\" contains whitespace, which is "+
				"likely not what you intended. If your intention was to provide "+
				"arguments to \"%s\" and you are using gcloud, use the "+
				"\"--container-arg\" option. If you are using Google Cloud Console, "+
				"specify the arguments separately under \"Command and arguments\" in "+
				"\"Advanced container options\".", commandAndArgs[0], fields[0])
		} else {
			log.Printf("Warning: executable \"%s\" contains whitespace, which is "+
				"likely not what you intended. Maybe you accidentally left "+
				"leading/trailing whitespace?", commandAndArgs[0])
		}
	}
}