Skip to content

Commit

Permalink
build: update CRDs and k8s dependencies (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
colunira authored May 10, 2021
1 parent 3fa0cc3 commit 9b8f463
Show file tree
Hide file tree
Showing 12 changed files with 892 additions and 668 deletions.
30 changes: 13 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: circleci/golang:1.13
- image: circleci/golang:1.15
working_directory: /go/src/github.com/ory/hydra-maester
steps:
- run:
Expand All @@ -18,19 +18,17 @@ jobs:
arch=$(go env GOARCH)
# download kubebuilder and extract it to tmp
curl -sL https://go.kubebuilder.io/dl/2.0.0-alpha.4/${os}/${arch} | tar -xz -C /tmp/
curl -sL https://go.kubebuilder.io/dl/2.3.2/${os}/${arch} | tar -xz -C /tmp/
# move to a long-term location and put it on your path
# (you'll need to set the KUBEBUILDER_ASSETS env var if you put it somewhere else)
sudo mv /tmp/kubebuilder_2.0.0-alpha.4_${os}_${arch} /usr/local/kubebuilder
sudo mv /tmp/kubebuilder_2.3.2_${os}_${arch} /usr/local/kubebuilder
export PATH=$PATH:/usr/local/kubebuilder/bin
- run: make
test:
docker:
- image: circleci/golang:1.13
environment:
- GO111MODULE=on
- image: circleci/golang:1.15
working_directory: /go/src/github.com/ory/hydra-maester
steps:
- checkout
Expand All @@ -41,11 +39,11 @@ jobs:
arch=$(go env GOARCH)
# download kubebuilder and extract it to tmp
curl -sL https://go.kubebuilder.io/dl/2.0.0-alpha.4/${os}/${arch} | tar -xz -C /tmp/
curl -sL https://go.kubebuilder.io/dl/2.3.2/${os}/${arch} | tar -xz -C /tmp/
# move to a long-term location and put it on your path
# (you'll need to set the KUBEBUILDER_ASSETS env var if you put it somewhere else)
sudo mv /tmp/kubebuilder_2.0.0-alpha.4_${os}_${arch} /usr/local/kubebuilder
sudo mv /tmp/kubebuilder_2.3.2_${os}_${arch} /usr/local/kubebuilder
export PATH=$PATH:/usr/local/kubebuilder/bin
- run: make test
test-integration:
Expand All @@ -56,8 +54,8 @@ jobs:
name: Update golang
command: |
sudo rm -rf /usr/local/go/
curl -LO https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.13.4.linux-amd64.tar.gz
curl -LO https://dl.google.com/go/go1.15.11.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.15.11.linux-amd64.tar.gz
sudo echo "export PATH=$PATH:/usr/local/go/bin" >> $HOME/.profile
go version
Expand All @@ -68,11 +66,11 @@ jobs:
arch=$(go env GOARCH)
# download kubebuilder and extract it to tmp
curl -sL https://go.kubebuilder.io/dl/2.0.0-alpha.4/${os}/${arch} | tar -xz -C /tmp/
curl -sL https://go.kubebuilder.io/dl/2.3.2/${os}/${arch} | tar -xz -C /tmp/
# move to a long-term location and put it on your path
# (you'll need to set the KUBEBUILDER_ASSETS env var if you put it somewhere else)
sudo mv /tmp/kubebuilder_2.0.0-alpha.4_${os}_${arch} /usr/local/kubebuilder
sudo mv /tmp/kubebuilder_2.3.2_${os}_${arch} /usr/local/kubebuilder
sudo echo "export PATH=$PATH:/usr/local/kubebuilder/bin" >> $HOME/.profile
- run:
Expand All @@ -86,12 +84,12 @@ jobs:
name: Install ginkgo,controller-gen
command: |
go get github.com/onsi/ginkgo/ginkgo
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.0-beta.2
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.5.0
- run:
name: Install Kind
command: |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.4.0/kind-linux-amd64
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.10.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
- run:
Expand All @@ -107,9 +105,7 @@ jobs:

release:
docker:
- image: circleci/golang:1.13
environment:
- GO111MODULE=on
- image: circleci/golang:1.15
working_directory: /go/src/github.com/ory/hydra-maester
steps:
- checkout
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true"
CRD_OPTIONS ?= "crd:trivialVersions=true,crdVersions=v1"

all: manager

Expand Down Expand Up @@ -62,7 +62,7 @@ docker-push:
# download controller-gen if necessary
controller-gen:
ifeq (, $(shell which controller-gen))
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.0-beta.2
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.5.0
CONTROLLER_GEN=$(shell go env GOPATH)/bin/controller-gen
else
CONTROLLER_GEN=$(shell which controller-gen)
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/oauth2client_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const (
// HydraAdmin defines the desired hydra admin instance to use for OAuth2Client
type HydraAdmin struct {
// +kubebuilder:validation:MaxLength=64
// +kubebuilder:validation:Pattern=(^$|^https?://.*)
// +kubebuilder:validation:Pattern=`(^$|^https?://.*)`
//
// URL is the URL for the hydra instance on
// which to set up the client. This value will override the value
Expand Down Expand Up @@ -132,7 +132,7 @@ type GrantType string
// ResponseType represents an OAuth 2.0 response type strings
type ResponseType string

// +kubebuilder:validation:Pattern=\w+:/?/?[^\s]+
// +kubebuilder:validation:Pattern=`\w+:/?/?[^\s]+`
// RedirectURI represents a redirect URI for the client
type RedirectURI string

Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 9b8f463

Please sign in to comment.