// IsImageInLocalRegistry checks if the image exists in the fake local registry
963791
func (f *FakeDocker) IsImageInLocalRegistry(imageName string) (bool, error) {
	f.LocalRegistryImage = imageName
	return f.LocalRegistryResult, f.LocalRegistryError
}
872130
func (p *Peer) IsLocal() bool {
	hostname, err := os.Hostname()
	if err != nil {
		return false
	}

	name := strings.Split(p.Hostname, ".")[0]
	return name == hostname
}
406985
func (a *AuditBroker) IsLocal(name string) (bool, error) {
	a.RLock()
	defer a.RUnlock()
	be, ok := a.backends[name]
	if ok {
		return be.local, nil
	}
	return false, fmt.Errorf("unknown audit backend %q", name)
}
674436
func (t *Track) IsLocal() bool {
	local := C.sp_track_is_local(
		t.session.sp_session,
		t.sp_track,
	)
	return local == 1
}
930067
func IsImageFormat(name string) bool {
	_, err := getImageFormat(name)
	return err == nil
}
1094928
func IsBuiltinLocalDriver(networkType string) bool {
	if "l2bridge" == networkType || "l2tunnel" == networkType || "nat" == networkType || "ics" == networkType || "transparent" == networkType {
		return true
	}

	return false
}
1019682
func LocalRegister(id IdentityID, authServer *AuthServer, additionalPrincipals, dnsNames []string, remoteAddr string) (*Identity, error) {
	// If local registration is happening and no remote address was passed in
	// (which means no advertise IP was set), use localhost.
	if remoteAddr == "" {
		remoteAddr = defaults.Localhost
	}
	keys, err := authServer.GenerateServerKeys(GenerateServerKeysRequest{
		HostID:               id.HostUUID,
		NodeName:             id.NodeName,
		Roles:                teleport.Roles{id.Role},
		AdditionalPrincipals: additionalPrincipals,
		RemoteAddr:           remoteAddr,
		DNSNames:             dnsNames,
		NoCache:              true,
	})
	if err != nil {
		return nil, trace.Wrap(err)
	}

	identity, err := ReadIdentityFromKeyPair(keys)
	if err != nil {
		return nil, trace.Wrap(err)
	}

	return identity, nil
}
1187179
func (l *RegistryListener) ImagePath(image string) (string, error) {
	imageID, err := commons.ParseImageID(image)
	if err != nil {
		return "", err
	}
	rImage := &registry.Image{
		Library: imageID.User,
		Repo:    imageID.Repo,
		Tag:     imageID.Tag,
	}
	if imageID.IsLatest() {
		rImage.Tag = docker.Latest
	}
	return path.Join(l.address, rImage.String()), nil
}
331938
func (f *Facade) GetRegistryImage(ctx datastore.Context, image string) (*registry.Image, error) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.GetRegistryImage"))
	rImage, err := f.registryStore.Get(ctx, image)
	if err != nil {
		return nil, err
	}
	return rImage, nil
}
207888
func (r DockerImageReference) RegistryHostPort(insecure bool) (string, string) {
	registryHost := r.AsV2().DockerClientDefaults().Registry
	if strings.Contains(registryHost, ":") {
		hostname, port, _ := net.SplitHostPort(registryHost)
		return hostname, port
	}
	if insecure {
		return registryHost, "80"
	}
	return registryHost, "443"
}
1108943
func (f *FakeDocker) CheckImage(name string) (*api.Image, error) {
	return nil, nil
}
1182137
func (f *Facade) markLocalDockerRegistryUpgraded(version int) error {
	versionInfo := registryVersionInfos[version]
	markerFilePath := versionInfo.getUpgradedMarkerPath(f.isvcsPath)
	logger := plog.WithFields(logrus.Fields{
		"version":        version,
		"markerfilepath": markerFilePath,
	})
	if err := ioutil.WriteFile(markerFilePath, []byte{}, 0644); err != nil {
		logger.WithError(err).Debug("Could not write marker file")
		return err
	}
	return nil
}
1307548
func (f *FakeDocker) IsImageOnBuild(imageName string) bool {
	f.IsOnBuildImage = imageName
	return f.IsOnBuildResult
}
819669
func (bs *baseVCSSource) initLocal(ctx context.Context) error {
	err := bs.repo.get(ctx)

	if err != nil {
		return unwrapVcsErr(err)
	}
	return nil
}
209007
func (client *RegistryIndexClient) FindImage(image string) (*registry.Image, error) {
	image, err := client.parseImage(image)
	if err != nil {
		return nil, err
	}
	rImage, err := client.facade.GetRegistryImage(client.ctx, image)
	if datastore.IsErrNoSuchEntity(err) {
		return nil, ErrImageNotFound
	}
	return rImage, err
}
902782
func (s *CatAliasesService) Local(local bool) *CatAliasesService {
	s.local = &local
	return s
}
1190652
func (e *Engine) ImageLocalDigests(ctx context.Context, image string) ([]string, error) {
	inspect, _, err := e.client.ImageInspectWithRaw(ctx, image)
	if err != nil {
		return nil, err
	}
	return inspect.RepoDigests, nil
}