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

Commit f3f9f3f

Browse files
committed
Suffix -> prefix
1 parent 2cc535e commit f3f9f3f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cmd/tarmak/cmd/root.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ func init() {
106106
)
107107

108108
RootCmd.PersistentFlags().StringSliceVar(
109-
&globalFlags.ConfigSuffixes,
110-
"config-suffixes",
109+
&globalFlags.ConfigPrefixes,
110+
"config-prefixes",
111111
[]string{
112112
"tarmak",
113113
"cluster",
114114
"environment",
115115
"provider",
116116
},
117-
"set suffixes of files containing tarmak configuration",
117+
"set prefixes of files containing tarmak configuration to be used",
118118
)
119119

120120
if version == "dev" {

pkg/apis/tarmak/v1alpha1/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ type Flags struct {
128128

129129
WingDevMode bool // use a bundled wing version rather than a tagged release from GitHub
130130

131-
ConfigSuffixes []string // the suffixes used for imported configuration fragments
131+
ConfigPrefixes []string // the prefixes used for imported configuration fragments
132132
}
133133

134134
// This contains the cluster specifc operation flags

pkg/tarmak/config/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ func (c *Config) configPath() string {
323323
func (c *Config) ReadConfig() (*tarmakv1alpha1.Config, error) {
324324
var config *tarmakv1alpha1.Config
325325

326-
configBytes, err := c.readConfigFragments(c.flags.ConfigSuffixes)
326+
configBytes, err := c.readConfigFragments(c.flags.ConfigPrefixes)
327327
if err != nil {
328328
return nil, fmt.Errorf("failed to read tarmak configs: %v", err)
329329
}
@@ -342,7 +342,7 @@ func (c *Config) ReadConfig() (*tarmakv1alpha1.Config, error) {
342342
return config, nil
343343
}
344344

345-
func (c *Config) readConfigFragments(suffixes []string) ([]byte, error) {
345+
func (c *Config) readConfigFragments(prefixes []string) ([]byte, error) {
346346
dir, err := ioutil.ReadDir(c.tarmak.ConfigPath())
347347
if err != nil {
348348
return nil, err
@@ -352,8 +352,8 @@ func (c *Config) readConfigFragments(suffixes []string) ([]byte, error) {
352352
for _, f := range dir {
353353
if !f.IsDir() && strings.HasSuffix(f.Name(), ".yaml") {
354354

355-
for _, suffix := range suffixes {
356-
if strings.HasPrefix(f.Name(), suffix) {
355+
for _, prefix := range prefixes {
356+
if strings.HasPrefix(f.Name(), prefix) {
357357
fragFiles = append(fragFiles, f)
358358
break
359359
}

0 commit comments

Comments
 (0)