Skip to content

Model the bucket publicRead field #80

Open

Description

@mattia-eleuteri

cozystack/cozystack#5252 adds an optional top-level spec.publicRead boolean to the Bucket application. The provider models cozystack_bucket with a hand-written schema, so the field is not reachable from Terraform until it is added there.

What changes upstream

  • New field: publicRead (bool, default false). When true, the bucket's objects are served to anyone without credentials at <endpoint>/<bucket>/<key>; anonymous callers cannot list the bucket or write to it.
  • Only the bucket kind gets it.

Suggested change

In internal/provider/bucket_resource.go, bucket_data_source.go and bucket_model.go: the attribute in the schema, the model field, and the expand/flatten pair, plus docs/resources/bucket.md and docs/data-sources/bucket.md.

locking is the closest existing attribute and has the same default (false), so flatten can read an absent publicRead as false. Expand should send publicRead only when it is set, rather than restating the default, so a provider used against a Cozystack release that predates the field keeps working.

This only applies once cozystack/cozystack#5252 is merged and the api/apps/v1alpha1 pin is bumped.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions