-
Notifications
You must be signed in to change notification settings - Fork 14
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
angelnu
committed
May 30, 2021
1 parent
ae2bc21
commit c1a6593
Showing
7 changed files
with
134 additions
and
56 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
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 |
---|---|---|
@@ -1,16 +1,25 @@ | ||
package webhook | ||
|
||
import ( | ||
"encoding/json" | ||
"net/http" | ||
) | ||
|
||
// routes wires the routes to handlers on a specific router. | ||
func (h handler) routes(router *http.ServeMux) error { | ||
|
||
// Add gatewayPodMutator | ||
gatewayPodMutator, err := h.gatewayPodMutator() | ||
if err != nil { | ||
return err | ||
} | ||
router.Handle("/wh/mutating/gatewayPodMutator", gatewayPodMutator) | ||
router.Handle("/wh/mutating/setgateway", gatewayPodMutator) | ||
|
||
//Add health | ||
router.HandleFunc("/wh/health", func(w http.ResponseWriter, r *http.Request) { | ||
// an example API handler | ||
json.NewEncoder(w).Encode(map[string]bool{"ok": true}) | ||
}) | ||
|
||
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
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