// InitACMEProvider create an acme provider from the ACME part of globalConfiguration
514168
func (c *Configuration) InitACMEProvider() (*acmeprovider.Provider, error) {
	if c.ACME != nil {
		if len(c.ACME.Storage) == 0 {
			return nil, errors.New("unable to initialize ACME provider with no storage location for the certificates")
		}
		return &acmeprovider.Provider{
			Configuration: c.ACME,
		}, nil
	}
	return nil, nil
}
500070
func (m *MockImplementor) ACLProvider() aclprovider.IptablesProvider {
	ret := m.ctrl.Call(m, "ACLProvider")
	ret0, _ := ret[0].(aclprovider.IptablesProvider)
	return ret0
}
1294073
func SchemaDBStoreProvider(s *schema.Schema) schema.Source {
	schemaDb := NewSchemaDb(s)
	s.InfoSchema.DS = schemaDb
	return schemaDb
}
441097
func (d *DenyExec) ValidateInitialization() error {
	if d.client == nil {
		return fmt.Errorf("missing client")
	}
	return nil
}
1113403
func (c *constraint) ValidateInitialization() error {
	if c.sccLister == nil {
		return fmt.Errorf("%s requires an sccLister", PluginName)
	}
	if c.client == nil {
		return fmt.Errorf("%s requires a client", PluginName)
	}
	if c.authorizer == nil {
		return fmt.Errorf("%s requires an authorizer", PluginName)
	}
	return nil
}
1346516
func (p *Plugin) InitSpec(execRoot string) (*specs.Spec, error) {
	return nil, errors.New("not supported")
}
812744
func (k *kubernetesClient) ConstraintsValidator(ctx context.ProviderCallContext) (constraints.Validator, error) {
	validator := constraints.NewValidator()
	validator.RegisterUnsupported(unsupportedConstraints)
	return validator, nil
}
953141
func (mr *MockRemoteIntfMockRecorder) InitEnforcer(req, resp interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitEnforcer", reflect.TypeOf((*MockRemoteIntf)(nil).InitEnforcer), req, resp)
}
220166
func RegisterAuthenticateeProvider(name string, auth Authenticatee) (err error) {
	providerLock.Lock()
	defer providerLock.Unlock()

	if _, found := authenticateeProviders[name]; found {
		err = fmt.Errorf("authentication provider already registered: %v", name)
	} else {
		authenticateeProviders[name] = auth
		log.V(1).Infof("registered authentication provider: %v", name)
	}
	return
}
1076735
func (env *maasEnviron) ConstraintsValidator(ctx context.ProviderCallContext) (constraints.Validator, error) {
	validator := constraints.NewValidator()
	validator.RegisterUnsupported(unsupportedConstraints)
	supportedArches, err := env.getSupportedArchitectures(ctx)
	if err != nil {
		return nil, err
	}
	validator.RegisterVocabulary(constraints.Arch, supportedArches)
	return validator, nil
}
132188
func NewAutoProvider(constructor interface{}) Provider {
	fnValue := reflect.ValueOf(constructor)
	if fnValue.Kind() != reflect.Func {
		panic("constructor is not a function")
	}

	fnType := reflect.TypeOf(constructor)
	if fnType.NumOut() != 1 {
		panic("constructor must have exactly 1 return value")
	}

	return autoProvider{
		constructor: constructor,
	}
}
1157469
func NewOrdererProvider(capabilities map[string]*cb.Capability) *OrdererProvider {
	cp := &OrdererProvider{}
	cp.registry = newRegistry(cp, capabilities)
	_, cp.v11BugFixes = capabilities[OrdererV1_1]
	_, cp.kafka2RaftMig = capabilities[OrdererV2_0]
	return cp
}
267644
func (plugin *PodSecurityPolicyPlugin) ValidateInitialization() error {
	if plugin.authz == nil {
		return fmt.Errorf("%s requires an authorizer", PluginName)
	}
	if plugin.lister == nil {
		return fmt.Errorf("%s requires a lister", PluginName)
	}
	return nil
}
888541
func (m *ManagerImpl) callPreStartContainerIfNeeded(podUID, contName, resource string) error {
	m.mutex.Lock()
	eI, ok := m.endpoints[resource]
	if !ok {
		m.mutex.Unlock()
		return fmt.Errorf("endpoint not found in cache for a registered resource: %s", resource)
	}

	if eI.opts == nil || !eI.opts.PreStartRequired {
		m.mutex.Unlock()
		klog.V(4).Infof("Plugin options indicate to skip PreStartContainer for resource: %s", resource)
		return nil
	}

	devices := m.podDevices.containerDevices(podUID, contName, resource)
	if devices == nil {
		m.mutex.Unlock()
		return fmt.Errorf("no devices found allocated in local cache for pod %s, container %s, resource %s", podUID, contName, resource)
	}

	m.mutex.Unlock()
	devs := devices.UnsortedList()
	klog.V(4).Infof("Issuing an PreStartContainer call for container, %s, of pod %s", contName, podUID)
	_, err := eI.e.preStartContainer(devs)
	if err != nil {
		return fmt.Errorf("device plugin PreStartContainer rpc failed with err: %v", err)
	}
	// TODO: Add metrics support for init RPC
	return nil
}
660197
func (bc *BuildController) createBuildCAConfigMapSpec(build *buildv1.Build, buildPod *corev1.Pod) *corev1.ConfigMap {
	// Create a ConfigMap with the `inject-cabundle` annotation, which tells the service cert signing controller
	// to add the service-ca.crt entry to this map.
	// See https://github.com/openshift/service-serving-cert-signer
	cm := &corev1.ConfigMap{
		ObjectMeta: metav1.ObjectMeta{
			Name: buildapihelpers.GetBuildCAConfigMapName(build),
			OwnerReferences: []metav1.OwnerReference{
				makeBuildPodOwnerRef(buildPod),
			},
			Annotations: map[string]string{
				"service.alpha.openshift.io/inject-cabundle": "true",
			},
		},
		Data: bc.additionalTrustedCAData,
	}

	if cm.Data == nil {
		cm.Data = make(map[string]string)
	}

	return cm
}
767393
func (ec *Envcfg) diskCertProvider(params []string) CertificateProvider {
	// "certname:keyname"
	if len(params) < 2 {
		panic("invalid certificate provider params")
	}

	dir := ec.CertPath()
	certPath, keyPath := filepath.Join(dir, params[0]), filepath.Join(dir, params[1])
	dcp, err := newDiskCertProvider(certPath, keyPath, ec.logf, ec.errf)
	if err != nil {
		panic(fmt.Sprintf("unable to load certificate and key from disk: %v", err))
	}

	return dcp
}
1163457
func (p *Provider) Init() error {

	ctx := log.With(context.Background(), log.Str(log.ProviderName, "acme"))
	logger := log.FromContext(ctx)

	if p.ACMELogging {
		legolog.Logger = fmtlog.New(logger.WriterLevel(logrus.InfoLevel), "legolog: ", 0)
	} else {
		legolog.Logger = fmtlog.New(ioutil.Discard, "", 0)
	}

	if len(p.Configuration.Storage) == 0 {
		return errors.New("unable to initialize ACME provider with no storage location for the certificates")
	}
	p.Store = NewLocalStore(p.Configuration.Storage)

	var err error
	p.account, err = p.Store.GetAccount()
	if err != nil {
		return fmt.Errorf("unable to get ACME account : %v", err)
	}

	// Reset Account if caServer changed, thus registration URI can be updated
	if p.account != nil && p.account.Registration != nil && !isAccountMatchingCaServer(ctx, p.account.Registration.URI, p.CAServer) {
		logger.Info("Account URI does not match the current CAServer. The account will be reset.")
		p.account = nil
	}

	p.certificates, err = p.Store.GetCertificates()
	if err != nil {
		return fmt.Errorf("unable to get ACME certificates : %v", err)
	}

	// Init the currently resolved domain map
	p.resolvingDomains = make(map[string]struct{})

	return nil
}