Skip to content

Commit

Permalink
delete unused functions in pkg/controller directory
Browse files Browse the repository at this point in the history
  • Loading branch information
HirazawaUi committed Mar 28, 2023
1 parent c3e7eca commit 397cc73
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 130 deletions.
92 changes: 0 additions & 92 deletions pkg/controller/lookup_cache.go

This file was deleted.

12 changes: 0 additions & 12 deletions pkg/controller/replication/replication_controller_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,8 @@ package replication

import (
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// NewReplicationControllerCondition creates a new replication controller condition.
func NewReplicationControllerCondition(condType v1.ReplicationControllerConditionType, status v1.ConditionStatus, reason, msg string) v1.ReplicationControllerCondition {
return v1.ReplicationControllerCondition{
Type: condType,
Status: status,
LastTransitionTime: metav1.Now(),
Reason: reason,
Message: msg,
}
}

// GetCondition returns a replication controller condition with the provided type if it exists.
func GetCondition(status v1.ReplicationControllerStatus, condType v1.ReplicationControllerConditionType) *v1.ReplicationControllerCondition {
for i := range status.Conditions {
Expand Down
13 changes: 0 additions & 13 deletions pkg/controller/resourcequota/resource_quota_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,6 @@ type QuotaMonitor struct {
updateFilter UpdateFilter
}

// NewMonitor creates a new instance of a QuotaMonitor
func NewMonitor(informersStarted <-chan struct{}, informerFactory informerfactory.InformerFactory, ignoredResources map[schema.GroupResource]struct{}, resyncPeriod controller.ResyncPeriodFunc, replenishmentFunc ReplenishmentFunc, registry quota.Registry) *QuotaMonitor {
return &QuotaMonitor{
informersStarted: informersStarted,
informerFactory: informerFactory,
ignoredResources: ignoredResources,
resourceChanges: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "resource_quota_controller_resource_changes"),
resyncPeriod: resyncPeriod,
replenishmentFunc: replenishmentFunc,
registry: registry,
}
}

// monitor runs a Controller with a local stop channel.
type monitor struct {
controller cache.Controller
Expand Down
13 changes: 0 additions & 13 deletions pkg/controller/statefulset/stateful_set_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package statefulset

import (
"bytes"
"encoding/json"
"fmt"
"regexp"
Expand Down Expand Up @@ -481,18 +480,6 @@ func newVersionedStatefulSetPod(currentSet, updateSet *apps.StatefulSet, current
return pod
}

// Match check if the given StatefulSet's template matches the template stored in the given history.
func Match(ss *apps.StatefulSet, history *apps.ControllerRevision) (bool, error) {
// Encoding the set for the patch may update its GVK metadata, which causes data races if this
// set is in an informer cache.
clone := ss.DeepCopy()
patch, err := getPatch(clone)
if err != nil {
return false, err
}
return bytes.Equal(patch, history.Data.Raw), nil
}

// getPatch returns a strategic merge patch that can be applied to restore a StatefulSet to a
// previous version. If the returned error is nil the patch is valid. The current state that we save is just the
// PodSpecTemplate. We can modify this later to encompass more state (or less) and remain compatible with previously
Expand Down

0 comments on commit 397cc73

Please sign in to comment.