Skip to content

Commit

Permalink
update to use CLOUDTRUTH_API_KEY everywhere like cli does
Browse files Browse the repository at this point in the history
  • Loading branch information
wr0ngway committed Apr 29, 2021
1 parent 9ef2fd1 commit 7600981
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: push

env:
CI: true
CT_API_KEY: ${{ secrets.CT_API_KEY }}
CLOUDTRUTH_API_KEY: ${{ secrets.CLOUDTRUTH_API_KEY }}

jobs:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ To install and run via helm in a local cluster:
#
docker build -t kubetruth . && helm install \
--set image.repository=kubetruth --set image.pullPolicy=Never --set image.tag=latest \
--set appSettings.debug=true --set appSettings.apiKey=$CT_API_KEY --set appSettings.environment=development \
--set appSettings.debug=true --set appSettings.apiKey=$CLOUDTRUTH_API_KEY --set appSettings.environment=development \
kubetruth ./helm/kubetruth/
```
Expand Down
2 changes: 1 addition & 1 deletion helm/kubetruth/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ metadata:
labels:
{{- include "kubetruth.labels" . | nindent 4 }}
data:
CT_API_KEY: {{ required "The cloudtruth api key needs to be set in .Values.appSettings.apiKey!" .Values.appSettings.apiKey | b64enc | quote }}
CLOUDTRUTH_API_KEY: {{ required "The cloudtruth api key needs to be set in .Values.appSettings.apiKey!" .Values.appSettings.apiKey | b64enc | quote }}
2 changes: 1 addition & 1 deletion lib/kubetruth/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CLI < Clamp::Command

option "--api-key",
'APIKEY', "The cloudtruth api key",
environment_variable: 'CT_API_KEY',
environment_variable: 'CLOUDTRUTH_API_KEY',
required: true

option "--kube-namespace",
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion spec/kubetruth/ctapi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Kubetruth

describe "CtApi", :vcr do

let(:ctapi) { ::Kubetruth::CtApi(api_key: ENV['CT_API_KEY']) }
let(:ctapi) { ::Kubetruth::CtApi(api_key: ENV['CLOUDTRUTH_API_KEY']) }

describe "class definition", :vcr do

Expand Down
2 changes: 1 addition & 1 deletion spec/kubetruth/kubeapi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def setup
check_deps
teardown
root = File.expand_path('../..', __dir__)
sysrun("helm install --create-namespace --namespace #{namespace} --set appSettings.apiKey=#{ENV['CT_API_KEY']} #{helm_name} #{root}/helm/kubetruth/")
sysrun("helm install --create-namespace --namespace #{namespace} --set appSettings.apiKey=#{ENV['CLOUDTRUTH_API_KEY']} #{helm_name} #{root}/helm/kubetruth/")
end

def token
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def filter_object!(object, text, replacement_text)

string_with_escapes = '"((\\\\.|[^\"])*)"'
c.filter_sensitive_data('"parameterValue":"<PARAM_VALUE>"') { /"parameterValue":#{string_with_escapes}/ }
c.filter_sensitive_data('"CT_API_KEY":"<API_KEY>"') { /"CT_API_KEY":#{string_with_escapes}/ }
c.filter_sensitive_data('"CLOUDTRUTH_API_KEY":"<API_KEY>"') { /"CLOUDTRUTH_API_KEY":#{string_with_escapes}/ }
end


Expand Down

0 comments on commit 7600981

Please sign in to comment.