MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / envVarsTable

Function envVarsTable

app/cli/cmd/attestation_status.go:155–187  ·  view source on GitHub ↗
(status *action.AttestationStatusResult, w io.Writer, full bool)

Source from the content-addressed store, hash-verified

153}
154
155func envVarsTable(status *action.AttestationStatusResult, w io.Writer, full bool) error {
156 if len(status.EnvVars) == 0 && len(status.RunnerContext.EnvVars) == 0 {
157 return nil
158 }
159
160 if len(status.EnvVars) > 0 {
161 // Env Variables table
162 evt := output.NewTableWriterWithWriter(w)
163 evt.SetTitle("Env Variables")
164 for k, v := range status.EnvVars {
165 if v == "" {
166 v = "NOT FOUND"
167 }
168 evt.AppendRow(table.Row{k, v})
169 }
170 evt.Render()
171 }
172
173 runnerVars := status.RunnerContext.EnvVars
174 if len(runnerVars) > 0 && full {
175 evt := output.NewTableWriterWithWriter(w)
176 evt.SetTitle("Runner context")
177 for k, v := range runnerVars {
178 if v == "" {
179 v = "NOT FOUND"
180 }
181 evt.AppendRow(table.Row{k, v})
182 }
183 evt.Render()
184 }
185
186 return nil
187}
188func materialsTable(status *action.AttestationStatusResult, w io.Writer, full bool) error {
189 if len(status.Materials) == 0 {
190 return nil

Callers 1

Calls 2

NewTableWriterWithWriterFunction · 0.92
RenderMethod · 0.80

Tested by

no test coverage detected