fix(git): update stack name for git stacks [EE-6670] (#11217)
parent
ce3a1b8ba5
commit
988d4103d4
|
@ -27,6 +27,8 @@ type stackGitRedployPayload struct {
|
||||||
Prune bool
|
Prune bool
|
||||||
// Force a pulling to current image with the original tag though the image is already the latest
|
// Force a pulling to current image with the original tag though the image is already the latest
|
||||||
PullImage bool `example:"false"`
|
PullImage bool `example:"false"`
|
||||||
|
|
||||||
|
StackName string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (payload *stackGitRedployPayload) Validate(r *http.Request) error {
|
func (payload *stackGitRedployPayload) Validate(r *http.Request) error {
|
||||||
|
@ -136,6 +138,10 @@ func (handler *Handler) stackGitRedeploy(w http.ResponseWriter, r *http.Request)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if payload.StackName != "" {
|
||||||
|
stack.Name = payload.StackName
|
||||||
|
}
|
||||||
|
|
||||||
repositoryUsername := ""
|
repositoryUsername := ""
|
||||||
repositoryPassword := ""
|
repositoryPassword := ""
|
||||||
if payload.RepositoryAuthentication {
|
if payload.RepositoryAuthentication {
|
||||||
|
|
|
@ -180,6 +180,7 @@
|
||||||
ng-if="ctrl.state.appType === ctrl.KubernetesDeploymentTypes.GIT"
|
ng-if="ctrl.state.appType === ctrl.KubernetesDeploymentTypes.GIT"
|
||||||
stack="ctrl.stack"
|
stack="ctrl.stack"
|
||||||
namespace="ctrl.formValues.ResourcePool.Namespace.Name"
|
namespace="ctrl.formValues.ResourcePool.Namespace.Name"
|
||||||
|
stack-name="ctrl.formValues.StackName"
|
||||||
></kubernetes-redeploy-app-git-form>
|
></kubernetes-redeploy-app-git-form>
|
||||||
<!-- #endregion -->
|
<!-- #endregion -->
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,10 @@ class KubernetesRedeployAppGitFormController {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.stack.Name !== this.stackName) {
|
||||||
|
this.formValues.StackName = this.stackName;
|
||||||
|
}
|
||||||
|
|
||||||
this.state.redeployInProgress = true;
|
this.state.redeployInProgress = true;
|
||||||
await this.StackService.updateKubeGit(this.stack.Id, this.stack.EndpointId, this.namespace, this.formValues);
|
await this.StackService.updateKubeGit(this.stack.Id, this.stack.EndpointId, this.namespace, this.formValues);
|
||||||
this.Notifications.success('Success', 'Pulled and redeployed stack successfully');
|
this.Notifications.success('Success', 'Pulled and redeployed stack successfully');
|
||||||
|
|
|
@ -7,6 +7,7 @@ const kubernetesRedeployAppGitForm = {
|
||||||
bindings: {
|
bindings: {
|
||||||
stack: '<',
|
stack: '<',
|
||||||
namespace: '<',
|
namespace: '<',
|
||||||
|
stackName: '<',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -461,6 +461,7 @@ angular.module('portainer.app').factory('StackService', [
|
||||||
RepositoryAuthentication: gitConfig.RepositoryAuthentication,
|
RepositoryAuthentication: gitConfig.RepositoryAuthentication,
|
||||||
RepositoryUsername: gitConfig.RepositoryUsername,
|
RepositoryUsername: gitConfig.RepositoryUsername,
|
||||||
RepositoryPassword: gitConfig.RepositoryPassword,
|
RepositoryPassword: gitConfig.RepositoryPassword,
|
||||||
|
StackName: gitConfig.StackName,
|
||||||
}
|
}
|
||||||
).$promise;
|
).$promise;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue