Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
66f2622b
Unverified
Commit
66f2622b
authored
May 14, 2018
by
Eric Chiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client-go: remove dep on pflag
parent
c9591ee6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
0 additions
and
64 deletions
+0
-64
BUILD
staging/src/k8s.io/apimachinery/pkg/api/resource/BUILD
+0
-2
quantity.go
staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
+0
-42
quantity_test.go
...src/k8s.io/apimachinery/pkg/api/resource/quantity_test.go
+0
-16
Godeps.json
staging/src/k8s.io/metrics/Godeps/Godeps.json
+0
-4
No files found.
staging/src/k8s.io/apimachinery/pkg/api/resource/BUILD
View file @
66f2622b
...
@@ -18,7 +18,6 @@ go_test(
...
@@ -18,7 +18,6 @@ go_test(
embed = [":go_default_library"],
embed = [":go_default_library"],
deps = [
deps = [
"//vendor/github.com/google/gofuzz:go_default_library",
"//vendor/github.com/google/gofuzz:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
"//vendor/gopkg.in/inf.v0:go_default_library",
"//vendor/gopkg.in/inf.v0:go_default_library",
],
],
)
)
...
@@ -38,7 +37,6 @@ go_library(
...
@@ -38,7 +37,6 @@ go_library(
importpath = "k8s.io/apimachinery/pkg/api/resource",
importpath = "k8s.io/apimachinery/pkg/api/resource",
deps = [
deps = [
"//vendor/github.com/gogo/protobuf/proto:go_default_library",
"//vendor/github.com/gogo/protobuf/proto:go_default_library",
"//vendor/github.com/spf13/pflag:go_default_library",
"//vendor/gopkg.in/inf.v0:go_default_library",
"//vendor/gopkg.in/inf.v0:go_default_library",
],
],
)
)
...
...
staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
View file @
66f2622b
...
@@ -25,8 +25,6 @@ import (
...
@@ -25,8 +25,6 @@ import (
"strconv"
"strconv"
"strings"
"strings"
flag
"github.com/spf13/pflag"
inf
"gopkg.in/inf.v0"
inf
"gopkg.in/inf.v0"
)
)
...
@@ -747,43 +745,3 @@ func (q *Quantity) Copy() *Quantity {
...
@@ -747,43 +745,3 @@ func (q *Quantity) Copy() *Quantity {
Format
:
q
.
Format
,
Format
:
q
.
Format
,
}
}
}
}
// qFlag is a helper type for the Flag function
type
qFlag
struct
{
dest
*
Quantity
}
// Sets the value of the internal Quantity. (used by flag & pflag)
func
(
qf
qFlag
)
Set
(
val
string
)
error
{
q
,
err
:=
ParseQuantity
(
val
)
if
err
!=
nil
{
return
err
}
// This copy is OK because q will not be referenced again.
*
qf
.
dest
=
q
return
nil
}
// Converts the value of the internal Quantity to a string. (used by flag & pflag)
func
(
qf
qFlag
)
String
()
string
{
return
qf
.
dest
.
String
()
}
// States the type of flag this is (Quantity). (used by pflag)
func
(
qf
qFlag
)
Type
()
string
{
return
"quantity"
}
// QuantityFlag is a helper that makes a quantity flag (using standard flag package).
// Will panic if defaultValue is not a valid quantity.
func
QuantityFlag
(
flagName
,
defaultValue
,
description
string
)
*
Quantity
{
q
:=
MustParse
(
defaultValue
)
flag
.
Var
(
NewQuantityFlagValue
(
&
q
),
flagName
,
description
)
return
&
q
}
// NewQuantityFlagValue returns an object that can be used to back a flag,
// pointing at the given Quantity variable.
func
NewQuantityFlagValue
(
q
*
Quantity
)
flag
.
Value
{
return
qFlag
{
q
}
}
staging/src/k8s.io/apimachinery/pkg/api/resource/quantity_test.go
View file @
66f2622b
...
@@ -24,7 +24,6 @@ import (
...
@@ -24,7 +24,6 @@ import (
"unicode"
"unicode"
fuzz
"github.com/google/gofuzz"
fuzz
"github.com/google/gofuzz"
"github.com/spf13/pflag"
inf
"gopkg.in/inf.v0"
inf
"gopkg.in/inf.v0"
)
)
...
@@ -1059,21 +1058,6 @@ func TestCopy(t *testing.T) {
...
@@ -1059,21 +1058,6 @@ func TestCopy(t *testing.T) {
}
}
}
}
func
TestQFlagSet
(
t
*
testing
.
T
)
{
qf
:=
qFlag
{
&
Quantity
{}}
qf
.
Set
(
"1Ki"
)
if
e
,
a
:=
"1Ki"
,
qf
.
String
();
e
!=
a
{
t
.
Errorf
(
"Unexpected result %v != %v"
,
e
,
a
)
}
}
func
TestQFlagIsPFlag
(
t
*
testing
.
T
)
{
var
pfv
pflag
.
Value
=
qFlag
{}
if
e
,
a
:=
"quantity"
,
pfv
.
Type
();
e
!=
a
{
t
.
Errorf
(
"Unexpected result %v != %v"
,
e
,
a
)
}
}
func
TestSub
(
t
*
testing
.
T
)
{
func
TestSub
(
t
*
testing
.
T
)
{
tests
:=
[]
struct
{
tests
:=
[]
struct
{
a
Quantity
a
Quantity
...
...
staging/src/k8s.io/metrics/Godeps/Godeps.json
View file @
66f2622b
...
@@ -71,10 +71,6 @@
...
@@ -71,10 +71,6 @@
"Rev"
:
"05fbef0ca5da472bbf96c9322b84a53edc03c9fd"
"Rev"
:
"05fbef0ca5da472bbf96c9322b84a53edc03c9fd"
},
},
{
{
"ImportPath"
:
"github.com/spf13/pflag"
,
"Rev"
:
"583c0c0531f06d5278b7d917446061adc344b5cd"
},
{
"ImportPath"
:
"golang.org/x/crypto/ssh/terminal"
,
"ImportPath"
:
"golang.org/x/crypto/ssh/terminal"
,
"Rev"
:
"49796115aa4b964c318aad4f3084fdb41e9aa067"
"Rev"
:
"49796115aa4b964c318aad4f3084fdb41e9aa067"
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment