Skip to content

Commit 7b8c9ac

Browse files
committed
remove unused code
Change-Id: If821920ec8872e326b7d85437ad8d2620807799d
1 parent 0772f85 commit 7b8c9ac

File tree

77 files changed

+0
-904
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+0
-904
lines changed

cmd/kubeadm/app/preflight/checks.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,10 +1088,6 @@ func RunPullImagesCheck(execer utilsexec.Interface, cfg *kubeadmapi.InitConfigur
10881088
// RunChecks runs each check, displays it's warnings/errors, and once all
10891089
// are processed will exit if any errors occurred.
10901090
func RunChecks(checks []Checker, ww io.Writer, ignorePreflightErrors sets.String) error {
1091-
type checkErrors struct {
1092-
Name string
1093-
Errors []error
1094-
}
10951091
var errsBuffer bytes.Buffer
10961092

10971093
for _, c := range checks {

pkg/api/v1/persistentvolume/util_test.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,3 @@ func collectSecretPaths(t *testing.T, path *field.Path, name string, tp reflect.
268268

269269
return secretPaths
270270
}
271-
272-
func newHostPathType(pathType string) *corev1.HostPathType {
273-
hostPathType := new(corev1.HostPathType)
274-
*hostPathType = corev1.HostPathType(pathType)
275-
return hostPathType
276-
}

pkg/apis/batch/validation/validation_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package validation
1818

1919
import (
20-
"fmt"
2120
"strings"
2221
"testing"
2322

@@ -68,12 +67,6 @@ func getValidPodTemplateSpecForGenerated(selector *metav1.LabelSelector) api.Pod
6867
}
6968
}
7069

71-
func featureToggle(feature utilfeature.Feature) []string {
72-
enabled := fmt.Sprintf("%s=%t", feature, true)
73-
disabled := fmt.Sprintf("%s=%t", feature, false)
74-
return []string{enabled, disabled}
75-
}
76-
7770
func TestValidateJob(t *testing.T) {
7871
validManualSelector := getValidManualSelector()
7972
validPodTemplateSpecForManual := getValidPodTemplateSpecForManual(validManualSelector)

pkg/apis/policy/v1beta1/defaults.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,8 @@ package v1beta1
1818

1919
import (
2020
policyv1beta1 "k8s.io/api/policy/v1beta1"
21-
"k8s.io/apimachinery/pkg/runtime"
2221
)
2322

24-
func addDefaultingFuncs(scheme *runtime.Scheme) error {
25-
return RegisterDefaults(scheme)
26-
}
27-
2823
func SetDefaults_PodSecurityPolicySpec(obj *policyv1beta1.PodSecurityPolicySpec) {
2924
// This field was added after PodSecurityPolicy was released.
3025
// Policies that do not include this field must remain as permissive as they were prior to the introduction of this field.

pkg/cloudprovider/providers/azure/azure_standard.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -568,16 +568,6 @@ func extractResourceGroupByNicID(nicID string) (string, error) {
568568
return matches[1], nil
569569
}
570570

571-
// extractResourceGroupByPipID extracts the resource group name by publicIP ID.
572-
func extractResourceGroupByPipID(pipID string) (string, error) {
573-
matches := publicIPResourceGroupRE.FindStringSubmatch(pipID)
574-
if len(matches) != 2 {
575-
return "", fmt.Errorf("error of extracting resourceGroup from pipID %q", pipID)
576-
}
577-
578-
return matches[1], nil
579-
}
580-
581571
// getPrimaryInterfaceWithVMSet gets machine primary network interface by node name and vmSet.
582572
func (as *availabilitySet) getPrimaryInterfaceWithVMSet(nodeName, vmSetName string) (network.Interface, error) {
583573
var machine compute.VirtualMachine

pkg/cloudprovider/providers/gce/gce.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,6 @@ const (
8181
gceComputeAPIEndpointBeta = "https://www.googleapis.com/compute/beta/"
8282
)
8383

84-
// gceObject is an abstraction of all GCE API object in go client
85-
type gceObject interface {
86-
MarshalJSON() ([]byte, error)
87-
}
88-
8984
var _ cloudprovider.Interface = (*Cloud)(nil)
9085
var _ cloudprovider.Instances = (*Cloud)(nil)
9186
var _ cloudprovider.LoadBalancer = (*Cloud)(nil)

pkg/cloudprovider/providers/gce/gce_util.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,6 @@ func makeGoogleAPINotFoundError(message string) error {
244244
return &googleapi.Error{Code: http.StatusNotFound, Message: message}
245245
}
246246

247-
func makeGoogleAPIError(code int, message string) error {
248-
return &googleapi.Error{Code: code, Message: message}
249-
}
250-
251247
// TODO(#51665): Remove this once Network Tiers becomes Beta in GCP.
252248
func handleAlphaNetworkTierGetError(err error) (string, error) {
253249
if isForbidden(err) {

pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ type LbaasV2 struct {
8585
LoadBalancer
8686
}
8787

88-
type empty struct{}
89-
9088
func networkExtensions(client *gophercloud.ServiceClient) (map[string]bool, error) {
9189
seen := make(map[string]bool)
9290

pkg/controller/podautoscaler/metrics/legacy_metrics_client_test.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -389,22 +389,6 @@ func TestCPUEmptyMetricsForOnePod(t *testing.T) {
389389
tc.runTest(t)
390390
}
391391

392-
func testCollapseTimeSamples(t *testing.T) {
393-
now := time.Now()
394-
metrics := heapster.MetricResult{
395-
Metrics: []heapster.MetricPoint{
396-
{Timestamp: now, Value: 50, FloatValue: nil},
397-
{Timestamp: now.Add(-15 * time.Second), Value: 100, FloatValue: nil},
398-
{Timestamp: now.Add(-60 * time.Second), Value: 100000, FloatValue: nil}},
399-
LatestTimestamp: now,
400-
}
401-
402-
val, timestamp, hadMetrics := collapseTimeSamples(metrics, time.Minute)
403-
assert.True(t, hadMetrics, "should report that it received a populated list of metrics")
404-
assert.InEpsilon(t, float64(75), val, 0.1, "collapsed sample value should be as expected")
405-
assert.True(t, timestamp.Equal(now), "timestamp should be the current time (the newest)")
406-
}
407-
408392
func offsetTimestampBy(t int) time.Time {
409393
return fixedTimestamp.Add(time.Duration(t) * time.Minute)
410394
}

pkg/controller/serviceaccount/tokens_controller.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -702,16 +702,6 @@ func (e *TokensController) listTokenSecrets(serviceAccount *v1.ServiceAccount) (
702702
return items, nil
703703
}
704704

705-
// serviceAccountNameAndUID is a helper method to get the ServiceAccount Name and UID from the given secret
706-
// Returns "","" if the secret is not a ServiceAccountToken secret
707-
// If the name or uid annotation is missing, "" is returned instead
708-
func serviceAccountNameAndUID(secret *v1.Secret) (string, string) {
709-
if secret.Type != v1.SecretTypeServiceAccountToken {
710-
return "", ""
711-
}
712-
return secret.Annotations[v1.ServiceAccountNameKey], secret.Annotations[v1.ServiceAccountUIDKey]
713-
}
714-
715705
func getSecretReferences(serviceAccount *v1.ServiceAccount) sets.String {
716706
references := sets.NewString()
717707
for _, secret := range serviceAccount.Secrets {

0 commit comments

Comments
 (0)