Skip to content

Commit

Permalink
Merge pull request #2313 from barney-s/fix_firstgcp_sample
Browse files Browse the repository at this point in the history
Update the First GCP sample to use a pre generated CRD
  • Loading branch information
google-oss-prow[bot] authored Jul 19, 2024
2 parents 6c63509 + 4d8a91a commit 8c8d2f4
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ kubectl create -f composition/cors-bucket.yaml

## Create a CRBucket instance

Create a new `Team` CR
Create a new `CRBucket` CR

```
kubectl apply -f - <<EOF
apiVersion: facade.compositions.google.com/v1
apiVersion: idp.mycompany.com/v1
kind: CRBucket
metadata:
name: example-bucket
namespace: config-control
spec:
corsurl: "something.foobar.com"
retention: 10 # days
corsURL: "something.foobar.com"
retentionDays: 10 # days
EOF
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kind: Composition
metadata:
name: cors-bucket
spec:
inputAPIGroup: crbuckets.facade.compositions.google.com # Facade API
inputAPIGroup: crbuckets.idp.mycompany.com # Facade API
expanders:
- type: jinja2 # inbuilt jinja2 expander
name: bucket
Expand Down Expand Up @@ -48,21 +48,50 @@ spec:
maxAgeSeconds: 3600
{% endif %}
---
apiVersion: composition.google.com/v1alpha1
kind: Facade
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: crbucket
namespace: default
name: crbuckets.idp.mycompany.com
spec:
facadeKind: CRBucket
openAPIV3Schema:
# Schema for the `spec` field
type: object
required:
- retention
- corsurl
properties:
corsurl:
type: string
retention:
type: integer
conversion:
strategy: None
group: idp.mycompany.com
names:
categories:
- facade
- facades
kind: CRBucket
listKind: CRBucketList
plural: crbuckets
singular: crbucket
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
description: Create GCS Bucket with CORS and retention
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
properties:
corsURL:
type: string
retentionDays:
type: integer
required:
- retentionDays
- corsURL
type: object
status:
description: Status of CRBuckets
type: object
type: object
served: true
storage: true
subresources:
status: {}

0 comments on commit 8c8d2f4

Please sign in to comment.