Skip to content

Commit

Permalink
Remove FileMode from environment list (#73)
Browse files Browse the repository at this point in the history
We've decided to remove the file mode functionality for now, so I'm removing it from spacectl before it's removed from the API.
  • Loading branch information
adamconnelly authored Aug 23, 2022
1 parent 418d6c8 commit 7bc9fca
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions internal/cmd/stack/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package stack
import (
"encoding/base64"
"fmt"
"github.com/pkg/errors"
"io/ioutil"
"os"
"regexp"
"strings"

"github.com/pkg/errors"

"github.com/shurcooL/graphql"
"github.com/urfave/cli/v2"

Expand Down Expand Up @@ -41,14 +42,12 @@ type configElement struct {
Type ConfigType `graphql:"type" json:"type,omitempty"`
Value *string `graphql:"value" json:"value,omitempty"`
WriteOnly bool `graphql:"writeOnly" json:"writeOnly,omitempty"`
FileMode *string `graphql:"fileMode" json:"fileMode,omitempty"`
}

type listEnvElementOutput struct {
Name string `json:"name"`
Type string `json:"type"`
Value *string `json:"value"`
FileMode *string `json:"fileMode"`
Name string `json:"name"`
Type string `json:"type"`
Value *string `json:"value"`
// Context specifies the name of the context.
Context *string `json:"context"`
// Runtime is not printed, it's just used to determine output formatting.
Expand Down Expand Up @@ -157,7 +156,7 @@ func (e *listEnvCommand) listEnv(cliCtx *cli.Context) error {
}

func (e *listEnvCommand) showOutputsTable(outputs []listEnvElementOutput) error {
tableData := [][]string{{"Name", "Type", "Value", "File Mode", "Context"}}
tableData := [][]string{{"Name", "Type", "Value", "Context"}}
for _, output := range outputs {
var row []string

Expand All @@ -179,11 +178,6 @@ func (e *listEnvCommand) showOutputsTable(outputs []listEnvElementOutput) error
}
row = append(row, value)

if output.FileMode != nil {
row = append(row, *output.FileMode)
} else {
row = append(row, "")
}
if output.Context != nil {
row = append(row, *output.Context)
} else {
Expand Down Expand Up @@ -218,7 +212,6 @@ func (e *configElement) toConfigElementOutput(contextName *string) (listEnvEleme
Name: e.ID,
Type: string(e.Type),
Value: value,
FileMode: e.FileMode,
Context: contextName,
Runtime: e.Runtime,
WriteOnly: e.WriteOnly,
Expand Down

0 comments on commit 7bc9fca

Please sign in to comment.