-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add revision describe (#15) #16
Conversation
nimakaviani
commented
Jan 30, 2019
- print the yaml formatted revision by default
- allow for custom formatting to be passed in
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
f72d1f2
to
fa460dd
Compare
I signed it! |
CLAs look good, thanks! |
pkg/kn/commands/revision_describe.go
Outdated
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"k8s.io/cli-runtime/pkg/genericclioptions" | ||
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp" |
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.
we should move this line into root command.
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.
fixed in a separate commit in the PR
pkg/kn/commands/revision_describe.go
Outdated
var revisionDescribePrintFlags *genericclioptions.PrintFlags | ||
|
||
func NewRevisionDescribeCommand(p *KnParams) *cobra.Command { | ||
revisionDescribePrintFlags = genericclioptions.NewPrintFlags("").WithDefaultOutput("yaml") |
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.
should use :=
and remove outside declaration. wanna keep scope as tight as possible.
|
||
action, data, err := fakeRevision([]string{"revision", "describe", "test-rev"}, expectedRevision) | ||
if err != nil { | ||
t.Error(err) |
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.
t.Fatal(err) and below as well.
return | ||
} | ||
|
||
var returnedRevision = &v1alpha1.Revision{} |
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.
more common is to have var returnedRevision *v1alpha1.Revision{}
as declaration
ca4168c
to
2e9b134
Compare
/ok-to-test
…On Wed, Jan 30, 2019 at 11:29 AM Nima Kaviani ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pkg/kn/commands/revision_describe.go
<#16 (comment)>:
> +// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package commands
+
+import (
+ "errors"
+
+ "github.com/spf13/cobra"
+ v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+ "k8s.io/apimachinery/pkg/runtime/schema"
+ "k8s.io/cli-runtime/pkg/genericclioptions"
+ _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
fixed in a separate commit in the PR
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#16 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHlyN1okTgQ1CFnq0ju1V0MnZWa6xi3fks5vIfKCgaJpZM4aZRa_>
.
--
Evan Anderson <argent@google.com>
|
pkg/kn/commands/revision_describe.go
Outdated
@@ -0,0 +1,65 @@ | |||
// Copyright © 2018 The Knative Authors |
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.
nit: 2019 🙃
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.
good catch. gotta fix it all across the board though. probably in a separate PR
I think this only needs to be done on newly-created files, not for existing
files, where the copyright starts when the file was created.
…On Thu, Jan 31, 2019 at 10:09 AM Nima Kaviani ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pkg/kn/commands/revision_describe.go
<#16 (comment)>:
> @@ -0,0 +1,65 @@
+// Copyright © 2018 The Knative Authors
good catch. gotta fix it all across the board though. probably in a
separate PR
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#16 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHlyN4s2bKWk42HyNaivLnVS-zrvo_Zuks5vIzFmgaJpZM4aZRa_>
.
--
Evan Anderson <argent@google.com>
|
This looks good to me as soon as the copyright date is changed :) |
done! |
* print the yaml formatted revision by default * allow for custom formatting to be passed in
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.
/lgtm
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cppforlife, nimakaviani, vdemeester 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 |
* Multiarch github action * Remove upstream workflows from create-release-branch.sh * Patch for ko base image * Remove upstream github actions in update-to-head.sh