diff options
-rw-r--r-- | CHANGELOG.md | 11 | ||||
-rw-r--r-- | GITALY_SERVER_VERSION | 2 | ||||
-rw-r--r-- | app/assets/javascripts/lib/utils/datetime_utility.js | 18 | ||||
-rw-r--r-- | app/assets/javascripts/vue_shared/components/timezone_dropdown.vue | 11 | ||||
-rw-r--r-- | app/models/clusters/applications/fluentd.rb | 6 | ||||
-rw-r--r-- | app/models/clusters/applications/ingress.rb | 7 | ||||
-rw-r--r-- | app/models/clusters/applications/prometheus.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml | 2 | ||||
-rw-r--r-- | lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml | 2 | ||||
-rw-r--r-- | spec/frontend/deploy_freeze/components/timezone_dropdown_spec.js | 15 | ||||
-rw-r--r-- | spec/models/clusters/applications/fluentd_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/clusters/applications/ingress_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/clusters/applications/prometheus_spec.rb | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | vendor/gitignore/C++.gitignore | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | vendor/gitignore/Java.gitignore | 0 |
15 files changed, 68 insertions, 22 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 02faf92eb98..7f5f837d9c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. +## 13.4.6 (2020-11-03) + +### Fixed (1 change) + +- Auto Deploy: fixes issues for fetching other charts from stable repo. !46531 + +### Other (1 change) + +- GitLab-managed apps: Use GitLab's repo as replacement for the Helm stable repo. !44875 + + ## 13.4.5 (2020-11-02) ### Security (9 changes) diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 2150631c08c..56f3fd065d7 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -13.4.5
\ No newline at end of file +13.4.6
\ No newline at end of file diff --git a/app/assets/javascripts/lib/utils/datetime_utility.js b/app/assets/javascripts/lib/utils/datetime_utility.js index b193a8b2c9a..611c97929a7 100644 --- a/app/assets/javascripts/lib/utils/datetime_utility.js +++ b/app/assets/javascripts/lib/utils/datetime_utility.js @@ -643,6 +643,24 @@ export const secondsToMilliseconds = seconds => seconds * 1000; export const secondsToDays = seconds => Math.round(seconds / 86400); /** + * Converts a numeric utc offset in seconds to +/- hours + * ie -32400 => -9 hours + * ie -12600 => -3.5 hours + * + * @param {Number} offset UTC offset in seconds as a integer + * + * @return {String} the + or - offset in hours + */ +export const secondsToHours = offset => { + const parsed = parseInt(offset, 10); + if (Number.isNaN(parsed) || parsed === 0) { + return `0`; + } + const num = offset / 3600; + return parseInt(num, 10) !== num ? num.toFixed(1) : num; +}; + +/** * Returns the date n days after the date provided * * @param {Date} date the initial date diff --git a/app/assets/javascripts/vue_shared/components/timezone_dropdown.vue b/app/assets/javascripts/vue_shared/components/timezone_dropdown.vue index 135b9842cbf..43420e393b2 100644 --- a/app/assets/javascripts/vue_shared/components/timezone_dropdown.vue +++ b/app/assets/javascripts/vue_shared/components/timezone_dropdown.vue @@ -2,6 +2,7 @@ import { GlDropdown, GlDeprecatedDropdownItem, GlSearchBoxByType, GlIcon } from '@gitlab/ui'; import { __ } from '~/locale'; import autofocusonshow from '~/vue_shared/directives/autofocusonshow'; +import { secondsToHours } from '~/lib/utils/datetime_utility'; export default { name: 'TimezoneDropdown', @@ -59,16 +60,8 @@ export default { isSelected(timezone) { return this.value === timezone.formattedTimezone; }, - formatUtcOffset(offset) { - const parsed = parseInt(offset, 10); - if (Number.isNaN(parsed) || parsed === 0) { - return `0`; - } - const prefix = offset > 0 ? '+' : '-'; - return `${prefix}${Math.abs(offset / 3600)}`; - }, formatTimezone(item) { - return `[UTC ${this.formatUtcOffset(item.offset)}] ${item.name}`; + return `[UTC ${secondsToHours(item.offset)}] ${item.name}`; }, }, }; diff --git a/app/models/clusters/applications/fluentd.rb b/app/models/clusters/applications/fluentd.rb index 3fd6e870edc..c608d37be77 100644 --- a/app/models/clusters/applications/fluentd.rb +++ b/app/models/clusters/applications/fluentd.rb @@ -22,7 +22,11 @@ module Clusters validate :has_at_least_one_log_enabled? def chart - 'stable/fluentd' + 'fluentd/fluentd' + end + + def repository + 'https://gitlab-org.gitlab.io/cluster-integration/helm-stable-archive' end def install_command diff --git a/app/models/clusters/applications/ingress.rb b/app/models/clusters/applications/ingress.rb index 1d08f38a2f1..d5412714858 100644 --- a/app/models/clusters/applications/ingress.rb +++ b/app/models/clusters/applications/ingress.rb @@ -46,7 +46,11 @@ module Clusters end def chart - 'stable/nginx-ingress' + "#{name}/nginx-ingress" + end + + def repository + 'https://gitlab-org.gitlab.io/cluster-integration/helm-stable-archive' end def values @@ -60,6 +64,7 @@ module Clusters def install_command Gitlab::Kubernetes::Helm::InstallCommand.new( name: name, + repository: repository, version: VERSION, rbac: cluster.platform_kubernetes_rbac?, chart: chart, diff --git a/app/models/clusters/applications/prometheus.rb b/app/models/clusters/applications/prometheus.rb index dd6a4144608..7679296699f 100644 --- a/app/models/clusters/applications/prometheus.rb +++ b/app/models/clusters/applications/prometheus.rb @@ -51,7 +51,11 @@ module Clusters end def chart - 'stable/prometheus' + "#{name}/prometheus" + end + + def repository + 'https://gitlab-org.gitlab.io/cluster-integration/helm-stable-archive' end def service_name @@ -65,6 +69,7 @@ module Clusters def install_command Gitlab::Kubernetes::Helm::InstallCommand.new( name: name, + repository: repository, version: VERSION, rbac: cluster.platform_kubernetes_rbac?, chart: chart, @@ -76,6 +81,7 @@ module Clusters def patch_command(values) ::Gitlab::Kubernetes::Helm::PatchCommand.new( name: name, + repository: repository, version: version, rbac: cluster.platform_kubernetes_rbac?, chart: chart, diff --git a/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml index 86f946aafda..7ad5a9e2bba 100644 --- a/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml @@ -1,5 +1,5 @@ .dast-auto-deploy: - image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v1.0.3" + image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v1.0.7" dast_environment_deploy: extends: .dast-auto-deploy diff --git a/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml index 829fd7a722f..33d77e39bc9 100644 --- a/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml @@ -1,5 +1,5 @@ .auto-deploy: - image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v1.0.3" + image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:v1.0.7" dependencies: [] review: diff --git a/spec/frontend/deploy_freeze/components/timezone_dropdown_spec.js b/spec/frontend/deploy_freeze/components/timezone_dropdown_spec.js index 99cb864ce34..dc25c7647b8 100644 --- a/spec/frontend/deploy_freeze/components/timezone_dropdown_spec.js +++ b/spec/frontend/deploy_freeze/components/timezone_dropdown_spec.js @@ -1,6 +1,7 @@ import Vuex from 'vuex'; import { shallowMount, createLocalVue } from '@vue/test-utils'; import { GlDeprecatedDropdownItem, GlDropdown } from '@gitlab/ui'; +import { secondsToHours } from '~/lib/utils/datetime_utility'; import TimezoneDropdown from '~/vue_shared/components/timezone_dropdown.vue'; import createStore from '~/deploy_freeze/store'; @@ -12,6 +13,11 @@ describe('Deploy freeze timezone dropdown', () => { let store; const timezoneDataFixture = getJSONFixture('/api/freeze-periods/timezone_data.json'); + const findTzByName = (identifier = '') => + timezoneDataFixture.find(({ name }) => name.toLowerCase() === identifier.toLowerCase()); + + const formatTz = ({ offset, name }) => `[UTC ${secondsToHours(offset)}] ${name}`; + const createComponent = (searchTerm, selectedTimezone) => { store = createStore({ projectId: '8', @@ -63,8 +69,9 @@ describe('Deploy freeze timezone dropdown', () => { }); it('renders only the time zone searched for', () => { + const selectedTz = findTzByName('Alaska'); expect(findAllDropdownItems()).toHaveLength(1); - expect(findDropdownItemByIndex(0).text()).toBe('[UTC -8] Alaska'); + expect(findDropdownItemByIndex(0).text()).toBe(formatTz(selectedTz)); }); it('should not display empty results message', () => { @@ -72,13 +79,15 @@ describe('Deploy freeze timezone dropdown', () => { }); describe('Custom events', () => { + const selectedTz = findTzByName('Alaska'); + it('should emit input if a time zone is clicked', () => { findDropdownItemByIndex(0).vm.$emit('click'); expect(wrapper.emitted('input')).toEqual([ [ { - formattedTimezone: '[UTC -8] Alaska', - identifier: 'America/Juneau', + formattedTimezone: formatTz(selectedTz), + identifier: selectedTz.identifier, }, ], ]); diff --git a/spec/models/clusters/applications/fluentd_spec.rb b/spec/models/clusters/applications/fluentd_spec.rb index be7b4a87947..3bda3e99ec1 100644 --- a/spec/models/clusters/applications/fluentd_spec.rb +++ b/spec/models/clusters/applications/fluentd_spec.rb @@ -25,7 +25,7 @@ RSpec.describe Clusters::Applications::Fluentd do it 'is initialized with fluentd arguments' do expect(subject.name).to eq('fluentd') - expect(subject.chart).to eq('stable/fluentd') + expect(subject.chart).to eq('fluentd/fluentd') expect(subject.version).to eq('2.4.0') expect(subject).to be_rbac end diff --git a/spec/models/clusters/applications/ingress_spec.rb b/spec/models/clusters/applications/ingress_spec.rb index e029283326f..196d57aff7b 100644 --- a/spec/models/clusters/applications/ingress_spec.rb +++ b/spec/models/clusters/applications/ingress_spec.rb @@ -135,7 +135,7 @@ RSpec.describe Clusters::Applications::Ingress do it 'is initialized with ingress arguments' do expect(subject.name).to eq('ingress') - expect(subject.chart).to eq('stable/nginx-ingress') + expect(subject.chart).to eq('ingress/nginx-ingress') expect(subject.version).to eq('1.40.2') expect(subject).to be_rbac expect(subject.files).to eq(ingress.files) diff --git a/spec/models/clusters/applications/prometheus_spec.rb b/spec/models/clusters/applications/prometheus_spec.rb index 82971596176..b450900bee6 100644 --- a/spec/models/clusters/applications/prometheus_spec.rb +++ b/spec/models/clusters/applications/prometheus_spec.rb @@ -152,7 +152,7 @@ RSpec.describe Clusters::Applications::Prometheus do it 'is initialized with 3 arguments' do expect(subject.name).to eq('prometheus') - expect(subject.chart).to eq('stable/prometheus') + expect(subject.chart).to eq('prometheus/prometheus') expect(subject.version).to eq('10.4.1') expect(subject).to be_rbac expect(subject.files).to eq(prometheus.files) @@ -240,7 +240,7 @@ RSpec.describe Clusters::Applications::Prometheus do it 'is initialized with 3 arguments' do expect(patch_command.name).to eq('prometheus') - expect(patch_command.chart).to eq('stable/prometheus') + expect(patch_command.chart).to eq('prometheus/prometheus') expect(patch_command.version).to eq('10.4.1') expect(patch_command.files).to eq(prometheus.files) end diff --git a/vendor/gitignore/C++.gitignore b/vendor/gitignore/C++.gitignore index 259148fa18f..259148fa18f 100644..100755 --- a/vendor/gitignore/C++.gitignore +++ b/vendor/gitignore/C++.gitignore diff --git a/vendor/gitignore/Java.gitignore b/vendor/gitignore/Java.gitignore index a1c2a238a96..a1c2a238a96 100644..100755 --- a/vendor/gitignore/Java.gitignore +++ b/vendor/gitignore/Java.gitignore |