Skip to content

Commit

Permalink
fix: excludeProjects
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Oct 31, 2023
1 parent 520ce0b commit 7081ba7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ const getClusterName = async (clusterId) => {
return clusterName;
};

const excludeProjects = ["Default","System"]
const listProjectsByClusters = async () => {
const response = await axios.get(`${RANCHER_SERVER}/v3/projects`, {
headers: { Authorization: `Bearer ${RANCHER_TOKEN}` },
});

const clusters = {}
for (const project of response.data.data) {
if(excludeProjects.includes(project.name)){
continue
}
const clusterName = await getClusterName(project.clusterId);
if (!clusters[clusterName]){
clusters[clusterName] = []
Expand Down

0 comments on commit 7081ba7

Please # to comment.