Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian-McM committed Feb 21, 2025
1 parent 1258982 commit d88add3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 32 deletions.
15 changes: 3 additions & 12 deletions pkg/controller/whisker/whisker_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import (
"context"
"fmt"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/handler"
Expand Down Expand Up @@ -168,18 +166,11 @@ func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (
return result, err
}

linseedCASecret, err := utils.GetIfExists[corev1.Secret](ctx,
types.NamespacedName{Name: render.VoltronLinseedPublicCert, Namespace: common.OperatorNamespace()}, r.cli)
if err != nil {
return result, err
}

ch := utils.NewComponentHandler(log, r.cli, r.scheme, whiskerCR)
cfg := &whisker.Configuration{
PullSecrets: pullSecrets,
OpenShift: r.provider.IsOpenShift(),
Installation: installation,
LinseedPublicCASecret: linseedCASecret,
PullSecrets: pullSecrets,
OpenShift: r.provider.IsOpenShift(),
Installation: installation,
}

components := []render.Component{whisker.Whisker(cfg)}
Expand Down
23 changes: 3 additions & 20 deletions pkg/render/whisker/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
package whisker

import (
"fmt"

"github.com/tigera/operator/pkg/components"

"github.com/tigera/operator/pkg/common"
Expand Down Expand Up @@ -56,10 +54,9 @@ func Whisker(cfg *Configuration) render.Component {

// Configuration contains all the config information needed to render the component.
type Configuration struct {
PullSecrets []*corev1.Secret
OpenShift bool
Installation *operatorv1.InstallationSpec
LinseedPublicCASecret *corev1.Secret
PullSecrets []*corev1.Secret
OpenShift bool
Installation *operatorv1.InstallationSpec
}

type Component struct {
Expand Down Expand Up @@ -237,20 +234,6 @@ func (c *Component) deployment() *appsv1.Deployment {
}
}

func secretMount(path string, scrt *corev1.Secret) corev1.VolumeMount {
return corev1.VolumeMount{
Name: fmt.Sprintf("%s-%s", scrt.Name, "scrt"),
MountPath: path,
}
}

func secretVolume(scrt *corev1.Secret) corev1.Volume {
return corev1.Volume{
Name: fmt.Sprintf("%s-%s", scrt.Name, "scrt"),
VolumeSource: corev1.VolumeSource{Secret: &corev1.SecretVolumeSource{SecretName: scrt.Name}},
}
}

func (c *Component) clusterRoleBinding() *rbacv1.ClusterRoleBinding {
return &rbacv1.ClusterRoleBinding{
TypeMeta: metav1.TypeMeta{Kind: "ClusterRoleBinding", APIVersion: "rbac.authorization.k8s.io/v1"},
Expand Down

0 comments on commit d88add3

Please sign in to comment.