// Exists determines if the current build supports incremental workflow.
// It checks if the previous image exists in the system and if so, then it
// verifies that the save-artifacts script is present.
10133
func (builder *STI) Exists(config *api.Config) bool {
	if !config.Incremental {
		return false
	}

	policy := config.PreviousImagePullPolicy
	if len(policy) == 0 {
		policy = api.DefaultPreviousImagePullPolicy
	}

	tag := util.FirstNonEmpty(config.IncrementalFromTag, config.Tag)

	startTime := time.Now()
	result, err := dockerpkg.PullImage(tag, builder.incrementalDocker, policy)
	builder.result.BuildInfo.Stages = api.RecordStageAndStepInfo(builder.result.BuildInfo.Stages, api.StagePullImages, api.StepPullPreviousImage, startTime, time.Now())

	if err != nil {
		builder.result.BuildInfo.FailureReason = utilstatus.NewFailureReason(
			utilstatus.ReasonPullPreviousImageFailed,
			utilstatus.ReasonMessagePullPreviousImageFailed,
		)
		glog.V(2).Infof("Unable to pull previously built image %q: %v", tag, err)
		return false
	}

	return result.Image != nil && builder.installedScripts[constants.SaveArtifacts]
}
337826
func (c *ZkConn) Exists(ctx context.Context, path string) (exists bool, stat *zk.Stat, err error) {
	err = c.withRetry(ctx, func(conn *zk.Conn) error {
		exists, stat, err = conn.Exists(path)
		return err
	})
	return
}
708174
func (s *Store) Exists(ctx context.Context, name string) bool {
	out.Debug(ctx, "consul.Exists(%s)", name)
	v, err := s.Get(ctx, name)
	if err == nil && v != nil {
		return true
	}
	return false
}
1231156
func Exists(execer exec.Interface) bool {
	_, err := execer.LookPath("conntrack")
	return err == nil
}
754998
func (s *StoreToPodLister) Exists(pod *api.Pod) (bool, error) {
	_, exists, err := s.Store.Get(pod)
	if err != nil {
		return false, err
	}
	return exists, nil
}
81025
func (c *Client) Exists(path string) (bool, error) {
	if strings.HasPrefix(path, "s3://") {
		s3Conn, err := s3ConnectionInformation(path, c.Region)
		if err != nil {
			return false, err
		}
		return existsS3(s3Conn)
	}
	return existsLocal(path)
}
981731
func Exists(table Table, chain string, rule ...string) bool {
	return exists(false, table, chain, rule...)
}
812770
func (l *OSFileSystemLoader) Exists(name string) (string, bool) {
	for i := 0; i < len(l.dirs); i++ {
		fileName := path.Join(l.dirs[i], name)
		if _, err := os.Stat(fileName); err == nil {
			return fileName, true
		}
	}
	return "", false
}
997928
func Exists(path string, fs afero.Fs) (bool, error) {
	return afero.Exists(fs, path)
}
491058
func Exists(path string) (bool, error) {
	path, err := filepath.Abs(filepath.Join(path, keysBoltFile))
	if err != nil {
		return false, trace.Wrap(err)
	}
	f, err := os.Open(path)
	err = trace.ConvertSystemError(err)
	if err != nil {
		if trace.IsNotFound(err) {
			return false, nil
		}
		return false, trace.Wrap(err)
	}
	defer f.Close()
	return true, nil
}
1176871
func (self *CachingBackend) Exists(collection string, id interface{}) bool {
	return self.backend.Exists(collection, id)
}
430109
func Exists(t TestReporter, path string) bool {
	exists, err := afero.Exists(appFs, path)
	if err != nil {
		t.Error("Something went wrong when checking if "+path+"exists!", err)
	}
	return exists
}
629440
func (s *StoreToJobLister) Exists(job *extensions.Job) (bool, error) {
	_, exists, err := s.Store.Get(job)
	if err != nil {
		return false, err
	}
	return exists, nil
}
114404
func (c *Client) Exists(key string) (bool, error) {
	v, err := c.execWithKey(true, "EXISTS", key)
	if err != nil {
		return false, err
	}
	return iface2bool(v)
}
1270336
func (self *Model) Exists(id interface{}) bool {
	return self.db.Exists(self.collection.Name, id)
}
1202312
func (d *StateDir) Exists() bool {
	_, err := os.Stat(d.path)
	return err == nil
}
515110
func (c *Conf) Exist() bool {
	_, err := os.Stat(c.Path())
	return (err == nil)
}