Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for controllerRef (0.12 sec)

  1. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/controller_ref_test.go

    			Name: "name",
    			UID:  "uid1",
    		},
    	}
    	controllerRef := NewControllerRef(obj1, gvk)
    	if controllerRef.UID != obj1.UID {
    		t.Errorf("Incorrect UID: %s", controllerRef.UID)
    	}
    	if controllerRef.Controller == nil || *controllerRef.Controller != true {
    		t.Error("Controller must be set to true")
    	}
    	if controllerRef.BlockOwnerDeletion == nil || *controllerRef.BlockOwnerDeletion != true {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 09 05:14:33 UTC 2024
    - 4K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/controller_ref.go

    	"k8s.io/utils/ptr"
    )
    
    // IsControlledBy checks if the  object has a controllerRef set to the given owner
    func IsControlledBy(obj Object, owner Object) bool {
    	ref := GetControllerOfNoCopy(obj)
    	if ref == nil {
    		return false
    	}
    	return ref.UID == owner.GetUID()
    }
    
    // GetControllerOf returns a pointer to a copy of the controllerRef if controllee has a controller
    func GetControllerOf(controllee Object) *OwnerReference {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Apr 09 05:14:33 UTC 2024
    - 2K bytes
    - Viewed (0)
Back to top