From 81d2c7b6fceae79b7c4be49b161160ddc2883aaa Mon Sep 17 00:00:00 2001 From: Chris Baumbauer Date: Wed, 17 Apr 2019 18:36:06 +0000 Subject: Bump version of knative from 0.3 -> 0.5 --- app/models/clusters/applications/knative.rb | 2 +- changelogs/unreleased/knative-0-5.yml | 5 +++++ config/prometheus/common_metrics.yml | 2 +- .../20190408163745_prometheus_knative05_fix.rb | 20 ++++++++++++++++++++ db/schema.rb | 2 +- spec/models/clusters/applications/knative_spec.rb | 2 +- 6 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 changelogs/unreleased/knative-0-5.yml create mode 100644 db/migrate/20190408163745_prometheus_knative05_fix.rb diff --git a/app/models/clusters/applications/knative.rb b/app/models/clusters/applications/knative.rb index f7e54833296..38cbc9ce8eb 100644 --- a/app/models/clusters/applications/knative.rb +++ b/app/models/clusters/applications/knative.rb @@ -3,7 +3,7 @@ module Clusters module Applications class Knative < ApplicationRecord - VERSION = '0.3.0'.freeze + VERSION = '0.5.0'.freeze REPOSITORY = 'https://storage.googleapis.com/triggermesh-charts'.freeze METRICS_CONFIG = 'https://storage.googleapis.com/triggermesh-charts/istio-metrics.yaml'.freeze FETCH_IP_ADDRESS_DELAY = 30.seconds diff --git a/changelogs/unreleased/knative-0-5.yml b/changelogs/unreleased/knative-0-5.yml new file mode 100644 index 00000000000..c7112b957e9 --- /dev/null +++ b/changelogs/unreleased/knative-0-5.yml @@ -0,0 +1,5 @@ +--- +title: Knative version bump 0.3 -> 0.5 +merge_request: +author: Chris Baumbauer +type: changed diff --git a/config/prometheus/common_metrics.yml b/config/prometheus/common_metrics.yml index 884868c6336..356f573c5e9 100644 --- a/config/prometheus/common_metrics.yml +++ b/config/prometheus/common_metrics.yml @@ -266,6 +266,6 @@ weight: 1 queries: - id: system_metrics_knative_function_invocation_count - query_range: 'floor(sum(rate(istio_revision_request_count{destination_configuration="%{function_name}", destination_namespace="%{kube_namespace}"}[1m])*30))' + query_range: 'floor(sum(rate(istio_revision_request_count{destination_configuration="%{function_name}", destination_namespace="%{kube_namespace}"}[1m])/3))' label: invocations / minute unit: requests diff --git a/db/migrate/20190408163745_prometheus_knative05_fix.rb b/db/migrate/20190408163745_prometheus_knative05_fix.rb new file mode 100644 index 00000000000..c11f6f0e29b --- /dev/null +++ b/db/migrate/20190408163745_prometheus_knative05_fix.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class PrometheusKnative05Fix < ActiveRecord::Migration[5.0] + include Gitlab::Database::MigrationHelpers + + require Rails.root.join('db/importers/common_metrics_importer.rb') + + DOWNTIME = false + + def up + Importers::CommonMetricsImporter.new.execute + end + + def down + # no-op + end +end diff --git a/db/schema.rb b/db/schema.rb index d1b3672725d..c0399529deb 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20190326164045) do +ActiveRecord::Schema.define(version: 20190408163745) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" diff --git a/spec/models/clusters/applications/knative_spec.rb b/spec/models/clusters/applications/knative_spec.rb index 5e68f2634da..405b5ad691c 100644 --- a/spec/models/clusters/applications/knative_spec.rb +++ b/spec/models/clusters/applications/knative_spec.rb @@ -109,7 +109,7 @@ describe Clusters::Applications::Knative do subject { knative.install_command } it 'is initialized with latest version' do - expect(subject.version).to eq('0.3.0') + expect(subject.version).to eq('0.5.0') end it_behaves_like 'a command' -- cgit v1.2.1