Hello community, here is the log from the commit of package velum for openSUSE:Factory checked in at 2018-06-02 12:11:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/velum (Old) and /work/SRC/openSUSE:Factory/.velum.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "velum" Sat Jun 2 12:11:18 2018 rev:30 rq:613134 version:4.0.0+dev+git_r808_1dbbecc8a60ef4939b41f048eaf80b2922d9d8b3 Changes: -------- --- /work/SRC/openSUSE:Factory/velum/velum.changes 2018-05-29 10:44:23.453663869 +0200 +++ /work/SRC/openSUSE:Factory/.velum.new/velum.changes 2018-06-02 12:12:02.536223162 +0200 @@ -1,0 +2,69 @@ +Wed May 30 14:24:25 UTC 2018 - [email protected] + +- Commit 8fcb730 by Miquel Sabaté Solà [email protected] + reservations: don't save if a value is not valid + + Before this commit, the transaction on the `create` method from the + KubeletComputeResourcesReservationsController was useless because it updated + the attributes before the transaction itself. This commit corrects that and + simplifies it, so an error on any of the parameters will issue a rollback + (hence, the DB will be left untouched). + + Signed-off-by: Miquel Sabaté Solà <[email protected]> + + Commit be1c78a by Miquel Sabaté Solà [email protected] + pillar: added a validator for hard eviction + + The kubelet component does not accept any kind of value: it expects a + specific syntax. This commit adds a validator for the pillar that applies + only if its `pillar` value is set to `kubelet:eviction-hard`. + + bsc#1093894 + + Signed-off-by: Miquel Sabaté Solà <[email protected]> + + +------------------------------------------------------------------- +Wed May 30 13:35:05 UTC 2018 - [email protected] + +- Commit f3a38e6 by Maximilian Meister [email protected] + read distribution from a file + + this enables branding for kubic and caasp + + feature#branding + + Signed-off-by: Maximilian Meister <[email protected]> + + +------------------------------------------------------------------- +Tue May 29 10:25:45 UTC 2018 - [email protected] + +- Commit 96437a9 by Flavio Castelli [email protected] + Revert "Allow users to choose flannel's backend" + + This reverts commit 99550aacb6b7c5bfa48545005039c743aa2ee853. + + It turns out it's possible to use the VXLAN backend to create clusters over + segmented networks. + + feature#revert-UDP-selection-UI + + +------------------------------------------------------------------- +Tue May 29 10:19:01 UTC 2018 - [email protected] + +- Commit 5334257 by Florian Bergmann [email protected] + Fix bsc#1062186: update tooltip to explain possible dashboard values. + + +------------------------------------------------------------------- +Mon May 28 10:56:23 UTC 2018 - [email protected] + +- Commit 5463971 by Jordi Massaguer Pla [email protected] + update velum requirements on mariadb for sle15 + + Signed-off-by: Jordi Massaguer Pla <[email protected]> + + +------------------------------------------------------------------- @@ -76,2 +145,2 @@ -- Commit 16ee911 by Florian Bergmann [email protected] - Extract more logic into the base controller. +- Commit 59f3741 by Florian Bergmann [email protected] + Fix bsc#1090067 (5/5): Extract more logic into the base controller. @@ -85,2 +154,4 @@ - Commit 471f9ed by Florian Bergmann [email protected] - Move the migration to the end of the migration list by renaming. + (cherry picked from commit 16ee911dfa89e84e5366886ebc00a8afffb82c86) + + Commit 01ed07e by Florian Bergmann [email protected] + Fix bsc#1090067 (4/5): Move the migration to the end of list. @@ -91,2 +162,4 @@ - Commit 61b72b5 by Florian Bergmann [email protected] - Add ui for self-signed certificates to welcome page. + (cherry picked from commit 471f9eda08ad99f56d0d03cf002a308674fb27fa) + + Commit 25dc6c9 by Florian Bergmann [email protected] + Fix bsc#1090067 (3/5): UI for self-signed certificates on welcome page. @@ -96,2 +169,4 @@ - Commit 5e85427 by Florian Bergmann [email protected] - Extract common logic of certificate handling controllers. + (cherry picked from commit 61b72b5f4b4cebd62e9f31e299d07e068f7c0270) + + Commit 22af67c by Florian Bergmann [email protected] + Fix bsc#1090067 (2/5): Extract certificate handling logic. @@ -99,2 +174,4 @@ - Commit 66fdc28 by Florian Bergmann [email protected] - Initial basic implementation of a system wide certificates. + (cherry picked from commit 5e85427dfaa3db1795d1cca92440d334e6dcd182) + + Commit ad18b17 by Florian Bergmann [email protected] + Fix bsc#1090067 (1/5): implementation of a system wide certificates. @@ -104 +180,0 @@ - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ velum.spec ++++++ --- /var/tmp/diff_new_pack.WUhFor/_old 2018-06-02 12:12:06.600074108 +0200 +++ /var/tmp/diff_new_pack.WUhFor/_new 2018-06-02 12:12:06.640072641 +0200 @@ -23,7 +23,7 @@ # Version: 1.0.0 # %%define branch 1.0.0 -Version: 4.0.0+dev+git_r797_7e1a29814f26359f9f065d99f101f1ba80ec93ab +Version: 4.0.0+dev+git_r808_1dbbecc8a60ef4939b41f048eaf80b2922d9d8b3 Release: 0 %define branch master Summary: Dashboard for CaasP @@ -56,7 +56,8 @@ # fixed gem dependent build requires BuildRequires: libxml2-devel BuildRequires: libxslt-devel -%if 0%{?suse_version} > 1500 +# if openSUSE Tumbleweed or SLE_15 +%if 0%{?suse_version} > 1500 || 0%{?sle_version} == 150000 BuildRequires: libmariadb-devel Requires: mariadb-client %else @@ -91,7 +92,7 @@ %description velum is the dashboard for CaasP to manage and deploy kubernetes clusters on top of MicroOS -This package has been built with commit 7e1a29814f26359f9f065d99f101f1ba80ec93ab from branch master on date Fri, 25 May 2018 11:47:50 +0000 +This package has been built with commit 1dbbecc8a60ef4939b41f048eaf80b2922d9d8b3 from branch master on date Wed, 30 May 2018 14:23:41 +0000 %prep %setup -q -n velum-%{branch} ++++++ master.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/PRODUCT new/velum-master/PRODUCT --- old/velum-master/PRODUCT 1970-01-01 01:00:00.000000000 +0100 +++ new/velum-master/PRODUCT 2018-05-30 16:25:04.000000000 +0200 @@ -0,0 +1 @@ +Kubic diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/README.md new/velum-master/README.md --- old/velum-master/README.md 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/README.md 2018-05-30 16:25:04.000000000 +0200 @@ -4,17 +4,17 @@ |--------|--------------| | [](https://travis-ci.org/kubic-project/velum) | [](https://codeclimate.com/github/kubic-project/velum) [](https://codeclimate.com/github/kubic-project/velum/coverage) | -Velum is a dashboard that manages your SUSE CaaS Platform cluster. With Velum, you will +Velum is a dashboard that manages your Kubic/SUSE CaaS Platform cluster. With Velum, you will be able to: - Bootstrap a Kubernetes cluster with a simple click. - Manage your Kubernetes cluster: adding and removing nodes from your cluster, monitoring faulty nodes, etc. -- Setup an update policy that suits your needs. SUSE CaaS Platform already provides a +- Setup an update policy that suits your needs. Kubic/SUSE CaaS Platform already provides a transparent and sensible procedure for updates that guarantees no downtime, but with Velum you will be able to further tune this. -The architecture of CaaS Platform uses [Salt](https://saltstack.com/) quite heavily, +The architecture of Kubic/CaaS Platform uses [Salt](https://saltstack.com/) quite heavily, and worker nodes are supposed to run as [Salt minions](https://docs.saltstack.com/en/latest/ref/cli/salt-minion.html). These Salt minions should then register to Velum, which acts as a Salt master. As an diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/controllers/dashboard_controller.rb new/velum-master/app/controllers/dashboard_controller.rb --- old/velum-master/app/controllers/dashboard_controller.rb 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/controllers/dashboard_controller.rb 2018-05-30 16:25:04.000000000 +0200 @@ -19,7 +19,7 @@ before_action :redirect_to_dashboard, only: :unassigned_nodes # Return the autoyast XML profile to bootstrap other worker nodes. They will read this response in - # order to start an unattended installation of CaaSP. + # order to start an unattended cluster installation. # # It will return the content of the autoyast profile along with a 200 HTTP response code if the # operation was successfull, or a 503 HTTP response code (service unavailable) if there was any diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/controllers/settings/kubelet_compute_resources_reservations_controller.rb new/velum-master/app/controllers/settings/kubelet_compute_resources_reservations_controller.rb --- old/velum-master/app/controllers/settings/kubelet_compute_resources_reservations_controller.rb 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/controllers/settings/kubelet_compute_resources_reservations_controller.rb 2018-05-30 16:25:04.000000000 +0200 @@ -18,27 +18,18 @@ @system_reservations = KubeletComputeResourcesReservation.find_or_initialize_by( component: "system" ) - - @kube_reservations.update_attributes(kube_reservation_params) - @system_reservations.update_attributes(system_reservation_params) @eviction_hard = Pillar.find_or_initialize_by(pillar: "kubelet:eviction-hard") ActiveRecord::Base.transaction do - @kube_reservations.save! - @system_reservations.save! - - if eviction_hard_param.blank? - @eviction_hard.destroy - @eviction_hard = Pillar.find_or_initialize_by(pillar: "kubelet:eviction-hard") - else - @eviction_hard.value = eviction_hard_param - @eviction_hard.save! - end + @kube_reservations.update_attributes!(kube_reservation_params) + @system_reservations.update_attributes!(system_reservation_params) + @eviction_hard.update_or_remove!(eviction_hard_param) end redirect_to settings_kubelet_compute_resources_reservations_path, notice: "kubelet resource reservations successfully saved." - rescue ActiveRecord::RecordInvalid + rescue ActiveRecord::RecordInvalid => e + Rails.logger.tagged(:kubelet_compute_resources_reservation) { Rails.logger.error e.message } render action: :index, status: :unprocessable_entity end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/controllers/setup_controller.rb new/velum-master/app/controllers/setup_controller.rb --- old/velum-master/app/controllers/setup_controller.rb 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/controllers/setup_controller.rb 2018-05-30 16:25:04.000000000 +0200 @@ -51,10 +51,6 @@ @cloud_openstack_lb_mon_retries = Pillar.value(pillar: :cloud_openstack_lb_mon_retries) || "3" @cloud_openstack_bs_version = Pillar.value(pillar: :cloud_openstack_bs_version) || "v2" - # flannel settings - @flannel_backend = Pillar.value(pillar: :flannel_backend) || "vxlan" - @flannel_port = Pillar.value(pillar: :flannel_port) || "8472" - # container runtime setting @cri = Pillar.value(pillar: :container_runtime) || "docker" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/helpers/application_helper.rb new/velum-master/app/helpers/application_helper.rb --- old/velum-master/app/helpers/application_helper.rb 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/helpers/application_helper.rb 2018-05-30 16:25:04.000000000 +0200 @@ -45,4 +45,12 @@ end end end + + def product_name + Rails.configuration.x.product.name + end + + def product_version + Rails.configuration.x.product.version + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/models/pillar.rb new/velum-master/app/models/pillar.rb --- old/velum-master/app/models/pillar.rb 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/models/pillar.rb 2018-05-30 16:25:04.000000000 +0200 @@ -2,12 +2,18 @@ # rubocop:disable Metrics/ClassLength class Pillar < ApplicationRecord validates :pillar, presence: true - validates :value, presence: true + validates :value, presence: true, eviction: true scope :global, -> { where minion_id: nil } PROTECTED_PILLARS = [:dashboard, :apiserver, :dashboard_external_fqdn].freeze + # update_or_remove! updates the current pillar with the given value. That + # being said, if the given value is blank, then it will destroy this pillar. + def update_or_remove!(val) + val.blank? ? destroy : update_attributes!(value: val) + end + class << self def value(pillar:) Pillar.find_by(pillar: all_pillars[pillar]).try(:value) @@ -26,8 +32,6 @@ cluster_cidr_min: "cluster_cidr_min", cluster_cidr_max: "cluster_cidr_max", cluster_cidr_len: "cluster_cidr_len", - flannel_backend: "flannel:backend", - flannel_port: "flannel:port", cni_plugin: "cni:plugin", cilium_image: "cilium:image", services_cidr: "services_cidr", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/validators/eviction_validator.rb new/velum-master/app/validators/eviction_validator.rb --- old/velum-master/app/validators/eviction_validator.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/velum-master/app/validators/eviction_validator.rb 2018-05-30 16:25:04.000000000 +0200 @@ -0,0 +1,76 @@ +# Evictionvalidator checks the syntax for hard eviction policies. Some valid +# policies would be: "memory.available<10Mi" or "nodefs.inodesFree<10.6%". +class EvictionValidator < ActiveModel::EachValidator + INVALID_SYNTAX = "`kubelet:eviction-hard` has to follow a syntax like " \ + "'memory.available<10%'".freeze + + NUMBER_REGEXP = /(\d+(\.\d+)?(e\d+)?)/ + NUM_OR_PERC_REGEXP = /\A#{NUMBER_REGEXP}%?\z/ + BYTES_REGEXP = /\A#{NUMBER_REGEXP}([EPTGMK]i?)?\z/ + + # validate_each only validates the pillar value for `kubelet:eviction-hard`. + def validate_each(record, attribute, value) + return if attribute.to_sym != :value + return if record.pillar != "kubelet:eviction-hard" + + # According to `OpForSignal` from `pkg/kubelet/eviction/api/types.go`, the + # only supported operator for now is "<". This may change in the future if + # they introduce other operations like `memory.consumed>10Gi`. + parts = value.split("<") + if parts.size != 2 + record.errors.add(:value, INVALID_SYNTAX) + return + end + + # At this point we can have errors on both sides of the comparison. Do not + # return early so we can fetch as many errors as possible. + lval(record, parts.first) + rval(record, parts.last) + end + + protected + + # lval checks the syntax of the left value from the comparison. + def lval(record, val) + components = val.split(".") + + case components.first + when "memory" + validate_lval(record, components.first, components[1], ["available"]) + when "nodefs", "imagefs" + validate_lval(record, components.first, components[1], %w[available inodesFree]) + else + unknown!(record, components.first) + end + end + + # validate_lval will set an error on the given record if the given method is + # blank or not supported. + def validate_lval(record, component, method, supported) + if method.blank? + eg = "#{component}.#{supported.first}" + record.errors.add(:value, "`#{component}` requires something like `#{eg}`") + elsif !supported.include?(method) + unknown!(record, component, method) + end + end + + # rval checks the syntax of the right value from the comparison. + def rval(record, val) + return if val =~ NUM_OR_PERC_REGEXP + return if val =~ BYTES_REGEXP + + record.errors.add(:value, "invalid syntax for right side " \ + "(i.e. expected something like `1.5Gi` or `10%`)") + end + + # unknown! sets an error for unknown components or options. If `option` is + # left blank, then it's assumed that the component is the thing unknown. + def unknown!(record, component, option = "") + if option.blank? + record.errors.add(:value, "unknown component `#{component}`") + else + record.errors.add(:value, "unknown `#{component}.#{option}` option") + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/views/dashboard/index.html.slim new/velum-master/app/views/dashboard/index.html.slim --- old/velum-master/app/views/dashboard/index.html.slim 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/views/dashboard/index.html.slim 2018-05-30 16:25:04.000000000 +0200 @@ -1,7 +1,7 @@ .alert.alert-warning.unsupported-alert role="alert" hidden="true" i.fa.fa-4x.pull-left aria-hidden="true" span - | A supported deployment of SUSE CaaS Platform requires + | A supported deployment of #{product_name} requires span class="reason" | . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/views/devise/registrations/new.html.slim new/velum-master/app/views/devise/registrations/new.html.slim --- old/velum-master/app/views/devise/registrations/new.html.slim 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/views/devise/registrations/new.html.slim 2018-05-30 16:25:04.000000000 +0200 @@ -1,11 +1,9 @@ .row .col-sm-6 h1.Raleway-font - | SUSE - br - small CaaS Platform + = product_name .margins-updown - p SUSE CaaS Platform allows you to provision, manage, and scale container-based applications. + p #{product_name} allows you to provision, manage, and scale container-based applications. p It automates your tedious management tasks allowing you to focus on development and writing apps to meet business goals. p | I already have an account. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/views/devise/sessions/new.html.slim new/velum-master/app/views/devise/sessions/new.html.slim --- old/velum-master/app/views/devise/sessions/new.html.slim 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/views/devise/sessions/new.html.slim 2018-05-30 16:25:04.000000000 +0200 @@ -1,11 +1,9 @@ .row .col-sm-6 h1.Raleway-font - | SUSE - br - small CaaS Platform + = product_name .margins-updown - p SUSE CaaS Platform allows you to provision, manage, and scale container-based applications. + p #{product_name} allows you to provision, manage, and scale container-based applications. p It automates your tedious management tasks allowing you to focus on development and writing apps to meet business goals. p - if User.count.zero? diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/views/layouts/application.html.slim new/velum-master/app/views/layouts/application.html.slim --- old/velum-master/app/views/layouts/application.html.slim 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/views/layouts/application.html.slim 2018-05-30 16:25:04.000000000 +0200 @@ -28,7 +28,7 @@ .col-xs-12 p.text-center span - 'SUSE® CaaS Platform #{Rails.root.join("VERSION").read} | © SUSE Linux #{Time.now.year} + '#{product_name} #{product_version} | © SUSE Linux #{Time.now.year} = javascript_include_tag 'application' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/views/layouts/authentication.html.slim new/velum-master/app/views/layouts/authentication.html.slim --- old/velum-master/app/views/layouts/authentication.html.slim 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/views/layouts/authentication.html.slim 2018-05-30 16:25:04.000000000 +0200 @@ -1,7 +1,8 @@ doctype html html head - title SUSE CaaS Platform: Velum + title + = product_name + ": Velum" = stylesheet_link_tag 'authentication', media: 'all' = javascript_include_tag 'application' = csrf_meta_tags @@ -26,7 +27,7 @@ .row .col-sm-9 .copyright - | SUSE® CaaS Platform #{Rails.root.join("VERSION").read} | © SUSE Linux #{Time.now.year} + | #{product_name} #{product_version} | © SUSE Linux #{Time.now.year} .col-sm-3 = image_tag "logo-footer.png", class: "suse-logo-footer pull-right" .bottom-line diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/views/layouts/settings.html.slim new/velum-master/app/views/layouts/settings.html.slim --- old/velum-master/app/views/layouts/settings.html.slim 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/views/layouts/settings.html.slim 2018-05-30 16:25:04.000000000 +0200 @@ -33,7 +33,7 @@ .col-xs-12 p.text-center span - 'SUSE® CaaS Platform #{Rails.root.join("VERSION").read} | © SUSE Linux #{Time.now.year} + '#{product_name} #{product_version} | © SUSE Linux #{Time.now.year} = javascript_include_tag 'application' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/views/setup/_warn_minimum_nodes_modal.html.erb new/velum-master/app/views/setup/_warn_minimum_nodes_modal.html.erb --- old/velum-master/app/views/setup/_warn_minimum_nodes_modal.html.erb 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/views/setup/_warn_minimum_nodes_modal.html.erb 2018-05-30 16:25:04.000000000 +0200 @@ -12,7 +12,7 @@ <div class="modal-body"> <p>You are going to deploy a cluster made by only one master and one worker node.</p> - <p>This kind of clusters is meant to be used only for development/testing/evaluation of SUSE CaaS Platform and is not a supported topology</p> + <p>This kind of clusters is meant to be used only for development/testing/evaluation of <%= product_name %> and is not a supported topology</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/views/setup/cloud/_openstack_configuration.html.slim new/velum-master/app/views/setup/cloud/_openstack_configuration.html.slim --- old/velum-master/app/views/setup/cloud/_openstack_configuration.html.slim 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/views/setup/cloud/_openstack_configuration.html.slim 2018-05-30 16:25:04.000000000 +0200 @@ -26,7 +26,7 @@ = f.label :cloud_openstack_password, "Password" = f.password_field :cloud_openstack_password, value: @cloud_openstack_password, class: "form-control" .form-group - = f.label :cloud_openstack_subnet, "Subnet UUID for the CaaS Platform private network" + = f.label :cloud_openstack_subnet, "Subnet UUID for the #{product_name} private network" = f.text_field :cloud_openstack_subnet, value: @cloud_openstack_subnet, class: "form-control" .form-group = f.label :cloud_openstack_floating, "Floating network UUID" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/views/setup/discovery.html.slim new/velum-master/app/views/setup/discovery.html.slim --- old/velum-master/app/views/setup/discovery.html.slim 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/views/setup/discovery.html.slim 2018-05-30 16:25:04.000000000 +0200 @@ -23,7 +23,7 @@ .alert.alert-warning.discovery-minimum-nodes-alert role="alert" hidden="true" i.fa.fa-4x.pull-left aria-hidden="true" span - | A supported deployment of SUSE CaaS Platform requires a minimum of three nodes. Please select a minimum of three nodes. + | A supported deployment of #{product_name} requires a minimum of three nodes. Please select a minimum of three nodes. .alert.alert-danger.discovery-bootstrap-alert role="alert" hidden="true" i.fa.fa-4x.pull-left aria-hidden="true" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/views/setup/welcome.html.slim new/velum-master/app/views/setup/welcome.html.slim --- old/velum-master/app/views/setup/welcome.html.slim 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/views/setup/welcome.html.slim 2018-05-30 16:25:04.000000000 +0200 @@ -1,5 +1,5 @@ = content_for :body_class, "welcome" -h1 Initial CaaS Platform Configuration +h1 Initial #{product_name} Configuration = form_for :settings, url: setup_path, method: :put do |f| .panel.panel-default @@ -7,11 +7,11 @@ h3.panel-title Generic settings .panel-body .form-group - = f.label :dashboard, "Internal Dashboard FQDN/IP" + = f.label :dashboard, "Internal Dashboard Location" .input-group = f.text_field :dashboard, value: @dashboard, class: "form-control", required: true span class="input-group-addon" - a data-toggle="tooltip" data-placement="left" title="Fully qualified domain name or IP used to reach Velum within the internal network. The external fqdn will have to be provided in a later step." + a data-toggle="tooltip" data-placement="left" title="Internal location of the dashboard - this must be resolvable by the worker nodes: it can either be a short name, the fully qualified domain name (FQDN) or an ip address depending on your networking setup. The external fqdn will have to be provided in a later step." i class='glyphicon glyphicon-info-sign' .panel.panel-default @@ -70,24 +70,6 @@ hr - .form-group - = f.label :flannel_backend, "Flannel backend" - = f.select :flannel_backend, options_for_select([["VXLAN", "vxlan"], ["UDP", "udp"]], @flannel_backend), {}, {class: "form-control", 'aria-describedby' => "flannel_backend_help"} - small.form-text.text-muted#flannel_backend_help - | The backend used by Flannel to encapsulate network traffic. VXLAN is the recommended choice. - - .form-group - = f.label :flannel_port, "Flannel port" - = f.text_field :flannel_port, value: @flannel_port, class: "form-control", required: true, 'aria-describedby' => "flannel_port_help" - small.form-text.text-muted#flannel_port_help - | The port used by Flannel to encapsulate network traffic. - code 8472 - | is the recommended port for the VXLAN backend. - code 8285 - | is the recommended port for the UDP backend. - - hr - p The Service Network is used internally within Kubernetes for pod to service communications. Each Kubernetes service will be allocated an IP from this range, this IP will be independant of any single master or worker. This network range will not be accessible from outside the cluster, however, conflicts with preexisting address ranges used elsewhere should be avoided. .form-group diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/views/setup/worker_bootstrap.html.slim new/velum-master/app/views/setup/worker_bootstrap.html.slim --- old/velum-master/app/views/setup/worker_bootstrap.html.slim 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/views/setup/worker_bootstrap.html.slim 2018-05-30 16:25:04.000000000 +0200 @@ -1,6 +1,6 @@ = content_for :body_class, "worker_bootstrap" -h1 Bootstrap your CaaS Platform +h1 Bootstrap your #{product_name} p | In order to complete the installation, it is necessary to bootstrap a few additional nodes, those will be the Kubernetes Master and Workers. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/views/setup/worker_bootstrap_azure.html.slim new/velum-master/app/views/setup/worker_bootstrap_azure.html.slim --- old/velum-master/app/views/setup/worker_bootstrap_azure.html.slim 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/views/setup/worker_bootstrap_azure.html.slim 2018-05-30 16:25:04.000000000 +0200 @@ -1,7 +1,7 @@ = content_for :body_class, "worker_bootstrap" h1 - ' Bootstrap your CaaS Platform + ' Bootstrap your #{product_name} small in Microsoft Azure diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/app/views/setup/worker_bootstrap_ec2.html.slim new/velum-master/app/views/setup/worker_bootstrap_ec2.html.slim --- old/velum-master/app/views/setup/worker_bootstrap_ec2.html.slim 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/app/views/setup/worker_bootstrap_ec2.html.slim 2018-05-30 16:25:04.000000000 +0200 @@ -1,7 +1,7 @@ = content_for :body_class, "worker_bootstrap" h1 - ' Bootstrap your CaaS Platform + ' Bootstrap your #{product_name} small in Amazon Web Services' Elastic Compute Cloud diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/config/environments/development.rb new/velum-master/config/environments/development.rb --- old/velum-master/config/environments/development.rb 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/config/environments/development.rb 2018-05-30 16:25:04.000000000 +0200 @@ -47,4 +47,8 @@ # Raises error for missing translations # config.action_view.raise_on_missing_translations = true + + # Read the product config + config.x.product.name = Rails.root.join("PRODUCT").read + config.x.product.version = Rails.root.join("VERSION").read end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/config/environments/production.rb new/velum-master/config/environments/production.rb --- old/velum-master/config/environments/production.rb 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/config/environments/production.rb 2018-05-30 16:25:04.000000000 +0200 @@ -77,4 +77,8 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + + # Read the product config + config.x.product.name = Rails.root.join("PRODUCT").read + config.x.product.version = Rails.root.join("VERSION").read end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/config/environments/test.rb new/velum-master/config/environments/test.rb --- old/velum-master/config/environments/test.rb 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/config/environments/test.rb 2018-05-30 16:25:04.000000000 +0200 @@ -44,4 +44,8 @@ # Precompile additional assets. config.assets.precompile += ["test.js", "test.css"] + + # Read the product config + config.x.product.name = Rails.root.join("PRODUCT").read + config.x.product.version = Rails.root.join("VERSION").read end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/packaging/suse/velum.spec.in new/velum-master/packaging/suse/velum.spec.in --- old/velum-master/packaging/suse/velum.spec.in 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/packaging/suse/velum.spec.in 2018-05-30 16:25:04.000000000 +0200 @@ -51,7 +51,8 @@ # fixed gem dependent build requires BuildRequires: libxml2-devel libxslt-devel -%if 0%{?suse_version} > 1500 +# if openSUSE Tumbleweed or SLE_15 +%if 0%{?suse_version} > 1500 || 0%{?sle_version} == 150000 BuildRequires: libmariadb-devel Requires: mariadb-client %else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/spec/controllers/settings/kubelet_compute_resources_reservations_controller_spec.rb new/velum-master/spec/controllers/settings/kubelet_compute_resources_reservations_controller_spec.rb --- old/velum-master/spec/controllers/settings/kubelet_compute_resources_reservations_controller_spec.rb 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/spec/controllers/settings/kubelet_compute_resources_reservations_controller_spec.rb 2018-05-30 16:25:04.000000000 +0200 @@ -55,6 +55,37 @@ end describe "POST #create" do + let(:kube_cpu) { "100m" } + let(:kube_memory) { "100M" } + let(:kube_ephemeral_storage) { "1G" } + + let(:system_cpu) { "200m" } + let(:system_memory) { "200M" } + let(:system_ephemeral_storage) { "2G" } + + let(:eviction_policy) { "10%" } + + context "when a validation error happens" do + let(:params) do + { + kube_cpu: kube_cpu, + kube_memory: kube_memory, + kube_ephemeral_storage: kube_ephemeral_storage, + system_cpu: system_cpu, + system_memory: system_memory, + system_ephemeral_storage: system_ephemeral_storage, + eviction_hard: eviction_policy + } + end + + it "rolls back and sends a 422" do + post :create, kubelet_compute_resources_reservations: params + + expect(response).to have_http_status(422) + expect(KubeletComputeResourcesReservation).not_to be_any + end + end + context "when no pre-existing reservations are in place" do let(:kube_cpu) { "100m" } let(:kube_memory) { "100M" } @@ -112,11 +143,20 @@ ).save end - it "removes the eviction policy when an empty value is given" do - post :create, kubelet_compute_resources_reservations: { - eviction_hard: "" + let(:params) do + { + kube_cpu: kube_cpu, + kube_memory: kube_memory, + kube_ephemeral_storage: kube_ephemeral_storage, + system_cpu: system_cpu, + system_memory: system_memory, + system_ephemeral_storage: system_ephemeral_storage, + eviction_hard: "" } + end + it "removes the eviction policy when an empty value is given" do + post :create, kubelet_compute_resources_reservations: params expect(Pillar.find_by(pillar: "kubelet:eviction-hard")).to be_nil end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/spec/models/kubelet_compute_resources_reservation_spec.rb new/velum-master/spec/models/kubelet_compute_resources_reservation_spec.rb --- old/velum-master/spec/models/kubelet_compute_resources_reservation_spec.rb 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/spec/models/kubelet_compute_resources_reservation_spec.rb 2018-05-30 16:25:04.000000000 +0200 @@ -1,7 +1,6 @@ require "rails_helper" describe KubeletComputeResourcesReservation, type: :model do - it { is_expected.not_to validate_presence_of(:cpu) } it { is_expected.not_to validate_presence_of(:memory) } it { is_expected.not_to validate_presence_of(:ephemeral_storage) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/velum-master/spec/models/pillar_spec.rb new/velum-master/spec/models/pillar_spec.rb --- old/velum-master/spec/models/pillar_spec.rb 2018-05-25 13:48:43.000000000 +0200 +++ new/velum-master/spec/models/pillar_spec.rb 2018-05-30 16:25:04.000000000 +0200 @@ -49,6 +49,118 @@ end end end + end + + describe "EvictionValidator" do + subject(:pillar) { described_class.find_or_initialize_by(pillar: "kubelet:eviction-hard") } + + it "is not valid if there is no comparator" do + pillar.value = "10%" + pillar.validate + + expect(pillar.errors[:value].first).to eq EvictionValidator::INVALID_SYNTAX + end + + it "catches as many errors as possible with operands" do + pillar.value = "memory.lala<10|" + pillar.validate + + expect(pillar.errors[:value].size).to eq 2 + end + + context "when memory is used" do + it "is not valid if there is no method specified" do + pillar.value = "memory<10%" + pillar.validate + + expect(pillar.errors[:value].first).to( + eq "`memory` requires something like `memory.available`" + ) + end + + it "is not valid if the given method is unknown" do + pillar.value = "memory.IAMERROR<10%" + pillar.validate + expect(pillar.errors[:value].first).to eq "unknown `memory.IAMERROR` option" + end + end + + # NOTE: 'imagefs' follows the same case as 'nodefs' + context "when nodefs is used" do + it "is not valid if there is no method specified" do + pillar.value = "nodefs<10%" + pillar.validate + + expect(pillar.errors[:value].first).to( + eq "`nodefs` requires something like `nodefs.available`" + ) + end + + it "is not valid if the given method is unknown" do + pillar.value = "nodefs.IAMERROR<10%" + pillar.validate + + expect(pillar.errors[:value].first).to eq "unknown `nodefs.IAMERROR` option" + end + + it "is valid for `available` and for `inodesFree`" do + %w[available inodesFree].each do |m| + pillar.value = "nodefs.#{m}<10%" + expect(pillar).to be_valid + end + end + end + + context "with left value" do + it "is not valid for unknown values" do + pillar.value = "IAMERROR.available<10%" + pillar.validate + + expect(pillar.errors[:value].first).to eq "unknown component `IAMERROR`" + end + end + + context "with right value" do + it "accepts percentages" do + pillar.value = "memory.available<10%" + expect(pillar).to be_valid + end + + it "accepts percentages with dots in it" do + pillar.value = "memory.available<10.55%" + expect(pillar).to be_valid + end + + it "accepts lone numbers" do + pillar.value = "memory.available<10" + expect(pillar).to be_valid + end + + it "accepts lone numbers with dots in it" do + pillar.value = "memory.available<10.0" + expect(pillar).to be_valid + end + + it "accepts valid suffixes" do + %w[E P T G M K Ei Pi Ti Gi Mi Ki].each do |suffix| + pillar.value = "memory.available<1024#{suffix}" + expect(pillar).to be_valid + end + end + + it "accepts exponential numbers" do + pillar.value = "memory.available<10e6M" + expect(pillar).to be_valid + end + + it "does not accept weird suffixes" do + pillar.value = "memory.available<10|" + pillar.validate + + msg = "invalid syntax for right side (i.e. expected something like `1.5Gi` or `10%`)" + expect(pillar.errors[:value].first).to eq msg + end + end end end
