This file contains hidden or 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
func (r *Reconciler) ReconcileKind(ctx context.Context, source *sourcesv1alpha1.GitHubSource) pkgreconciler.Event { | |
source.Status.InitializeConditions() | |
accessToken, err := r.secretFrom(ctx, source.Namespace, source.Spec.AccessToken.SecretKeyRef) | |
if err != nil { | |
source.Status.MarkNoSecrets("AccessTokenNotFound", "%s", err) | |
return err | |
} | |
secretToken, err := r.secretFrom(ctx, source.Namespace, source.Spec.SecretToken.SecretKeyRef) | |
if err != nil { |
This file contains hidden or 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
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | |
payload, err := h.Hook.Parse(r, ValidEvents...) | |
if err != nil { | |
if err == gh.ErrEventNotFound { | |
w.WriteHeader(http.StatusNotFound) | |
h.Logger.Info("Event not found") | |
return | |
} | |
w.WriteHeader(http.StatusBadRequest) | |
h.Logger.Errorf("Error processing request: %v", err) |
This file contains hidden or 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
// RegisterHandlerFor implements MTAdapter. | |
func (a *gitHubAdapter) RegisterHandlerFor(ctx context.Context, src *v1alpha1.GitHubSource) error { | |
secretCli := a.secrGetter.Secrets(src.Namespace) | |
secretToken, err := common.SecretFrom(ctx, secretCli, src.Spec.SecretToken.SecretKeyRef) | |
if err != nil { | |
return fmt.Errorf("reading token from Secret: %w", err) | |
} | |
logger := logging.FromContext(ctx) | |
ceSrc := v1alpha1.GitHubEventSource(src.Spec.OwnerAndRepository) |
This file contains hidden or 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
func (a *gitHubAdapter) Start(ctx context.Context) error { | |
// Start our multi-tenant server receiving GitHub events | |
server := &http.Server{ | |
ReadTimeout: 10 * time.Second, | |
ReadHeaderTimeout: 2 * time.Second, | |
Addr: fmt.Sprintf(":%d", a.port), | |
Handler: a.router, | |
} | |
done := make(chan bool, 1) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.