New ๐ŸŒŠ wave for @helm

Commit 5ad3107a

5ad3107a5654Merged

Svyatoslav Dumchenko <[email protected]> ยท 4 years ago ยท 2 files ยท ~2 modified

Description

Add some yaml tags

Details

Commit
5ad3107a5654
Parent
33257c927109

pkg/release/config.gomodifiedView file

@@ -13,37 +13,37 @@
1313 )
1414
1515 type config struct {
16- cfg *action.Configuration
17- dependencies map[uniqname.UniqName]<-chan pubsub.ReleaseStatus
18- helm *helm.EnvSettings
19- log *log.Entry
20- Store map[string]interface{}
21- ChartF Chart `yaml:"chart"`
22- uniqName uniqname.UniqName
23- NameF string `yaml:"name"`
24- NamespaceF string `yaml:"namespace"`
25- DescriptionF string `yaml:"description"`
26- DependsOnF []string `yaml:"depends_on"`
27- ValuesF []ValuesReference `yaml:"values"`
28- TagsF []string `yaml:"tags"`
29- Timeout time.Duration `yaml:"timeout"`
30- MaxHistory int
31- AllowFailure bool `yaml:"allow_failure"`
32- CreateNamespace bool
33- ResetValues bool
34- Recreate bool
35- Force bool
36- Atomic bool
37- CleanupOnFail bool
38- SubNotes bool
39- DisableHooks bool
40- DisableOpenAPIValidation bool
41- WaitForJobs bool
42- Wait bool
43- SkipCRDs bool
44- dryRun bool
45- Devel bool
46- ReuseValues bool
16+ cfg *action.Configuration `yaml:"-"`
17+ dependencies map[uniqname.UniqName]<-chan pubsub.ReleaseStatus `yaml:"-"`
18+ helm *helm.EnvSettings `yaml:"-"`
19+ log *log.Entry `yaml:"-"`
20+ Store map[string]interface{} `yaml:"store,omitempty"`
21+ ChartF Chart `yaml:"chart,omitempty"`
22+ uniqName uniqname.UniqName `yaml:"-"`
23+ NameF string `yaml:"name,omitempty"`
24+ NamespaceF string `yaml:"namespace,omitempty"`
25+ DescriptionF string `yaml:"description,omitempty"`
26+ DependsOnF []string `yaml:"depends_on,omitempty"`
27+ ValuesF []ValuesReference `yaml:"values,omitempty"`
28+ TagsF []string `yaml:"tags,omitempty"`
29+ Timeout time.Duration `yaml:"timeout,omitempty"`
30+ MaxHistory int `yaml:"maxhistory,omitempty"`
31+ AllowFailure bool `yaml:"allow_failure,omitempty"`
32+ Atomic bool `yaml:"atomic,omitempty"`
33+ CleanupOnFail bool `yaml:"cleanuponfail,omitempty"`
34+ CreateNamespace bool `yaml:"createnamespace,omitempty"`
35+ Devel bool `yaml:"devel,omitempty"`
36+ DisableHooks bool `yaml:"disablehooks,omitempty"`
37+ DisableOpenAPIValidation bool `yaml:"disableopenapivalidation,omitempty"`
38+ dryRun bool `yaml:"dryrun,omitempty"`
39+ Force bool `yaml:"force,omitempty"`
40+ Recreate bool `yaml:"recreate,omitempty"`
41+ ResetValues bool `yaml:"resetvalues,omitempty"`
42+ ReuseValues bool `yaml:"reusevalues,omitempty"`
43+ SkipCRDs bool `yaml:"skipcrds,omitempty"`
44+ SubNotes bool `yaml:"subnotes,omitempty"`
45+ Wait bool `yaml:"wait,omitempty"`
46+ WaitForJobs bool `yaml:"waitforjobs,omitempty"`
4747 }
4848
4949 func (rel *config) DryRun(b bool) {
@@ -127,7 +127,15 @@
127127 // Uniq redis@my-namespace.
128128 func (rel *config) Uniq() uniqname.UniqName {
129129 if rel.uniqName == "" {
130- rel.uniqName = uniqname.UniqName(rel.Name() + uniqname.Separator + rel.Namespace())
130+ var err error
131+ rel.uniqName, err = uniqname.Generate(rel.Name(), rel.Namespace())
132+ if err != nil {
133+ rel.log.WithFields(log.Fields{
134+ "name": rel.Name(),
135+ "namespace": rel.Namespace(),
136+ log.ErrorKey: err,
137+ }).Error("failed to generate valid uniqname")
138+ }
131139 }
132140
133141 return rel.uniqName