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

Support rust generic runtime #688

Merged
merged 8 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [1.18, 1.19, 1.20.4]
go-version: [1.19, 1.20.4]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the module setup-envtest requires go>=1.19, https://pkg.go.dev/sigs.k8s.io/controller-runtime/tools/setup-envtest

steps:
- name: clean disk
run: |
Expand Down
19 changes: 15 additions & 4 deletions api/compute/v1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (o *OAuth2Config) GetMountFile() string {
}

func (o *OAuth2Config) AuthenticationParameters() string {
return fmt.Sprintf(`'{"privateKey":"%s","private_key":"%s","issuerUrl":"%s","issuer_url":"%s","audience":"%s","scope":"%s"}'`, o.GetMountFile(), o.GetMountFile(), o.IssuerURL, o.IssuerURL, o.Audience, o.Scope)
return fmt.Sprintf(`'{"credentials_url":"file://%s","privateKey":"%s","private_key":"%s","issuerUrl":"%s","issuer_url":"%s","audience":"%s","scope":"%s"}'`, o.GetMountFile(), o.GetMountFile(), o.GetMountFile(), o.IssuerURL, o.IssuerURL, o.Audience, o.Scope)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pulsar rust client uses credentials_url instead of private_key for OAuth2 authentication

}

type GenericAuth struct {
Expand Down Expand Up @@ -234,9 +234,10 @@ type PodPolicy struct {
}

type Runtime struct {
Java *JavaRuntime `json:"java,omitempty"`
Python *PythonRuntime `json:"python,omitempty"`
Golang *GoRuntime `json:"golang,omitempty"`
Java *JavaRuntime `json:"java,omitempty"`
Python *PythonRuntime `json:"python,omitempty"`
Golang *GoRuntime `json:"golang,omitempty"`
GenericRuntime *GenericRuntime `json:"genericRuntime,omitempty"`
}

// JavaRuntime contains the java runtime configs
Expand Down Expand Up @@ -268,6 +269,16 @@ type GoRuntime struct {
Log *RuntimeLogConfig `json:"log,omitempty"`
}

// GenericRuntime contains the generic runtime configs
// +kubebuilder:validation:Optional
type GenericRuntime struct {
// +kubebuilder:validation:Required
FunctionFile string `json:"functionFile"`
// +kubebuilder:validation:Required
Language string `json:"language"`
FunctionFileLocation string `json:"functionFileLocation,omitempty"`
}

type SecretRef struct {
Path string `json:"path,omitempty"`
Key string `json:"key,omitempty"`
Expand Down
20 changes: 20 additions & 0 deletions api/compute/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ spec:
funcConfig:
type: object
x-kubernetes-preserve-unknown-fields: true
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down Expand Up @@ -3620,6 +3632,18 @@ spec:
type: string
filebeatImage:
type: string
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down Expand Up @@ -6937,6 +6961,18 @@ spec:
type: string
forwardSourceMessageProperty:
type: boolean
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ spec:
funcConfig:
type: object
x-kubernetes-preserve-unknown-fields: true
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ spec:
type: string
filebeatImage:
type: string
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ spec:
type: string
forwardSourceMessageProperty:
type: boolean
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
36 changes: 36 additions & 0 deletions config/crd/bases/compute.functionmesh.io_functionmeshes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ spec:
funcConfig:
type: object
x-kubernetes-preserve-unknown-fields: true
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down Expand Up @@ -3621,6 +3633,18 @@ spec:
type: string
filebeatImage:
type: string
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down Expand Up @@ -6938,6 +6962,18 @@ spec:
type: string
forwardSourceMessageProperty:
type: boolean
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/compute.functionmesh.io_functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ spec:
funcConfig:
type: object
x-kubernetes-preserve-unknown-fields: true
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/compute.functionmesh.io_sinks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ spec:
type: string
filebeatImage:
type: string
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
12 changes: 12 additions & 0 deletions config/crd/bases/compute.functionmesh.io_sources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ spec:
type: string
forwardSourceMessageProperty:
type: boolean
genericRuntime:
properties:
functionFile:
type: string
functionFileLocation:
type: string
language:
type: string
required:
- functionFile
- language
type: object
golang:
properties:
go:
Expand Down
Loading
Loading