Skip to content

Add WAF and Cilium Log column for Fluentd table

What does this MR do?

Add WAF and Cilium Log column for Fluentd table. Fluentd cluster application table was previously setting WAF path only.

Related issue: #199666 (closed)

Follow up from: !28844 (merged)

Migration output

== 20200413230056 AddWafAndCiliumLogsToApplicationsFluentd: migrating =========
-- transaction_open?()
   -> 0.0000s
-- execute("SET statement_timeout TO 0")
   -> 0.0003s
-- transaction()
-- add_column(:clusters_applications_fluentd, :waf_log_enabled, :boolean, {:default=>nil})
   -> 0.0027s
-- change_column_default(:clusters_applications_fluentd, :waf_log_enabled, true)
   -> 0.0036s
   -> 0.0072s
-- columns(:clusters_applications_fluentd)
   -> 0.0010s
-- transaction_open?()
   -> 0.0000s
-- exec_query("SELECT COUNT(*) AS count FROM \"clusters_applications_fluentd\"")
   -> 0.0005s
-- exec_query("SELECT \"clusters_applications_fluentd\".\"id\" FROM \"clusters_applications_fluentd\" ORDER BY \"clusters_applications_fluentd\".\"id\" ASC LIMIT 1")
   -> 0.0004s
-- exec_query("SELECT \"clusters_applications_fluentd\".\"id\" FROM \"clusters_applications_fluentd\" WHERE \"clusters_applications_fluentd\".\"id\" >= 2 ORDER BY \"clusters_applications_fluentd\".\"id\" ASC LIMIT 1 OFFSET 1")
   -> 0.0002s
-- execute("UPDATE \"clusters_applications_fluentd\" SET \"waf_log_enabled\" = TRUE WHERE \"clusters_applications_fluentd\".\"id\" >= 2")
   -> 0.0005s
-- change_column_null(:clusters_applications_fluentd, :waf_log_enabled, false)
   -> 0.0003s
-- execute("RESET ALL")
   -> 0.0001s
-- transaction_open?()
   -> 0.0000s
-- execute("SET statement_timeout TO 0")
   -> 0.0001s
-- transaction()
-- add_column(:clusters_applications_fluentd, :cilium_log_enabled, :boolean, {:default=>nil})
   -> 0.0005s
-- change_column_default(:clusters_applications_fluentd, :cilium_log_enabled, true)
   -> 0.0012s
   -> 0.0019s
-- columns(:clusters_applications_fluentd)
   -> 0.0008s
-- transaction_open?()
   -> 0.0000s
-- exec_query("SELECT COUNT(*) AS count FROM \"clusters_applications_fluentd\"")
   -> 0.0002s
-- exec_query("SELECT \"clusters_applications_fluentd\".\"id\" FROM \"clusters_applications_fluentd\" ORDER BY \"clusters_applications_fluentd\".\"id\" ASC LIMIT 1")
   -> 0.0002s
-- exec_query("SELECT \"clusters_applications_fluentd\".\"id\" FROM \"clusters_applications_fluentd\" WHERE \"clusters_applications_fluentd\".\"id\" >= 2 ORDER BY \"clusters_applications_fluentd\".\"id\" ASC LIMIT 1 OFFSET 1")
   -> 0.0002s
-- execute("UPDATE \"clusters_applications_fluentd\" SET \"cilium_log_enabled\" = TRUE WHERE \"clusters_applications_fluentd\".\"id\" >= 2")
   -> 0.0003s
-- change_column_null(:clusters_applications_fluentd, :cilium_log_enabled, false)
   -> 0.0003s
-- execute("RESET ALL")
   -> 0.0001s
== 20200413230056 AddWafAndCiliumLogsToApplicationsFluentd: migrated (0.0160s)
== 20200413230056 AddWafAndCiliumLogsToApplicationsFluentd: reverting =========
-- remove_column(:clusters_applications_fluentd, :waf_log_enabled)
   -> 0.0015s
-- remove_column(:clusters_applications_fluentd, :cilium_log_enabled)
   -> 0.0004s
== 20200413230056 AddWafAndCiliumLogsToApplicationsFluentd: reverted (0.0020s)

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Rémy Coutable

Merge request reports