-
Notifications
You must be signed in to change notification settings - Fork 23
Conversation
Welcome @zhanggbj! It looks like this is your first PR to knative/client-contrib 🎉 |
Hi @zhanggbj. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
75cd6a5
to
2c377f7
Compare
2c377f7
to
2c72aa5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot ! It's a crazy busy week for me (and next week I have PTO :(, so I hope I can bring it forward this week still.
sorry for the delay ...
@rhuss |
@zhanggbj sorry, I couldn't make it before my PTO (and I'm heading now off to the Alpes with little connectivity). I will be back the first week in March and get your PRs merged then is on the top of my priority list. Apologies, and have a nice week ! |
/ok-to-test |
Hi, @zhanggbj, so all the tests are failing :( I’ll leave some comments as well. But please fix this ^^^ first. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @zhanggbj, thanks for the contribution. However, few things TODO:
- Please address comments
- Add unit tests
- Try to at least add one e2e test if possible. OK to have that as a separate PR
- Since this PR has the dependency (1000s of files). It would be easier to have two PRs. But OK with one if that simple for you
- Ensure all UTs are passing
@zhanggbj: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@maximilien Thank you for you review! I've address your most of your comments and left one comment (add version in next PR), would you please help to take a review, thx! I check the test failure, looks like it doesn't relate do plugin code, it cannot find the proper test file to execute. For e.g.
|
go.mod
Outdated
@@ -0,0 +1,14 @@ | |||
module github.com/knative/client-contrib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be no top-level go.mod but each individual plugin uses its own dependency tree. the same is true for the vendor/
dir. See the comments to #5 for the reasoning and how I suggest to progress.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhuss sure, I'm working on it, will move vendor to the admin own structure and resubmit.
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
@zhanggbj I asked the Knative admins to add you to the GitHub orga |
Hi @rhuss @maximilien, This is an initial PR for kn-admin and I still have a lot of TODOs in my list. I'll raise new PRs for review later as this already got a little bit hard to review:-)
|
@@ -4,6 +4,7 @@ approvers: | |||
- rhuss | |||
- maximilien | |||
- navidshaikh | |||
- zhanggbj |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether we could add a OWNERS fils within the plugins/admin
directory ? I think this would be nice as it highlights the responsibilities and point-of-contact better.
I think prow supports this, let me check ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. Thanks a lot and I've joined Knative org.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot ! (also for your patience ;-)
Here's a first round of comments concerning UX aspects. In generall it looks good to me so far, except that I would think a bit more about the commands / option naming.
@zhanggbj btw, I would be happy to already commit the PR and then we can continue to work on it later. |
- Added kn-admin plugin - Added domain set - Added private registry enable
- To align with hello example plugin, restruct and add missing part - Add admin plugin maintainer in OWNERS
} | ||
|
||
// scanMantissa scans the mantissa beginning from the rune. It returns the next | ||
// non decimal rune. It's used to determine wheter it's a fraction or exponent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found potential misspelling(s):
// non decimal rune. It's used to determine wheter it's a fraction or exponent. | |
// non decimal rune. It's used to determine whether it's a fraction or exponent. |
} | ||
|
||
// scanMantissa scans the mantissa beginning from the rune. It returns the next | ||
// non decimal rune. It's used to determine wheter it's a fraction or exponent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found potential misspelling(s):
// non decimal rune. It's used to determine wheter it's a fraction or exponent. | |
// non decimal rune. It's used to determine whether it's a fraction or exponent. |
// filesystems saying so. | ||
// It will call Lstat if the filesystem iself is, or it delegates to, the os filesystem. | ||
// Else it will call Stat. | ||
// In addtion to the FileInfo, it will return a boolean telling whether Lstat was called or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found potential misspelling(s):
// In addtion to the FileInfo, it will return a boolean telling whether Lstat was called or not. | |
// In addition to the FileInfo, it will return a boolean telling whether Lstat was called or not. |
I really wanted a very straightforward library that could seamlessly do | ||
the following things. | ||
|
||
1. Replace all the println, printf, etc statements thoughout my code with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found potential misspelling(s):
1. Replace all the println, printf, etc statements thoughout my code with | |
1. Replace all the println, printf, etc statements throughout my code with |
} | ||
} | ||
|
||
// StrictDomainName limits the set of permissable ASCII characters to those |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found potential misspelling(s):
// StrictDomainName limits the set of permissable ASCII characters to those | |
// StrictDomainName limits the set of permissible ASCII characters to those |
@@ -0,0 +1,801 @@ | |||
// Copyright 2014 Unknwon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found potential misspelling(s):
// Copyright 2014 Unknwon | |
// Copyright 2014 Unknown |
@@ -0,0 +1,526 @@ | |||
// Copyright 2015 Unknwon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found potential misspelling(s):
// Copyright 2015 Unknwon | |
// Copyright 2015 Unknown |
|
||
// NOTE: Iterate and increase `currentPeekSize` until | ||
// the size of the parser buffer is found. | ||
// TODO(unknwon): When Golang 1.10 is the lowest version supported, replace with `parserBufferSize := p.buf.Size()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found potential misspelling(s):
// TODO(unknwon): When Golang 1.10 is the lowest version supported, replace with `parserBufferSize := p.buf.Size()`. | |
// TODO(unknown): When Golang 1.10 is the lowest version supported, replace with `parserBufferSize := p.buf.Size()`. |
@@ -0,0 +1,256 @@ | |||
// Copyright 2014 Unknwon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found potential misspelling(s):
// Copyright 2014 Unknwon | |
// Copyright 2014 Unknown |
@@ -0,0 +1,603 @@ | |||
// Copyright 2014 Unknwon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found potential misspelling(s):
// Copyright 2014 Unknwon | |
// Copyright 2014 Unknown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)
// we need to un-flatten the ast enough to decode | ||
newNode := &ast.ObjectItem{ | ||
Keys: []*ast.ObjectKey{ | ||
&ast.ObjectKey{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format Go code:
&ast.ObjectKey{ | |
{ |
"os" | ||
"log" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format Go code:
"os" | |
"log" |
import ( | ||
"os" | ||
"log" | ||
"io/ioutil" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format Go code:
"io/ioutil" | |
"io/ioutil" | |
"log" | |
"os" |
// ErrorLogger is used to print out error, can be set to writer other than stderr | ||
var ErrorLogger = log.New(os.Stderr, "", 0) | ||
|
||
// InfoLogger is used to print informational message, default to off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format Go code:
// InfoLogger is used to print informational message, default to off | |
// InfoLogger is used to print informational message, default to off | |
var InfoLogger = log.New(ioutil.Discard, "", 0) |
|
||
import ( | ||
"context" | ||
"fmt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format Go code:
"fmt" | |
"fmt" | |
"reflect" |
return yaml_INT_TAG, uintv | ||
} | ||
} else if strings.HasPrefix(plain, "-0b") { | ||
intv, err := strconv.ParseInt("-" + plain[3:], 2, 64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format Go code:
intv, err := strconv.ParseInt("-" + plain[3:], 2, 64) | |
intv, err := strconv.ParseInt("-"+plain[3:], 2, 64) |
var ai, bi int | ||
var an, bn int64 | ||
if ar[i] == '0' || br[i] == '0' { | ||
for j := i-1; j >= 0 && unicode.IsDigit(ar[j]); j-- { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format Go code:
for j := i-1; j >= 0 && unicode.IsDigit(ar[j]); j-- { | |
for j := i - 1; j >= 0 && unicode.IsDigit(ar[j]); j-- { |
func (meta *ObjectMeta) SetDeletionTimestamp(deletionTimestamp *Time) { | ||
meta.DeletionTimestamp = deletionTimestamp | ||
} | ||
func (meta *ObjectMeta) GetDeletionGracePeriodSeconds() *int64 { return meta.DeletionGracePeriodSeconds } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format Go code:
func (meta *ObjectMeta) GetDeletionGracePeriodSeconds() *int64 { return meta.DeletionGracePeriodSeconds } | |
func (meta *ObjectMeta) GetDeletionGracePeriodSeconds() *int64 { | |
return meta.DeletionGracePeriodSeconds | |
} |
func (n nothingSelector) Matches(_ Fields) bool { return false } | ||
func (n nothingSelector) Empty() bool { return false } | ||
func (n nothingSelector) String() string { return "" } | ||
func (n nothingSelector) Requirements() Requirements { return nil } | ||
func (n nothingSelector) DeepCopySelector() Selector { return n } | ||
func (n nothingSelector) RequiresExactMatch(field string) (value string, found bool) { return "", false } | ||
func (n nothingSelector) Transform(fn TransformFunc) (Selector, error) { return n, nil } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format Go code:
func (n nothingSelector) Matches(_ Fields) bool { return false } | |
func (n nothingSelector) Empty() bool { return false } | |
func (n nothingSelector) String() string { return "" } | |
func (n nothingSelector) Requirements() Requirements { return nil } | |
func (n nothingSelector) DeepCopySelector() Selector { return n } | |
func (n nothingSelector) RequiresExactMatch(field string) (value string, found bool) { return "", false } | |
func (n nothingSelector) Transform(fn TransformFunc) (Selector, error) { return n, nil } | |
func (n nothingSelector) Matches(_ Fields) bool { return false } | |
func (n nothingSelector) Empty() bool { return false } | |
func (n nothingSelector) String() string { return "" } | |
func (n nothingSelector) Requirements() Requirements { return nil } | |
func (n nothingSelector) DeepCopySelector() Selector { return n } | |
func (n nothingSelector) RequiresExactMatch(field string) (value string, found bool) { | |
return "", false | |
} | |
func (n nothingSelector) Transform(fn TransformFunc) (Selector, error) { return n, nil } |
func (n nothingSelector) Matches(_ Labels) bool { return false } | ||
func (n nothingSelector) Empty() bool { return false } | ||
func (n nothingSelector) String() string { return "" } | ||
func (n nothingSelector) Add(_ ...Requirement) Selector { return n } | ||
func (n nothingSelector) Requirements() (Requirements, bool) { return nil, false } | ||
func (n nothingSelector) DeepCopySelector() Selector { return n } | ||
func (n nothingSelector) RequiresExactMatch(label string) (value string, found bool) { return "", false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Format Go code:
func (n nothingSelector) Matches(_ Labels) bool { return false } | |
func (n nothingSelector) Empty() bool { return false } | |
func (n nothingSelector) String() string { return "" } | |
func (n nothingSelector) Add(_ ...Requirement) Selector { return n } | |
func (n nothingSelector) Requirements() (Requirements, bool) { return nil, false } | |
func (n nothingSelector) DeepCopySelector() Selector { return n } | |
func (n nothingSelector) RequiresExactMatch(label string) (value string, found bool) { return "", false } | |
func (n nothingSelector) Matches(_ Labels) bool { return false } | |
func (n nothingSelector) Empty() bool { return false } | |
func (n nothingSelector) String() string { return "" } | |
func (n nothingSelector) Add(_ ...Requirement) Selector { return n } | |
func (n nothingSelector) Requirements() (Requirements, bool) { return nil, false } | |
func (n nothingSelector) DeepCopySelector() Selector { return n } | |
func (n nothingSelector) RequiresExactMatch(label string) (value string, found bool) { | |
return "", false | |
} |
@rhuss |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot ! Congrats to the first plugin merged ever to knative/client-contrib
;-) 👏
Let's continue to work on it to provide even more features. Also, I'm going to open an issue to collect more ideas for what might be interesting to add, so if we have kind of a complete overview we can align the command structure, too.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhuss, zhanggbj The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* Initialize kn-admin plugin - Added kn-admin plugin - Added domain set - Added private registry enable * Restruct kn-admin plugin - To align with hello example plugin, restruct and add missing part - Add admin plugin maintainer in OWNERS
Hi All,
This kn-admin plugin is designed to help administrators or operators better manage a Knative platform installation with kn CLI.
This is an initial commit. More details in the proposal: https://docs.google.com/document/d/1oD5P4WQZs39GIr_4ezcURgRCuUx8dXrcCi3N7GKmp5c/edit#
Thanks!