Compare commits
2 Commits
fix/201-ap
...
CE-185-bui
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40092be5eb | ||
|
|
d87ccd75b2 |
@@ -1119,7 +1119,7 @@ type (
|
||||
|
||||
const (
|
||||
// APIVersion is the version number of the Portainer API
|
||||
APIVersion = "2.0.1"
|
||||
APIVersion = "2.0.0"
|
||||
// DBVersion is the version number of the Portainer database
|
||||
DBVersion = 25
|
||||
// AssetsServerURL represents the URL of the Portainer asset server
|
||||
|
||||
@@ -28,19 +28,8 @@ class KubernetesConfigMapService {
|
||||
this.KubernetesConfigMaps(namespace).get(params).$promise,
|
||||
this.KubernetesConfigMaps(namespace).getYaml(params).$promise,
|
||||
]);
|
||||
|
||||
if (_.get(rawPromise, 'reason.status') == 404 && _.get(yamlPromise, 'reason.status') == 404) {
|
||||
return KubernetesConfigMapConverter.defaultConfigMap(namespace, name);
|
||||
}
|
||||
|
||||
// Saving binary data to 'data' field in configMap Object is not allowed by kubernetes and getYaml() may get
|
||||
// an error. We should keep binary data to 'binaryData' field instead of 'data'. Before that, we
|
||||
// use response from get() and ignore 500 error as a workaround.
|
||||
if (rawPromise.value) {
|
||||
return KubernetesConfigMapConverter.apiToConfigMap(rawPromise.value, yamlPromise.value);
|
||||
}
|
||||
|
||||
throw new PortainerError('Unable to retrieve config map ', name);
|
||||
const configMap = KubernetesConfigMapConverter.apiToConfigMap(rawPromise.value, yamlPromise.value);
|
||||
return configMap;
|
||||
} catch (err) {
|
||||
if (err.status === 404) {
|
||||
return KubernetesConfigMapConverter.defaultConfigMap(namespace, name);
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
</uib-tab>
|
||||
<!-- !tab-info -->
|
||||
<!-- tab-file -->
|
||||
<uib-tab index="1" select="showEditor()" ng-if="!state.externalStack">
|
||||
<uib-tab index="1" select="showEditor()">
|
||||
<uib-tab-heading> <i class="fa fa-pencil-alt space-right" aria-hidden="true"></i> Editor </uib-tab-heading>
|
||||
<form class="form-horizontal" ng-if="state.showEditorTab" style="margin-top: 10px;">
|
||||
<div class="form-group">
|
||||
|
||||
@@ -3,7 +3,6 @@ param (
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop";
|
||||
$ProgressPreference = "SilentlyContinue";
|
||||
|
||||
New-Item -Path "docker-binary" -ItemType Directory | Out-Null
|
||||
|
||||
|
||||
7
build/download_docker_compose_binary.ps1
Executable file
7
build/download_docker_compose_binary.ps1
Executable file
@@ -0,0 +1,7 @@
|
||||
param (
|
||||
[string]$docker_compose_version
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop";
|
||||
|
||||
Invoke-WebRequest -O "dist/docker-compose.exe" "https://github.com/docker/compose/releases/download/$($docker_compose_version)/docker-compose-Windows-x86_64.exe"
|
||||
15
build/download_docker_compose_binary.sh
Executable file
15
build/download_docker_compose_binary.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
PLATFORM=$1
|
||||
ARCH=$2
|
||||
DOCKER_COMPOSE_VERSION=$3
|
||||
|
||||
if [ "${PLATFORM}" == 'win' ]; then
|
||||
wget -O "dist/docker-compose.exe" "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-Windows-x86_64.exe"
|
||||
elif [ "${PLATFORM}" == 'linux' ] && [ "${ARCH}" == 'amd64' ]; then
|
||||
wget -O "dist/docker-compose" "https://github.com/portainer/docker-compose-linux-amd64-static-binary/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose"
|
||||
chmod +x "dist/docker-compose"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -3,6 +3,5 @@ param (
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop";
|
||||
$ProgressPreference = "SilentlyContinue";
|
||||
|
||||
Invoke-WebRequest -O "dist/kompose.exe" "https://github.com/kubernetes/kompose/releases/download/$($kompose_version)/kompose-windows-amd64.exe"
|
||||
|
||||
@@ -3,6 +3,5 @@ param (
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop";
|
||||
$ProgressPreference = "SilentlyContinue";
|
||||
|
||||
Invoke-WebRequest -O "dist/kubectl.exe" "https://storage.googleapis.com/kubernetes-release/release/$($kubectl_version)/bin/windows/amd64/kubectl.exe"
|
||||
|
||||
34
gruntfile.js
34
gruntfile.js
@@ -19,7 +19,8 @@ module.exports = function (grunt) {
|
||||
binaries: {
|
||||
dockerLinuxVersion: '18.09.3',
|
||||
dockerWindowsVersion: '17.09.0-ce',
|
||||
komposeVersion: 'v1.21.0',
|
||||
dockerComposeVersion: '1.27.4',
|
||||
komposeVersion: 'v1.22.0',
|
||||
kubectlVersion: 'v1.18.0',
|
||||
},
|
||||
config: gruntfile_cfg.config,
|
||||
@@ -37,6 +38,7 @@ module.exports = function (grunt) {
|
||||
grunt.registerTask('build:server', [
|
||||
'shell:build_binary:linux:' + arch,
|
||||
'shell:download_docker_binary:linux:' + arch,
|
||||
'shell:download_docker_compose_binary:linux:' + arch,
|
||||
'shell:download_kompose_binary:linux:' + arch,
|
||||
'shell:download_kubectl_binary:linux:' + arch,
|
||||
]);
|
||||
@@ -63,6 +65,7 @@ module.exports = function (grunt) {
|
||||
'copy:assets',
|
||||
'shell:build_binary:' + p + ':' + a,
|
||||
'shell:download_docker_binary:' + p + ':' + a,
|
||||
'shell:download_docker_compose_binary:' + p + ':' + a,
|
||||
'shell:download_kompose_binary:' + p + ':' + a,
|
||||
'shell:download_kubectl_binary:' + p + ':' + a,
|
||||
'webpack:prod',
|
||||
@@ -77,6 +80,7 @@ module.exports = function (grunt) {
|
||||
'copy:assets',
|
||||
'shell:build_binary_azuredevops:' + p + ':' + a,
|
||||
'shell:download_docker_binary:' + p + ':' + a,
|
||||
'shell:download_docker_compose_binary:' + p + ':' + a,
|
||||
'shell:download_kompose_binary:' + p + ':' + a,
|
||||
'shell:download_kubectl_binary:' + p + ':' + a,
|
||||
'webpack:prod',
|
||||
@@ -138,6 +142,7 @@ gruntfile_cfg.shell = {
|
||||
download_docker_binary: { command: shell_download_docker_binary },
|
||||
download_kompose_binary: { command: shell_download_kompose_binary },
|
||||
download_kubectl_binary: { command: shell_download_kubectl_binary },
|
||||
download_docker_compose_binary: { command: shell_download_docker_compose_binary },
|
||||
run_container: { command: shell_run_container },
|
||||
run_localserver: { command: shell_run_localserver, options: { async: true } },
|
||||
install_yarndeps: { command: shell_install_yarndeps },
|
||||
@@ -204,6 +209,33 @@ function shell_download_docker_binary(p, a) {
|
||||
}
|
||||
}
|
||||
|
||||
function shell_download_docker_compose_binary(p, a) {
|
||||
var ps = { windows: 'win', darwin: 'mac' };
|
||||
var as = { amd64: 'x86_64', arm: 'armhf', arm64: 'aarch64' };
|
||||
var ip = ps[p] === undefined ? p : ps[p];
|
||||
var ia = as[a] === undefined ? a : as[a];
|
||||
var binaryVersion = '<%= binaries.dockerComposeVersion %>';
|
||||
|
||||
if (p === 'linux' || p === 'mac') {
|
||||
return [
|
||||
'if [ -f dist/docker ]; then',
|
||||
'echo "Docker Compose binary exists";',
|
||||
'else',
|
||||
'build/download_docker_compose_binary.sh ' + ip + ' ' + ia + ' ' + binaryVersion + ';',
|
||||
'fi',
|
||||
].join(' ');
|
||||
} else {
|
||||
return [
|
||||
'powershell -Command "& {if (Test-Path -Path "dist/docker-compose.exe") {',
|
||||
'Write-Host "Skipping download, Docker Compose binary exists"',
|
||||
'return',
|
||||
'} else {',
|
||||
'& ".\\build\\download_docker_compose_binary.ps1" -docker_compose_version ' + binaryVersion + '',
|
||||
'}}"',
|
||||
].join(' ');
|
||||
}
|
||||
}
|
||||
|
||||
function shell_download_kompose_binary(p, a) {
|
||||
var binaryVersion = '<%= binaries.komposeVersion %>';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user