Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for EnsureChain (0.14 sec)

  1. pkg/util/iptables/testing/fake_test.go

    	}
    
    	// EnsureChain
    	existed, err := fake.EnsureChain(iptables.Table("blah"), iptables.Chain("KUBE-TEST"))
    	if err == nil {
    		t.Errorf("did not get expected error creating chain in non-existent table")
    	} else if existed {
    		t.Errorf("wrong return value from EnsureChain with non-existent table")
    	}
    	existed, err = fake.EnsureChain(iptables.TableNAT, iptables.Chain("KUBE-TEST"))
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Dec 19 01:20:51 UTC 2023
    - 10.2K bytes
    - Viewed (0)
  2. pkg/kubelet/kubelet_network_linux.go

    func (kl *Kubelet) syncIPTablesRules(iptClient utiliptables.Interface) bool {
    	// Create hint chain so other components can see whether we are using iptables-legacy
    	// or iptables-nft.
    	if _, err := iptClient.EnsureChain(utiliptables.TableMangle, KubeIPTablesHintChain); err != nil {
    		klog.ErrorS(err, "Failed to ensure that iptables hint chain exists")
    		return false
    	}
    
    	if !iptClient.IsIPv6() { // ipv6 doesn't have this issue
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 17 20:51:47 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  3. pkg/proxy/nftables/proxier.go

    	{clusterIPsCheckChain, filterOutputPostDNATChain, "ct state new"},
    }
    
    // ensureChain adds commands to tx to ensure that chain exists and doesn't contain
    // anything from before this transaction (using createdChains to ensure that we don't
    // Flush a chain more than once and lose *new* rules as well.)
    func ensureChain(chain string, tx *knftables.Transaction, createdChains sets.Set[string]) {
    	if createdChains.Has(chain) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jun 08 13:48:54 UTC 2024
    - 55.5K bytes
    - Viewed (0)
  4. pkg/util/iptables/testing/fake.go

    }
    
    // SetHasRandomFully sets f's return value for HasRandomFully()
    func (f *FakeIPTables) SetHasRandomFully(can bool) *FakeIPTables {
    	f.hasRandomFully = can
    	return f
    }
    
    // EnsureChain is part of iptables.Interface
    func (f *FakeIPTables) EnsureChain(table iptables.Table, chain iptables.Chain) (bool, error) {
    	t, err := f.Dump.GetTable(table)
    	if err != nil {
    		return false, err
    	}
    	if c, _ := f.Dump.GetChain(table, chain); c != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Dec 19 01:20:51 UTC 2023
    - 8.5K bytes
    - Viewed (0)
  5. pkg/util/iptables/iptables.go

    )
    
    // Interface is an injectable interface for running iptables commands.  Implementations must be goroutine-safe.
    type Interface interface {
    	// EnsureChain checks if the specified chain exists and, if not, creates it.  If the chain existed, return true.
    	EnsureChain(table Table, chain Chain) (bool, error)
    	// FlushChain clears the specified chain.  If the chain did not exist, return error.
    	FlushChain(table Table, chain Chain) error
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Dec 19 01:20:51 UTC 2023
    - 28.6K bytes
    - Viewed (0)
  6. pkg/util/iptables/iptables_test.go

    	}
    	// Exists.
    	exists, err = runner.EnsureChain(TableNAT, Chain("FOOBAR"))
    	if err != nil {
    		t.Errorf("%s existing chain: Expected success, got %v", protocol, err)
    	}
    	if !exists {
    		t.Errorf("%s existing chain: Expected exists = true", protocol)
    	}
    	// Simulate failure.
    	_, err = runner.EnsureChain(TableNAT, Chain("FOOBAR"))
    	if err == nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 08 15:21:59 UTC 2023
    - 46.3K bytes
    - Viewed (0)
  7. pkg/proxy/iptables/proxier.go

    		// (which will be very slow on hosts with lots of iptables rules).
    		for _, jump := range append(iptablesJumpChains, iptablesKubeletJumpChains...) {
    			if _, err := proxier.iptables.EnsureChain(jump.table, jump.dstChain); err != nil {
    				proxier.logger.Error(err, "Failed to ensure chain exists", "table", jump.table, "chain", jump.dstChain)
    				return
    			}
    			args := jump.extraArgs
    			if jump.comment != "" {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 21 14:39:54 UTC 2024
    - 65.1K bytes
    - Viewed (0)
  8. pkg/proxy/ipvs/proxier.go

    // createAndLinkKubeChain create all kube chains that ipvs proxier need and write basic link.
    func (proxier *Proxier) createAndLinkKubeChain() {
    	for _, ch := range iptablesChains {
    		if _, err := proxier.iptables.EnsureChain(ch.table, ch.chain); err != nil {
    			proxier.logger.Error(err, "Failed to ensure chain exists", "table", ch.table, "chain", ch.chain)
    			return
    		}
    		if ch.table == utiliptables.TableNAT {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Apr 28 15:51:23 UTC 2024
    - 77.7K bytes
    - Viewed (0)
Back to top