Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for IsProtectedCommunityGroup (0.37 sec)

  1. staging/src/k8s.io/apiextensions-apiserver/pkg/apihelpers/helpers.go

    	apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
    	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    )
    
    // IsProtectedCommunityGroup returns whether or not a group specified for a CRD is protected for the community and needs
    // to have the v1beta1.KubeAPIApprovalAnnotation set.
    func IsProtectedCommunityGroup(group string) bool {
    	switch {
    	case group == "k8s.io" || strings.HasSuffix(group, ".k8s.io"):
    		return true
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Dec 03 16:49:27 UTC 2019
    - 9.5K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiextensions-apiserver/pkg/controller/apiapproval/apiapproval_controller.go

    // calculateCondition determines the new KubernetesAPIApprovalPolicyConformant condition
    func calculateCondition(crd *apiextensionsv1.CustomResourceDefinition) *apiextensionsv1.CustomResourceDefinitionCondition {
    	if !apihelpers.IsProtectedCommunityGroup(crd.Spec.Group) {
    		return nil
    	}
    
    	approvalState, reason := apihelpers.GetAPIApprovalState(crd.Annotations)
    	switch approvalState {
    	case apihelpers.APIApprovalInvalid:
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 9.2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiextensions-apiserver/pkg/apihelpers/helpers_test.go

    		},
    		{
    			name:     "alternative",
    			group:    "different.io",
    			expected: false,
    		},
    	}
    
    	for _, test := range tests {
    		t.Run(test.name, func(t *testing.T) {
    			actual := IsProtectedCommunityGroup(test.group)
    
    			if actual != test.expected {
    				t.Fatalf("expected %v, got %v", test.expected, actual)
    			}
    		})
    	}
    }
    
    func TestGetAPIApprovalState(t *testing.T) {
    	tests := []struct {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Dec 03 16:49:27 UTC 2019
    - 20.3K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go

    func validateAPIApproval(newCRD, oldCRD *apiextensions.CustomResourceDefinition) field.ErrorList {
    	// check to see if we need confirm API approval for kube group.
    	if !apihelpers.IsProtectedCommunityGroup(newCRD.Spec.Group) {
    		// no-op for non-protected groups
    		return nil
    	}
    
    	// default to a state that allows missing values to continue to be missing
    	var oldApprovalState *apihelpers.APIApprovalState
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 82.6K bytes
    - Viewed (0)
Back to top