-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea20fd7
commit f630e71
Showing
32 changed files
with
2,769 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,52 @@ config: | |
pvc: | ||
size: 10Gi | ||
|
||
gateway: | ||
enabled: true | ||
merge: | ||
gateways: | ||
- name: typhoon-gw-west-nats | ||
urls: | ||
- nats://gwp:[email protected]:7222 | ||
- name: typhoon-gw-central-nats | ||
urls: | ||
- nats://gwp:[email protected]:7222 | ||
authorization: | ||
user: gwp | ||
password: gwp | ||
|
||
merge: | ||
accounts: | ||
$SYS: | ||
jetstream: true | ||
users: | ||
- user: sys | ||
password: pass | ||
|
||
natsBox: | ||
contexts: | ||
sys: | ||
merge: { user: sys, password: pass } | ||
defaultContextName: sys | ||
|
||
podTemplate: | ||
topologySpreadConstraints: | ||
kubernetes.io/hostname: | ||
maxSkew: 1 | ||
whenUnsatisfiable: DoNotSchedule | ||
|
||
service: | ||
ports: | ||
gateway: | ||
enabled: true | ||
merge: | ||
metadata: | ||
annotations: | ||
service.beta.kubernetes.io/azure-load-balancer-ipv4: "" | ||
service.beta.kubernetes.io/azure-load-balancer-internal: "true" | ||
spec: | ||
type: LoadBalancer | ||
|
||
container: | ||
env: | ||
# different from k8s units, suffix must be B, KiB, MiB, GiB, or TiB | ||
|
@@ -27,4 +67,4 @@ container: | |
memory: 8Gi | ||
limits: | ||
cpu: "2" | ||
memory: 8Gi | ||
memory: 8Gi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
"context" | ||
|
||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
|
||
"knative.dev/pkg/apis" | ||
duckv1 "knative.dev/pkg/apis/duck/v1" | ||
|
||
"github.com/zeiss/typhoon/pkg/apis/common/v1alpha1" | ||
) | ||
|
||
// GetGroupVersionKind implements kmeta.OwnerRefable. | ||
func (s *SalesforceSource) GetGroupVersionKind() schema.GroupVersionKind { | ||
return SchemeGroupVersion.WithKind("SalesforceSource") | ||
} | ||
|
||
// GetConditionSet implements duckv1.KRShaped. | ||
func (s *SalesforceSource) GetConditionSet() apis.ConditionSet { | ||
return v1alpha1.EventSenderConditionSet | ||
} | ||
|
||
// GetStatus implements duckv1.KRShaped. | ||
func (s *SalesforceSource) GetStatus() *duckv1.Status { | ||
return &s.Status.Status | ||
} | ||
|
||
// GetSink implements EventSender. | ||
func (s *SalesforceSource) GetSink() *duckv1.Destination { | ||
return &s.Spec.Sink | ||
} | ||
|
||
// GetStatusManager implements Reconcilable. | ||
func (s *SalesforceSource) GetStatusManager() *v1alpha1.StatusManager { | ||
return &v1alpha1.StatusManager{ | ||
ConditionSet: s.GetConditionSet(), | ||
Status: &s.Status, | ||
} | ||
} | ||
|
||
// AsEventSource implements EventSource. | ||
func (s *SalesforceSource) AsEventSource() string { | ||
channel := s.Spec.Subscription.Channel | ||
if channel[0] != '/' { | ||
channel = "/" + channel | ||
} | ||
return "com.zeiss.typhoon.salesforce" + channel | ||
} | ||
|
||
// GetEventTypes returns the event types generated by the source. | ||
func (s *SalesforceSource) GetEventTypes() []string { | ||
return []string{"com.salesforce.stream.message"} | ||
} | ||
|
||
// GetAdapterOverrides implements AdapterConfigurable. | ||
func (s *SalesforceSource) GetAdapterOverrides() *v1alpha1.AdapterOverrides { | ||
return s.Spec.AdapterOverrides | ||
} | ||
|
||
// SetDefaults implements apis.Defaultable | ||
func (s *SalesforceSource) SetDefaults(ctx context.Context) { | ||
} | ||
|
||
// Validate implements apis.Validatable | ||
func (s *SalesforceSource) Validate(ctx context.Context) *apis.FieldError { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
duckv1 "knative.dev/pkg/apis/duck/v1" | ||
|
||
"github.com/zeiss/typhoon/pkg/apis/common/v1alpha1" | ||
) | ||
|
||
// +genclient | ||
// +genreconciler | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// SalesforceSource is the Schema for the event source. | ||
type SalesforceSource struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec SalesforceSourceSpec `json:"spec,omitempty"` | ||
Status v1alpha1.Status `json:"status,omitempty"` | ||
} | ||
|
||
// Check the interfaces the event source should be implementing. | ||
var ( | ||
_ v1alpha1.Reconcilable = (*SalesforceSource)(nil) | ||
_ v1alpha1.AdapterConfigurable = (*SalesforceSource)(nil) | ||
_ v1alpha1.EventSource = (*SalesforceSource)(nil) | ||
_ v1alpha1.EventSender = (*SalesforceSource)(nil) | ||
) | ||
|
||
// SalesforceSourceSpec defines the desired state of the event source. | ||
type SalesforceSourceSpec struct { | ||
duckv1.SourceSpec `json:",inline"` | ||
|
||
// Authentication method to interact with the Salesforce API. | ||
Auth SalesforceAuth `json:"auth"` | ||
|
||
// APIVersion at Salesforce. | ||
// +optional | ||
APIVersion *string `json:"apiVersion"` | ||
|
||
// Subscription to a Salesforce channel | ||
Subscription SalesforceSubscription `json:"subscription"` | ||
|
||
// Adapter spec overrides parameters. | ||
// +optional | ||
AdapterOverrides *v1alpha1.AdapterOverrides `json:"adapterOverrides,omitempty"` | ||
} | ||
|
||
// SalesforceSubscription to connect to. | ||
type SalesforceSubscription struct { | ||
Channel string `json:"channel"` | ||
ReplayID *int `json:"replayID,omitempty"` | ||
} | ||
|
||
// SalesforceAuth contains Salesforce credentials. | ||
type SalesforceAuth struct { | ||
ClientID string `json:"clientID"` | ||
Server string `json:"server"` | ||
User string `json:"user"` | ||
CertKey v1alpha1.ValueFromField `json:"certKey"` | ||
} | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// SalesforceSourceList contains a list of event sources. | ||
type SalesforceSourceList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []SalesforceSource `json:"items"` | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.