Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labels are not missing fromgoogle_storage_bucket.rb #242

Comments

@pburnet-lbg
Copy link

We used to use the method (bucket.respond_to? :labels) all the time in our checks and the latest release does not seem to expose this method anymore.

Describe the problem

bucket = google_storage_bucket(name: 'll-pbburnetbucket')
(bucket.respond_to? :labels)

should be true is there are labels set on a bucket

Possible Solution

bit of guess but i think we need

@acl = GoogleInSpec::Storage::Property::BucketAclArray.parse(@fetched['acl'], to_s)
@cors = GoogleInSpec::Storage::Property::BucketCorsArray.parse(@fetched['cors'], to_s)
@default_event_based_hold = @fetched['defaultEventBasedHold']
@default_object_acl = GoogleInSpec::Storage::Property::BucketDefaultObjectAclArray.parse(@fetched['defaultObjectAcl'], to_s)
@id = @fetched['id']
@lifecycle = GoogleInSpec::Storage::Property::BucketLifecycle.new(@fetched['lifecycle'], to_s)
@location = @fetched['location']
@logging = GoogleInSpec::Storage::Property::BucketLogging.new(@fetched['logging'], to_s)
@metageneration = @fetched['metageneration']
@name = @fetched['name']
@owner = GoogleInSpec::Storage::Property::BucketOwner.new(@fetched['owner'], to_s)
@project_number = @fetched['projectNumber']
@storage_class = @fetched['storageClass']
@time_created = parse_time_string(@fetched['timeCreated'])
@updated = parse_time_string(@fetched['updated'])
@versioning = GoogleInSpec::Storage::Property::BucketVersioning.new(@fetched['versioning'], to_s)
@website = GoogleInSpec::Storage::Property::BucketWebsite.new(@fetched['website'], to_s)
@project = @fetched['project']
@predefined_default_object_acl = @fetched['predefinedDefaultObjectAcl']

add.

@labels = @fetch['labels]

also add

attr_reader :labels

@slevenick
Copy link
Collaborator

Ah, yeah that looks like an oversight. I'll get that added.

@slevenick
Copy link
Collaborator

Hm, my PR auto closed this even though it wasn't in master yet. I'll only link issues on the actual PR to this repo in the future

@slevenick slevenick reopened this Apr 13, 2020
@sukchomb-zz
Copy link

Hi @slevenick Please advise eta as we are nearing a critical milestone.

@slevenick
Copy link
Collaborator

@sukchomb see the 1.2.0 of the profile. Should have labels enabled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants