Paul Davis f8f51ea2f8
fix: Use scoped client name in Reconcile (#45)
When the maester creates a client, it adds the namespace to the owner. This fix takes that into account when checking for updates.

Without this patch, the maester fails to update the client with hydra when the k8s admin makes changes to the oauth2client resource in a namespace.

Testing image is available at `dangersalad/hydra-maester:v0.0.12-alpha2`.
2020-02-05 09:43:04 +01:00
2019-08-06 11:14:13 +02:00
2019-08-21 10:12:07 +02:00
2019-08-14 14:46:44 +02:00
2019-08-30 10:23:03 +02:00
2019-09-05 09:58:27 +02:00
2019-06-13 11:54:02 +02:00
2019-08-21 10:12:07 +02:00

Table of Contents generated with DocToc

Hydra-maester

This project contains a Kubernetes controller that uses Custom Resources (CR) to manage Hydra Oauth2 clients. ORY Hydra Maester watches for instances of oauth2clients.hydra.ory.sh/v1alpha1 CR and creates, updates, or deletes corresponding OAuth2 clients by communicating with ORY Hydra's API.

Visit Hydra-maester's chart documentation and view sample OAuth2 client resources to learn more about the oauth2clients.hydra.ory.sh/v1alpha1 CR.

The project is based on Kubebuilder.

Prerequisites

  • recent version of Go language with support for modules (e.g: 1.12.6)
  • make
  • kubectl
  • kustomize
  • kubebuilder for running tests
  • ginkgo for local integration testing
  • access to K8s environment: minikube or a remote K8s cluster
  • mockery to generate mocks for testing purposes

Design

Take a look at Design Readme.

How to use it

  • make test to run tests
  • make test-integration to run integration tests
  • make install to generate CRD file from go sources and install it on the cluster
  • export HYDRA_URL={HYDRA_SERVICE_URL} && make run to run the controller

To deploy the controller, edit the value of the --hydra-url argument in the manager.yaml file and run make deploy.

Command-line flags

Name Required Description Default value Example values
hydra-url yes ORY Hydra's service address - ory-hydra-admin.ory.svc.cluster.local
hydra-port no ORY Hydra's service port 4445 4445

Development

Testing

Use mockery to generate mock types that implement existing interfaces. To generate a mock type for an interface, navigate to the directory containing that interface and run this command:

mockery -name={INTERFACE_NAME}
Description
No description provided
Readme Apache-2.0 485 KiB
Languages
Go 94.7%
Makefile 5.3%