diff --git a/app/models/clusters/applications/knative.rb b/app/models/clusters/applications/knative.rb index 6ad086211fb9a8f7beecb47f756c986870e72e44..bca0b09a3f63e9f6c673df4bdc971b4b19d1a161 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.7.0' + VERSION = '0.8.1' REPOSITORY = 'https://storage.googleapis.com/triggermesh-charts' METRICS_CONFIG = 'https://storage.googleapis.com/triggermesh-charts/istio-metrics.yaml' FETCH_IP_ADDRESS_DELAY = 30.seconds diff --git a/changelogs/unreleased/knative-0-8-update.yml b/changelogs/unreleased/knative-0-8-update.yml new file mode 100644 index 0000000000000000000000000000000000000000..24ed1d0e9a7a4fe7153ef6a8a3b174d457badd43 --- /dev/null +++ b/changelogs/unreleased/knative-0-8-update.yml @@ -0,0 +1,5 @@ +--- +title: Update Knative to 0.8.1 +merge_request: +author: cab105 +type: added diff --git a/spec/controllers/projects/serverless/functions_controller_spec.rb b/spec/controllers/projects/serverless/functions_controller_spec.rb index 73fb0fad646a15f975af8d654909386c17a3addd..55b9fa08b00acd297b3b205484d54bdf883736dc 100644 --- a/spec/controllers/projects/serverless/functions_controller_spec.rb +++ b/spec/controllers/projects/serverless/functions_controller_spec.rb @@ -149,6 +149,14 @@ def params(opts = {}) include_examples 'GET #show with valid data' end + + context 'on Knative 0.8.1' do + before do + prepare_knative_stubs(knative_08_service(knative_stub_options)) + end + + include_examples 'GET #show with valid data' + end end end @@ -210,6 +218,14 @@ def params(opts = {}) include_examples 'GET #index with data' end + + context 'on Knative 0.8.1' do + before do + prepare_knative_stubs(knative_08_service(knative_stub_options)) + end + + include_examples 'GET #index with data' + end end def prepare_knative_stubs(knative_service) diff --git a/spec/models/clusters/applications/knative_spec.rb b/spec/models/clusters/applications/knative_spec.rb index f1ce447a0d8c33cc64b0dd13699f17f81b884aa2..8262833bac6eeb25c35ec0a7e1bb9ea2a621d8bf 100644 --- a/spec/models/clusters/applications/knative_spec.rb +++ b/spec/models/clusters/applications/knative_spec.rb @@ -119,7 +119,7 @@ subject { knative.install_command } it 'is initialized with latest version' do - expect(subject.version).to eq('0.7.0') + expect(subject.version).to eq('0.8.1') end it_behaves_like 'a command' diff --git a/spec/support/helpers/kubernetes_helpers.rb b/spec/support/helpers/kubernetes_helpers.rb index 677aef57661e18c4915953b57f1833928ed30301..95656747382791ae7b9b9bfc721202d9b92a3a3e 100644 --- a/spec/support/helpers/kubernetes_helpers.rb +++ b/spec/support/helpers/kubernetes_helpers.rb @@ -322,7 +322,7 @@ def kube_knative_pods_body(name, namespace) def kube_knative_services_body(**options) { "kind" => "List", - "items" => [knative_07_service(options)] + "items" => [knative_08_service(options)] } end @@ -510,6 +510,58 @@ def knative_07_service(name: 'kubetest', namespace: 'default', domain: 'example. "podcount" => 0 } end + # noinspection RubyStringKeysInHashInspection + def knative_08_service(name: 'kubetest', namespace: 'default', domain: 'example.com', description: 'a knative service', environment: 'production') + { "apiVersion" => "serving.knative.dev/v1alpha1", + "kind" => "Service", + "metadata" => + { "annotations" => + { "serving.knative.dev/creator" => "system:serviceaccount:#{namespace}:#{namespace}-service-account", + "serving.knative.dev/lastModifier" => "system:serviceaccount:#{namespace}:#{namespace}-service-account" }, + "creationTimestamp" => "2019-10-22T21:19:13Z", + "generation" => 1, + "labels" => { "service" => name }, + "name" => name, + "namespace" => namespace, + "resourceVersion" => "289726", + "selfLink" => "/apis/serving.knative.dev/v1alpha1/namespaces/#{namespace}/services/#{name}", + "uid" => "988349fa-f511-11e9-9ea1-42010a80005e" }, + "spec" => { + "template" => { + "metadata" => { + "annotations" => { "Description" => description }, + "creationTimestamp" => "2019-10-22T21:19:12Z", + "labels" => { "service" => name } + }, + "spec" => { + "containers" => [{ + "env" => + [{ "name" => "timestamp", "value" => "2019-10-22 21:19:12" }], + "image" => "image_name", + "name" => "user-container", + "resources" => {} + }], + "timeoutSeconds" => 300 + } + }, + "traffic" => [{ "latestRevision" => true, "percent" => 100 }] + }, + "status" => + { "address" => { "url" => "http://#{name}.#{namespace}.svc.cluster.local" }, + "conditions" => + [{ "lastTransitionTime" => "2019-10-22T21:20:15Z", "status" => "True", "type" => "ConfigurationsReady" }, + { "lastTransitionTime" => "2019-10-22T21:20:15Z", "status" => "True", "type" => "Ready" }, + { "lastTransitionTime" => "2019-10-22T21:20:15Z", "status" => "True", "type" => "RoutesReady" }], + "latestCreatedRevisionName" => "#{name}-92tsj", + "latestReadyRevisionName" => "#{name}-92tsj", + "observedGeneration" => 1, + "traffic" => [{ "latestRevision" => true, "percent" => 100, "revisionName" => "#{name}-92tsj" }], + "url" => "http://#{name}.#{namespace}.#{domain}" }, + "environment_scope" => environment, + "cluster_id" => 5, + "podcount" => 0 } + end + # noinspection RubyStringKeysInHashInspection def knative_05_service(name: 'kubetest', namespace: 'default', domain: 'example.com', description: 'a knative service', environment: 'production') { "apiVersion" => "serving.knative.dev/v1alpha1",