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 759452f commit 75802d1
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,

Check warning on line 15 in pkg/openshift/consoleplugin/common.go

View check run for this annotation

Codecov / codecov/patch

pkg/openshift/consoleplugin/common.go#L8-L15

Added lines #L8 - L15 were not covered by tests
}
}
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

Check warning on line 9 in pkg/openshift/consoleplugin/consoleplugin.go

View check run for this annotation

Codecov / codecov/patch

pkg/openshift/consoleplugin/consoleplugin.go#L8-L9

Added lines #L8 - L9 were not covered by tests
}

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

Check warning on line 14 in pkg/openshift/consoleplugin/deployment.go

View check run for this annotation

Codecov / codecov/patch

pkg/openshift/consoleplugin/deployment.go#L13-L14

Added lines #L13 - L14 were not covered by tests
}

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{

Check warning on line 99 in pkg/openshift/consoleplugin/deployment.go

View check run for this annotation

Codecov / codecov/patch

pkg/openshift/consoleplugin/deployment.go#L83-L99

Added lines #L83 - L99 were not covered by tests
{
Name: KUADRANT_CONSOLE,
Name: KuadrantConsoleName,
Image: image,
Ports: []corev1.ContainerPort{

Check warning on line 103 in pkg/openshift/consoleplugin/deployment.go

View check run for this annotation

Codecov / codecov/patch

pkg/openshift/consoleplugin/deployment.go#L101-L103

Added lines #L101 - L103 were not covered by tests
{
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

Check warning on line 10 in pkg/openshift/consoleplugin/service.go

View check run for this annotation

Codecov / codecov/patch

pkg/openshift/consoleplugin/service.go#L9-L10

Added lines #L9 - L10 were not covered by tests
}

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,

Check warning on line 21 in pkg/openshift/consoleplugin/service.go

View check run for this annotation

Codecov / codecov/patch

pkg/openshift/consoleplugin/service.go#L19-L21

Added lines #L19 - L21 were not covered by tests
}
}

Expand Down

0 comments on commit 75802d1

Please sign in to comment.