Skip to content

Commit 764167d

Browse files
committed
pkg/annotation: unexport default annotation names
1 parent 8004608 commit 764167d

File tree

2 files changed

+37
-39
lines changed

2 files changed

+37
-39
lines changed

pkg/annotation/annotation.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,23 @@ type InstallDisableHooks struct {
5252
var _ Install = &InstallDisableHooks{}
5353

5454
const (
55-
DefaultDomain = "helm.operator-sdk"
56-
DefaultInstallDisableHooksName = DefaultDomain + "/install-disable-hooks"
57-
DefaultUpgradeDisableHooksName = DefaultDomain + "/upgrade-disable-hooks"
58-
DefaultUninstallDisableHooksName = DefaultDomain + "/uninstall-disable-hooks"
55+
defaultDomain = "helm.operator-sdk"
56+
defaultInstallDisableHooksName = defaultDomain + "/install-disable-hooks"
57+
defaultUpgradeDisableHooksName = defaultDomain + "/upgrade-disable-hooks"
58+
defaultUninstallDisableHooksName = defaultDomain + "/uninstall-disable-hooks"
5959

60-
DefaultUpgradeForceName = DefaultDomain + "/upgrade-force"
60+
defaultUpgradeForceName = defaultDomain + "/upgrade-force"
6161

62-
DefaultInstallDescriptionName = DefaultDomain + "/install-description"
63-
DefaultUpgradeDescriptionName = DefaultDomain + "/upgrade-description"
64-
DefaultUninstallDescriptionName = DefaultDomain + "/uninstall-description"
62+
defaultInstallDescriptionName = defaultDomain + "/install-description"
63+
defaultUpgradeDescriptionName = defaultDomain + "/upgrade-description"
64+
defaultUninstallDescriptionName = defaultDomain + "/uninstall-description"
6565
)
6666

6767
func (i InstallDisableHooks) Name() string {
6868
if i.CustomName != "" {
6969
return i.CustomName
7070
}
71-
return DefaultInstallDisableHooksName
71+
return defaultInstallDisableHooksName
7272
}
7373

7474
func (i InstallDisableHooks) InstallOption(val string) helmclient.InstallOption {
@@ -92,7 +92,7 @@ func (u UpgradeDisableHooks) Name() string {
9292
if u.CustomName != "" {
9393
return u.CustomName
9494
}
95-
return DefaultUpgradeDisableHooksName
95+
return defaultUpgradeDisableHooksName
9696
}
9797

9898
func (u UpgradeDisableHooks) UpgradeOption(val string) helmclient.UpgradeOption {
@@ -116,7 +116,7 @@ func (u UpgradeForce) Name() string {
116116
if u.CustomName != "" {
117117
return u.CustomName
118118
}
119-
return DefaultUpgradeForceName
119+
return defaultUpgradeForceName
120120
}
121121

122122
func (u UpgradeForce) UpgradeOption(val string) helmclient.UpgradeOption {
@@ -140,7 +140,7 @@ func (u UninstallDisableHooks) Name() string {
140140
if u.CustomName != "" {
141141
return u.CustomName
142142
}
143-
return DefaultUninstallDisableHooksName
143+
return defaultUninstallDisableHooksName
144144
}
145145

146146
func (u UninstallDisableHooks) UninstallOption(val string) helmclient.UninstallOption {
@@ -164,7 +164,7 @@ func (i InstallDescription) Name() string {
164164
if i.CustomName != "" {
165165
return i.CustomName
166166
}
167-
return DefaultInstallDescriptionName
167+
return defaultInstallDescriptionName
168168
}
169169
func (i InstallDescription) InstallOption(v string) helmclient.InstallOption {
170170
return func(i *action.Install) error {
@@ -183,7 +183,7 @@ func (u UpgradeDescription) Name() string {
183183
if u.CustomName != "" {
184184
return u.CustomName
185185
}
186-
return DefaultUpgradeDescriptionName
186+
return defaultUpgradeDescriptionName
187187
}
188188
func (u UpgradeDescription) UpgradeOption(v string) helmclient.UpgradeOption {
189189
return func(upgrade *action.Upgrade) error {
@@ -202,7 +202,7 @@ func (u UninstallDescription) Name() string {
202202
if u.CustomName != "" {
203203
return u.CustomName
204204
}
205-
return DefaultUninstallDescriptionName
205+
return defaultUninstallDescriptionName
206206
}
207207
func (u UninstallDescription) UninstallOption(v string) helmclient.UninstallOption {
208208
return func(uninstall *action.Uninstall) error {

pkg/annotation/annotation_test.go

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package annotation_test
17+
package annotation
1818

1919
import (
2020
. "github.com/onsi/ginkgo"
2121
. "github.com/onsi/gomega"
2222
"helm.sh/helm/v3/pkg/action"
23-
24-
"github.com/joelanford/helm-operator/pkg/annotation"
2523
)
2624

2725
var _ = Describe("Annotation", func() {
@@ -33,14 +31,14 @@ var _ = Describe("Annotation", func() {
3331
})
3432

3533
Describe("DisableHooks", func() {
36-
var a annotation.InstallDisableHooks
34+
var a InstallDisableHooks
3735

3836
BeforeEach(func() {
39-
a = annotation.InstallDisableHooks{}
37+
a = InstallDisableHooks{}
4038
})
4139

4240
It("should return a default name", func() {
43-
Expect(a.Name()).To(Equal(annotation.DefaultInstallDisableHooksName))
41+
Expect(a.Name()).To(Equal(defaultInstallDisableHooksName))
4442
})
4543

4644
It("should return a custom name", func() {
@@ -68,14 +66,14 @@ var _ = Describe("Annotation", func() {
6866
})
6967

7068
Describe("Description", func() {
71-
var a annotation.InstallDescription
69+
var a InstallDescription
7270

7371
BeforeEach(func() {
74-
a = annotation.InstallDescription{}
72+
a = InstallDescription{}
7573
})
7674

7775
It("should return a default name", func() {
78-
Expect(a.Name()).To(Equal(annotation.DefaultInstallDescriptionName))
76+
Expect(a.Name()).To(Equal(defaultInstallDescriptionName))
7977
})
8078

8179
It("should return a custom name", func() {
@@ -99,14 +97,14 @@ var _ = Describe("Annotation", func() {
9997
})
10098

10199
Describe("DisableHooks", func() {
102-
var a annotation.UpgradeDisableHooks
100+
var a UpgradeDisableHooks
103101

104102
BeforeEach(func() {
105-
a = annotation.UpgradeDisableHooks{}
103+
a = UpgradeDisableHooks{}
106104
})
107105

108106
It("should return a default name", func() {
109-
Expect(a.Name()).To(Equal(annotation.DefaultUpgradeDisableHooksName))
107+
Expect(a.Name()).To(Equal(defaultUpgradeDisableHooksName))
110108
})
111109

112110
It("should return a custom name", func() {
@@ -134,14 +132,14 @@ var _ = Describe("Annotation", func() {
134132
})
135133

136134
Describe("Force", func() {
137-
var a annotation.UpgradeForce
135+
var a UpgradeForce
138136

139137
BeforeEach(func() {
140-
a = annotation.UpgradeForce{}
138+
a = UpgradeForce{}
141139
})
142140

143141
It("should return a default name", func() {
144-
Expect(a.Name()).To(Equal(annotation.DefaultUpgradeForceName))
142+
Expect(a.Name()).To(Equal(defaultUpgradeForceName))
145143
})
146144

147145
It("should return a custom name", func() {
@@ -169,14 +167,14 @@ var _ = Describe("Annotation", func() {
169167
})
170168

171169
Describe("Description", func() {
172-
var a annotation.UpgradeDescription
170+
var a UpgradeDescription
173171

174172
BeforeEach(func() {
175-
a = annotation.UpgradeDescription{}
173+
a = UpgradeDescription{}
176174
})
177175

178176
It("should return a default name", func() {
179-
Expect(a.Name()).To(Equal(annotation.DefaultUpgradeDescriptionName))
177+
Expect(a.Name()).To(Equal(defaultUpgradeDescriptionName))
180178
})
181179

182180
It("should return a custom name", func() {
@@ -200,14 +198,14 @@ var _ = Describe("Annotation", func() {
200198
})
201199

202200
Describe("DisableHooks", func() {
203-
var a annotation.UninstallDisableHooks
201+
var a UninstallDisableHooks
204202

205203
BeforeEach(func() {
206-
a = annotation.UninstallDisableHooks{}
204+
a = UninstallDisableHooks{}
207205
})
208206

209207
It("should return a default name", func() {
210-
Expect(a.Name()).To(Equal(annotation.DefaultUninstallDisableHooksName))
208+
Expect(a.Name()).To(Equal(defaultUninstallDisableHooksName))
211209
})
212210

213211
It("should return a custom name", func() {
@@ -235,14 +233,14 @@ var _ = Describe("Annotation", func() {
235233
})
236234

237235
Describe("Description", func() {
238-
var a annotation.UninstallDescription
236+
var a UninstallDescription
239237

240238
BeforeEach(func() {
241-
a = annotation.UninstallDescription{}
239+
a = UninstallDescription{}
242240
})
243241

244242
It("should return a default name", func() {
245-
Expect(a.Name()).To(Equal(annotation.DefaultUninstallDescriptionName))
243+
Expect(a.Name()).To(Equal(defaultUninstallDescriptionName))
246244
})
247245

248246
It("should return a custom name", func() {

0 commit comments

Comments
 (0)