Skip to content

Commit

Permalink
Check controller name
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharsanan1 committed Feb 21, 2024
1 parent 447598c commit 3145e3c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const (

var (
setReadiness sync.Once
wso2APKDefaultControllerName = "wso2.com/apk-gateway-default"
)

// GatewayClassReconciler reconciles a Gateway object
Expand Down Expand Up @@ -102,7 +103,11 @@ func (gatewayClassReconciler *GatewayClassReconciler) Reconcile(ctx context.Cont
RequeueAfter: time.Duration(1 * time.Second),
}, nil
}
gatewayClassReconciler.handleGatewayClassStatus(req.NamespacedName, constants.Create, []string{})
// Check whether the gateway class controller name refers to wso2 apk and update the status as accepted, if it is.
controllerName := string(gatewayClassDef.Spec.ControllerName)
if (controllerName == wso2APKDefaultControllerName) {
gatewayClassReconciler.handleGatewayClassStatus(req.NamespacedName, constants.Create, []string{})
}
return ctrl.Result{}, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ data:
keyFilePath = "/home/wso2apk/config-deployer/security/config.key"
certFilePath = "/home/wso2apk/config-deployer/security/config.pem"
[wso2.config_deployer_service.gatewayConfiguration]
name = {{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}
name = "{{ .Values.wso2.apk.dp.gateway.name | default "wso2-apk-default" }}"
listenerName = "httpslistener"
{{ include "generateVhosts" .Values.wso2.apk.dp.configdeployer.vhosts | indent 4 }}
{{if and .Values.wso2.apk.dp.partitionServer .Values.wso2.apk.dp.partitionServer.enabled}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
apiVersion: gateway.networking.k8s.io/v1beta1
kind: GatewayClass
metadata:
{{- if .Values.wso2.apk.dp.gatewayClass }}
name: {{ .Values.wso2.apk.dp.gatewayClass.name | default "wso2-apk-default" }}
{{- else }}
name: "wso2-apk-default"
{{- end }}
spec:
controllerName: "wso2.com/apk-gateway-default"
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ metadata:
annotations:
cert-manager.io/issuer: selfsigned-issuer
spec:
{{- if .Values.wso2.apk.dp.gatewayClass }}
gatewayClassName: {{ .Values.wso2.apk.dp.gatewayClass.name | default "wso2-apk-default" }}
{{- else }}
gatewayClassName: "wso2-apk-default"
{{- end }}
listeners:
{{ if and .Values.wso2.apk.dp.gateway.httpListener .Values.wso2.apk.dp.gateway.httpListener.enabled }}
- name: httplistener
Expand Down

0 comments on commit 3145e3c

Please sign in to comment.