Skip to content

Commit

Permalink
0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
sebt3 committed Feb 14, 2024
1 parent 851981e commit 3250ec6
Show file tree
Hide file tree
Showing 70 changed files with 10,463 additions and 705 deletions.
2 changes: 2 additions & 0 deletions back/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const envMapping = [
{name: 'limitNamespaceHave', key: "GRAMO_LIMIT_NAMESPACE_HAVE"},
{name: 'limitVynilDistrib', key: "GRAMO_LIMIT_VYNIL_DISTRIB"},
{name: 'limitVynilCategory', key: "GRAMO_LIMIT_VYNIL_CATEGORY"},
{name: 'vynilNamespace', key: "GRAMO_VYNIL_NAMESPACE"},
// Frontend config
{name: 'defaultNamespace', key: "GRAMO_DEFAULT_NAMESPACE"},
{name: 'defaultRoute', key: "GRAMO_DEFAULT_ROUTE"},
Expand All @@ -17,6 +18,7 @@ export const defaultConfig = {
limitNamespaceKey: "",
limitNamespaceValue: "",
limitNamespaceHave: "",
vynilNamespace: "vynil",
defaultNamespace: "default",
defaultRoute: "",
};
Expand Down
3 changes: 2 additions & 1 deletion back/resolvers/k8slibs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import NodeCache from 'node-cache';
export const kc = new k8s.KubeConfig();
export const cache = new NodeCache({ stdTTL: 2, useClones: false, deleteOnExpire: true, checkperiod: 60 });

kc.loadFromCluster();
if (process.env['NODE_ENV']=='dev') kc.loadFromDefault();
else kc.loadFromCluster();
export function getMetaNS(args: object) {
return {
namespace: args['namespace'],
Expand Down
2 changes: 1 addition & 1 deletion back/resolvers/vynil/Category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const queries = {
};
export const resolvers = {
vynilCategory: {
providePackage: async (parent) => {
providevynilPackage: async (parent) => {
const packages = await packageQueries.vynilPackage(null, {})
return packages.filter(pkg => {
if (gramoConfig.limitVynilDistrib != "" && pkg['distrib'] != gramoConfig.limitVynilDistrib) return false;
Expand Down
4 changes: 2 additions & 2 deletions back/resolvers/vynil/Package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ export const queries = {

export const resolvers = {
vynilPackage: {
consumeCategory: async (parent) => {
consumevynilCategory: async (parent) => {
return {
name: parent.category,
};
},
consumeDistrib: async (parent) => {
consumevynilDistrib: async (parent) => {
const lst = (await distribQueries.vynilDistrib(parent,{})).filter((i) => i.metadata.name == parent.distrib)
if (lst.length>0) return lst[0];
return {
Expand Down
14 changes: 9 additions & 5 deletions back/schema/core.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,23 @@ type permissionReview {
}
type vynilCategory {
name: String!
providePackage(params: queryParameters): [vynilPackage!]
providevynilPackage(params: queryParameters): [vynilPackage!]
}
type coreUrl {
proto: String
host: String
path: String
}
type vynilPackage {
name: String!
commit_id: ID!
description: String
consumeCategory: vynilCategory!
consumeDistrib: vynilDistrib!
consumevynilCategory: vynilCategory!
consumevynilDistrib: vynilDistrib!
options: JSONObject!
}
type Query {
gramoConfig: GramoConfig
vynilCategory(params: queryParameters): [vynilCategory]
vynilPackage(params: queryParameters): [vynilPackage]
}

}
Loading

0 comments on commit 3250ec6

Please sign in to comment.