INNER CODE UNIT · Go

checkDeletionTimestamp

GalleyBytes/terraform-operator · pkg/controllers/terraform_controller.go:736

func checkDeletionTimestamp(tf *tfv1beta1.Terraform) {
	deletePhases := []string{
		string(tfv1beta1.PhaseDeleting),
		string(tfv1beta1.PhaseInitDelete),
		string(tfv1beta1.PhaseDeleted),
	}

	if tf.GetDeletionTimestamp() != nil && !utils.ListContainsStr(deletePhases, string(tf.Status.Phase)) {
		tf.Status.Phase = tfv1beta1.PhaseInitDelete
	}
}

// checkRetryLabel checks for the kubernetes.io/change-cause label to trigger a retry.
// Returns true if a retry should be triggered.
func checkRetryLabel(tf *tfv1beta1.Terraform) bool {
	if tf.Labels == nil {
		return false
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…