// Convert_v1_RegistryLocation_To_config_RegistryLocation is an autogenerated conversion function.
355915
func Convert_v1_RegistryLocation_To_config_RegistryLocation(in *v1.RegistryLocation, out *config.RegistryLocation, s conversion.Scope) error {
	return autoConvert_v1_RegistryLocation_To_config_RegistryLocation(in, out, s)
}
784878
func Convert_config_ProviderConfiguration_To_v1_ProviderConfiguration(in *config.ProviderConfiguration, out *ProviderConfiguration, s conversion.Scope) error {
	return autoConvert_config_ProviderConfiguration_To_v1_ProviderConfiguration(in, out, s)
}
310923
func Convert_config_PolicyConfig_To_v1_PolicyConfig(in *config.PolicyConfig, out *v1.PolicyConfig, s conversion.Scope) error {
	return autoConvert_config_PolicyConfig_To_v1_PolicyConfig(in, out, s)
}
211816
func (_m *APIClient) RegistryLogin(ctx context.Context, auth types.AuthConfig) (registry.AuthenticateOKBody, error) {
	ret := _m.Called(ctx, auth)

	var r0 registry.AuthenticateOKBody
	if rf, ok := ret.Get(0).(func(context.Context, types.AuthConfig) registry.AuthenticateOKBody); ok {
		r0 = rf(ctx, auth)
	} else {
		r0 = ret.Get(0).(registry.AuthenticateOKBody)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, types.AuthConfig) error); ok {
		r1 = rf(ctx, auth)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
967169
func Convert_v1_MasterConfig_To_config_MasterConfig(in *v1.MasterConfig, out *config.MasterConfig, s conversion.Scope) error {
	return autoConvert_v1_MasterConfig_To_config_MasterConfig(in, out, s)
}
124067
func Registry() (c *RegistryController) {
	return &RegistryController{
		List:   registryList,
		Create: registryCreate,
		Delete: registryDelete,
		Update: registryUpdate,
	}
}
1156513
func Convert_v1_OpenIDIdentityProvider_To_config_OpenIDIdentityProvider(in *v1.OpenIDIdentityProvider, out *config.OpenIDIdentityProvider, s conversion.Scope) error {
	return autoConvert_v1_OpenIDIdentityProvider_To_config_OpenIDIdentityProvider(in, out, s)
}
1009476
func Convert_v1_AESConfiguration_To_config_AESConfiguration(in *AESConfiguration, out *config.AESConfiguration, s conversion.Scope) error {
	return autoConvert_v1_AESConfiguration_To_config_AESConfiguration(in, out, s)
}
739223
func Convert_v1_DeploymentConfigList_To_apps_DeploymentConfigList(in *v1.DeploymentConfigList, out *apps.DeploymentConfigList, s conversion.Scope) error {
	return autoConvert_v1_DeploymentConfigList_To_apps_DeploymentConfigList(in, out, s)
}
1350177
func Convert_config_SecurityAllocator_To_v1_SecurityAllocator(in *config.SecurityAllocator, out *v1.SecurityAllocator, s conversion.Scope) error {
	return autoConvert_config_SecurityAllocator_To_v1_SecurityAllocator(in, out, s)
}
1374604
func Convert_v1_ControllerConfig_To_config_ControllerConfig(in *v1.ControllerConfig, out *config.ControllerConfig, s conversion.Scope) error {
	return autoConvert_v1_ControllerConfig_To_config_ControllerConfig(in, out, s)
}
685903
func Convert_config_DNSConfig_To_v1_DNSConfig(in *config.DNSConfig, out *v1.DNSConfig, s conversion.Scope) error {
	return autoConvert_config_DNSConfig_To_v1_DNSConfig(in, out, s)
}
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"
}
1239173
func (c *Client) TerraformProviderLocation(provider *regsrc.TerraformProvider, version string) (*response.TerraformProviderPlatformLocation, error) {
	host, err := provider.SvcHost()
	if err != nil {
		return nil, err
	}

	service, err := c.Discover(host, providersServiceID)
	if err != nil {
		return nil, err
	}

	p, err := url.Parse(path.Join(
		provider.TerraformProvider(),
		version,
		"download",
		provider.OS,
		provider.Arch,
	))
	if err != nil {
		return nil, err
	}

	service = service.ResolveReference(p)

	log.Printf("[DEBUG] fetching provider location from %q", service)

	req, err := http.NewRequest("GET", service.String(), nil)
	if err != nil {
		return nil, err
	}

	c.addRequestCreds(host, req)
	req.Header.Set(xTerraformVersion, tfVersion)

	resp, err := c.client.Do(req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	var loc response.TerraformProviderPlatformLocation

	dec := json.NewDecoder(resp.Body)
	if err := dec.Decode(&loc); err != nil {
		return nil, err
	}

	switch resp.StatusCode {
	case http.StatusOK, http.StatusNoContent:
		// OK
	case http.StatusNotFound:
		return nil, fmt.Errorf("provider %q version %q not found", provider.TerraformProvider(), version)
	default:
		// anything else is an error:
		return nil, fmt.Errorf("error getting download location for %q: %s", provider.TerraformProvider(), resp.Status)
	}

	return &loc, nil
}
366618
func (r DockerImageReference) RegistryURL() *url.URL {
	return &url.URL{
		Scheme: "https",
		Host:   r.AsV2().Registry,
	}
}
1255935
func Convert_v1_TokenConfig_To_config_TokenConfig(in *v1.TokenConfig, out *config.TokenConfig, s conversion.Scope) error {
	return autoConvert_v1_TokenConfig_To_config_TokenConfig(in, out, s)
}
1227460
func Convert_core_RangeAllocation_To_v1_RangeAllocation(in *core.RangeAllocation, out *v1.RangeAllocation, s conversion.Scope) error {
	return autoConvert_core_RangeAllocation_To_v1_RangeAllocation(in, out, s)
}