Skip to content
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

Adds odo project delete -o json #2037

Merged

Conversation

cdrage
Copy link
Member

@cdrage cdrage commented Aug 22, 2019

Adds capability for odo project create -o json output.

To test:

github.com/openshift/odo  json-delete-project ✗                                                                                                                                                                                                                        1h50m ⚑  ⍉
▶ ./odo project create foobar -o json | jq
{
  "kind": "Project",
  "apiVersion": "odo.openshift.io/v1alpha1",
  "metadata": {
    "name": "foobar",
    "namespace": "foobar",
    "creationTimestamp": null
  },
  "message": "Project 'foobar' is ready for use"
}

github.com/openshift/odo  json-delete-project ✗                                                                                                                                                                                                                         1h50m ⚑
▶ ./odo project delete foobar -o json | jq
{
  "kind": "Project",
  "apiVersion": "odo.openshift.io/v1alpha1",
  "metadata": {
    "name": "foobar",
    "namespace": "foobar",
    "creationTimestamp": null
  },
  "message": "Deleted project foobar"
}

@cdrage
Copy link
Member Author

cdrage commented Aug 22, 2019

Tests have been added and this is ready for review 🎉

@cdrage cdrage changed the title Adds odo project create -o json Adds odo project delete -o json Aug 22, 2019
@cdrage cdrage force-pushed the json-delete-project branch from 24a6c70 to 4a47e5c Compare August 22, 2019 20:11
Copy link
Member

@dharmit dharmit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested very minor fix for a comment.

@@ -61,22 +61,32 @@ func (pdo *ProjectDeleteOptions) Validate() (err error) {

// Run runs the project delete command
func (pdo *ProjectDeleteOptions) Run() (err error) {
// this to set the project in the file and runtime

// This to set the project in the file and runtime
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/This to/This is to/

@dharmit
Copy link
Member

dharmit commented Aug 23, 2019

▶ ./odo project create foobar -o json | jq
{
"kind": "Project",
"apiVersion": "odo.openshift.io/v1alpha1",
"metadata": {
"name": "foobar",
"namespace": "foobar",
"creationTimestamp": null
},
"message": "Project 'foobar' is ready for use"
}

Shouldn't we provide a value for creationTimestamp? If it's not possible to do so, we should not have it in the json output, no?

@cdrage
Copy link
Member Author

cdrage commented Aug 27, 2019

/retest

@cdrage cdrage force-pushed the json-delete-project branch from 4a47e5c to ccf316e Compare August 27, 2019 19:55
@cdrage
Copy link
Member Author

cdrage commented Aug 27, 2019

/retest

Copy link
Contributor

@amitkrout amitkrout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integration test including the code change looks good to me
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Aug 28, 2019
@amitkrout
Copy link
Contributor

/test integration

@cdrage
Copy link
Member Author

cdrage commented Aug 28, 2019

/retest all

@cdrage cdrage force-pushed the json-delete-project branch from ccf316e to 42a2c96 Compare August 28, 2019 14:49
Adds capability for `odo project delete -o json` output.

To test

```sh
github.com/openshift/odo  json-delete-project ✗                                                                                                                                                                                                                        1h50m ⚑  ⍉
▶ ./odo project create foobar -o json | jq
{
  "kind": "Project",
  "apiVersion": "odo.openshift.io/v1alpha1",
  "metadata": {
    "name": "foobar",
    "namespace": "foobar",
    "creationTimestamp": null
  },
  "message": "Project 'foobar' is ready for use"
}

github.com/openshift/odo  json-delete-project ✗                                                                                                                                                                                                                         1h50m ⚑
▶ ./odo project delete foobar -o json | jq
{
  "kind": "Project",
  "apiVersion": "odo.openshift.io/v1alpha1",
  "metadata": {
    "name": "foobar",
    "namespace": "foobar",
    "creationTimestamp": null
  },
  "message": "Deleted project foobar"
}
```
@cdrage cdrage force-pushed the json-delete-project branch from 42a2c96 to 11a8fff Compare August 28, 2019 16:09
@cdrage
Copy link
Member Author

cdrage commented Aug 28, 2019

I've been re-running this test about 10 times now, still running into "Terraform" issues. Any ideas @mohammedzee1000 ?

@amitkrout
Copy link
Contributor

/retest

@cdrage
Copy link
Member Author

cdrage commented Aug 29, 2019

Need one more review!

@dharmit @kadel @girishramnani ?

@kadel
Copy link
Member

kadel commented Aug 29, 2019

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kadel

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label Aug 29, 2019
@openshift-merge-robot openshift-merge-robot merged commit 94f4bc0 into redhat-developer:master Aug 29, 2019
cdrage added a commit to cdrage/odo that referenced this pull request Sep 3, 2019
- Lists all URLs even if they are undeployed or not
(redhat-developer#2034)

- Added json output for `odo project delete -o json`
(redhat-developer#2037)

- Fixed service integration test that was previously failing
(redhat-developer#2022)

- `odo push` will now only push changed files
(redhat-developer#2030)
- We now use relative paths within the file indexer
(redhat-developer#2003)
- You can now create list and edit services using --app and --project
(redhat-developer#2001)
- Deleted files will now propagate to the OpenShift container
(redhat-developer#1999)
- Added `odo service create --context` functionality
(redhat-developer#1997)
- Making cross-compile independant of gox vendor package
(redhat-developer#2047)
- `odo-supervisord-image` has been renamed to `odo-init-image`
(redhat-developer#2027)
- Releases now use .tar.gz (redhat-developer#2009)
- If there is an error creating a service, it will fail quicker
(redhat-developer#2008)

- We now have a Google Group!
(redhat-developer#2007)
- Added documentation on how to manage environment
variables(redhat-developer#2026)
- Badges added to the README
(redhat-developer#2060)
- Updated documentation on uninstallation
(redhat-developer#2053)
- Added documentation for default parameters
(redhat-developer#2038)
- Minor update to help output
(redhat-developer#2006)
- Updated documentation regarding bootstrapper image
(redhat-developer#1991)
@cdrage cdrage mentioned this pull request Sep 3, 2019
openshift-merge-robot pushed a commit that referenced this pull request Sep 3, 2019
- Lists all URLs even if they are undeployed or not
(#2034)

- Added json output for `odo project delete -o json`
(#2037)

- Fixed service integration test that was previously failing
(#2022)

- `odo push` will now only push changed files
(#2030)
- We now use relative paths within the file indexer
(#2003)
- You can now create list and edit services using --app and --project
(#2001)
- Deleted files will now propagate to the OpenShift container
(#1999)
- Added `odo service create --context` functionality
(#1997)
- Making cross-compile independant of gox vendor package
(#2047)
- `odo-supervisord-image` has been renamed to `odo-init-image`
(#2027)
- Releases now use .tar.gz (#2009)
- If there is an error creating a service, it will fail quicker
(#2008)

- We now have a Google Group!
(#2007)
- Added documentation on how to manage environment
variables(#2026)
- Badges added to the README
(#2060)
- Updated documentation on uninstallation
(#2053)
- Added documentation for default parameters
(#2038)
- Minor update to help output
(#2006)
- Updated documentation regarding bootstrapper image
(#1991)
@cdrage cdrage deleted the json-delete-project branch January 14, 2022 14:53
@rm3l rm3l added the estimated-size/M (10-20) Rough sizing for Epics. About 1 sprint of work for one person label Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. estimated-size/M (10-20) Rough sizing for Epics. About 1 sprint of work for one person lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants