Skip to content

Commit ae5b87a

Browse files
committed
[1.16] Update release-1.16 with main
Signed-off-by: joshvanl <[email protected]>
1 parent 61917cb commit ae5b87a

File tree

69 files changed

+1937
-433
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1937
-433
lines changed

.build-tools/pkg/metadataschema/schema.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type ComponentMetadata struct {
2020
// Version of the component metadata schema.
2121
SchemaVersion string `json:"schemaVersion" yaml:"schemaVersion" jsonschema:"enum=v1"`
2222
// Component type, of one of the allowed values.
23-
Type string `json:"type" yaml:"type" jsonschema:"enum=bindings,enum=state,enum=secretstores,enum=pubsub,enum=workflows,enum=configuration,enum=lock,enum=middleware,enum=crypto,enum=nameresolution,enum=conversation"`
23+
Type string `json:"type" yaml:"type" jsonschema:"enum=bindings,enum=state,enum=secretstores,enum=pubsub,enum=workflows,enum=configuration,enum=lock,enum=middleware,enum=crypto,enum=conversation"`
2424
// Name of the component (without the inital type, e.g. "http" instead of "bindings.http").
2525
Name string `json:"name" yaml:"name"`
2626
// Version of the component, with the leading "v", e.g. "v1".

.github/infrastructure/docker-compose-cassandra.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '2'
22

33
services:
44
cassandra:
5-
image: docker.io/bitnami/cassandra:4.1
5+
image: docker.io/bitnami/cassandra:4.0.1
66
ports:
77
- '7000:7000'
88
- '9042:9042'

bindings/apns/metadata.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ authenticationProfiles:
3333
description: "The APNS private key (P8 file content)"
3434
metadata:
3535
- name: development
36-
type: bool
36+
type: boolean
3737
required: false
3838
description: "The APNS environment is development or not"
39-
example: "true"
40-
default: "false"
39+
example: true
40+
default: false

bindings/gcp/bucket/bucket.go

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ const (
4747
metadataEncodeBase64 = "encodeBase64"
4848
metadataSignTTL = "signTTL"
4949

50-
metadataContentType = "contentType"
51-
metadataKey = "key"
52-
maxResults = 1000
50+
metadataKey = "key"
51+
maxResults = 1000
5352

5453
metadataKeyBC = "name"
5554
signOperation = "sign"
@@ -78,7 +77,6 @@ type gcpMetadata struct {
7877
TokenURI string `json:"token_uri" mapstructure:"tokenURI" mdignore:"true" mapstructurealiases:"token_uri"`
7978
AuthProviderCertURL string `json:"auth_provider_x509_cert_url" mapstructure:"authProviderX509CertURL" mdignore:"true" mapstructurealiases:"auth_provider_x509_cert_url"`
8079
ClientCertURL string `json:"client_x509_cert_url" mapstructure:"clientX509CertURL" mdignore:"true" mapstructurealiases:"client_x509_cert_url"`
81-
ContentType string `json:"contentType,omitempty" mapstructure:"contentType"`
8280

8381
Bucket string `json:"bucket" mapstructure:"bucket"`
8482
DecodeBase64 bool `json:"decodeBase64,string" mapstructure:"decodeBase64"`
@@ -235,12 +233,6 @@ func (g *GCPStorage) create(ctx context.Context, req *bindings.InvokeRequest) (*
235233
}
236234

237235
h := g.client.Bucket(g.metadata.Bucket).Object(name).NewWriter(ctx)
238-
239-
// Set content type if provided
240-
if metadata.ContentType != "" {
241-
h.ContentType = metadata.ContentType
242-
}
243-
244236
// Cannot do `defer h.Close()` as Close() will flush the bytes and need to have error handling.
245237
if _, err = io.Copy(h, r); err != nil {
246238
cerr := h.Close()
@@ -386,15 +378,9 @@ func (metadata gcpMetadata) mergeWithRequestMetadata(req *bindings.InvokeRequest
386378
if val, ok := req.Metadata[metadataEncodeBase64]; ok && val != "" {
387379
merged.EncodeBase64 = strings.IsTruthy(val)
388380
}
389-
390381
if val, ok := req.Metadata[metadataSignTTL]; ok && val != "" {
391382
merged.SignTTL = val
392383
}
393-
394-
if val, ok := req.Metadata[metadataContentType]; ok && val != "" {
395-
merged.ContentType = val
396-
}
397-
398384
return merged, nil
399385
}
400386

bindings/gcp/bucket/bucket_test.go

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -233,42 +233,6 @@ func TestMergeWithRequestMetadata(t *testing.T) {
233233
assert.NotNil(t, mergedMeta)
234234
assert.False(t, mergedMeta.EncodeBase64)
235235
})
236-
237-
t.Run("Has merged contentType metadata", func(t *testing.T) {
238-
m := bindings.Metadata{}
239-
m.Properties = map[string]string{
240-
"bucket": "my_bucket",
241-
"projectID": "my_project_id",
242-
"contentType": "text/plain",
243-
}
244-
gs := GCPStorage{logger: logger.NewLogger("test")}
245-
meta, err := gs.parseMetadata(m)
246-
require.NoError(t, err)
247-
assert.Equal(t, "text/plain", meta.ContentType)
248-
249-
// Empty request doesn't override
250-
request := bindings.InvokeRequest{}
251-
request.Metadata = map[string]string{}
252-
mergedMeta, err := meta.mergeWithRequestMetadata(&request)
253-
require.NoError(t, err)
254-
assert.Equal(t, "text/plain", mergedMeta.ContentType)
255-
256-
// Request overrides component
257-
request.Metadata = map[string]string{
258-
"contentType": "text/csv",
259-
}
260-
mergedMeta, err = meta.mergeWithRequestMetadata(&request)
261-
require.NoError(t, err)
262-
assert.Equal(t, "text/csv", mergedMeta.ContentType)
263-
264-
// Empty string doesn't override
265-
request.Metadata = map[string]string{
266-
"contentType": "",
267-
}
268-
mergedMeta, err = meta.mergeWithRequestMetadata(&request)
269-
require.NoError(t, err)
270-
assert.Equal(t, "text/plain", mergedMeta.ContentType)
271-
})
272236
}
273237

274238
func TestInit(t *testing.T) {

bindings/gcp/bucket/metadata.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,4 @@ metadata:
4444
description: |
4545
Configuration to encode base64 file content before return the content.
4646
(In case of saving a file with binary content).
47-
example: '"true, false"'
48-
- name: contentType
49-
type: string
50-
required: false
51-
description: |
52-
The MIME type of the object being stored. If not specified, GCS will attempt to
53-
auto-detect the type, which may default to application/octet-stream or text/plain.
54-
Common values include text/csv, application/json, image/png, etc.
55-
example: '"text/csv", "application/json"'
47+
example: '"true, false"'

bindings/kafka/metadata.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,13 @@ metadata:
352352
It allows sending headers with special characters that are usually not allowed in HTTP headers.
353353
example: "true"
354354
default: "false"
355+
- name: useAvroJSON
356+
type: bool
357+
required: false
358+
description: |
359+
Enables Avro JSON schema for serialization. Only applicable when the subscription uses valueSchemaType=Avro
360+
example: "true"
361+
default: "false"
355362
- name: compression
356363
type: string
357364
required: false

bindings/kubemq/metadata.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ metadata:
3737
description: The KubeMQ channel name.
3838
example: "my-channel"
3939
- name: pollMaxItems
40-
type: number
40+
type: int
4141
required: false
4242
description: The maximum number of items to poll.
43-
example: "10"
44-
default: "1"
43+
example: 10
44+
default: 1
4545
- name: pollTimeoutSeconds
46-
type: number
46+
type: int
4747
required: false
4848
description: The timeout in seconds for polling.
49-
example: "3600"
50-
default: "3600"
49+
example: 3600
50+
default: 3600
5151
- name: autoAcknowledged
5252
type: bool
5353
required: false
5454
description: Whether to automatically acknowledge messages.
55-
example: "true"
56-
default: "false"
55+
example: true
56+
default: false

bindings/kubernetes/kubernetes.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,6 @@ func (k *kubernetesInput) Read(ctx context.Context, handler bindings.Handler) er
119119
fields.Everything(),
120120
)
121121
resultChan := make(chan EventResponse)
122-
// TODO:
123-
// cache.NewInformer is deprecated: Use NewInformerWithOptions instead.
124-
//nolint:staticcheck
125122
_, controller := cache.NewInformer(
126123
watchlist,
127124
&corev1.Event{},

bindings/mqtt3/metadata.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ metadata:
5050
- name: retain
5151
required: false
5252
description: "Whether to retain messages"
53-
example: "false"
54-
default: "false"
53+
example: false
54+
default: false
5555
- name: cleanSession
5656
required: false
5757
description: "Whether to use clean session"
58-
example: "true"
59-
default: "true"
58+
example: true
59+
default: true
6060
- name: backOffMaxRetries
6161
required: false
6262
description: "Maximum retries for backoff"

0 commit comments

Comments
 (0)