Skip to content

Commit

Permalink
move to correct struct
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Currah <[email protected]>
  • Loading branch information
ryancurrah committed Feb 16, 2024
1 parent d352072 commit 7886c94
Show file tree
Hide file tree
Showing 11 changed files with 548 additions and 564 deletions.
24 changes: 12 additions & 12 deletions api/event-source.html

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

24 changes: 12 additions & 12 deletions api/event-source.md

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

12 changes: 4 additions & 8 deletions api/jsonschema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,10 @@
"description": "BitbucketServerBaseURL is the base URL for API requests to a custom endpoint.",
"type": "string"
},
"checkInterval": {
"description": "CheckInterval is a duration in which to wait before checking that the webhooks exist, e.g. 1s, 30m, 2h... (defaults to 1m)",
"type": "string"
},
"deleteHookOnFinish": {
"description": "DeleteHookOnFinish determines whether to delete the Bitbucket Server hook for the project once the event source is stopped.",
"type": "boolean"
Expand Down Expand Up @@ -3114,10 +3118,6 @@
"$ref": "#/definitions/io.k8s.api.core.v1.SecretKeySelector",
"description": "AuthSecret holds a secret selector that contains a bearer token for authentication"
},
"checkInterval": {
"description": "CheckInterval is a duration in which to wait before checking that the webhooks exist, e.g. 1s, 30m, 2h... (defaults to 1m)",
"type": "string"
},
"endpoint": {
"description": "REST API endpoint",
"type": "string"
Expand Down Expand Up @@ -3170,10 +3170,6 @@
"$ref": "#/definitions/io.k8s.api.core.v1.SecretKeySelector",
"description": "AuthSecret holds a secret selector that contains a bearer token for authentication"
},
"checkInterval": {
"description": "CheckInterval is a duration in which to wait before checking that the webhooks exist, e.g. 1s, 30m, 2h... (defaults to 1m)",
"type": "string"
},
"endpoint": {
"description": "REST API endpoint",
"type": "string"
Expand Down
12 changes: 4 additions & 8 deletions api/openapi-spec/swagger.json

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

4 changes: 2 additions & 2 deletions eventsources/sources/bitbucketserver/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ func (el *EventListener) StartListening(ctx context.Context, dispatch func([]byt
applyWebhooks()

var checkInterval time.Duration
if bitbucketserverEventSource.Webhook.CheckInterval == "" {
if bitbucketserverEventSource.CheckInterval == "" {
checkInterval = 60 * time.Second
} else {
checkInterval, err = time.ParseDuration(bitbucketserverEventSource.Webhook.CheckInterval)
checkInterval, err = time.ParseDuration(bitbucketserverEventSource.CheckInterval)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions eventsources/sources/bitbucketserver/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ func validate(eventSource *v1alpha1.BitbucketServerEventSource) error {
if eventSource.BitbucketServerBaseURL == "" {
return fmt.Errorf("bitbucket server base url can't be empty")
}
if eventSource.Webhook.CheckInterval != "" {
if _, err := time.ParseDuration(eventSource.Webhook.CheckInterval); err != nil {
if eventSource.CheckInterval != "" {
if _, err := time.ParseDuration(eventSource.CheckInterval); err != nil {
return fmt.Errorf("failed to parse webhook check interval duration: %w", err)
}
}
Expand Down
Loading

0 comments on commit 7886c94

Please sign in to comment.