mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 13:25:26 +02:00
fix(k8s): add tag ids to request payload for creating local k8s endpoint. EE-1454 (#5577)
* fix(k8s): add tag ids to request payload for creating local k8s endpoint. * add https to k8s local environment url
This commit is contained in:
parent
4ffee27a4b
commit
f16fdd3ea7
3 changed files with 9 additions and 4 deletions
|
@ -137,10 +137,10 @@ angular.module('portainer.app').factory('EndpointService', [
|
||||||
return deferred.promise;
|
return deferred.promise;
|
||||||
};
|
};
|
||||||
|
|
||||||
service.createLocalKubernetesEndpoint = function (name = 'local') {
|
service.createLocalKubernetesEndpoint = function (name = 'local', tagIds = []) {
|
||||||
var deferred = $q.defer();
|
var deferred = $q.defer();
|
||||||
|
|
||||||
FileUploadService.createEndpoint(name, PortainerEndpointCreationTypes.LocalKubernetesEnvironment, '', '', 1, [], true, true, true)
|
FileUploadService.createEndpoint(name, PortainerEndpointCreationTypes.LocalKubernetesEnvironment, '', '', 1, tagIds, true, true, true)
|
||||||
.then(function success(response) {
|
.then(function success(response) {
|
||||||
deferred.resolve(response.data);
|
deferred.resolve(response.data);
|
||||||
})
|
})
|
||||||
|
|
|
@ -154,8 +154,9 @@ angular
|
||||||
|
|
||||||
$scope.addKubernetesEndpoint = function () {
|
$scope.addKubernetesEndpoint = function () {
|
||||||
var name = $scope.formValues.Name;
|
var name = $scope.formValues.Name;
|
||||||
|
var tagIds = $scope.formValues.TagIds;
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
EndpointService.createLocalKubernetesEndpoint(name)
|
EndpointService.createLocalKubernetesEndpoint(name, tagIds)
|
||||||
.then(function success(result) {
|
.then(function success(result) {
|
||||||
Notifications.success('Endpoint created', name);
|
Notifications.success('Endpoint created', name);
|
||||||
$state.go('portainer.endpoints.endpoint.kubernetesConfig', { id: result.Id });
|
$state.go('portainer.endpoints.endpoint.kubernetesConfig', { id: result.Id });
|
||||||
|
|
|
@ -168,10 +168,14 @@ function EndpointController(
|
||||||
payload.URL = 'tcp://' + endpoint.URL;
|
payload.URL = 'tcp://' + endpoint.URL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (endpoint.Type === PortainerEndpointTypes.AgentOnKubernetesEnvironment || endpoint.Type === PortainerEndpointTypes.KubernetesLocalEnvironment) {
|
if (endpoint.Type === PortainerEndpointTypes.AgentOnKubernetesEnvironment) {
|
||||||
payload.URL = endpoint.URL;
|
payload.URL = endpoint.URL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (endpoint.Type === PortainerEndpointTypes.KubernetesLocalEnvironment) {
|
||||||
|
payload.URL = 'https://' + endpoint.URL;
|
||||||
|
}
|
||||||
|
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
EndpointService.updateEndpoint(endpoint.Id, payload).then(
|
EndpointService.updateEndpoint(endpoint.Id, payload).then(
|
||||||
function success() {
|
function success() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue