// OverrideRemotes takes a signing configuration and updates the remote server object
// to the hostname:port combination sent by remote
433221
func (p *Signing) OverrideRemotes(remote string) error {
	if remote != "" {
		var err error
		for _, profile := range p.Profiles {
			err = profile.updateRemote(remote)
			if err != nil {
				return err
			}
		}
		err = p.Default.updateRemote(remote)
		if err != nil {
			return err
		}
	}
	return nil
}
231803
func (s *State) OverrideValidator(so StateValidator) States {
	s.vo.Lock()
	s.optionalValidator = so
	s.vo.Unlock()
	return s
}
1059240
func RecommendedAuthOverrideFlags(prefix string) AuthOverrideFlags {
	return AuthOverrideFlags{
		ClientCertificate: FlagInfo{prefix + FlagCertFile, "", "", "Path to a client certificate file for TLS."},
		ClientKey:         FlagInfo{prefix + FlagKeyFile, "", "", "Path to a client key file for TLS."},
		Token:             FlagInfo{prefix + FlagBearerToken, "", "", "Bearer token for authentication to the API server."},
		Username:          FlagInfo{prefix + FlagUsername, "", "", "Username for basic authentication to the API server."},
		Password:          FlagInfo{prefix + FlagPassword, "", "", "Password for basic authentication to the API server."},
	}
}
88935
func (s *BuildArtifacts) SetOverrideArtifactName(v bool) *BuildArtifacts {
	s.OverrideArtifactName = &v
	return s
}
922600
func OverrideHosts(template *x509.Certificate, hosts []string) {
	if hosts != nil {
		template.IPAddresses = []net.IP{}
		template.EmailAddresses = []string{}
		template.DNSNames = []string{}
		template.URIs = []*url.URL{}
	}

	for i := range hosts {
		if ip := net.ParseIP(hosts[i]); ip != nil {
			template.IPAddresses = append(template.IPAddresses, ip)
		} else if email, err := mail.ParseAddress(hosts[i]); err == nil && email != nil {
			template.EmailAddresses = append(template.EmailAddresses, email.Address)
		} else if uri, err := url.ParseRequestURI(hosts[i]); err == nil && uri != nil {
			template.URIs = append(template.URIs, uri)
		} else {
			template.DNSNames = append(template.DNSNames, hosts[i])
		}
	}

}
1276930
func CreateRemote(host, remote, appID string) error {
	cmd := exec.Command("git", "remote", "add", remote, RemoteURL(host, appID))
	stderr, err := cmd.StderrPipe()

	if err != nil {
		return err
	}

	if err = cmd.Start(); err != nil {
		return err
	}

	output, _ := ioutil.ReadAll(stderr)
	fmt.Print(string(output))

	if err := cmd.Wait(); err != nil {
		return err
	}

	fmt.Printf("Git remote %s added\n", remote)

	return nil
}
605055
func (repo *Repository) RemoveRemote(name string) error {
	_, err := NewCommand("remote", "remove", name).RunInDir(repo.Path)
	return err
}
1338384
func (g *Git) AddRemote(ctx context.Context, remote, url string) error {
	return g.Cmd(ctx, "gitAddRemote", "remote", "add", remote, url)
}
19289
func (p *Signing) SetRemoteCAs(remoteCAs *x509.CertPool) {
	for _, profile := range p.Profiles {
		profile.RemoteCAs = remoteCAs
	}
	p.Default.RemoteCAs = remoteCAs
}
1164366
func Convert_v1_ClientConnectionOverrides_To_config_ClientConnectionOverrides(in *v1.ClientConnectionOverrides, out *config.ClientConnectionOverrides, s conversion.Scope) error {
	return autoConvert_v1_ClientConnectionOverrides_To_config_ClientConnectionOverrides(in, out, s)
}
1345244
func (s *DescribeSigningJobOutput) SetOverrides(v *SigningPlatformOverrides) *DescribeSigningJobOutput {
	s.Overrides = v
	return s
}
1250620
func (s *ErrorRootCauseEntity) SetRemote(v bool) *ErrorRootCauseEntity {
	s.Remote = &v
	return s
}
155558
func (c *MutableTLSCreds) OverrideServerName(name string) error {
	c.Lock()
	c.config.ServerName = name
	c.Unlock()
	return nil
}
399746
func (b BuildOverrides) ApplyOverrides(pod *corev1.Pod) error {
	if b.Config == nil {
		return nil
	}

	build, err := common.GetBuildFromPod(pod)
	if err != nil {
		return err
	}

	klog.V(4).Infof("Applying overrides to build %s/%s", build.Namespace, build.Name)

	if b.Config.ForcePull {
		if build.Spec.Strategy.DockerStrategy != nil {
			klog.V(5).Infof("Setting docker strategy ForcePull to true in build %s/%s", build.Namespace, build.Name)
			build.Spec.Strategy.DockerStrategy.ForcePull = true
		}
		if build.Spec.Strategy.SourceStrategy != nil {
			klog.V(5).Infof("Setting source strategy ForcePull to true in build %s/%s", build.Namespace, build.Name)
			build.Spec.Strategy.SourceStrategy.ForcePull = true
		}
		if build.Spec.Strategy.CustomStrategy != nil {
			err := applyForcePullToPod(pod)
			if err != nil {
				return err
			}
			klog.V(5).Infof("Setting custom strategy ForcePull to true in build %s/%s", build.Namespace, build.Name)
			build.Spec.Strategy.CustomStrategy.ForcePull = true
		}
	}

	// Apply label overrides
	for _, lbl := range b.Config.ImageLabels {
		externalLabel := buildv1.ImageLabel{
			Name:  lbl.Name,
			Value: lbl.Value,
		}
		klog.V(5).Infof("Overriding image label %s=%s in build %s/%s", lbl.Name, lbl.Value, build.Namespace, build.Name)
		overrideLabel(externalLabel, &build.Spec.Output.ImageLabels)
	}

	if len(b.Config.NodeSelector) != 0 && pod.Spec.NodeSelector == nil {
		pod.Spec.NodeSelector = map[string]string{}
	}
	for k, v := range b.Config.NodeSelector {
		klog.V(5).Infof("Adding override nodeselector %s=%s to build pod %s/%s", k, v, pod.Namespace, pod.Name)
		pod.Spec.NodeSelector[k] = v
	}

	if len(b.Config.Annotations) != 0 && pod.Annotations == nil {
		pod.Annotations = map[string]string{}
	}
	for k, v := range b.Config.Annotations {
		klog.V(5).Infof("Adding override annotation %s=%s to build pod %s/%s", k, v, pod.Namespace, pod.Name)
		pod.Annotations[k] = v
	}

	// Override Tolerations
	if len(b.Config.Tolerations) != 0 {
		klog.V(5).Infof("Overriding tolerations for pod %s/%s", pod.Namespace, pod.Name)
		pod.Spec.Tolerations = []corev1.Toleration{}
		for _, toleration := range b.Config.Tolerations {
			t := corev1.Toleration{}
			if err := legacyscheme.Scheme.Convert(&toleration, &t, nil); err != nil {
				err := fmt.Errorf("unable to convert core.Toleration to corev1.Toleration: %v", err)
				utilruntime.HandleError(err)
				return err
			}
			pod.Spec.Tolerations = append(pod.Spec.Tolerations, t)
		}
	}

	return common.SetBuildInPod(pod, build)
}
320467
func (c *Security) SetOverrideCertificateErrorsWithParams(v *SecuritySetOverrideCertificateErrorsParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Security.setOverrideCertificateErrors", Params: v})
}
900737
func (s *PutSigningProfileInput) SetOverrides(v *SigningPlatformOverrides) *PutSigningProfileInput {
	s.Overrides = v
	return s
}
1085087
func (rp remotePeer) AsRemotePeer() *comm.RemotePeer {
	return &comm.RemotePeer{
		PKIID:    common.PKIidType(rp.pkiID),
		Endpoint: rp.endpoint,
	}
}