Skip to content

Commit 29c5046

Browse files
author
Per Goncalves da Silva
committed
Refactor BundleWebhookServiceResourceGenerator to BundleDeploymentServiceResourceGenerator
Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com>
1 parent 351b64d commit 29c5046

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

internal/operator-controller/rukpak/render/registryv1/generators/generators.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,10 +379,10 @@ func BundleMutatingWebhookResourceGenerator(rv1 *bundle.RegistryV1, opts render.
379379
return objs, nil
380380
}
381381

382-
// BundleWebhookServiceResourceGenerator generates Service resources based that support the webhooks defined in
383-
// the bundle's cluster service version spec. The resource is modified by the CertificateProvider in opts
382+
// BundleDeploymentServiceResourceGenerator generates Service resources that support, e.g. the webhooks,
383+
// defined in the bundle's cluster service version spec. The resource is modified by the CertificateProvider in opts
384384
// to add any annotations or modifications necessary for certificate injection.
385-
func BundleWebhookServiceResourceGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error) {
385+
func BundleDeploymentServiceResourceGenerator(rv1 *bundle.RegistryV1, opts render.Options) ([]client.Object, error) {
386386
if rv1 == nil {
387387
return nil, fmt.Errorf("bundle cannot be nil")
388388
}

internal/operator-controller/rukpak/render/registryv1/generators/generators_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@ func Test_BundleMutatingWebhookResourceGenerator_FailsOnNil(t *testing.T) {
20002000
require.Contains(t, err.Error(), "bundle cannot be nil")
20012001
}
20022002

2003-
func Test_BundleWebhookServiceResourceGenerator_Succeeds(t *testing.T) {
2003+
func Test_BundleDeploymentServiceResourceGenerator_Succeeds(t *testing.T) {
20042004
fakeProvider := FakeCertProvider{
20052005
InjectCABundleFn: func(obj client.Object, cfg render.CertificateProvisionerConfig) error {
20062006
obj.SetAnnotations(map[string]string{
@@ -2414,14 +2414,14 @@ func Test_BundleWebhookServiceResourceGenerator_Succeeds(t *testing.T) {
24142414
},
24152415
} {
24162416
t.Run(tc.name, func(t *testing.T) {
2417-
objs, err := generators.BundleWebhookServiceResourceGenerator(tc.bundle, tc.opts)
2417+
objs, err := generators.BundleDeploymentServiceResourceGenerator(tc.bundle, tc.opts)
24182418
require.NoError(t, err)
24192419
require.Equal(t, tc.expectedResources, objs)
24202420
})
24212421
}
24222422
}
24232423

2424-
func Test_BundleWebhookServiceResourceGenerator_FailsOnNil(t *testing.T) {
2424+
func Test_BundleDeploymentServiceResourceGenerator_FailsOnNil(t *testing.T) {
24252425
objs, err := generators.BundleMutatingWebhookResourceGenerator(nil, render.Options{})
24262426
require.Nil(t, objs)
24272427
require.Error(t, err)

internal/operator-controller/rukpak/render/registryv1/registryv1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ var ResourceGenerators = []render.ResourceGenerator{
4343
generators.BundleCSVDeploymentGenerator,
4444
generators.BundleValidatingWebhookResourceGenerator,
4545
generators.BundleMutatingWebhookResourceGenerator,
46-
generators.BundleWebhookServiceResourceGenerator,
46+
generators.BundleDeploymentServiceResourceGenerator,
4747
generators.CertProviderResourceGenerator,
4848
}

internal/operator-controller/rukpak/render/registryv1/registryv1_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func Test_ResourceGeneratorsHasAllGenerators(t *testing.T) {
5050
generators.BundleCSVDeploymentGenerator,
5151
generators.BundleValidatingWebhookResourceGenerator,
5252
generators.BundleMutatingWebhookResourceGenerator,
53-
generators.BundleWebhookServiceResourceGenerator,
53+
generators.BundleDeploymentServiceResourceGenerator,
5454
generators.CertProviderResourceGenerator,
5555
}
5656
actualGenerators := registryv1.ResourceGenerators

0 commit comments

Comments
 (0)