mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-09-12 02:56:14 +00:00
Split the config CRDs into two API groups.
Signed-off-by: Matt Moyer <moyerm@vmware.com>
This commit is contained in:
@@ -3,7 +3,7 @@ processor:
|
||||
|
||||
# Ignore internal API versions
|
||||
ignoreGroupVersions:
|
||||
- "config.pinniped.dev/config"
|
||||
- "config.supervisor.pinniped.dev/config"
|
||||
- "authentication.concierge.pinniped.dev/authentication"
|
||||
- "login.concierge.pinniped.dev/login"
|
||||
ignoreFields:
|
||||
|
||||
@@ -111,7 +111,7 @@ k8s_resource(
|
||||
new_name='supervisor', # this is the name that will appear in the tilt UI
|
||||
objects=[
|
||||
# these are the objects that would otherwise appear in the "uncategorized" tab in the tilt UI
|
||||
'oidcproviderconfigs.config.pinniped.dev:customresourcedefinition',
|
||||
'oidcproviderconfigs.config.supervisor.pinniped.dev:customresourcedefinition',
|
||||
'pinniped-supervisor-static-config:configmap',
|
||||
'supervisor:namespace',
|
||||
'pinniped-supervisor:role',
|
||||
@@ -169,7 +169,7 @@ k8s_resource(
|
||||
'pinniped-concierge-kube-system-pod-read:rolebinding',
|
||||
'pinniped-concierge:clusterrolebinding',
|
||||
'pinniped-concierge:serviceaccount',
|
||||
'credentialissuerconfigs.config.pinniped.dev:customresourcedefinition',
|
||||
'credentialissuerconfigs.config.concierge.pinniped.dev:customresourcedefinition',
|
||||
'webhookauthenticators.authentication.concierge.pinniped.dev:customresourcedefinition',
|
||||
'v1alpha1.login.concierge.pinniped.dev:apiservice',
|
||||
],
|
||||
|
||||
@@ -86,6 +86,8 @@ EOF
|
||||
# Make the generated client code its own Go module.
|
||||
echo "generating ${OUTPUT_DIR}/client/go.mod..."
|
||||
mkdir client
|
||||
mkdir client/concierge
|
||||
mkdir client/supervisor
|
||||
cat << EOF > "./client/go.mod"
|
||||
// This go.mod file is generated by ./hack/codegen.sh.
|
||||
module ${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/client
|
||||
@@ -110,7 +112,7 @@ echo "generating API-related code for our public API groups..."
|
||||
deepcopy \
|
||||
"${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/apis" \
|
||||
"${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/apis" \
|
||||
"config:v1alpha1 concierge/authentication:v1alpha1 concierge/login:v1alpha1" \
|
||||
"supervisor/config:v1alpha1 concierge/config:v1alpha1 concierge/authentication:v1alpha1 concierge/login:v1alpha1" \
|
||||
--go-header-file "${ROOT}/hack/boilerplate.go.txt" 2>&1 | sed "s|^|gen-api > |"
|
||||
)
|
||||
|
||||
@@ -119,12 +121,22 @@ echo "generating API-related code for our internal API groups..."
|
||||
(cd apis &&
|
||||
bash "${GOPATH}/src/k8s.io/code-generator/generate-internal-groups.sh" \
|
||||
deepcopy,defaulter,conversion,openapi \
|
||||
"${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/client" \
|
||||
"${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/client/concierge" \
|
||||
"${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/apis" \
|
||||
"${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/apis" \
|
||||
"config:v1alpha1 concierge/authentication:v1alpha1 concierge/login:v1alpha1" \
|
||||
"concierge/config:v1alpha1 concierge/authentication:v1alpha1 concierge/login:v1alpha1" \
|
||||
--go-header-file "${ROOT}/hack/boilerplate.go.txt" 2>&1 | sed "s|^|gen-int-api > |"
|
||||
)
|
||||
(cd apis &&
|
||||
bash "${GOPATH}/src/k8s.io/code-generator/generate-internal-groups.sh" \
|
||||
deepcopy,defaulter,conversion,openapi \
|
||||
"${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/client/supervisor" \
|
||||
"${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/apis" \
|
||||
"${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/apis" \
|
||||
"supervisor/config:v1alpha1" \
|
||||
--go-header-file "${ROOT}/hack/boilerplate.go.txt" 2>&1 | sed "s|^|gen-int-api > |"
|
||||
)
|
||||
|
||||
|
||||
# Tidy up the .../apis module
|
||||
echo "tidying ${OUTPUT_DIR}/apis/go.mod..."
|
||||
@@ -135,9 +147,17 @@ echo "generating client code for our public API groups..."
|
||||
(cd client &&
|
||||
bash "${GOPATH}/src/k8s.io/code-generator/generate-groups.sh" \
|
||||
client,lister,informer \
|
||||
"${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/client" \
|
||||
"${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/client/concierge" \
|
||||
"${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/apis" \
|
||||
"config:v1alpha1 concierge/authentication:v1alpha1 concierge/login:v1alpha1" \
|
||||
"concierge/config:v1alpha1 concierge/authentication:v1alpha1 concierge/login:v1alpha1" \
|
||||
--go-header-file "${ROOT}/hack/boilerplate.go.txt" 2>&1 | sed "s|^|gen-client > |"
|
||||
)
|
||||
(cd client &&
|
||||
bash "${GOPATH}/src/k8s.io/code-generator/generate-groups.sh" \
|
||||
client,lister,informer \
|
||||
"${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/client/supervisor" \
|
||||
"${BASE_PKG}/generated/${KUBE_MINOR_VERSION}/apis" \
|
||||
"supervisor/config:v1alpha1" \
|
||||
--go-header-file "${ROOT}/hack/boilerplate.go.txt" 2>&1 | sed "s|^|gen-client > |"
|
||||
)
|
||||
|
||||
@@ -156,6 +176,7 @@ crd-ref-docs \
|
||||
|
||||
# Generate CRD YAML
|
||||
(cd apis &&
|
||||
controller-gen paths=./config/v1alpha1 crd:trivialVersions=true output:crd:artifacts:config=../crds &&
|
||||
controller-gen paths=./supervisor/config/v1alpha1 crd:trivialVersions=true output:crd:artifacts:config=../crds &&
|
||||
controller-gen paths=./concierge/config/v1alpha1 crd:trivialVersions=true output:crd:artifacts:config=../crds &&
|
||||
controller-gen paths=./concierge/authentication/v1alpha1 crd:trivialVersions=true output:crd:artifacts:config=../crds
|
||||
)
|
||||
|
||||
+2
-3
@@ -11,9 +11,8 @@ ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
||||
xargs -n 1 -P 8 "$ROOT/hack/lib/update-codegen.sh" < "${ROOT}/hack/lib/kube-versions.txt"
|
||||
|
||||
# Copy each CRD yaml to the app which should cause it to be installed.
|
||||
cp "$ROOT"/generated/1.19/crds/*oidcproviderconfigs.yaml "$ROOT/deploy/supervisor"
|
||||
cp "$ROOT"/generated/1.19/crds/*credentialissuerconfigs.yaml "$ROOT/deploy/concierge"
|
||||
cp "$ROOT"/generated/1.19/crds/*webhookauthenticators.yaml "$ROOT/deploy/concierge"
|
||||
cp "$ROOT"/generated/1.19/crds/*.supervisor.*.yaml "$ROOT/deploy/supervisor"
|
||||
cp "$ROOT"/generated/1.19/crds/*.concierge.*.yaml "$ROOT/deploy/concierge"
|
||||
|
||||
# Make sure we didn't miss any new CRDs.
|
||||
crdCount=$(find "$ROOT"/generated/1.19/crds/ -maxdepth 1 -type f -name '*.yaml' | wc -l | tr -d ' ')
|
||||
|
||||
Reference in New Issue
Block a user