-
Notifications
You must be signed in to change notification settings - Fork 461
STOR-2770: Generate Azure Disk and File CSI Driver Operator metrics serving certs by HCP controller #7970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
STOR-2770: Generate Azure Disk and File CSI Driver Operator metrics serving certs by HCP controller #7970
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package manifests | ||
|
|
||
| import ( | ||
| corev1 "k8s.io/api/core/v1" | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| // Metrics | ||
| func AzureDiskCSIDriverOperatorMetricsService(namespace string) *corev1.Service { | ||
| return &corev1.Service{ | ||
| ObjectMeta: metav1.ObjectMeta{ | ||
| Name: "azure-disk-csi-driver-operator", | ||
| Namespace: namespace, | ||
| }, | ||
| Spec: corev1.ServiceSpec{ | ||
| ClusterIP: "None", | ||
| }, | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package manifests | ||
|
|
||
| import ( | ||
| corev1 "k8s.io/api/core/v1" | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| // Metrics | ||
| func AzureFileCSIDriverOperatorMetricsService(namespace string) *corev1.Service { | ||
| return &corev1.Service{ | ||
| ObjectMeta: metav1.ObjectMeta{ | ||
| Name: "azure-file-csi-driver-operator", | ||
| Namespace: namespace, | ||
| }, | ||
| Spec: corev1.ServiceSpec{ | ||
| ClusterIP: "None", | ||
| }, | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package pki | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| "github.com/openshift/hypershift/support/config" | ||
|
|
||
| corev1 "k8s.io/api/core/v1" | ||
| ) | ||
|
|
||
| func ReconcileAzureDiskCsiDriverOperatorMetricsServingCertSecret(secret, ca *corev1.Secret, ownerRef config.OwnerRef) error { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Abbreviations in the middle of an idenitifer are all uppercase. https://google.github.io/styleguide/go/decisions#initialisms This applies to the whole PR.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jsafrane , I can easily substitute It's not nice to mix pre-existing
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jsafrane , After more thinking I came to a trivial idea: let's merge this PR with Csi (because it's consistent with pre-existing |
||
| dnsNames := []string{ | ||
| fmt.Sprintf("azure-disk-csi-driver-operator.%s.svc", secret.Namespace), | ||
| fmt.Sprintf("azure-disk-csi-driver-operator.%s.svc.cluster.local", secret.Namespace), | ||
| "azure-disk-csi-driver-operator", | ||
| "localhost", | ||
| } | ||
| return reconcileSignedCertWithAddresses(secret, ca, ownerRef, "azure-disk-csi-driver-operator", []string{"openshift"}, X509UsageClientServerAuth, dnsNames, nil) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package pki | ||
|
|
||
| import ( | ||
| "fmt" | ||
|
|
||
| "github.com/openshift/hypershift/support/config" | ||
|
|
||
| corev1 "k8s.io/api/core/v1" | ||
| ) | ||
|
|
||
| func ReconcileAzureFileCsiDriverOperatorMetricsServingCertSecret(secret, ca *corev1.Secret, ownerRef config.OwnerRef) error { | ||
| dnsNames := []string{ | ||
| fmt.Sprintf("azure-file-csi-driver-operator.%s.svc", secret.Namespace), | ||
| fmt.Sprintf("azure-file-csi-driver-operator.%s.svc.cluster.local", secret.Namespace), | ||
| "azure-file-csi-driver-operator", | ||
| "localhost", | ||
| } | ||
| return reconcileSignedCertWithAddresses(secret, ca, ownerRef, "azure-file-csi-driver-operator", []string{"openshift"}, X509UsageClientServerAuth, dnsNames, nil) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would personally put the manifests into azure.go, with other azure-specific objects. But I'd let HyperShift folks decide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed! My logic was like that: If NTO implements
func ClusterNodeTuningOperatorMetricsService()incontrol-plane-operator/controllers/hostedcontrolplane/manifests/nto.go, then we have to implementfunc AzureDiskCSIDriverOperatorMetricsService()incontrol-plane-operator/controllers/hostedcontrolplane/manifests/azure_disk_csi_driver_operator.go. I can re-work if HyperShift folks prefer another place for manifests.