Skip to content

Commit

Permalink
address lint issues
Browse files Browse the repository at this point in the history
Signed-off-by: Eguzki Astiz Lezaun <eastizle@redhat.com>
  • Loading branch information
eguzki committed Oct 1, 2024
1 parent 1a243ce commit 58ddb25
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
14 changes: 8 additions & 6 deletions pkg/openshift/consoleplugin/common.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package consoleplugin

const (
KUADRANT_CONSOLE = "kuadrant-console"
KuadrantConsoleName = "kuadrant-console"
KuadrantPluginComponent = "kuadrant-plugin"
)

func CommonLabels() map[string]string {
return map[string]string{
"app": KUADRANT_CONSOLE,
"app.kubernetes.io/component": KUADRANT_CONSOLE,
"app.kubernetes.io/instance": KUADRANT_CONSOLE,
"app.kubernetes.io/name": KUADRANT_CONSOLE,
"app.kubernetes.io/part-of": KUADRANT_CONSOLE,
"app": KuadrantConsoleName,
"app.kubernetes.io/component": KuadrantPluginComponent,
"app.kubernetes.io/managed-by": "kuadrant-operator",
"app.kubernetes.io/instance": KuadrantConsoleName,
"app.kubernetes.io/name": KuadrantConsoleName,
"app.kubernetes.io/part-of": KuadrantConsoleName,
}
}
8 changes: 4 additions & 4 deletions pkg/openshift/consoleplugin/consoleplugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func ConsolePluginName() string {
return KUADRANT_CONSOLE
func Name() string {
return KuadrantConsoleName
}

func ConsolePlugin(ns string) *consolev1.ConsolePlugin {
return &consolev1.ConsolePlugin{
TypeMeta: metav1.TypeMeta{Kind: "ConsolePlugin", APIVersion: "v1"},
ObjectMeta: metav1.ObjectMeta{
Name: ConsolePluginName(),
Name: Name(),
Labels: CommonLabels(),
},
Spec: consolev1.ConsolePluginSpec{
DisplayName: "Kuadrant Console Plugin",
Backend: consolev1.ConsolePluginBackend{
Type: consolev1.Service,
Service: &consolev1.ConsolePluginService{
Name: KUADRANT_CONSOLE,
Name: KuadrantConsoleName,
Namespace: ns,
Port: 9443,
BasePath: "/",
Expand Down
4 changes: 2 additions & 2 deletions pkg/openshift/consoleplugin/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func DeploymentName() string {
return KUADRANT_CONSOLE
return KuadrantConsoleName
}

func DeploymentStrategy() appsv1.DeploymentStrategy {
Expand Down Expand Up @@ -98,7 +98,7 @@ func Deployment(ns, image string) *appsv1.Deployment {
Spec: corev1.PodSpec{
Containers: []corev1.Container{
{
Name: KUADRANT_CONSOLE,
Name: KuadrantConsoleName,
Image: image,
Ports: []corev1.ContainerPort{
{
Expand Down
4 changes: 2 additions & 2 deletions pkg/openshift/consoleplugin/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func ServiceName() string {
return KUADRANT_CONSOLE
return KuadrantConsoleName
}

func ServiceAnnotations() map[string]string {
Expand All @@ -18,7 +18,7 @@ func ServiceAnnotations() map[string]string {

func ServiceSelector() map[string]string {
return map[string]string{
"app": KUADRANT_CONSOLE,
"app": KuadrantConsoleName,
}
}

Expand Down

0 comments on commit 58ddb25

Please sign in to comment.