mirror of https://github.com/portainer/portainer
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 urlpull/5310/head
parent
4ffee27a4b
commit
f16fdd3ea7
|
@ -137,10 +137,10 @@ angular.module('portainer.app').factory('EndpointService', [
|
|||
return deferred.promise;
|
||||
};
|
||||
|
||||
service.createLocalKubernetesEndpoint = function (name = 'local') {
|
||||
service.createLocalKubernetesEndpoint = function (name = 'local', tagIds = []) {
|
||||
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) {
|
||||
deferred.resolve(response.data);
|
||||
})
|
||||
|
|
|
@ -154,8 +154,9 @@ angular
|
|||
|
||||
$scope.addKubernetesEndpoint = function () {
|
||||
var name = $scope.formValues.Name;
|
||||
var tagIds = $scope.formValues.TagIds;
|
||||
$scope.state.actionInProgress = true;
|
||||
EndpointService.createLocalKubernetesEndpoint(name)
|
||||
EndpointService.createLocalKubernetesEndpoint(name, tagIds)
|
||||
.then(function success(result) {
|
||||
Notifications.success('Endpoint created', name);
|
||||
$state.go('portainer.endpoints.endpoint.kubernetesConfig', { id: result.Id });
|
||||
|
|
|
@ -168,10 +168,14 @@ function EndpointController(
|
|||
payload.URL = 'tcp://' + endpoint.URL;
|
||||
}
|
||||
|
||||
if (endpoint.Type === PortainerEndpointTypes.AgentOnKubernetesEnvironment || endpoint.Type === PortainerEndpointTypes.KubernetesLocalEnvironment) {
|
||||
if (endpoint.Type === PortainerEndpointTypes.AgentOnKubernetesEnvironment) {
|
||||
payload.URL = endpoint.URL;
|
||||
}
|
||||
|
||||
if (endpoint.Type === PortainerEndpointTypes.KubernetesLocalEnvironment) {
|
||||
payload.URL = 'https://' + endpoint.URL;
|
||||
}
|
||||
|
||||
$scope.state.actionInProgress = true;
|
||||
EndpointService.updateEndpoint(endpoint.Id, payload).then(
|
||||
function success() {
|
||||
|
|
Loading…
Reference in New Issue