Skip to content

Commit

Permalink
Merge pull request #36 from kubenav/fix-aws-integration
Browse files Browse the repository at this point in the history
Fix adding EKS and GKE clusters
  • Loading branch information
ricoberger committed Feb 29, 2020
2 parents 649dead + 5aab556 commit e0444d5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/pages/ClustersAWS.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ const ClustersAWS: React.FunctionComponent<IClustersAWSProps> = ({ match, histor
match.params.region
);

const tmpClusters: ICluster[] = [];

// eslint-disable-next-line
awsClusters.map((cluster) => {
setClusters([...clusters, {
tmpClusters.push({
id: `aws_${match.params.region}_${cluster.Name}`,
name: `aws_${match.params.region}_${cluster.Name}`,
url: `${cluster.Endpoint}`,
Expand All @@ -77,8 +79,10 @@ const ClustersAWS: React.FunctionComponent<IClustersAWSProps> = ({ match, histor
password: '',
authProvider: 'aws',
namespace: 'default',
}]);
});
});

setClusters(tmpClusters);
}
} catch (err) {
setError(err.message);
Expand Down
8 changes: 6 additions & 2 deletions src/pages/ClustersGoogle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ const ClustersGoogle: React.FunctionComponent<IClustersGoogleProps> = ({ locatio
for (let project of projects) {
const projectClusters = await getGoogleClusters(tokens.access_token, project.projectId);

const tmpClusters: ICluster[] = [];

if (projectClusters) {
// eslint-disable-next-line
projectClusters.map((cluster) => {
setClusters([...clusters, {
tmpClusters.push({
id: `gke_${project.projectId}_${cluster.location}_${cluster.name}`,
name: `gke_${project.projectId}_${cluster.location}_${cluster.name}`,
url: `https://${cluster.endpoint}`,
Expand All @@ -75,8 +77,10 @@ const ClustersGoogle: React.FunctionComponent<IClustersGoogleProps> = ({ locatio
password: cluster.masterAuth.password ? cluster.masterAuth.password : '',
authProvider: 'google',
namespace: 'default',
}]);
});
});

setClusters(tmpClusters);
}
}
}
Expand Down

0 comments on commit e0444d5

Please sign in to comment.