Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

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

Closed

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!

Activity

  1. self-assigned this
    on Oct 18, 2022
  2. added
    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.
    on Oct 18, 2022
  3. BenWhitehead commented on Oct 18, 2022

    @BenWhitehead
    Collaborator

    Thanks for reporting @sundarrajanraman, I'll investigate and see what can be done to fix this.

  4. sundarrajanraman commented on Oct 18, 2022

    @sundarrajanraman
    ContributorAuthor

    @BenWhitehead Created the PR to fix the issue. Please review. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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