Skip to content

Commit 87a4801

Browse files
⚠️ cleanup: remove func APIPackagePathLegacy which is no longer used since release 4.0.0 (#4182)
warning: (cleanup)r emove func APIPackagePathLegacy which is no longer used since release 4.0.0 The APIPackagePathLegacy function was useful in older scaffolds to ensure backward compatibility. However, with the release of version 4.0.0, all deprecated features have been removed. As a result, this function should no longer be present
1 parent 983a929 commit 87a4801

File tree

3 files changed

+1
-30
lines changed

3 files changed

+1
-30
lines changed

pkg/model/resource/utils.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,6 @@ func APIPackagePath(repo, group, version string, multiGroup bool) string {
5656
return path.Join(repo, "api", version)
5757
}
5858

59-
// APIPackagePathLegacy returns the default path
60-
func APIPackagePathLegacy(repo, group, version string, multiGroup bool) string {
61-
if multiGroup {
62-
if group != "" {
63-
return path.Join(repo, "apis", group, version)
64-
}
65-
return path.Join(repo, "apis", version)
66-
}
67-
return path.Join(repo, "api", version)
68-
}
69-
7059
// RegularPlural returns a default plural form when none was specified
7160
func RegularPlural(singular string) string {
7261
return flect.Pluralize(strings.ToLower(singular))

pkg/model/resource/utils_test.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,23 +50,6 @@ var _ = Describe("APIPackagePath", func() {
5050
)
5151
})
5252

53-
var _ = Describe("APIPackagePathLegacy", func() {
54-
const (
55-
repo = "github.com/kubernetes-sigs/kubebuilder"
56-
group = "group"
57-
version = "v1"
58-
)
59-
60-
DescribeTable("should work",
61-
func(repo, group, version string, multiGroup bool, p string) {
62-
Expect(APIPackagePathLegacy(repo, group, version, multiGroup)).To(Equal(p))
63-
},
64-
Entry("single group setup", repo, group, version, false, path.Join(repo, "api", version)),
65-
Entry("multiple group setup", repo, group, version, true, path.Join(repo, "apis", group, version)),
66-
Entry("multiple group setup with empty group", repo, "", version, true, path.Join(repo, "apis", version)),
67-
)
68-
})
69-
7053
var _ = DescribeTable("RegularPlural should return the regular plural form",
7154
func(singular, plural string) { Expect(RegularPlural(singular)).To(Equal(plural)) },
7255
Entry("basic singular", "firstmate", "firstmates"),

test/e2e/utils/test_context.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ func (t *TestContext) makePrometheusOperatorURL() string {
126126
return fmt.Sprintf(prometheusOperatorURL, prometheusOperatorVersion)
127127
}
128128

129-
// InstallCertManager installs the cert manager bundle. If hasv1beta1CRs is true,
130-
// the legacy version (which uses v1alpha2 CRs) is installed.
129+
// InstallCertManager installs the cert manager bundle.
131130
func (t *TestContext) InstallCertManager() error {
132131
url := t.makeCertManagerURL()
133132
if _, err := t.Kubectl.Apply(false, "-f", url, "--validate=false"); err != nil {

0 commit comments

Comments
 (0)