diff --git a/Tiltfile b/Tiltfile index 3abab9b7..b5ee4d5a 100644 --- a/Tiltfile +++ b/Tiltfile @@ -39,24 +39,6 @@ for role in roles: if len(roles_rules_mapping["ClusterRole"]) == 0 or len(roles_rules_mapping["Role"]) == 0: fail("Failed to load cluster and namespace roles") -# Get the webhook configuration with the latest values generated in the -# controller repository. -mutating_webhooks = [] -validating_webhooks = [] -webhooks_config = decode_yaml_stream(kustomize('config/webhook')) -for webhook_config in webhooks_config: - if webhook_config.get('kind') == 'MutatingWebhookConfiguration': - mutating_webhooks = webhook_config.get('webhooks') - for i in range(len(mutating_webhooks)): - mutating_webhooks[i]["clientConfig"]["service"]["name"] = "kubewarden-controller-webhook-service" - mutating_webhooks[i]["clientConfig"]["service"]["namespace"] = "kubewarden" - if webhook_config.get('kind') == 'ValidatingWebhookConfiguration': - validating_webhooks = webhook_config.get('webhooks') - for i in range(len(validating_webhooks)): - validating_webhooks[i]["clientConfig"]["service"]["name"] = "kubewarden-controller-webhook-service" - validating_webhooks[i]["clientConfig"]["service"]["namespace"] = "kubewarden" - - # Install kubewarden-controller helm chart install = helm( settings.get('helm_charts_path') + '/charts/kubewarden-controller/', @@ -87,13 +69,6 @@ for o in objects: if o.get('kind') == 'Role' and o.get('metadata').get('name') == 'kubewarden-controller-leader-election-role': o['rules'] = roles_rules_mapping["Role"]["leader-election-role"] - # Update the webhook configuration with the latest values generated in the - # controller repository. This useful when adding/updating webhooks. - if o.get('kind') == 'MutatingWebhookConfiguration': - o['webhooks'] = mutating_webhooks - if o.get('kind') == 'ValidatingWebhookConfiguration': - o['webhooks'] = validating_webhooks - updated_install = encode_yaml_stream(objects) k8s_yaml(updated_install)