feat(k8s): advanced deployment from Git repo EE-447 (#5166)

* feat(stack): UI updates in git repo deployment method for k8s EE-640. (#5097)

* feat(stack): UI updates in git repo deployment method for k8s EE-640.

* feat(stack): supports the combination of GIT + COMPOSE.

* feat(stack): rename variable

* feat(stack): add git repo deployment method for k8s EE-638

* cleanup

* update payload validation rules

* make repo ref optional in frond end

Co-authored-by: fhanportainer <79428273+fhanportainer@users.noreply.github.com>
This commit is contained in:
Hui
2021-06-17 09:47:32 +12:00
committed by GitHub
parent 6b759438b8
commit caa6c15032
11 changed files with 409 additions and 63 deletions

View File

@@ -369,21 +369,16 @@ angular.module('portainer.app').factory('StackService', [
return action(name, stackFileContent, env, endpointId);
};
async function kubernetesDeployAsync(endpointId, namespace, content, compose) {
async function kubernetesDeployAsync(endpointId, method, payload) {
try {
const payload = {
StackFileContent: content,
ComposeFormat: compose,
Namespace: namespace,
};
await Stack.create({ method: 'undefined', type: 3, endpointId: endpointId }, payload).$promise;
await Stack.create({ endpointId: endpointId, method: method, type: 3 }, payload).$promise;
} catch (err) {
throw { err: err };
}
}
service.kubernetesDeploy = function (endpointId, namespace, content, compose) {
return $async(kubernetesDeployAsync, endpointId, namespace, content, compose);
service.kubernetesDeploy = function (endpointId, method, payload) {
return $async(kubernetesDeployAsync, endpointId, method, payload);
};
service.start = start;