@@ -94,6 +94,19 @@ func getAllowExternalTrafficConfig() graphqlclient.AllowExternalTrafficPolicy {
9494 }
9595}
9696
97+ func getAutomateAllowWebhookTrafficConfig () graphqlclient.AutomateThirdPartyNetworkPolicy {
98+ switch enforcement .GetConfig ().AutomateAllowWebhookTraffic {
99+ case automate_third_party_network_policy .Always :
100+ return graphqlclient .AutomateThirdPartyNetworkPolicyAlways
101+ case automate_third_party_network_policy .Off :
102+ return graphqlclient .AutomateThirdPartyNetworkPolicyOff
103+ case automate_third_party_network_policy .IfBlockedByOtterize :
104+ return graphqlclient .AutomateThirdPartyNetworkPolicyIfBlockedByOtterize
105+ default :
106+ return ""
107+ }
108+ }
109+
97110func uploadConfiguration (ctx context.Context , client CloudClient , mgr manager.Manager ) {
98111 ingressConfigIdentities := operatorconfig .GetIngressControllerServiceIdentities ()
99112 externallyManagedPolicyWorkloadIdentities := operatorconfig .GetExternallyManagedPoliciesServiceIdentities ()
@@ -143,6 +156,7 @@ func uploadConfiguration(ctx context.Context, client CloudClient, mgr manager.Ma
143156 AllowExternalTrafficPolicy : getAllowExternalTrafficConfig (), // The server expect for AllowExternalTrafficPolicy because of backwards compatibility
144157 AutomateThirdPartyNetworkPolicies : getAutomateThirdPartyNetworkPoliciesConfig (),
145158 PrometheusServerConfigs : getPrometheusServiceIdentities (),
159+ AutomateAllowWebhookTraffic : getAutomateAllowWebhookTrafficConfig (),
146160 }
147161
148162 configInput .IngressControllerConfig = lo .Map (ingressConfigIdentities , func (identity serviceidentity.ServiceIdentity , _ int ) graphqlclient.IngressControllerConfigInput {
@@ -165,7 +179,6 @@ func uploadConfiguration(ctx context.Context, client CloudClient, mgr manager.Ma
165179 configInput .AutomatedThirdPartyPolicyTypes = []graphqlclient.AutomatedThirdPartyPolicyTypes {
166180 graphqlclient .AutomatedThirdPartyPolicyTypesExternalTraffic ,
167181 graphqlclient .AutomatedThirdPartyPolicyTypesMetricsTraffic ,
168- graphqlclient .AutomatedThirdPartyPolicyTypesWebhookTraffic ,
169182 }
170183
171184 client .ReportIntentsOperatorConfiguration (timeoutCtx , configInput )
0 commit comments