Skip to content
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

COO-186: fix: add korrel8r proxy configuration to logging view plugin #515

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/controllers/uiplugin/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const (
port = 9443
serviceAccountSuffix = "-sa"
servingCertVolumeName = "serving-cert"
korrel8rName = "korrel8r"
Korrel8rConfigFileName = "korrel8r.yaml"
Korrel8rConfigMountDir = "/config/"
OpenshiftLoggingNs = "openshift-logging"
Expand Down Expand Up @@ -79,12 +80,11 @@ func pluginComponentReconcilers(plugin *uiv1alpha1.UIPlugin, pluginInfo UIPlugin
}

if pluginInfo.Korrel8rImage != "" {
kname := "korrel8r"
components = append(components, reconciler.NewUpdater(newKorrel8rService(kname, namespace), plugin))
korrel8rCm, err := newKorrel8rConfigMap(kname, namespace, pluginInfo)
components = append(components, reconciler.NewUpdater(newKorrel8rService(korrel8rName, namespace), plugin))
korrel8rCm, err := newKorrel8rConfigMap(korrel8rName, namespace, pluginInfo)
if err == nil && korrel8rCm != nil {
components = append(components, reconciler.NewUpdater(korrel8rCm, plugin))
components = append(components, reconciler.NewUpdater(newKorrel8rDeployment(kname, namespace, pluginInfo), plugin))
components = append(components, reconciler.NewUpdater(newKorrel8rDeployment(korrel8rName, namespace, pluginInfo), plugin))
}
}

Expand Down
10 changes: 10 additions & 0 deletions pkg/controllers/uiplugin/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ func createLoggingPluginInfo(plugin *uiv1alpha1.UIPlugin, namespace, name, image
Port: 8080,
},
},
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok to create the proxy entry even when the korrel8r plugin isn't installed?

Copy link
Contributor Author

@jgbernalp jgbernalp Jun 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think is ok as the console proxy just allows the plugin to communicate to the in cluster service. If the korrel8r deployment/service fails, or is not there, requests will fail and the plugin won't show the correlation links.

Type: "Service",
Alias: "korrel8r",
Authorize: true,
Service: osv1alpha1.ConsolePluginProxyServiceConfig{
Name: korrel8rName,
Namespace: namespace,
Port: port,
},
},
},
ConfigMap: &corev1.ConfigMap{
TypeMeta: metav1.TypeMeta{
Expand Down
Loading