Skip to content
This repository was archived by the owner on Jun 29, 2023. It is now read-only.

Commit 0ed508f

Browse files
authored
Remove deploy logging via Google Cloud Logging (#53)
We will put all our hopes and dreams into Spinnaker audit log. More importantly, for the sake of OSS it is one less hardcoded reference to LiveRamp GCP stuff that we have to worry about.
1 parent e98b282 commit 0ed508f

File tree

4 files changed

+2
-26
lines changed

4 files changed

+2
-26
lines changed

bin/deploy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,5 @@ Dir.mktmpdir do |tmpdir|
5656
)
5757
deploy.run(
5858
dry_run: options.dry_run,
59-
send_report: options.send_report
6059
)
6160
end

lib/kube_deploy_tools/deploy.rb

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
Service
3030
].freeze
3131

32-
# TODO: (aaron): make these configurable
33-
DEPLOY_LOG = 'projects/***REMOVED***/logs/deploys'
34-
DEPLOY_PROJECT = '***REMOVED***'
35-
3632
module KubeDeployTools
3733
class Deploy
3834
def initialize(
@@ -102,8 +98,7 @@ def do_deploy(dry_run)
10298
success
10399
end
104100

105-
def run(dry_run: true, send_report: true)
106-
notify(project_info.merge({'type':'deploy'}).to_json) if !dry_run && send_report
101+
def run(dry_run: true)
107102
do_deploy(dry_run)
108103
end
109104

@@ -216,13 +211,5 @@ def self.kube_namespace(context:, kubeconfig: nil)
216211
def current_user
217212
Shellrunner.run_call('gcloud', 'config', 'list', 'account', '--format', 'value(core.account)')[0]
218213
end
219-
220-
def notify(message)
221-
args = [
222-
'gcloud', 'logging', 'write', "--project=#{DEPLOY_PROJECT}",
223-
'--payload-type=json', DEPLOY_LOG, message
224-
]
225-
Shellrunner.check_call(*args)
226-
end
227214
end
228215
end

lib/kube_deploy_tools/deploy/options.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class Options
1313
:artifact,
1414
:build_number,
1515
:dry_run,
16-
:send_report,
1716
:glob_files,
1817
:pre_apply_hook,
1918
:max_retries,
@@ -23,7 +22,6 @@ def initialize
2322
self.project = File.basename(`git config remote.origin.url`.chomp, '.git')
2423
self.flavor = 'default'
2524
self.dry_run = true
26-
self.send_report = true
2725
self.glob_files = []
2826
end
2927

@@ -80,10 +78,6 @@ def define_options(parser)
8078
self.pre_apply_hook = p
8179
end
8280

83-
parser.on('--send-report SEND_REPORT', TrueClass, "If true, records data about the deploy to a centralized log. Default is #{send_report}") do |p|
84-
self.send_report = p
85-
end
86-
8781
parser.on('--retry NUM', 'Maximum number of times to retry') do |p|
8882
self.max_retries = p
8983
end

spec/unit/deploy_spec.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ def parse(ops)
7878
expect(kubectl).to receive(:run).with('apply', '-f', be_kubernetes_resource_of_kind('Service'), any_args).ordered
7979
expect(kubectl).to receive(:run).with('apply', '-f', be_kubernetes_resource_of_kind('Deployment'), any_args).ordered
8080

81-
expect(deploy).to receive(:notify).with(any_args)
8281
deploy.run(dry_run: false)
8382
end
8483

@@ -123,8 +122,6 @@ def parse(ops)
123122
expect(kubectl).to receive(:run).with('apply', '-f', be_kubernetes_resource_of_kind('Service'), any_args).ordered.exactly(3).times
124123
expect(kubectl).to receive(:run).with('apply', '-f', be_kubernetes_resource_of_kind('Deployment'), any_args).ordered.exactly(3).times
125124

126-
expect(deploy).to receive(:notify).with(any_args)
127-
128125
# Ultimately deploy should fail
129126
expect {
130127
deploy.run(dry_run: false)
@@ -222,12 +219,11 @@ def parse(ops)
222219
build: build_number,
223220
context: CONTEXT,
224221
'dry-run': 'false',
225-
'send-report': 'false')
222+
)
226223
expect(options.artifact).to match(artifact)
227224
expect(options.build_number).to match(build_number)
228225
expect(options.context).to match(CONTEXT)
229226
expect(options.dry_run).to be(false)
230-
expect(options.send_report).to be(false)
231227

232228
from_files = 'bogus/path/'
233229
options = parse('from-files': from_files,

0 commit comments

Comments
 (0)