Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ tasks:
output:crd:artifacts:config=config/base/crd/bases \
output:rbac:artifacts:config=config/components/controller_rbac \
output:webhook:artifacts:config=config/base/webhook
# controller-gen always emits the kubebuilder placeholder
# service name (`webhook-service`) on every regeneration,
# which does not match the Service this repo actually
# declares (`billing-webhook`). Restore it in-place so the
# generated manifest matches the declared Service without
# requiring an out-of-band manual fix-up.
perl -pi -e 's/^( name: )webhook-service$/${1}billing-webhook/' \
config/base/webhook/manifests.yaml
echo "Manifests generated!"
deps:
- install-tools
Expand Down
2 changes: 2 additions & 0 deletions config/base/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ resources:
- bases/billing.miloapis.com_billingaccountbindings.yaml
- bases/billing.miloapis.com_meterdefinitions.yaml
- bases/billing.miloapis.com_monitoredresourcetypes.yaml
- bases/billing.miloapis.com_paymentmethods.yaml
- bases/billing.miloapis.com_paymentmethodclasses.yaml
# +kubebuilder:scaffold:crdkustomizeresource

patches:
Expand Down
7 changes: 4 additions & 3 deletions config/base/webhook/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component
resources:
# manifests.yaml is generated by controller-gen and should NOT be edited
# directly — `task manifests` will overwrite it. After regeneration, restore
# the service name from the controller-gen default (`webhook-service`) to
# `billing-webhook` to match the declared Service.
# directly — `task manifests` will overwrite it. The service name fix-up
# (`webhook-service` → `billing-webhook`) is applied in-place by the
# manifests task itself, so regenerating no longer leaves the file in a
# broken state.
- manifests.yaml

# Teach kustomize about the webhook clientConfig.service.{name,namespace}
Expand Down
16 changes: 8 additions & 8 deletions config/base/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ webhooks:
- v1
clientConfig:
service:
name: webhook-service
name: billing-webhook
namespace: system
path: /mutate-billing-miloapis-com-v1alpha1-billingaccount
failurePolicy: Fail
Expand All @@ -28,7 +28,7 @@ webhooks:
- v1
clientConfig:
service:
name: webhook-service
name: billing-webhook
namespace: system
path: /mutate-billing-miloapis-com-v1alpha1-paymentmethod
failurePolicy: Fail
Expand All @@ -54,7 +54,7 @@ webhooks:
- v1
clientConfig:
service:
name: webhook-service
name: billing-webhook
namespace: system
path: /validate-billing-miloapis-com-v1alpha1-billingaccount
failurePolicy: Fail
Expand All @@ -75,7 +75,7 @@ webhooks:
- v1
clientConfig:
service:
name: webhook-service
name: billing-webhook
namespace: system
path: /validate-billing-miloapis-com-v1alpha1-billingaccountbinding
failurePolicy: Fail
Expand All @@ -96,7 +96,7 @@ webhooks:
- v1
clientConfig:
service:
name: webhook-service
name: billing-webhook
namespace: system
path: /validate-billing-miloapis-com-v1alpha1-meterdefinition
failurePolicy: Fail
Expand All @@ -117,7 +117,7 @@ webhooks:
- v1
clientConfig:
service:
name: webhook-service
name: billing-webhook
namespace: system
path: /validate-billing-miloapis-com-v1alpha1-monitoredresourcetype
failurePolicy: Fail
Expand All @@ -138,7 +138,7 @@ webhooks:
- v1
clientConfig:
service:
name: webhook-service
name: billing-webhook
namespace: system
path: /validate-billing-miloapis-com-v1alpha1-paymentmethod
failurePolicy: Fail
Expand All @@ -158,7 +158,7 @@ webhooks:
- v1
clientConfig:
service:
name: webhook-service
name: billing-webhook
namespace: system
path: /validate-billing-miloapis-com-v1alpha1-paymentmethodclass
failurePolicy: Fail
Expand Down
Loading