Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for CreateOrUpdateClusterRole (0.18 sec)

  1. cmd/kubeadm/app/phases/bootstraptoken/node/tlsbootstrap.go

    func AllowBoostrapTokensToGetNodes(client clientset.Interface) error {
    	fmt.Println("[bootstrap-token] Configured RBAC rules to allow Node Bootstrap tokens to get nodes")
    
    	if err := apiclient.CreateOrUpdateClusterRole(client, &rbac.ClusterRole{
    		ObjectMeta: metav1.ObjectMeta{
    			Name: constants.GetNodesClusterRoleName,
    		},
    		Rules: []rbac.PolicyRule{
    			{
    				Verbs:     []string{"get"},
    				APIGroups: []string{""},
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Oct 15 10:49:52 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  2. cmd/kubeadm/app/util/apiclient/idempotency.go

    				}
    			}
    			return true, nil
    		})
    	if err == nil {
    		return nil
    	}
    	return lastError
    }
    
    // CreateOrUpdateClusterRole creates a ClusterRole if the target resource doesn't exist. If the resource exists already, this function will update the resource instead.
    func CreateOrUpdateClusterRole(client clientset.Interface, clusterRole *rbac.ClusterRole) error {
    	var lastError error
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Feb 18 11:14:32 UTC 2024
    - 18.4K bytes
    - Viewed (0)
  3. cmd/kubeadm/app/phases/addons/dns/dns.go

    		return errors.Wrapf(err, "%s ClusterRole", unableToDecodeCoreDNS)
    	}
    
    	// Create the Clusterroles for CoreDNS or update it in case it already exists
    	if err := apiclient.CreateOrUpdateClusterRole(client, coreDNSClusterRoles); err != nil {
    		return err
    	}
    
    	coreDNSClusterRolesBinding := &rbac.ClusterRoleBinding{}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 11 10:21:20 UTC 2024
    - 16.1K bytes
    - Viewed (0)
  4. cmd/kubeadm/app/util/apiclient/idempotency_test.go

    			},
    			expectedError: true,
    		},
    	}
    
    	for _, tc := range tests {
    		t.Run(tc.name, func(t *testing.T) {
    			client := clientsetfake.NewSimpleClientset()
    			tc.setupClient(client)
    			err := CreateOrUpdateClusterRole(client, &rbac.ClusterRole{})
    			if (err != nil) != tc.expectedError {
    				t.Fatalf("expected error: %v, got %v, error: %v", tc.expectedError, err != nil, err)
    			}
    		})
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Feb 18 11:14:32 UTC 2024
    - 33.2K bytes
    - Viewed (0)
Back to top