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

feat: add inactive topic policies command for topic #444

Merged
merged 2 commits into from
Sep 28, 2021

Conversation

nodece
Copy link
Contributor

@nodece nodece commented Sep 8, 2021

Signed-off-by: Zixuan Liu nodeces@gmail.com

Changes

background from #246, the PR implements the following commands:

  • pulsarctl topics get-inactive-topic-policies <topic> --applied <bool>
  • pulsarctl topics remove-inactive-topic-policies <topic>
  • pulsarctl topics set-inactive-topic-policies <topic> --enable-delete-while-inactive <bool> --max-inactive-duration <string> --delete-mode <delete_when_no_subscriptions|delete_when_subscriptions_caught_up>


import (
"github.com/streamnative/pulsarctl/pkg/cmdutils"

Copy link
Member

Choose a reason for hiding this comment

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

remove the empty line?

"github.com/stretchr/testify/assert"
)

func TestInactiveTopicCmd(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

We also need to add some failure case tests.

Copy link
Contributor Author

@nodece nodece Sep 22, 2021

Choose a reason for hiding this comment

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

I think we just need to test the flag required by set-inactive-topic-policies.

Copy link
Member

Choose a reason for hiding this comment

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

The failure case is used to check the error response is parsed correctly at the pulsarctl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you want to test the response from pulsar?

@nodece nodece force-pushed the inactive_topic branch 2 times, most recently from b8246b2 to 851cdeb Compare September 24, 2021 06:19
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
@nodece nodece force-pushed the inactive_topic branch 2 times, most recently from a97367d to 57cdcf0 Compare September 24, 2021 12:29
@zymap zymap merged commit db4dda4 into streamnative:master Sep 28, 2021
@nodece nodece deleted the inactive_topic branch September 29, 2021 01:36
nodece added a commit that referenced this pull request Nov 12, 2021
Signed-off-by: Zixuan Liu <nodeces@gmail.com>

### Changes

background from #246,  the PR implements the following commands:

- `pulsarctl topics get-inactive-topic-policies <topic> --applied <bool>`
- `pulsarctl topics remove-inactive-topic-policies <topic>`
- `pulsarctl topics set-inactive-topic-policies <topic> --enable-delete-while-inactive <bool> --max-inactive-duration <string> --delete-mode <delete_when_no_subscriptions|delete_when_subscriptions_caught_up>`

(cherry picked from commit db4dda4)
tisonkun pushed a commit to tisonkun/pulsar-client-go that referenced this pull request Aug 15, 2023
…sarctl#444)

Signed-off-by: Zixuan Liu <nodeces@gmail.com>

### Changes

background from streamnative/pulsarctl#246,  the PR implements the following commands:

- `pulsarctl topics get-inactive-topic-policies <topic> --applied <bool>`
- `pulsarctl topics remove-inactive-topic-policies <topic>`
- `pulsarctl topics set-inactive-topic-policies <topic> --enable-delete-while-inactive <bool> --max-inactive-duration <string> --delete-mode <delete_when_no_subscriptions|delete_when_subscriptions_caught_up>`
tisonkun pushed a commit to apache/pulsar-client-go that referenced this pull request Aug 16, 2023
…sarctl#444)

Signed-off-by: Zixuan Liu <nodeces@gmail.com>

### Changes

background from streamnative/pulsarctl#246,  the PR implements the following commands:

- `pulsarctl topics get-inactive-topic-policies <topic> --applied <bool>`
- `pulsarctl topics remove-inactive-topic-policies <topic>`
- `pulsarctl topics set-inactive-topic-policies <topic> --enable-delete-while-inactive <bool> --max-inactive-duration <string> --delete-mode <delete_when_no_subscriptions|delete_when_subscriptions_caught_up>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants