Skip to content
Snippets Groups Projects

Incorporates Kubernetes Namespace into Cluster's flow

Merged Thong Kuah requested to merge 51716-create-kube-namespace into master
Compare and Show latest version
14 files
+ 238
60
Compare changes
  • Side-by-side
  • Inline
Files
14
@@ -6,6 +6,7 @@ class Kubernetes < ActiveRecord::Base
include Gitlab::Kubernetes
include ReactiveCaching
include EnumWithNil
include AfterCommitQueue
self.table_name = 'cluster_platforms_kubernetes'
self.reactive_cache_key = ->(kubernetes) { [kubernetes.class.model_name.singular, kubernetes.id] }
@@ -39,6 +40,7 @@ class Kubernetes < ActiveRecord::Base
validate :prevent_modification, on: :update
after_save :clear_reactive_cache!
after_update :update_kubernetes_namespace
alias_attribute :ca_pem, :ca_cert
@@ -196,6 +198,14 @@ def prevent_modification
true
end
def update_kubernetes_namespace
return unless namespace_changed?
run_after_commit do
ClusterPlatformConfigureWorker.perform_async(cluster.id)
end
end
end
end
end
Loading