KEMBAR78
MatchPrefix and MatchSuffix properties created from the UI, are not reflecting in the LifecycleCondition · Issue #1715 · googleapis/java-storage · GitHub
Skip to content

MatchPrefix and MatchSuffix properties created from the UI, are not reflecting in the LifecycleCondition #1715

@sundarrajanraman

Description

@sundarrajanraman

Thanks for stopping by to let us know something could be better!

Environment details

API: https://github.com/googleapis/java-storage
2. OS type and version: All OS
3. Java version: 8
4. version(s): 2.13.0

Steps to reproduce

  1. Create a Bucket in GCP Console
  2. For the Bucket just created Add a LifeCyle Rule with Condition: MatchPrefix and Match Suffix. Save the Configuration.
  3. Using Google Cloud API, create a Bucket Object for the bucket created from the step 1.
  4. sysout the LifeCyleCondition, correct behaviour is for the LifecycleRule. getCondition.getMatchesPrefix() & LifecycleRule. getCondition.getMatchesSuffix() return the values set using step 3.
  5. But the values are shown as null, even though the values are populated from the Console UI

Code example

for (BucketInfo.LifecycleRule rule : bucket.getLifecycleRules()) {
    System.out.println(" Action: " + rule.getAction());  //Returns the Action
    System.out.println("Match Prefix :: " + rule.getCondition().getMatchesPrefix());   //returns null
    System.out.println("Age :: " + rule.getCondition().getAge()); //return value 5
}

Stack trace

Not applicable

External references such as API reference guides

Not applicable

Any additional information below

The reason for this behaviour:
While the API is able to bring the MatchPrefix and Matchsuffix, the same is not used in the Builder.
LifecycleRule fromPb(Rule rule) method, while building the LifeCyleRuleCondition, doesnt populate the matchPrefix and matchsuffix values.

Following these steps guarantees the quickest resolution possible.

Thanks!

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the googleapis/java-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions