-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from natrontech/TASK-115-optimizations
Task 115 optimizations
- Loading branch information
Showing
44 changed files
with
1,219 additions
and
447 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
kubelab-backend/pb_migrations/1686990480_updated_exercise_sessions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
migrate((db) => { | ||
const dao = new Dao(db) | ||
const collection = dao.findCollectionByNameOrId("qj6ssich32lcxru") | ||
|
||
// update | ||
collection.schema.addField(new SchemaField({ | ||
"system": false, | ||
"id": "g8s5seza", | ||
"name": "startTime", | ||
"type": "date", | ||
"required": false, | ||
"unique": false, | ||
"options": { | ||
"min": "", | ||
"max": "" | ||
} | ||
})) | ||
|
||
return dao.saveCollection(collection) | ||
}, (db) => { | ||
const dao = new Dao(db) | ||
const collection = dao.findCollectionByNameOrId("qj6ssich32lcxru") | ||
|
||
// update | ||
collection.schema.addField(new SchemaField({ | ||
"system": false, | ||
"id": "g8s5seza", | ||
"name": "startTime", | ||
"type": "date", | ||
"required": true, | ||
"unique": false, | ||
"options": { | ||
"min": "", | ||
"max": "" | ||
} | ||
})) | ||
|
||
return dao.saveCollection(collection) | ||
}) |
39 changes: 39 additions & 0 deletions
39
kubelab-backend/pb_migrations/1686990524_updated_lab_sessions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
migrate((db) => { | ||
const dao = new Dao(db) | ||
const collection = dao.findCollectionByNameOrId("n7tne53bbobf2bt") | ||
|
||
// update | ||
collection.schema.addField(new SchemaField({ | ||
"system": false, | ||
"id": "thwhdlu1", | ||
"name": "startTime", | ||
"type": "date", | ||
"required": false, | ||
"unique": false, | ||
"options": { | ||
"min": "", | ||
"max": "" | ||
} | ||
})) | ||
|
||
return dao.saveCollection(collection) | ||
}, (db) => { | ||
const dao = new Dao(db) | ||
const collection = dao.findCollectionByNameOrId("n7tne53bbobf2bt") | ||
|
||
// update | ||
collection.schema.addField(new SchemaField({ | ||
"system": false, | ||
"id": "thwhdlu1", | ||
"name": "startTime", | ||
"type": "date", | ||
"required": true, | ||
"unique": false, | ||
"options": { | ||
"min": "", | ||
"max": "" | ||
} | ||
})) | ||
|
||
return dao.saveCollection(collection) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
migrate((db) => { | ||
const dao = new Dao(db) | ||
const collection = dao.findCollectionByNameOrId("a1s1vqlm7141lcr") | ||
|
||
collection.listRule = null | ||
collection.viewRule = null | ||
|
||
return dao.saveCollection(collection) | ||
}, (db) => { | ||
const dao = new Dao(db) | ||
const collection = dao.findCollectionByNameOrId("a1s1vqlm7141lcr") | ||
|
||
collection.listRule = "" | ||
collection.viewRule = "" | ||
|
||
return dao.saveCollection(collection) | ||
}) |
17 changes: 17 additions & 0 deletions
17
kubelab-backend/pb_migrations/1687092574_updated_exercises.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
migrate((db) => { | ||
const dao = new Dao(db) | ||
const collection = dao.findCollectionByNameOrId("s4f0lpy3ibkgfqp") | ||
|
||
collection.listRule = null | ||
collection.viewRule = null | ||
|
||
return dao.saveCollection(collection) | ||
}, (db) => { | ||
const dao = new Dao(db) | ||
const collection = dao.findCollectionByNameOrId("s4f0lpy3ibkgfqp") | ||
|
||
collection.listRule = "" | ||
collection.viewRule = "" | ||
|
||
return dao.saveCollection(collection) | ||
}) |
23 changes: 23 additions & 0 deletions
23
kubelab-backend/pb_migrations/1687092614_updated_exercises.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
migrate((db) => { | ||
const dao = new Dao(db) | ||
const collection = dao.findCollectionByNameOrId("s4f0lpy3ibkgfqp") | ||
|
||
collection.listRule = "" | ||
collection.viewRule = "" | ||
collection.createRule = null | ||
collection.updateRule = null | ||
collection.deleteRule = null | ||
|
||
return dao.saveCollection(collection) | ||
}, (db) => { | ||
const dao = new Dao(db) | ||
const collection = dao.findCollectionByNameOrId("s4f0lpy3ibkgfqp") | ||
|
||
collection.listRule = null | ||
collection.viewRule = null | ||
collection.createRule = "" | ||
collection.updateRule = "" | ||
collection.deleteRule = "" | ||
|
||
return dao.saveCollection(collection) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
migrate((db) => { | ||
const dao = new Dao(db) | ||
const collection = dao.findCollectionByNameOrId("a1s1vqlm7141lcr") | ||
|
||
collection.listRule = "" | ||
collection.viewRule = "" | ||
collection.createRule = null | ||
collection.updateRule = null | ||
collection.deleteRule = null | ||
|
||
return dao.saveCollection(collection) | ||
}, (db) => { | ||
const dao = new Dao(db) | ||
const collection = dao.findCollectionByNameOrId("a1s1vqlm7141lcr") | ||
|
||
collection.listRule = null | ||
collection.viewRule = null | ||
collection.createRule = "" | ||
collection.updateRule = "" | ||
collection.deleteRule = "" | ||
|
||
return dao.saveCollection(collection) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package k8s | ||
|
||
import ( | ||
v1 "k8s.io/api/core/v1" | ||
"k8s.io/apimachinery/pkg/api/resource" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
func CreateResourceQuota(namespace string, name string, pods string, storage string) error { | ||
resourceQuota := &v1.ResourceQuota{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: name, | ||
Namespace: namespace, | ||
}, | ||
Spec: v1.ResourceQuotaSpec{ | ||
Hard: v1.ResourceList{ | ||
v1.ResourcePods: resource.MustParse(pods), | ||
v1.ResourceRequestsStorage: resource.MustParse(storage), | ||
}, | ||
}, | ||
} | ||
|
||
_, err := Clientset.CoreV1().ResourceQuotas(namespace).Create(Ctx, resourceQuota, metav1.CreateOptions{}) | ||
return err | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.