Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for HasActiveRules (0.3 sec)

  1. internal/bucket/replication/replication.go

    	}
    	return false
    }
    
    // HasActiveRules - returns whether replication policy has active rules
    // Optionally a prefix can be supplied.
    // If recursive is specified the function will also return true if any level below the
    // prefix has active rules. If no prefix is specified recursive is effectively true.
    func (c Config) HasActiveRules(prefix string, recursive bool) bool {
    	if len(c.Rules) == 0 {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Mar 28 17:44:56 GMT 2024
    - 8.9K bytes
    - Viewed (0)
  2. internal/bucket/lifecycle/lifecycle.go

    			default:
    				return xml.UnmarshalError(fmt.Sprintf("expected element type <Rule> but have <%s>", se.Name.Local))
    			}
    		}
    	}
    	return nil
    }
    
    // HasActiveRules - returns whether lc has active rules at any level below or at prefix.
    func (lc Lifecycle) HasActiveRules(prefix string) bool {
    	if len(lc.Rules) == 0 {
    		return false
    	}
    	for _, rule := range lc.Rules {
    		if rule.Status == Disabled {
    			continue
    		}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Mar 09 06:41:22 GMT 2024
    - 17K bytes
    - Viewed (0)
  3. internal/bucket/replication/replication_test.go

    			if err != nil {
    				t.Fatalf("Got unexpected error: %v", err)
    			}
    			if got := cfg.HasActiveRules(tc.prefix, false); got != tc.expectedNonRec {
    				t.Fatalf("Expected result with recursive set to false: `%v`, got: `%v`", tc.expectedNonRec, got)
    			}
    			if got := cfg.HasActiveRules(tc.prefix, true); got != tc.expectedRec {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Mar 28 17:44:56 GMT 2024
    - 32.5K bytes
    - Viewed (0)
  4. cmd/data-scanner.go

    		// If there are lifecycle rules for the prefix.
    		_, prefix := path2BucketObjectWithBasePath(f.root, folder.name)
    		var activeLifeCycle *lifecycle.Lifecycle
    		if f.oldCache.Info.lifeCycle != nil && f.oldCache.Info.lifeCycle.HasActiveRules(prefix) {
    			if f.dataUsageScannerDebug {
    				console.Debugf(scannerLogPrefix+" Prefix %q has active rules\n", prefix)
    			}
    			activeLifeCycle = f.oldCache.Info.lifeCycle
    		}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 22 17:49:30 GMT 2024
    - 47.4K bytes
    - Viewed (0)
  5. cmd/xl-storage.go

    		lc, err = globalLifecycleSys.Get(cache.Info.Name)
    		if err == nil && lc.HasActiveRules("") {
    			cache.Info.lifeCycle = lc
    		}
    	}
    
    	// Check if the current bucket has replication configuration
    	if rcfg, _, err := globalBucketMetadataSys.GetReplicationConfig(ctx, cache.Info.Name); err == nil {
    		if rcfg.HasActiveRules("", true) {
    			tgts, err := globalBucketTargetSys.ListBucketTargets(ctx, cache.Info.Name)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 84.7K bytes
    - Viewed (0)
  6. internal/bucket/lifecycle/lifecycle_test.go

    			}
    			// To ensure input lifecycle configurations are valid
    			if err := lc.Validate(); err != nil {
    				t.Fatalf("Invalid test case: %d %v", i+1, err)
    			}
    			if got := lc.HasActiveRules(tc.prefix); got != tc.want {
    				t.Fatalf("Expected result: `%v`, got: `%v`", tc.want, got)
    			}
    		})
    	}
    }
    
    func TestSetPredictionHeaders(t *testing.T) {
    	lc := Lifecycle{
    		Rules: []Rule{
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Mar 09 06:41:22 GMT 2024
    - 45.6K bytes
    - Viewed (0)
  7. cmd/bucket-handlers.go

    			case err != nil:
    				if _, ok := err.(BucketReplicationConfigNotFound); !ok {
    					writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrMethodNotAllowed), r.URL)
    					return
    				}
    			case rcfg != nil && rcfg.HasActiveRules("", true):
    				writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrMethodNotAllowed), r.URL)
    				return
    			}
    		}
    	}
    
    	// Return an error if the bucket does not exist
    	if !forceDelete {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 25 16:27:27 GMT 2024
    - 61.6K bytes
    - Viewed (0)
  8. cmd/bucket-replication.go

    	c, err := getReplicationConfig(ctx, bucket)
    	if err != nil || c == nil {
    		replLogOnceIf(ctx, err, bucket)
    		return false
    	}
    	for _, obj := range objects {
    		if c.HasActiveRules(obj.ObjectName, true) {
    			return true
    		}
    	}
    	return false
    }
    
    // isStandardHeader returns true if header is a supported header and not a custom header
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 22 17:49:30 GMT 2024
    - 112.2K bytes
    - Viewed (1)
Back to top