// ValidateExec checks that the specified values for the Task struct are correct for a cli exec task
502733
func (t *TaskAttributes) ValidateExec() error {
	if len(t.RunIf) == 0 {
		return errors.New("'run_if' must not be empty")
	}
	if t.Command == "" {
		return errors.New("'command' must not be empty")
	}
	if len(t.Arguments) == 0 {
		return errors.New("'arguments' must not be empty")
	}
	if t.WorkingDirectory == "" {
		return errors.New("'working_directory' must not empty")
	}

	return nil
}
1076741
func (db *DB) MustExecute(stmt Executable, args ...interface{}) sql.Result {
	s, params, err := db.compile(stmt)
	if err != nil {
		log.Panicf(
			"aspect: failed to compile (%s): %s",
			stmt,
			err,
		)
	}
	if len(args) == 0 {
		args = params.args
	}
	result, err := db.conn.Exec(s, args...)
	if err != nil {
		log.Panicf(
			"aspect: failed to exec (%s) with parameters (%v): %s",
			s,
			args,
			err,
		)
	}
	return result
}
819520
func validateSecretRefsSpec(spec api.TaskSpec) error {
	container := spec.GetContainer()
	if container == nil {
		return nil
	}

	// Keep a map to track all the targets that will be exposed
	// The string returned is only used for logging. It could as well be struct{}{}
	existingTargets := make(map[string]string)
	for _, secretRef := range container.Secrets {
		// SecretID and SecretName are mandatory, we have invalid references without them
		if secretRef.SecretID == "" || secretRef.SecretName == "" {
			return status.Errorf(codes.InvalidArgument, "malformed secret reference")
		}

		// Every secret reference requires a Target
		if secretRef.GetTarget() == nil {
			return status.Errorf(codes.InvalidArgument, "malformed secret reference, no target provided")
		}

		// If this is a file target, we will ensure filename uniqueness
		if secretRef.GetFile() != nil {
			fileName := secretRef.GetFile().Name
			if fileName == "" {
				return status.Errorf(codes.InvalidArgument, "malformed file secret reference, invalid target file name provided")
			}
			// If this target is already in use, we have conflicting targets
			if prevSecretName, ok := existingTargets[fileName]; ok {
				return status.Errorf(codes.InvalidArgument, "secret references '%s' and '%s' have a conflicting target: '%s'", prevSecretName, secretRef.SecretName, fileName)
			}

			existingTargets[fileName] = secretRef.SecretName
		}
	}

	return nil
}
825346
func (e *UnionScanExec) Exec() *flow.Dataset {
	d := e.Src.Exec()

	ret := d

	return ret
}
930865
func (e *UniversalExecutor) Exec(deadline time.Time, name string, args []string) ([]byte, int, error) {
	ctx, cancel := context.WithDeadline(context.Background(), deadline)
	defer cancel()
	return ExecScript(ctx, e.childCmd.Dir, e.commandCfg.Env, e.childCmd.SysProcAttr, name, args)
}
816258
func (c *CrateDriver) Exec(stmt string, args []driver.Value) (result driver.Result, err error) {
	res, err := c.query(stmt, args)

	if err != nil {
		return nil, err
	}

	result = &Result{res.Rowcount}

	return result, nil
}
759844
func (c Conf) Validate(renderer shell.Renderer) error {
	if c.Desc == "" {
		return errors.New("missing Desc")
	}

	// Check the Exec* fields.
	if c.ExecStart == "" {
		return errors.New("missing ExecStart")
	}

	for field, cmd := range map[string]string{
		"ExecStart":    c.ExecStart,
		"ExecStopPost": c.ExecStopPost,
	} {
		if cmd == "" {
			continue
		}
		if err := c.checkExec(field, cmd, renderer); err != nil {
			return errors.Trace(err)
		}
	}

	for _, value := range c.Limit {
		switch value {
		case "unlimited", "infinity":
		default:
			_, err := strconv.Atoi(value)
			if err != nil {
				newErr := errors.NotValidf("limit must be \"infinity\", \"unlimited\", or an integer, %q", value)
				return errors.Wrap(err, newErr)
			}
		}
	}

	return nil
}
938792
func Exec(name string, args []string, timeout time.Duration, log Log) (Result, error) {
	return execWithFunc(name, args, nil, exec.Command, timeout, log)
}
1211744
func (p *Init) exec(ctx context.Context, path string, r *ExecConfig) (proc.Process, error) {
	// process exec request
	var spec specs.Process
	if err := json.Unmarshal(r.Spec.Value, &spec); err != nil {
		return nil, err
	}
	spec.Terminal = r.Terminal

	e := &execProcess{
		id:     r.ID,
		path:   path,
		parent: p,
		spec:   spec,
		stdio: proc.Stdio{
			Stdin:    r.Stdin,
			Stdout:   r.Stdout,
			Stderr:   r.Stderr,
			Terminal: r.Terminal,
		},
		waitBlock: make(chan struct{}),
		pid:       &safePid{},
	}
	e.execState = &execCreatedState{p: e}
	return e, nil
}
48532
func (c *Pipeline) Exec() ([]Cmder, error) {
	c.mu.Lock()
	defer c.mu.Unlock()

	if c.closed {
		return nil, pool.ErrClosed
	}

	if len(c.cmds) == 0 {
		return nil, nil
	}

	cmds := c.cmds
	c.cmds = nil

	return cmds, c.exec(cmds)
}
226862
func (q *Queryx) Exec() error {
	if q.err != nil {
		return q.err
	}
	return q.Query.Exec()
}
663245
func (tx *TX) MustExecute(stmt Executable, args ...interface{}) sql.Result {
	s, params, err := tx.compile(stmt)
	if err != nil {
		log.Panicf(
			"aspect: failed to compile (%s): %s",
			stmt,
			err,
		)
	}
	if len(args) == 0 {
		args = params.args
	}
	result, err := tx.Exec(s, args...)
	if err != nil {
		log.Panicf(
			"aspect: failed to exec (%s) with parameters (%v): %s",
			s,
			args,
			err,
		)
	}
	return result
}
1306528
func (tx *Tx) Exec(query interface{}, args ...interface{}) (sql.Result, error) {
	return tx.ExecContext(tx.Context(), query, args...)
}
70654
func (t *Template) Exec(name string, context ...interface{}) (string, error) {
	ctx := t.defaultCtx
	if len(context) == 1 {
		ctx = context[0]
	}
	tmpl := t.root.Lookup(name)
	if tmpl == nil {
		return "", errors.Errorf(`template "%s" not defined`, name)
	}
	return render(tmpl, ctx)
}
1252208
func (n *Node) Exec(ctx context.Context, q Query) (err error) {
	if n.Closed() {
		return ErrInvalidNode
	}

	return n.pool.Exec(ctx, q)
}
660459
func (s *Stmt) MustExec(args ...interface{}) sql.Result {
	return MustExec(&qStmt{s}, "", args...)
}
1373561
func SimpleExec(name string, args ...string) (string, error) {
	Trace(name, args...)
	return Output(ExecCommand(name, args...))
}