Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci improvements #51

Merged
merged 3 commits into from
Sep 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
ci improvements - fix error
  • Loading branch information
Yonah Dissen committed Sep 3, 2023
commit 1b540343c67bf6a134cd5ed1f9c7211888473ae3
8 changes: 7 additions & 1 deletion pkg/kor/serviceaccounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func getServiceAccountsFromRoleBindings(clientset *kubernetes.Clientset, namespa

func retrieveUsedSA(kubeClient *kubernetes.Clientset, namespace string) ([]string, []string, []string, error) {

podServiceAccounts := []string{}
var podServiceAccounts []string

// Retrieve pods in the specified namespace
pods, err := kubeClient.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{})
Expand All @@ -82,7 +82,13 @@ func retrieveUsedSA(kubeClient *kubernetes.Clientset, namespace string) ([]strin
}

roleServiceAccounts, err := getServiceAccountsFromRoleBindings(kubeClient, namespace)
if err != nil {
return nil, nil, nil, err
}
clusterRoleServiceAccounts, err := getServiceAccountsFromClusterRoleBindings(kubeClient, namespace)
if err != nil {
return nil, nil, nil, err
}
return podServiceAccounts, roleServiceAccounts, clusterRoleServiceAccounts, nil
}

Expand Down
Loading