Skip to content

Commit

Permalink
feat: Remove client side vaildation for lifecycle conditions (#816)
Browse files Browse the repository at this point in the history
* Remove client side vaildation for lifecycle conditions

* fix lint and suggest updating
  • Loading branch information
JesseLovelace committed May 11, 2021
1 parent 1a576ca commit 5ec84cc
Showing 1 changed file with 8 additions and 3 deletions.
Expand Up @@ -48,6 +48,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.logging.Logger;

/**
* Google Storage bucket metadata;
Expand Down Expand Up @@ -101,6 +102,8 @@ public com.google.api.services.storage.model.Bucket apply(BucketInfo bucketInfo)
private final String locationType;
private final Logging logging;

private static final Logger log = Logger.getLogger(BucketInfo.class.getName());

/**
* The Bucket's IAM Configuration.
*
Expand Down Expand Up @@ -356,9 +359,11 @@ public LifecycleRule(LifecycleAction action, LifecycleCondition condition) {
&& condition.getNoncurrentTimeBefore() == null
&& condition.getCustomTimeBefore() == null
&& condition.getDaysSinceCustomTime() == null) {
throw new IllegalArgumentException(
"You must specify at least one condition to use object lifecycle "
+ "management. Please see https://cloud.google.com/storage/docs/lifecycle for details.");
log.warning(
"Creating a lifecycle condition with no supported conditions:\n"
+ this
+ "\nAttempting to update with this rule may cause errors. Please update "
+ " to the latest version of google-cloud-storage");
}

this.lifecycleAction = action;
Expand Down

0 comments on commit 5ec84cc

Please sign in to comment.