diff options
-rw-r--r-- | app/models/clusters/applications/knative.rb | 13 | ||||
-rw-r--r-- | app/services/clusters/applications/install_service.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/kubernetes/helm/kubectl_command.rb (renamed from lib/gitlab/kubernetes/helm/apply_command.rb) | 7 |
3 files changed, 16 insertions, 12 deletions
diff --git a/app/models/clusters/applications/knative.rb b/app/models/clusters/applications/knative.rb index efcc386483b..a0e55766763 100644 --- a/app/models/clusters/applications/knative.rb +++ b/app/models/clusters/applications/knative.rb @@ -15,19 +15,22 @@ module Clusters default_value_for :version, VERSION + def set_initial_status + return unless not_installable? + + self.status = 'installable' if cluster&.platform_kubernetes_active? + end + def install_command Gitlab::Kubernetes::Helm::KubectlCommand.new( name: name, - version: VERSION, - rbac: false, - chart: chart, - files: files + scripts: scripts ) end private - def script + def scripts [ "kubectl apply -f https://raw.githubusercontent.com/knative/serving/v0.1.1/third_party/config/build/release.yaml", "kubectl apply -f https://github.com/knative/serving/releases/download/v0.1.1/release.yaml" diff --git a/app/services/clusters/applications/install_service.rb b/app/services/clusters/applications/install_service.rb index 7e3c0e77a83..2f72f604629 100644 --- a/app/services/clusters/applications/install_service.rb +++ b/app/services/clusters/applications/install_service.rb @@ -12,10 +12,10 @@ module Clusters ClusterWaitForAppInstallationWorker.perform_in( ClusterWaitForAppInstallationWorker::INTERVAL, app.name, app.id) - rescue Kubeclient::HttpError => ke - app.make_errored!("Kubernetes error: #{ke.message}") - rescue StandardError => e - app.make_errored!("Can't start installation process. #{e.message}") + #rescue Kubeclient::HttpError => ke + # app.make_errored!("Kubernetes error: #{ke.message}") + #rescue StandardError => e + # app.make_errored!("Can't start installation process. #{e.message}") end end end diff --git a/lib/gitlab/kubernetes/helm/apply_command.rb b/lib/gitlab/kubernetes/helm/kubectl_command.rb index c9ad8dc793c..c2bd9911df0 100644 --- a/lib/gitlab/kubernetes/helm/apply_command.rb +++ b/lib/gitlab/kubernetes/helm/kubectl_command.rb @@ -6,7 +6,7 @@ module Gitlab attr_reader :name, :scripts, :files - def initialize(name:, scripts:, files:) + def initialize(name:, scripts:, files: {}) @name = name @files = files @rbac = false @@ -21,12 +21,13 @@ module Gitlab echo http://mirror1.hs-esslingen.de/pub/Mirrors/alpine/v$ALPINE_VERSION/main >> /etc/apk/repositories apk add -U wget ca-certificates openssl >/dev/null wget -q https://storage.googleapis.com/kubernetes-release/release/v1.11.0/bin/darwin/amd64/kubectl - mv /usr/bin/ + chmod +x kubectl + mv kubectl /usr/bin/ HEREDOC end def generate_script - (base_script + scripts).join("\n") + ([base_script] + scripts).join("\n") end def rbac? |