cleanup.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. Copyright 2020 The Rook Authors. All rights reserved.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6.     http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package v1
  14. const (
  15. // SanitizeDataSourceZero uses /dev/zero as sanitize source
  16. SanitizeDataSourceZero SanitizeDataSourceProperty = "zero"
  17. // SanitizeDataSourceRandom uses `shred's default entropy source
  18. SanitizeDataSourceRandom SanitizeDataSourceProperty = "random"
  19. // SanitizeMethodComplete will sanitize everything on the disk
  20. SanitizeMethodComplete SanitizeMethodProperty = "complete"
  21. // SanitizeMethodQuick will sanitize metadata only on the disk
  22. SanitizeMethodQuick SanitizeMethodProperty = "quick"
  23. // DeleteDataDirOnHostsConfirmation represents the validation to destroy dataDirHostPath
  24. DeleteDataDirOnHostsConfirmation CleanupConfirmationProperty = "yes-really-destroy-data"
  25. )
  26. // HasDataDirCleanPolicy returns whether the cluster has a data dir policy
  27. func (c *CleanupPolicySpec) HasDataDirCleanPolicy() bool {
  28. return c.Confirmation == DeleteDataDirOnHostsConfirmation
  29. }
  30. func (c *SanitizeMethodProperty) String() string {
  31. return string(*c)
  32. }
  33. func (c *SanitizeDataSourceProperty) String() string {
  34. return string(*c)
  35. }