seira 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/trunk.yml +21 -0
- data/.trunk/.gitignore +8 -0
- data/.trunk/configs/.markdownlint.yaml +10 -0
- data/.trunk/configs/.shellcheckrc +7 -0
- data/.trunk/configs/.yamllint.yaml +10 -0
- data/.trunk/trunk.yaml +34 -0
- data/lib/seira/pods.rb +1 -2
- data/lib/seira/settings.rb +11 -0
- data/lib/seira/version.rb +2 -1
- data/lib/seira.rb +11 -2
- metadata +8 -4
- data/.default-rubocop.yml +0 -1769
- data/.rubocop.yml +0 -112
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5308da7fa9f186ee201c09b028df22b1b55adf32908bff5b01af79cbebb5ebb9
|
4
|
+
data.tar.gz: 0b51dbcc1ea03797265ec75cae09eeef3a530a4d0822236087fc134c57944d8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32920e089d26ca317373a577827393fc5ec276b80546cae3cb306606b9f531c51cb9aec818caebe7dfbcbf0d2ede6e71059d5cfaeb127a22d2eef06377c8c493
|
7
|
+
data.tar.gz: cba266956e025a7fea94a634f049215304788f3e09ba6880b810fb391653d508fe166249e9a45b97a4567c096386e1d48eb74fc80ef19b3b397418d8bf0f37cd
|
@@ -0,0 +1,21 @@
|
|
1
|
+
name: Trunk Check
|
2
|
+
on: [pull_request]
|
3
|
+
concurrency:
|
4
|
+
group: ${{ github.head_ref || github.run_id }}
|
5
|
+
cancel-in-progress: true
|
6
|
+
|
7
|
+
permissions: read-all
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
trunk_check:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
permissions:
|
13
|
+
checks: write # For trunk to post annotations
|
14
|
+
contents: read # For repo checkout
|
15
|
+
|
16
|
+
steps:
|
17
|
+
- name: Checkout
|
18
|
+
uses: actions/checkout@v3
|
19
|
+
|
20
|
+
- name: Trunk Check
|
21
|
+
uses: trunk-io/trunk-action@v1.1.7
|
data/.trunk/.gitignore
ADDED
data/.trunk/trunk.yaml
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
version: 0.1
|
2
|
+
cli:
|
3
|
+
version: 1.14.1
|
4
|
+
plugins:
|
5
|
+
sources:
|
6
|
+
- id: trunk
|
7
|
+
ref: v1.2.1
|
8
|
+
uri: https://github.com/trunk-io/plugins
|
9
|
+
runtimes:
|
10
|
+
enabled:
|
11
|
+
- go@1.19.5
|
12
|
+
- node@18.12.1
|
13
|
+
- python@3.10.8
|
14
|
+
- ruby@3.1.4
|
15
|
+
lint:
|
16
|
+
enabled:
|
17
|
+
- actionlint@1.6.25
|
18
|
+
- checkov@2.4.6
|
19
|
+
- git-diff-check
|
20
|
+
- markdownlint@0.35.0
|
21
|
+
- prettier@3.0.2
|
22
|
+
- shellcheck@0.9.0
|
23
|
+
- shfmt@3.6.0
|
24
|
+
- trivy@0.44.1
|
25
|
+
- trufflehog@3.48.0
|
26
|
+
- yamllint@1.32.0
|
27
|
+
disabled:
|
28
|
+
- rubocop@1.39.0
|
29
|
+
actions:
|
30
|
+
enabled:
|
31
|
+
- trunk-announce
|
32
|
+
- trunk-check-pre-push
|
33
|
+
- trunk-fmt-pre-commit
|
34
|
+
- trunk-upgrade-available
|
data/lib/seira/pods.rb
CHANGED
@@ -70,7 +70,6 @@ module Seira
|
|
70
70
|
pod_name = pod_name
|
71
71
|
dedicated = false
|
72
72
|
command = 'sh'
|
73
|
-
|
74
73
|
args.each do |arg|
|
75
74
|
if arg.start_with? '--tier='
|
76
75
|
tier = arg.split('=')[1]
|
@@ -181,7 +180,7 @@ module Seira
|
|
181
180
|
|
182
181
|
def connect_to_pod(name, command = 'sh')
|
183
182
|
puts "Connecting to #{name}..."
|
184
|
-
system("kubectl exec -ti #{name} --namespace=#{app} -- #{command}")
|
183
|
+
system("kubectl exec -ti #{name} --namespace=#{app} -- #{context[:settings].terminal_prefix(app, context[:cluster])} #{command}")
|
185
184
|
end
|
186
185
|
end
|
187
186
|
end
|
data/lib/seira/settings.rb
CHANGED
@@ -94,6 +94,17 @@ module Seira
|
|
94
94
|
requirements.map { |r| Seira::Teleport::RoleRequirement.new(r) }
|
95
95
|
end
|
96
96
|
|
97
|
+
def terminal_prefix(application, cluster)
|
98
|
+
settings['seira']['applications'].each do |app|
|
99
|
+
if app['name'] == application
|
100
|
+
return app.fetch('terminal_prefix', '') if app['terminal_prefix_envs'].nil?
|
101
|
+
return app.fetch('terminal_prefix', '') if app['terminal_prefix_envs'].include? cluster
|
102
|
+
|
103
|
+
return ''
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
97
108
|
private
|
98
109
|
|
99
110
|
def parse_settings
|
data/lib/seira/version.rb
CHANGED
data/lib/seira.rb
CHANGED
@@ -127,7 +127,14 @@ module Seira
|
|
127
127
|
status = Seira::Teleport::Status.new
|
128
128
|
|
129
129
|
unless required_roles.empty? || required_roles.any? { |r| status.has_role?(r) }
|
130
|
-
|
130
|
+
reviewer = ENV['TELEPORT_REVIEWER']
|
131
|
+
args.each do |arg|
|
132
|
+
if arg.start_with? '--reviewer='
|
133
|
+
reviewer = arg.split('=')[1]
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
Seira::Teleport::Request.new(required_roles, reviewer: reviewer, context: passed_context).invoke
|
131
138
|
end
|
132
139
|
end
|
133
140
|
|
@@ -180,7 +187,9 @@ module Seira
|
|
180
187
|
|
181
188
|
# The first arg must always be the cluster. This ensures commands are not run by
|
182
189
|
# accident on the wrong kubernetes cluster or gcloud project.
|
183
|
-
exit(1) unless Seira::Cluster.new(action: nil, args: nil, context: nil, settings: settings).switch(
|
190
|
+
exit(1) unless Seira::Cluster.new(action: nil, args: nil, context: nil, settings: settings).switch(
|
191
|
+
target_cluster: cluster, verbose: false
|
192
|
+
)
|
184
193
|
exit(0) if simple_cluster_change?
|
185
194
|
end
|
186
195
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Ringwelski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|
@@ -102,13 +102,17 @@ executables:
|
|
102
102
|
extensions: []
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
|
-
- ".default-rubocop.yml"
|
106
105
|
- ".github/workflows/ruby.yml"
|
106
|
+
- ".github/workflows/trunk.yml"
|
107
107
|
- ".gitignore"
|
108
108
|
- ".hound.yml"
|
109
109
|
- ".rspec"
|
110
|
-
- ".rubocop.yml"
|
111
110
|
- ".ruby-version"
|
111
|
+
- ".trunk/.gitignore"
|
112
|
+
- ".trunk/configs/.markdownlint.yaml"
|
113
|
+
- ".trunk/configs/.shellcheckrc"
|
114
|
+
- ".trunk/configs/.yamllint.yaml"
|
115
|
+
- ".trunk/trunk.yaml"
|
112
116
|
- Gemfile
|
113
117
|
- LICENSE
|
114
118
|
- README.md
|