Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4425 from shashankram/v1.0
Browse files Browse the repository at this point in the history
[backport] crd-conversion: fix webhook port number (#4424)
  • Loading branch information
nojnhuh authored Jan 11, 2022
2 parents edb1d45 + 4e5f574 commit a7f92b9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/osm/templates/osm-bootstrap-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
image: "{{ include "osmBootstrap.image" . }}"
imagePullPolicy: {{ .Values.osm.image.pullPolicy }}
ports:
- name: "tls"
- name: "crdconversion"
containerPort: 9443
- name: "metrics"
containerPort: 9091
Expand Down
3 changes: 1 addition & 2 deletions charts/osm/templates/osm-bootstrap-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ metadata:
app: osm-bootstrap
spec:
ports:
- name: tls
- name: crdconversion
port: 9443
targetPort: tls
- name: health
port: 9095
selector:
Expand Down
2 changes: 1 addition & 1 deletion cmd/osm-bootstrap/osm-bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func main() {
}

// Initialize the crd conversion webhook server to support the conversion of OSM's CRDs
crdConverterConfig.ListenPort = 9443
crdConverterConfig.ListenPort = constants.CRDConversionWebhookPort
if err := crdconversion.NewConversionWebhook(crdConverterConfig, kubeClient, crdClient, certManager, osmNamespace, enableReconciler, stop); err != nil {
events.GenericEventRecorder().FatalEvent(err, events.InitializationError, "Error creating crd conversion webhook")
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ const (

// OSMMeshConfig is the name of the OSM MeshConfig
OSMMeshConfig = "osm-mesh-config"

// CRDConversionWebhookPort is the port of the CRD conversion webhook service
CRDConversionWebhookPort = 9443
)

// Annotations used by the control plane
Expand Down
2 changes: 2 additions & 0 deletions pkg/crdconversion/crdconversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
apiclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/utils/pointer"

"github.com/openservicemesh/osm/pkg/certificate"
"github.com/openservicemesh/osm/pkg/certificate/providers"
Expand Down Expand Up @@ -186,6 +187,7 @@ func updateCrdConfiguration(cert certificate.Certificater, crdClient apiclient.A
Service: &apiv1.ServiceReference{
Namespace: osmNamespace,
Name: constants.OSMBootstrapName,
Port: pointer.Int32(constants.CRDConversionWebhookPort),
Path: &crdConversionPath,
},
CABundle: cert.GetCertificateChain(),
Expand Down

0 comments on commit a7f92b9

Please sign in to comment.