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

OCM-5941 | add enable delete protection parameter #602

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

ahitacat
Copy link
Contributor

Added --enable-delete-protection argument to the edit option.

How to test it:

  • Login and create a fake cluster called 'mycluster'
  • go run cmd/ocm/main.go edit cluster mycluster --enable-delete-protection --debug
I0228 13:00:07.139670  356406 dump.go:134] Request method is PATCH
I0228 13:00:07.139677  356406 dump.go:135] Request URL is 'http://localhost:9000/api/clusters_mgmt/v1/clusters/29lqu9n9kif8t7ergv0vfra1eeqd4kgu/delete_protection'
I0228 13:00:07.139683  356406 dump.go:153] Request header 'Accept' is 'application/json'
I0228 13:00:07.139689  356406 dump.go:151] Request header 'Authorization' is omitted
I0228 13:00:07.139694  356406 dump.go:153] Request header 'Content-Type' is 'application/json'
I0228 13:00:07.139699  356406 dump.go:153] Request header 'User-Agent' is 'OCM-CLI/0.1.72'
I0228 13:00:07.139706  356406 dump.go:158] Request body follows
I0228 13:00:07.139715  356406 dump.go:283] {
  "enabled": true
}
I0228 13:00:07.940433  356406 dump.go:165] Response protocol is 'HTTP/1.1'
I0228 13:00:07.940447  356406 dump.go:166] Response status is '200 OK'
I0228 13:00:07.940458  356406 dump.go:178] Response header 'Connection' is 'keep-alive'
I0228 13:00:07.940464  356406 dump.go:178] Response header 'Content-Type' is 'application/json'
I0228 13:00:07.940469  356406 dump.go:178] Response header 'Date' is 'Wed, 28 Feb 2024 12:00:07 GMT'
I0228 13:00:07.940475  356406 dump.go:178] Response header 'Server' is 'nginx/1.25.3'
I0228 13:00:07.940481  356406 dump.go:178] Response header 'Vary' is 'Accept-Encoding'
I0228 13:00:07.940488  356406 dump.go:178] Response header 'X-Operation-Id' is '46a7b87f-ddb2-48e1-9423-28e59a3c4a72'
I0228 13:00:07.940497  356406 dump.go:182] Response body follows
I0228 13:00:07.940516  356406 dump.go:283] {
  "href": "/api/clusters_mgmt/v1/clusters/29lqu9n9kif8t7ergv0vfra1eeqd4kgu/delete_protection",
  "enabled": true
}

Note: This current run will try to update the cluster, possible fix in #601

@ahitacat ahitacat force-pushed the add-delete-protection branch from 87e8a2a to e771770 Compare March 4, 2024 12:15
Added --enable-delete-protection argument to the edit option.

Signed-off-by: Alba Hita Catala <[email protected]>
@ahitacat ahitacat force-pushed the add-delete-protection branch from e771770 to 1caf2d0 Compare March 4, 2024 13:13
@mnecas
Copy link
Collaborator

mnecas commented Mar 4, 2024

lgtm!

Copy link
Contributor

@tzvatot tzvatot left a comment

Choose a reason for hiding this comment

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

LGTM

@tzvatot tzvatot merged commit 40f5375 into openshift-online:main Mar 11, 2024
4 checks passed
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.

3 participants