Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for loadConfig (0.23 sec)

  1. src/sync/atomic/example_test.go

    	var config atomic.Value // holds current server configuration
    	// Create initial config value and store into config.
    	config.Store(loadConfig())
    	go func() {
    		// Reload config every 10 seconds
    		// and update config value with the new version.
    		for {
    			time.Sleep(10 * time.Second)
    			config.Store(loadConfig())
    		}
    	}()
    	// Create worker goroutines that handle incoming requests
    	// using the latest config value.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 18 23:58:54 UTC 2018
    - 2.2K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/config/kubeconfig.go

    )
    
    func init() {
    	utilruntime.Must(webhookadmission.AddToScheme(scheme))
    	utilruntime.Must(v1.AddToScheme(scheme))
    	utilruntime.Must(v1alpha1.AddToScheme(scheme))
    }
    
    // LoadConfig extract the KubeConfigFile from configFile
    func LoadConfig(configFile io.Reader) (string, error) {
    	var kubeconfigFile string
    	if configFile != nil {
    		// we have a config so parse it.
    		data, err := io.ReadAll(configFile)
    		if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jun 29 15:48:39 UTC 2023
    - 2K bytes
    - Viewed (0)
  3. cmd/kube-scheduler/app/options/configfile.go

    func LoadConfigFromFile(logger klog.Logger, file string) (*config.KubeSchedulerConfiguration, error) {
    	data, err := os.ReadFile(file)
    	if err != nil {
    		return nil, err
    	}
    
    	return loadConfig(logger, data)
    }
    
    func loadConfig(logger klog.Logger, data []byte) (*config.KubeSchedulerConfiguration, error) {
    	// The UniversalDecoder runs defaulting and returns the internal type by default.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Aug 17 05:27:21 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/config/kubeconfig_test.go

    apiVersion: apiserver.config.k8s.io/v1
    kubeConfigFile: /foo
    `,
    			expectKubeconfig: "/foo",
    		},
    	}
    
    	for _, tc := range testcases {
    		t.Run(tc.name, func(t *testing.T) {
    			kubeconfig, err := LoadConfig(bytes.NewBufferString(tc.input))
    			if len(tc.expectErr) > 0 {
    				if err == nil {
    					t.Fatal("expected err, got none")
    				}
    				if !strings.Contains(err.Error(), tc.expectErr) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Nov 12 14:56:58 UTC 2019
    - 1.9K bytes
    - Viewed (0)
  5. cmd/config-current_test.go

    	}
    
    	if err := saveServerConfig(context.Background(), objLayer, globalServerConfig); err != nil {
    		t.Fatalf("Unable to save updated config file %s", err)
    	}
    
    	// Initialize server config.
    	if err := loadConfig(objLayer, nil); err != nil {
    		t.Fatalf("Unable to initialize from updated config file %s", err)
    	}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu May 16 23:13:47 UTC 2024
    - 2K bytes
    - Viewed (0)
  6. cmd/config-migrate.go

    	return quick.SaveConfig(data, configFile, globalEtcdClient)
    }
    
    // Load config from backend
    func Load(configFile string, data interface{}) (quick.Config, error) {
    	return quick.LoadConfig(configFile, globalEtcdClient, data)
    }
    
    func readConfigWithoutMigrate(ctx context.Context, objAPI ObjectLayer) (config.Config, error) {
    	// Construct path to config.json for the given bucket.
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  7. cmd/kube-proxy/app/server_test.go

    		config, err := options.loadConfig([]byte(yaml))
    
    		assert.NoError(t, err, "unexpected error for %s: %v", tc.name, err)
    
    		if diff := cmp.Diff(config, expected); diff != "" {
    			t.Fatalf("unexpected config for %s, diff = %s", tc.name, diff)
    		}
    	}
    }
    
    // TestLoadConfigFailures tests failure modes for loadConfig()
    func TestLoadConfigFailures(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 22 05:08:41 UTC 2024
    - 32.3K bytes
    - Viewed (0)
  8. pkg/kube/inject/watcher.go

    			if !ok {
    				return
    			}
    			log.Errorf("Watcher error: %v", err)
    		case <-stop:
    			return
    		}
    	}
    }
    
    func (w *fileWatcher) Get() (*Config, string, error) {
    	return loadConfig(w.configFile, w.valuesFile)
    }
    
    func (w *fileWatcher) SetHandler(handler func(*Config, string) error) {
    	w.handler = handler
    }
    
    // NewConfigMapWatcher creates a new Watcher for changes to the given ConfigMap.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 5.9K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/admission/plugin/webhook/generic/webhook.go

    // NewWebhook creates a new generic admission webhook.
    func NewWebhook(handler *admission.Handler, configFile io.Reader, sourceFactory sourceFactory, dispatcherFactory dispatcherFactory) (*Webhook, error) {
    	kubeconfigFile, err := config.LoadConfig(configFile)
    	if err != nil {
    		return nil, err
    	}
    
    	cm, err := webhookutil.NewClientManager(
    		[]schema.GroupVersion{
    			admissionv1beta1.SchemeGroupVersion,
    			admissionv1.SchemeGroupVersion,
    		},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/config.go

    		return fmt.Errorf("kmsv2 Provider %s is not healthy, error: %w", h.name, err)
    	}
    	return nil
    }
    
    // loadConfig parses the encryption configuration file at filepath and returns the parsed config and hash of the file.
    func loadConfig(filepath string, reload bool) (*apiserver.EncryptionConfiguration, string, error) {
    	data, contentHash, err := loadDataAndHash(filepath)
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu May 16 16:56:39 UTC 2024
    - 41.2K bytes
    - Viewed (0)
Back to top