Rename project

This commit is contained in:
Ryan Richard 2020-08-20 10:54:15 -07:00
parent 43888e9e0a
commit 3929fa672e
121 changed files with 1641 additions and 1652 deletions

View File

@ -33,17 +33,17 @@ COPY tools ./tools
COPY hack ./hack COPY hack ./hack
# Build the executable binary (CGO_ENABLED=0 means static linking) # Build the executable binary (CGO_ENABLED=0 means static linking)
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(hack/get-ldflags.sh)" -o out ./cmd/placeholder-name-server/... RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "$(hack/get-ldflags.sh)" -o out ./cmd/pinniped-server/...
# Use a runtime image based on Debian slim # Use a runtime image based on Debian slim
FROM debian:10.5-slim FROM debian:10.5-slim
# Copy the binary from the build-env stage # Copy the binary from the build-env stage
COPY --from=build-env /work/out/placeholder-name-server /usr/local/bin/placeholder-name-server COPY --from=build-env /work/out/pinniped-server /usr/local/bin/pinniped-server
# Document the port # Document the port
EXPOSE 443 EXPOSE 443
# Set the entrypoint # Set the entrypoint
ENTRYPOINT ["/usr/local/bin/placeholder-name-server"] ENTRYPOINT ["/usr/local/bin/pinniped-server"]

View File

@ -1,6 +1,15 @@
# placeholder-name # Pinniped
Copyright 2020 VMware, Inc. <img src="https://cdn.pixabay.com/photo/2015/12/07/21/52/harbor-1081482_1280.png" alt="Image of pinniped" width="250px"/>
<!--
Image source: https://pixabay.com/illustrations/harbor-seal-sitting-maine-marine-1081482/
Free for commercial use without attribution. https://pixabay.com/service/license/
-->
## About Pinniped
Pinniped provides authentication for Kubernetes clusters.
## Developing ## Developing
@ -28,3 +37,9 @@ pre-commit installed at .git/hooks/pre-commit
``` ```
[pre-commit]: https://pre-commit.com/ [pre-commit]: https://pre-commit.com/
## Licence
Pinniped is open source and licenced under Apache License Version 2.0. See [LICENSE](LICENSE) file.
Copyright 2020 VMware, Inc.

View File

@ -14,7 +14,7 @@ import (
"k8s.io/component-base/logs" "k8s.io/component-base/logs"
"k8s.io/klog/v2" "k8s.io/klog/v2"
"github.com/suzerain-io/placeholder-name/internal/server" "github.com/suzerain-io/pinniped/internal/server"
) )
func main() { func main() {

View File

@ -16,8 +16,8 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clientauthenticationv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1" clientauthenticationv1beta1 "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1"
"github.com/suzerain-io/placeholder-name/internal/constable" "github.com/suzerain-io/pinniped/internal/constable"
"github.com/suzerain-io/placeholder-name/pkg/client" "github.com/suzerain-io/pinniped/pkg/client"
) )
func main() { func main() {
@ -37,19 +37,19 @@ func run(envGetter envGetter, tokenExchanger tokenExchanger, outputWriter io.Wri
ctx, cancel := context.WithTimeout(context.Background(), timeout) ctx, cancel := context.WithTimeout(context.Background(), timeout)
defer cancel() defer cancel()
token, varExists := envGetter("PLACEHOLDER_NAME_TOKEN") token, varExists := envGetter("PINNIPED_TOKEN")
if !varExists { if !varExists {
return envVarNotSetError("PLACEHOLDER_NAME_TOKEN") return envVarNotSetError("PINNIPED_TOKEN")
} }
caBundle, varExists := envGetter("PLACEHOLDER_NAME_CA_BUNDLE") caBundle, varExists := envGetter("PINNIPED_CA_BUNDLE")
if !varExists { if !varExists {
return envVarNotSetError("PLACEHOLDER_NAME_CA_BUNDLE") return envVarNotSetError("PINNIPED_CA_BUNDLE")
} }
apiEndpoint, varExists := envGetter("PLACEHOLDER_NAME_K8S_API_ENDPOINT") apiEndpoint, varExists := envGetter("PINNIPED_K8S_API_ENDPOINT")
if !varExists { if !varExists {
return envVarNotSetError("PLACEHOLDER_NAME_K8S_API_ENDPOINT") return envVarNotSetError("PINNIPED_K8S_API_ENDPOINT")
} }
cred, err := tokenExchanger(ctx, token, caBundle, apiEndpoint) cred, err := tokenExchanger(ctx, token, caBundle, apiEndpoint)

View File

@ -12,13 +12,13 @@ import (
"testing" "testing"
"time" "time"
"github.com/suzerain-io/placeholder-name/internal/testutil" "github.com/suzerain-io/pinniped/internal/testutil"
"github.com/sclevine/spec" "github.com/sclevine/spec"
"github.com/sclevine/spec/report" "github.com/sclevine/spec/report"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/suzerain-io/placeholder-name/pkg/client" "github.com/suzerain-io/pinniped/pkg/client"
) )
func TestRun(t *testing.T) { func TestRun(t *testing.T) {
@ -40,29 +40,29 @@ func TestRun(t *testing.T) {
r = require.New(t) r = require.New(t)
buffer = new(bytes.Buffer) buffer = new(bytes.Buffer)
fakeEnv = map[string]string{ fakeEnv = map[string]string{
"PLACEHOLDER_NAME_TOKEN": "token from env", "PINNIPED_TOKEN": "token from env",
"PLACEHOLDER_NAME_CA_BUNDLE": "ca bundle from env", "PINNIPED_CA_BUNDLE": "ca bundle from env",
"PLACEHOLDER_NAME_K8S_API_ENDPOINT": "k8s api from env", "PINNIPED_K8S_API_ENDPOINT": "k8s api from env",
} }
}) })
when("env vars are missing", func() { when("env vars are missing", func() {
it("returns an error when PLACEHOLDER_NAME_TOKEN is missing", func() { it("returns an error when PINNIPED_TOKEN is missing", func() {
delete(fakeEnv, "PLACEHOLDER_NAME_TOKEN") delete(fakeEnv, "PINNIPED_TOKEN")
err := run(envGetter, tokenExchanger, buffer, 30*time.Second) err := run(envGetter, tokenExchanger, buffer, 30*time.Second)
r.EqualError(err, "failed to get credential: environment variable not set: PLACEHOLDER_NAME_TOKEN") r.EqualError(err, "failed to get credential: environment variable not set: PINNIPED_TOKEN")
}) })
it("returns an error when PLACEHOLDER_NAME_CA_BUNDLE is missing", func() { it("returns an error when PINNIPED_CA_BUNDLE is missing", func() {
delete(fakeEnv, "PLACEHOLDER_NAME_CA_BUNDLE") delete(fakeEnv, "PINNIPED_CA_BUNDLE")
err := run(envGetter, tokenExchanger, buffer, 30*time.Second) err := run(envGetter, tokenExchanger, buffer, 30*time.Second)
r.EqualError(err, "failed to get credential: environment variable not set: PLACEHOLDER_NAME_CA_BUNDLE") r.EqualError(err, "failed to get credential: environment variable not set: PINNIPED_CA_BUNDLE")
}) })
it("returns an error when PLACEHOLDER_NAME_K8S_API_ENDPOINT is missing", func() { it("returns an error when PINNIPED_K8S_API_ENDPOINT is missing", func() {
delete(fakeEnv, "PLACEHOLDER_NAME_K8S_API_ENDPOINT") delete(fakeEnv, "PINNIPED_K8S_API_ENDPOINT")
err := run(envGetter, tokenExchanger, buffer, 30*time.Second) err := run(envGetter, tokenExchanger, buffer, 30*time.Second)
r.EqualError(err, "failed to get credential: environment variable not set: PLACEHOLDER_NAME_K8S_API_ENDPOINT") r.EqualError(err, "failed to get credential: environment variable not set: PINNIPED_K8S_API_ENDPOINT")
}) })
}) })
@ -129,9 +129,9 @@ func TestRun(t *testing.T) {
it("writes the execCredential to the given writer", func() { it("writes the execCredential to the given writer", func() {
err := run(envGetter, tokenExchanger, buffer, 30*time.Second) err := run(envGetter, tokenExchanger, buffer, 30*time.Second)
r.NoError(err) r.NoError(err)
r.Equal(fakeEnv["PLACEHOLDER_NAME_TOKEN"], actualToken) r.Equal(fakeEnv["PINNIPED_TOKEN"], actualToken)
r.Equal(fakeEnv["PLACEHOLDER_NAME_CA_BUNDLE"], actualCaBundle) r.Equal(fakeEnv["PINNIPED_CA_BUNDLE"], actualCaBundle)
r.Equal(fakeEnv["PLACEHOLDER_NAME_K8S_API_ENDPOINT"], actualAPIEndpoint) r.Equal(fakeEnv["PINNIPED_K8S_API_ENDPOINT"], actualAPIEndpoint)
expected := `{ expected := `{
"kind": "ExecCredential", "kind": "ExecCredential",
"apiVersion": "client.authentication.k8s.io/v1beta1", "apiVersion": "client.authentication.k8s.io/v1beta1",

View File

@ -8,4 +8,4 @@ https://hub.docker.com/r/k14s/image/tags
1. Fill in the values in [values.yml](values.yaml) 1. Fill in the values in [values.yml](values.yaml)
2. In a terminal, cd to this `deploy` directory 2. In a terminal, cd to this `deploy` directory
3. Run: `ytt --file . | kapp deploy --yes --app placeholder-name --diff-changes --file -` 3. Run: `ytt --file . | kapp deploy --yes --app pinniped --diff-changes --file -`

View File

@ -1,9 +1,9 @@
#@ load("@ytt:data", "data") #@ load("@ytt:data", "data")
#! Example of valid LoginDiscoveryConfig object: #! Example of valid PinnipedDiscoveryInfo object:
#! --- #! ---
#! apiVersion: suzerain-io.github.io/v1alpha1 #! apiVersion: crd.pinniped.dev/v1alpha1
#! kind: LoginDiscoveryConfig #! kind: PinnipedDiscoveryInfo
#! metadata: #! metadata:
#! name: login-discovery #! name: login-discovery
#! namespace: integration #! namespace: integration
@ -15,12 +15,12 @@
apiVersion: apiextensions.k8s.io/v1 apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition kind: CustomResourceDefinition
metadata: metadata:
name: logindiscoveryconfigs.crds.placeholder.suzerain-io.github.io name: pinnipeddiscoveryinfos.crd.pinniped.dev
spec: spec:
group: crds.placeholder.suzerain-io.github.io group: crd.pinniped.dev
versions: versions:
#! Any changes to these schemas should also be reflected in the types.go file(s) #! Any changes to these schemas should also be reflected in the types.go file(s)
#! in https://github.com/suzerain-io/placeholder-name-api/tree/main/pkg/apis/placeholder #! in https://github.com/suzerain-io/pinniped-api/tree/main/pkg/apis/pinniped
- name: v1alpha1 - name: v1alpha1
served: true served: true
storage: true storage: true
@ -42,8 +42,8 @@ spec:
minLength: 1 minLength: 1
scope: Namespaced scope: Namespaced
names: names:
plural: logindiscoveryconfigs plural: pinnipeddiscoveryinfos
singular: logindiscoveryconfig singular: pinnipeddiscoveryinfo
kind: LoginDiscoveryConfig kind: PinnipedDiscoveryInfo
shortNames: shortNames:
- ldc - ldc

View File

@ -23,7 +23,7 @@ metadata:
app: #@ data.values.app_name app: #@ data.values.app_name
data: data:
#@yaml/text-templated-strings #@yaml/text-templated-strings
placeholder-name.yaml: | pinniped.yaml: |
discovery: discovery:
url: (@= data.values.discovery_url or "null" @) url: (@= data.values.discovery_url or "null" @)
webhook: webhook:
@ -70,7 +70,7 @@ spec:
- name: image-pull-secret - name: image-pull-secret
#@ end #@ end
containers: containers:
- name: placeholder-name - name: pinniped
#@ if data.values.image_digest: #@ if data.values.image_digest:
image: #@ data.values.image_repo + "@" + data.values.image_digest image: #@ data.values.image_repo + "@" + data.values.image_digest
#@ else: #@ else:
@ -78,7 +78,7 @@ spec:
#@ end #@ end
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
args: args:
- --config=/etc/config/placeholder-name.yaml - --config=/etc/config/pinniped.yaml
- --downward-api-path=/etc/podinfo - --downward-api-path=/etc/podinfo
volumeMounts: volumeMounts:
- name: config-volume - name: config-volume
@ -128,7 +128,7 @@ spec:
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: placeholder-name-api #! the golang code assumes this specific name as part of the common name during cert generation name: pinniped-api #! the golang code assumes this specific name as part of the common name during cert generation
namespace: #@ data.values.namespace namespace: #@ data.values.namespace
labels: labels:
app: #@ data.values.app_name app: #@ data.values.app_name
@ -144,16 +144,16 @@ spec:
apiVersion: apiregistration.k8s.io/v1 apiVersion: apiregistration.k8s.io/v1
kind: APIService kind: APIService
metadata: metadata:
name: v1alpha1.placeholder.suzerain-io.github.io name: v1alpha1.pinniped.dev
labels: labels:
app: #@ data.values.app_name app: #@ data.values.app_name
spec: spec:
version: v1alpha1 version: v1alpha1
group: placeholder.suzerain-io.github.io group: pinniped.dev
groupPriorityMinimum: 2500 #! TODO what is the right value? https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#apiservicespec-v1beta1-apiregistration-k8s-io groupPriorityMinimum: 2500 #! TODO what is the right value? https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#apiservicespec-v1beta1-apiregistration-k8s-io
versionPriority: 10 #! TODO what is the right value? https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#apiservicespec-v1beta1-apiregistration-k8s-io versionPriority: 10 #! TODO what is the right value? https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#apiservicespec-v1beta1-apiregistration-k8s-io
#! caBundle: Do not include this key here. Starts out null, will be updated/owned by the golang code. #! caBundle: Do not include this key here. Starts out null, will be updated/owned by the golang code.
service: service:
name: placeholder-name-api name: pinniped-api
namespace: #@ data.values.namespace namespace: #@ data.values.namespace
port: 443 port: 443

View File

@ -44,8 +44,8 @@ rules:
- apiGroups: [""] - apiGroups: [""]
resources: [secrets] resources: [secrets]
verbs: [create, get, list, patch, update, watch, delete] verbs: [create, get, list, patch, update, watch, delete]
- apiGroups: [crds.placeholder.suzerain-io.github.io] - apiGroups: [crd.pinniped.dev]
resources: [logindiscoveryconfigs] resources: [pinnipeddiscoveryinfos]
verbs: [create, get, list, update, watch] verbs: [create, get, list, update, watch]
--- ---
kind: RoleBinding kind: RoleBinding
@ -98,7 +98,7 @@ kind: ClusterRole
metadata: metadata:
name: #@ data.values.app_name + "-credentialrequests-cluster-role" name: #@ data.values.app_name + "-credentialrequests-cluster-role"
rules: rules:
- apiGroups: [placeholder.suzerain-io.github.io] - apiGroups: [pinniped.dev]
resources: [credentialrequests] resources: [credentialrequests]
verbs: [create] verbs: [create]
--- ---

View File

@ -1,9 +1,9 @@
#@data/values #@data/values
--- ---
app_name: placeholder-name app_name: pinniped
namespace: #! e.g. placeholder-name namespace: #! e.g. pinniped
#! Specify either an image_digest or an image_tag. If both are given, only image_digest will be used. #! Specify either an image_digest or an image_tag. If both are given, only image_digest will be used.
image_repo: #! e.g. registry.example.com/your-project-name/repo-name image_repo: #! e.g. registry.example.com/your-project-name/repo-name

14
go.mod
View File

@ -1,4 +1,4 @@
module github.com/suzerain-io/placeholder-name module github.com/suzerain-io/pinniped
go 1.14 go 1.14
@ -12,9 +12,9 @@ require (
github.com/spf13/pflag v1.0.5 github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.6.1 github.com/stretchr/testify v1.6.1
github.com/suzerain-io/controller-go v0.0.0-20200730212956-7f99b569ca9f github.com/suzerain-io/controller-go v0.0.0-20200730212956-7f99b569ca9f
github.com/suzerain-io/placeholder-name/kubernetes/1.19/api v0.0.0-00010101000000-000000000000 github.com/suzerain-io/pinniped/kubernetes/1.19/api v0.0.0-00010101000000-000000000000
github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go v0.0.0-00010101000000-000000000000 github.com/suzerain-io/pinniped/kubernetes/1.19/client-go v0.0.0-00010101000000-000000000000
github.com/suzerain-io/placeholder-name/pkg/client v0.0.0-00010101000000-000000000000 github.com/suzerain-io/pinniped/pkg/client v0.0.0-00010101000000-000000000000
k8s.io/api v0.19.0-rc.0 k8s.io/api v0.19.0-rc.0
k8s.io/apimachinery v0.19.0-rc.0 k8s.io/apimachinery v0.19.0-rc.0
k8s.io/apiserver v0.19.0-rc.0 k8s.io/apiserver v0.19.0-rc.0
@ -27,7 +27,7 @@ require (
) )
replace ( replace (
github.com/suzerain-io/placeholder-name/kubernetes/1.19/api => ./kubernetes/1.19/api github.com/suzerain-io/pinniped/kubernetes/1.19/api => ./kubernetes/1.19/api
github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go => ./kubernetes/1.19/client-go github.com/suzerain-io/pinniped/kubernetes/1.19/client-go => ./kubernetes/1.19/client-go
github.com/suzerain-io/placeholder-name/pkg/client => ./pkg/client github.com/suzerain-io/pinniped/pkg/client => ./pkg/client
) )

View File

@ -10,7 +10,7 @@ GOPATH="${GOPATH:-$(mktemp -d)}"
K8S_PKG_VERSION="${K8S_PKG_VERSION:-"1.19"}" K8S_PKG_VERSION="${K8S_PKG_VERSION:-"1.19"}"
CODEGEN_IMAGE=${CODEGEN_IMAGE:-"gcr.io/tanzu-user-authentication/k8s-code-generator-${K8S_PKG_VERSION}:latest"} CODEGEN_IMAGE=${CODEGEN_IMAGE:-"gcr.io/tanzu-user-authentication/k8s-code-generator-${K8S_PKG_VERSION}:latest"}
BASE_PKG="github.com/suzerain-io/placeholder-name" BASE_PKG="github.com/suzerain-io/pinniped"
function codegen::ensure_module_in_gopath() { function codegen::ensure_module_in_gopath() {
# This should be something like "kubernetes/1.19/api". # This should be something like "kubernetes/1.19/api".
@ -53,20 +53,20 @@ function codegen::generate_for_module() {
deepcopy,defaulter \ deepcopy,defaulter \
"${BASE_PKG}/kubernetes/1.19/api/generated" \ "${BASE_PKG}/kubernetes/1.19/api/generated" \
"${BASE_PKG}/kubernetes/1.19/api/apis" \ "${BASE_PKG}/kubernetes/1.19/api/apis" \
"placeholder:v1alpha1 crdsplaceholder:v1alpha1" "pinniped:v1alpha1 crdpinniped:v1alpha1"
codegen::invoke_code_generator generate-internal-groups "${mod_basename_for_version}" \ codegen::invoke_code_generator generate-internal-groups "${mod_basename_for_version}" \
deepcopy,defaulter,conversion,openapi \ deepcopy,defaulter,conversion,openapi \
"${BASE_PKG}/kubernetes/1.19/api/generated" \ "${BASE_PKG}/kubernetes/1.19/api/generated" \
"${BASE_PKG}/kubernetes/1.19/api/apis" \ "${BASE_PKG}/kubernetes/1.19/api/apis" \
"${BASE_PKG}/kubernetes/1.19/api/apis" \ "${BASE_PKG}/kubernetes/1.19/api/apis" \
"placeholder:v1alpha1 crdsplaceholder:v1alpha1" "pinniped:v1alpha1 crdpinniped:v1alpha1"
;; ;;
1.19/client-go) 1.19/client-go)
codegen::invoke_code_generator generate-groups "${mod_basename_for_version}" \ codegen::invoke_code_generator generate-groups "${mod_basename_for_version}" \
client,lister,informer \ client,lister,informer \
"${BASE_PKG}/kubernetes/1.19/client-go" \ "${BASE_PKG}/kubernetes/1.19/client-go" \
"${BASE_PKG}/kubernetes/1.19/api/apis" \ "${BASE_PKG}/kubernetes/1.19/api/apis" \
"placeholder:v1alpha1 crdsplaceholder:v1alpha1" "pinniped:v1alpha1 crdpinniped:v1alpha1"
;; ;;
esac esac
} }

View File

@ -20,9 +20,9 @@ import (
"k8s.io/client-go/pkg/version" "k8s.io/client-go/pkg/version"
"k8s.io/klog/v2" "k8s.io/klog/v2"
"github.com/suzerain-io/placeholder-name/internal/registry/credentialrequest" "github.com/suzerain-io/pinniped/internal/registry/credentialrequest"
placeholderapi "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder" pinnipedapi "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1" pinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
) )
var ( var (
@ -35,8 +35,8 @@ var (
//nolint: gochecknoinits //nolint: gochecknoinits
func init() { func init() {
utilruntime.Must(placeholderv1alpha1.AddToScheme(scheme)) utilruntime.Must(pinnipedv1alpha1.AddToScheme(scheme))
utilruntime.Must(placeholderapi.AddToScheme(scheme)) utilruntime.Must(pinnipedapi.AddToScheme(scheme))
// add the options to empty v1 // add the options to empty v1
metav1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) metav1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"})
@ -62,7 +62,7 @@ type ExtraConfig struct {
StartControllersPostStartHook func(ctx context.Context) StartControllersPostStartHook func(ctx context.Context)
} }
type PlaceHolderServer struct { type PinnipedServer struct {
GenericAPIServer *genericapiserver.GenericAPIServer GenericAPIServer *genericapiserver.GenericAPIServer
} }
@ -90,17 +90,17 @@ func (c *Config) Complete() CompletedConfig {
} }
// New returns a new instance of AdmissionServer from the given config. // New returns a new instance of AdmissionServer from the given config.
func (c completedConfig) New() (*PlaceHolderServer, error) { func (c completedConfig) New() (*PinnipedServer, error) {
genericServer, err := c.GenericConfig.New("place-holder-server", genericapiserver.NewEmptyDelegate()) // completion is done in Complete, no need for a second time genericServer, err := c.GenericConfig.New("pinniped-server", genericapiserver.NewEmptyDelegate()) // completion is done in Complete, no need for a second time
if err != nil { if err != nil {
return nil, fmt.Errorf("completion error: %w", err) return nil, fmt.Errorf("completion error: %w", err)
} }
s := &PlaceHolderServer{ s := &PinnipedServer{
GenericAPIServer: genericServer, GenericAPIServer: genericServer,
} }
gvr := placeholderv1alpha1.SchemeGroupVersion.WithResource("credentialrequests") gvr := pinnipedv1alpha1.SchemeGroupVersion.WithResource("credentialrequests")
apiGroupInfo := genericapiserver.APIGroupInfo{ apiGroupInfo := genericapiserver.APIGroupInfo{
PrioritizedVersions: []schema.GroupVersion{gvr.GroupVersion()}, PrioritizedVersions: []schema.GroupVersion{gvr.GroupVersion()},

View File

@ -24,8 +24,8 @@ import (
"k8s.io/client-go/tools/remotecommand" "k8s.io/client-go/tools/remotecommand"
"k8s.io/klog/v2" "k8s.io/klog/v2"
"github.com/suzerain-io/placeholder-name/internal/certauthority" "github.com/suzerain-io/pinniped/internal/certauthority"
"github.com/suzerain-io/placeholder-name/internal/constable" "github.com/suzerain-io/pinniped/internal/constable"
) )
// ErrNoKubeControllerManagerPod is returned when no kube-controller-manager pod is found on the cluster. // ErrNoKubeControllerManagerPod is returned when no kube-controller-manager pod is found on the cluster.

View File

@ -23,7 +23,7 @@ import (
kubernetesfake "k8s.io/client-go/kubernetes/fake" kubernetesfake "k8s.io/client-go/kubernetes/fake"
"k8s.io/klog/v2" "k8s.io/klog/v2"
"github.com/suzerain-io/placeholder-name/internal/testutil" "github.com/suzerain-io/pinniped/internal/testutil"
) )
type fakePodExecutor struct { type fakePodExecutor struct {

View File

@ -19,8 +19,8 @@ import (
"k8s.io/klog/v2" "k8s.io/klog/v2"
"github.com/suzerain-io/controller-go" "github.com/suzerain-io/controller-go"
"github.com/suzerain-io/placeholder-name/internal/constable" "github.com/suzerain-io/pinniped/internal/constable"
placeholdernamecontroller "github.com/suzerain-io/placeholder-name/internal/controller" pinnipedcontroller "github.com/suzerain-io/pinniped/internal/controller"
) )
type certsExpirerController struct { type certsExpirerController struct {
@ -44,7 +44,7 @@ func NewCertsExpirerController(
namespace string, namespace string,
k8sClient kubernetes.Interface, k8sClient kubernetes.Interface,
secretInformer corev1informers.SecretInformer, secretInformer corev1informers.SecretInformer,
withInformer placeholdernamecontroller.WithInformerOptionFunc, withInformer pinnipedcontroller.WithInformerOptionFunc,
ageThreshold float32, ageThreshold float32,
) controller.Controller { ) controller.Controller {
return controller.New( return controller.New(
@ -59,7 +59,7 @@ func NewCertsExpirerController(
}, },
withInformer( withInformer(
secretInformer, secretInformer,
placeholdernamecontroller.NameAndNamespaceExactMatchFilterFactory(certsSecretName, namespace), pinnipedcontroller.NameAndNamespaceExactMatchFilterFactory(certsSecretName, namespace),
controller.InformerOption{}, controller.InformerOption{},
), ),
) )

View File

@ -24,7 +24,7 @@ import (
kubetesting "k8s.io/client-go/testing" kubetesting "k8s.io/client-go/testing"
"github.com/suzerain-io/controller-go" "github.com/suzerain-io/controller-go"
"github.com/suzerain-io/placeholder-name/internal/testutil" "github.com/suzerain-io/pinniped/internal/testutil"
) )
func TestExpirerControllerFilters(t *testing.T) { func TestExpirerControllerFilters(t *testing.T) {

View File

@ -19,8 +19,8 @@ import (
aggregatorclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" aggregatorclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset"
"github.com/suzerain-io/controller-go" "github.com/suzerain-io/controller-go"
"github.com/suzerain-io/placeholder-name/internal/certauthority" "github.com/suzerain-io/pinniped/internal/certauthority"
placeholdernamecontroller "github.com/suzerain-io/placeholder-name/internal/controller" pinnipedcontroller "github.com/suzerain-io/pinniped/internal/controller"
) )
const ( const (
@ -43,8 +43,8 @@ func NewCertsManagerController(
k8sClient kubernetes.Interface, k8sClient kubernetes.Interface,
aggregatorClient aggregatorclient.Interface, aggregatorClient aggregatorclient.Interface,
secretInformer corev1informers.SecretInformer, secretInformer corev1informers.SecretInformer,
withInformer placeholdernamecontroller.WithInformerOptionFunc, withInformer pinnipedcontroller.WithInformerOptionFunc,
withInitialEvent placeholdernamecontroller.WithInitialEventOptionFunc, withInitialEvent pinnipedcontroller.WithInitialEventOptionFunc,
) controller.Controller { ) controller.Controller {
return controller.New( return controller.New(
controller.Config{ controller.Config{
@ -58,7 +58,7 @@ func NewCertsManagerController(
}, },
withInformer( withInformer(
secretInformer, secretInformer,
placeholdernamecontroller.NameAndNamespaceExactMatchFilterFactory(certsSecretName, namespace), pinnipedcontroller.NameAndNamespaceExactMatchFilterFactory(certsSecretName, namespace),
controller.InformerOption{}, controller.InformerOption{},
), ),
// Be sure to run once even if the Secret that the informer is watching doesn't exist. // Be sure to run once even if the Secret that the informer is watching doesn't exist.
@ -82,13 +82,13 @@ func (c *certsManagerController) Sync(ctx controller.Context) error {
} }
// Create a CA. // Create a CA.
aggregatedAPIServerCA, err := certauthority.New(pkix.Name{CommonName: "Placeholder CA"}) aggregatedAPIServerCA, err := certauthority.New(pkix.Name{CommonName: "Pinniped CA"})
if err != nil { if err != nil {
return fmt.Errorf("could not initialize CA: %w", err) return fmt.Errorf("could not initialize CA: %w", err)
} }
// This string must match the name of the Service declared in the deployment yaml. // This string must match the name of the Service declared in the deployment yaml.
const serviceName = "placeholder-name-api" const serviceName = "pinniped-api"
// Using the CA from above, create a TLS server cert for the aggregated API server to use. // Using the CA from above, create a TLS server cert for the aggregated API server to use.
serviceEndpoint := serviceName + "." + c.namespace + ".svc" serviceEndpoint := serviceName + "." + c.namespace + ".svc"

View File

@ -25,8 +25,8 @@ import (
aggregatorfake "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/fake" aggregatorfake "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/fake"
"github.com/suzerain-io/controller-go" "github.com/suzerain-io/controller-go"
"github.com/suzerain-io/placeholder-name/internal/testutil" "github.com/suzerain-io/pinniped/internal/testutil"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1" pinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
) )
func TestManagerControllerOptions(t *testing.T) { func TestManagerControllerOptions(t *testing.T) {
@ -187,7 +187,7 @@ func TestManagerControllerSync(t *testing.T) {
it.Before(func() { it.Before(func() {
apiService := &apiregistrationv1.APIService{ apiService := &apiregistrationv1.APIService{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: placeholderv1alpha1.SchemeGroupVersion.Version + "." + placeholderv1alpha1.GroupName, Name: pinnipedv1alpha1.SchemeGroupVersion.Version + "." + pinnipedv1alpha1.GroupName,
}, },
Spec: apiregistrationv1.APIServiceSpec{ Spec: apiregistrationv1.APIServiceSpec{
CABundle: nil, CABundle: nil,
@ -220,14 +220,14 @@ func TestManagerControllerSync(t *testing.T) {
// Validate the created cert using the CA, and also validate the cert's hostname // Validate the created cert using the CA, and also validate the cert's hostname
validCert := testutil.ValidateCertificate(t, actualCACert, actualCertChain) validCert := testutil.ValidateCertificate(t, actualCACert, actualCertChain)
validCert.RequireDNSName("placeholder-name-api." + installedInNamespace + ".svc") validCert.RequireDNSName("pinniped-api." + installedInNamespace + ".svc")
validCert.RequireLifetime(time.Now(), time.Now().Add(24*365*time.Hour), 2*time.Minute) validCert.RequireLifetime(time.Now(), time.Now().Add(24*365*time.Hour), 2*time.Minute)
validCert.RequireMatchesPrivateKey(actualPrivateKey) validCert.RequireMatchesPrivateKey(actualPrivateKey)
// Make sure we updated the APIService caBundle and left it otherwise unchanged // Make sure we updated the APIService caBundle and left it otherwise unchanged
r.Len(aggregatorAPIClient.Actions(), 2) r.Len(aggregatorAPIClient.Actions(), 2)
r.Equal("get", aggregatorAPIClient.Actions()[0].GetVerb()) r.Equal("get", aggregatorAPIClient.Actions()[0].GetVerb())
expectedAPIServiceName := placeholderv1alpha1.SchemeGroupVersion.Version + "." + placeholderv1alpha1.GroupName expectedAPIServiceName := pinnipedv1alpha1.SchemeGroupVersion.Version + "." + pinnipedv1alpha1.GroupName
expectedUpdateAction := coretesting.NewUpdateAction( expectedUpdateAction := coretesting.NewUpdateAction(
schema.GroupVersionResource{ schema.GroupVersionResource{
Group: apiregistrationv1.GroupName, Group: apiregistrationv1.GroupName,

View File

@ -13,8 +13,8 @@ import (
"k8s.io/klog/v2" "k8s.io/klog/v2"
"github.com/suzerain-io/controller-go" "github.com/suzerain-io/controller-go"
placeholdernamecontroller "github.com/suzerain-io/placeholder-name/internal/controller" pinnipedcontroller "github.com/suzerain-io/pinniped/internal/controller"
"github.com/suzerain-io/placeholder-name/internal/provider" "github.com/suzerain-io/pinniped/internal/provider"
) )
type certsObserverController struct { type certsObserverController struct {
@ -27,7 +27,7 @@ func NewCertsObserverController(
namespace string, namespace string,
dynamicCertProvider provider.DynamicTLSServingCertProvider, dynamicCertProvider provider.DynamicTLSServingCertProvider,
secretInformer corev1informers.SecretInformer, secretInformer corev1informers.SecretInformer,
withInformer placeholdernamecontroller.WithInformerOptionFunc, withInformer pinnipedcontroller.WithInformerOptionFunc,
) controller.Controller { ) controller.Controller {
return controller.New( return controller.New(
controller.Config{ controller.Config{
@ -40,7 +40,7 @@ func NewCertsObserverController(
}, },
withInformer( withInformer(
secretInformer, secretInformer,
placeholdernamecontroller.NameAndNamespaceExactMatchFilterFactory(certsSecretName, namespace), pinnipedcontroller.NameAndNamespaceExactMatchFilterFactory(certsSecretName, namespace),
controller.InformerOption{}, controller.InformerOption{},
), ),
) )

View File

@ -19,8 +19,8 @@ import (
kubernetesfake "k8s.io/client-go/kubernetes/fake" kubernetesfake "k8s.io/client-go/kubernetes/fake"
"github.com/suzerain-io/controller-go" "github.com/suzerain-io/controller-go"
"github.com/suzerain-io/placeholder-name/internal/provider" "github.com/suzerain-io/pinniped/internal/provider"
"github.com/suzerain-io/placeholder-name/internal/testutil" "github.com/suzerain-io/pinniped/internal/testutil"
) )
func TestObserverControllerInformerFilters(t *testing.T) { func TestObserverControllerInformerFilters(t *testing.T) {

View File

@ -13,13 +13,13 @@ import (
"k8s.io/client-go/util/retry" "k8s.io/client-go/util/retry"
aggregatorclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" aggregatorclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1" pinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
) )
// UpdateAPIService updates the APIService's CA bundle. // UpdateAPIService updates the APIService's CA bundle.
func UpdateAPIService(ctx context.Context, aggregatorClient aggregatorclient.Interface, aggregatedAPIServerCA []byte) error { func UpdateAPIService(ctx context.Context, aggregatorClient aggregatorclient.Interface, aggregatedAPIServerCA []byte) error {
apiServices := aggregatorClient.ApiregistrationV1().APIServices() apiServices := aggregatorClient.ApiregistrationV1().APIServices()
apiServiceName := placeholderv1alpha1.SchemeGroupVersion.Version + "." + placeholderv1alpha1.GroupName apiServiceName := pinnipedv1alpha1.SchemeGroupVersion.Version + "." + pinnipedv1alpha1.GroupName
if err := retry.RetryOnConflict(retry.DefaultRetry, func() error { if err := retry.RetryOnConflict(retry.DefaultRetry, func() error {
// Retrieve the latest version of the Service before attempting update. // Retrieve the latest version of the Service before attempting update.

View File

@ -21,7 +21,7 @@ import (
) )
func TestUpdateAPIService(t *testing.T) { func TestUpdateAPIService(t *testing.T) {
const apiServiceName = "v1alpha1.placeholder.suzerain-io.github.io" const apiServiceName = "v1alpha1.pinniped.dev"
tests := []struct { tests := []struct {
name string name string

View File

@ -0,0 +1,7 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Package discovery contains controller(s) for reconciling PinnipedDiscoveryInfo's.
package discovery

View File

@ -0,0 +1,174 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
package discovery
import (
"context"
"encoding/base64"
"fmt"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
corev1informers "k8s.io/client-go/informers/core/v1"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/klog/v2"
"github.com/suzerain-io/controller-go"
pinnipedcontroller "github.com/suzerain-io/pinniped/internal/controller"
crdpinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1"
pinnipedclientset "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned"
crdpinnipedv1alpha1informers "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions/crdpinniped/v1alpha1"
)
const (
ClusterInfoNamespace = "kube-public"
clusterInfoName = "cluster-info"
clusterInfoConfigMapKey = "kubeconfig"
configName = "pinniped-config"
)
type publisherController struct {
namespace string
serverOverride *string
pinnipedClient pinnipedclientset.Interface
configMapInformer corev1informers.ConfigMapInformer
pinnipedDiscoveryInfoInformer crdpinnipedv1alpha1informers.PinnipedDiscoveryInfoInformer
}
func NewPublisherController(
namespace string,
serverOverride *string,
pinnipedClient pinnipedclientset.Interface,
configMapInformer corev1informers.ConfigMapInformer,
pinnipedDiscoveryInfoInformer crdpinnipedv1alpha1informers.PinnipedDiscoveryInfoInformer,
withInformer pinnipedcontroller.WithInformerOptionFunc,
) controller.Controller {
return controller.New(
controller.Config{
Name: "publisher-controller",
Syncer: &publisherController{
namespace: namespace,
serverOverride: serverOverride,
pinnipedClient: pinnipedClient,
configMapInformer: configMapInformer,
pinnipedDiscoveryInfoInformer: pinnipedDiscoveryInfoInformer,
},
},
withInformer(
configMapInformer,
pinnipedcontroller.NameAndNamespaceExactMatchFilterFactory(clusterInfoName, ClusterInfoNamespace),
controller.InformerOption{},
),
withInformer(
pinnipedDiscoveryInfoInformer,
pinnipedcontroller.NameAndNamespaceExactMatchFilterFactory(configName, namespace),
controller.InformerOption{},
),
)
}
func (c *publisherController) Sync(ctx controller.Context) error {
configMap, err := c.configMapInformer.
Lister().
ConfigMaps(ClusterInfoNamespace).
Get(clusterInfoName)
notFound := k8serrors.IsNotFound(err)
if err != nil && !notFound {
return fmt.Errorf("failed to get %s configmap: %w", clusterInfoName, err)
}
if notFound {
klog.InfoS(
"could not find config map",
"configmap",
klog.KRef(ClusterInfoNamespace, clusterInfoName),
)
return nil
}
kubeConfig, kubeConfigPresent := configMap.Data[clusterInfoConfigMapKey]
if !kubeConfigPresent {
klog.InfoS("could not find kubeconfig configmap key")
return nil
}
config, _ := clientcmd.Load([]byte(kubeConfig))
var certificateAuthorityData, server string
for _, v := range config.Clusters {
certificateAuthorityData = base64.StdEncoding.EncodeToString(v.CertificateAuthorityData)
server = v.Server
break
}
if c.serverOverride != nil {
server = *c.serverOverride
}
discoveryInfo := crdpinnipedv1alpha1.PinnipedDiscoveryInfo{
TypeMeta: metav1.TypeMeta{},
ObjectMeta: metav1.ObjectMeta{
Name: configName,
Namespace: c.namespace,
},
Spec: crdpinnipedv1alpha1.PinnipedDiscoveryInfoSpec{
Server: server,
CertificateAuthorityData: certificateAuthorityData,
},
}
if err := c.createOrUpdatePinnipedDiscoveryInfo(ctx.Context, &discoveryInfo); err != nil {
return err
}
return nil
}
func (c *publisherController) createOrUpdatePinnipedDiscoveryInfo(
ctx context.Context,
discoveryInfo *crdpinnipedv1alpha1.PinnipedDiscoveryInfo,
) error {
existingDiscoveryInfo, err := c.pinnipedDiscoveryInfoInformer.
Lister().
PinnipedDiscoveryInfos(c.namespace).
Get(discoveryInfo.Name)
notFound := k8serrors.IsNotFound(err)
if err != nil && !notFound {
return fmt.Errorf("could not get pinnipeddiscoveryinfo: %w", err)
}
pinnipedDiscoveryInfos := c.pinnipedClient.
CrdV1alpha1().
PinnipedDiscoveryInfos(c.namespace)
if notFound {
if _, err := pinnipedDiscoveryInfos.Create(
ctx,
discoveryInfo,
metav1.CreateOptions{},
); err != nil {
return fmt.Errorf("could not create pinnipeddiscoveryinfo: %w", err)
}
} else if !equal(existingDiscoveryInfo, discoveryInfo) {
// Update just the fields we care about.
existingDiscoveryInfo.Spec.Server = discoveryInfo.Spec.Server
existingDiscoveryInfo.Spec.CertificateAuthorityData = discoveryInfo.Spec.CertificateAuthorityData
if _, err := pinnipedDiscoveryInfos.Update(
ctx,
existingDiscoveryInfo,
metav1.UpdateOptions{},
); err != nil {
return fmt.Errorf("could not update pinnipeddiscoveryinfo: %w", err)
}
}
return nil
}
func equal(a, b *crdpinnipedv1alpha1.PinnipedDiscoveryInfo) bool {
return a.Spec.Server == b.Spec.Server &&
a.Spec.CertificateAuthorityData == b.Spec.CertificateAuthorityData
}

View File

@ -3,7 +3,7 @@ Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0 SPDX-License-Identifier: Apache-2.0
*/ */
package logindiscovery package discovery
import ( import (
"context" "context"
@ -24,10 +24,10 @@ import (
coretesting "k8s.io/client-go/testing" coretesting "k8s.io/client-go/testing"
"github.com/suzerain-io/controller-go" "github.com/suzerain-io/controller-go"
"github.com/suzerain-io/placeholder-name/internal/testutil" "github.com/suzerain-io/pinniped/internal/testutil"
crdsplaceholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1" crdpinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1"
placeholderfake "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/fake" pinnipedfake "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/fake"
placeholderinformers "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions" pinnipedinformers "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions"
) )
func TestInformerFilters(t *testing.T) { func TestInformerFilters(t *testing.T) {
@ -37,23 +37,23 @@ func TestInformerFilters(t *testing.T) {
var r *require.Assertions var r *require.Assertions
var observableWithInformerOption *testutil.ObservableWithInformerOption var observableWithInformerOption *testutil.ObservableWithInformerOption
var configMapInformerFilter controller.Filter var configMapInformerFilter controller.Filter
var loginDiscoveryConfigInformerFilter controller.Filter var pinnipedDiscoveryInfoInformerFilter controller.Filter
it.Before(func() { it.Before(func() {
r = require.New(t) r = require.New(t)
observableWithInformerOption = testutil.NewObservableWithInformerOption() observableWithInformerOption = testutil.NewObservableWithInformerOption()
configMapInformer := kubeinformers.NewSharedInformerFactory(nil, 0).Core().V1().ConfigMaps() configMapInformer := kubeinformers.NewSharedInformerFactory(nil, 0).Core().V1().ConfigMaps()
loginDiscoveryConfigInformer := placeholderinformers.NewSharedInformerFactory(nil, 0).Crds().V1alpha1().LoginDiscoveryConfigs() pinnipedDiscoveryInfoInformer := pinnipedinformers.NewSharedInformerFactory(nil, 0).Crd().V1alpha1().PinnipedDiscoveryInfos()
_ = NewPublisherController( _ = NewPublisherController(
installedInNamespace, installedInNamespace,
nil, nil,
nil, nil,
configMapInformer, configMapInformer,
loginDiscoveryConfigInformer, pinnipedDiscoveryInfoInformer,
observableWithInformerOption.WithInformer, // make it possible to observe the behavior of the Filters observableWithInformerOption.WithInformer, // make it possible to observe the behavior of the Filters
) )
configMapInformerFilter = observableWithInformerOption.GetFilterForInformer(configMapInformer) configMapInformerFilter = observableWithInformerOption.GetFilterForInformer(configMapInformer)
loginDiscoveryConfigInformerFilter = observableWithInformerOption.GetFilterForInformer(loginDiscoveryConfigInformer) pinnipedDiscoveryInfoInformerFilter = observableWithInformerOption.GetFilterForInformer(pinnipedDiscoveryInfoInformer)
}) })
when("watching ConfigMap objects", func() { when("watching ConfigMap objects", func() {
@ -104,27 +104,27 @@ func TestInformerFilters(t *testing.T) {
}) })
}) })
when("watching LoginDiscoveryConfig objects", func() { when("watching PinnipedDiscoveryInfo objects", func() {
var subject controller.Filter var subject controller.Filter
var target, wrongNamespace, wrongName, unrelated *crdsplaceholderv1alpha1.LoginDiscoveryConfig var target, wrongNamespace, wrongName, unrelated *crdpinnipedv1alpha1.PinnipedDiscoveryInfo
it.Before(func() { it.Before(func() {
subject = loginDiscoveryConfigInformerFilter subject = pinnipedDiscoveryInfoInformerFilter
target = &crdsplaceholderv1alpha1.LoginDiscoveryConfig{ target = &crdpinnipedv1alpha1.PinnipedDiscoveryInfo{
ObjectMeta: metav1.ObjectMeta{Name: "placeholder-name-config", Namespace: installedInNamespace}, ObjectMeta: metav1.ObjectMeta{Name: "pinniped-config", Namespace: installedInNamespace},
} }
wrongNamespace = &crdsplaceholderv1alpha1.LoginDiscoveryConfig{ wrongNamespace = &crdpinnipedv1alpha1.PinnipedDiscoveryInfo{
ObjectMeta: metav1.ObjectMeta{Name: "placeholder-name-config", Namespace: "wrong-namespace"}, ObjectMeta: metav1.ObjectMeta{Name: "pinniped-config", Namespace: "wrong-namespace"},
} }
wrongName = &crdsplaceholderv1alpha1.LoginDiscoveryConfig{ wrongName = &crdpinnipedv1alpha1.PinnipedDiscoveryInfo{
ObjectMeta: metav1.ObjectMeta{Name: "wrong-name", Namespace: installedInNamespace}, ObjectMeta: metav1.ObjectMeta{Name: "wrong-name", Namespace: installedInNamespace},
} }
unrelated = &crdsplaceholderv1alpha1.LoginDiscoveryConfig{ unrelated = &crdpinnipedv1alpha1.PinnipedDiscoveryInfo{
ObjectMeta: metav1.ObjectMeta{Name: "wrong-name", Namespace: "wrong-namespace"}, ObjectMeta: metav1.ObjectMeta{Name: "wrong-name", Namespace: "wrong-namespace"},
} }
}) })
when("the target LoginDiscoveryConfig changes", func() { when("the target PinnipedDiscoveryInfo changes", func() {
it("returns true to trigger the sync method", func() { it("returns true to trigger the sync method", func() {
r.True(subject.Add(target)) r.True(subject.Add(target))
r.True(subject.Update(target, unrelated)) r.True(subject.Update(target, unrelated))
@ -133,7 +133,7 @@ func TestInformerFilters(t *testing.T) {
}) })
}) })
when("a LoginDiscoveryConfig from another namespace changes", func() { when("a PinnipedDiscoveryInfo from another namespace changes", func() {
it("returns false to avoid triggering the sync method", func() { it("returns false to avoid triggering the sync method", func() {
r.False(subject.Add(wrongNamespace)) r.False(subject.Add(wrongNamespace))
r.False(subject.Update(wrongNamespace, unrelated)) r.False(subject.Update(wrongNamespace, unrelated))
@ -142,7 +142,7 @@ func TestInformerFilters(t *testing.T) {
}) })
}) })
when("a LoginDiscoveryConfig with a different name changes", func() { when("a PinnipedDiscoveryInfo with a different name changes", func() {
it("returns false to avoid triggering the sync method", func() { it("returns false to avoid triggering the sync method", func() {
r.False(subject.Add(wrongName)) r.False(subject.Add(wrongName))
r.False(subject.Update(wrongName, unrelated)) r.False(subject.Update(wrongName, unrelated))
@ -151,7 +151,7 @@ func TestInformerFilters(t *testing.T) {
}) })
}) })
when("a LoginDiscoveryConfig with a different name and a different namespace changes", func() { when("a PinnipedDiscoveryInfo with a different name and a different namespace changes", func() {
it("returns false to avoid triggering the sync method", func() { it("returns false to avoid triggering the sync method", func() {
r.False(subject.Add(unrelated)) r.False(subject.Add(unrelated))
r.False(subject.Update(unrelated, unrelated)) r.False(subject.Update(unrelated, unrelated))
@ -171,31 +171,31 @@ func TestSync(t *testing.T) {
var subject controller.Controller var subject controller.Controller
var serverOverride *string var serverOverride *string
var kubeInformerClient *kubernetesfake.Clientset var kubeInformerClient *kubernetesfake.Clientset
var placeholderInformerClient *placeholderfake.Clientset var pinnipedInformerClient *pinnipedfake.Clientset
var kubeInformers kubeinformers.SharedInformerFactory var kubeInformers kubeinformers.SharedInformerFactory
var placeholderInformers placeholderinformers.SharedInformerFactory var pinnipedInformers pinnipedinformers.SharedInformerFactory
var placeholderAPIClient *placeholderfake.Clientset var pinnipedAPIClient *pinnipedfake.Clientset
var timeoutContext context.Context var timeoutContext context.Context
var timeoutContextCancel context.CancelFunc var timeoutContextCancel context.CancelFunc
var syncContext *controller.Context var syncContext *controller.Context
var expectedLoginDiscoveryConfig = func(expectedNamespace, expectedServerURL, expectedCAData string) (schema.GroupVersionResource, *crdsplaceholderv1alpha1.LoginDiscoveryConfig) { var expectedPinnipedDiscoveryInfo = func(expectedNamespace, expectedServerURL, expectedCAData string) (schema.GroupVersionResource, *crdpinnipedv1alpha1.PinnipedDiscoveryInfo) {
expectedLoginDiscoveryConfigGVR := schema.GroupVersionResource{ expectedPinnipedDiscoveryInfoGVR := schema.GroupVersionResource{
Group: crdsplaceholderv1alpha1.GroupName, Group: crdpinnipedv1alpha1.GroupName,
Version: "v1alpha1", Version: "v1alpha1",
Resource: "logindiscoveryconfigs", Resource: "pinnipeddiscoveryinfos",
} }
expectedLoginDiscoveryConfig := &crdsplaceholderv1alpha1.LoginDiscoveryConfig{ expectedPinnipedDiscoveryInfo := &crdpinnipedv1alpha1.PinnipedDiscoveryInfo{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "placeholder-name-config", Name: "pinniped-config",
Namespace: expectedNamespace, Namespace: expectedNamespace,
}, },
Spec: crdsplaceholderv1alpha1.LoginDiscoveryConfigSpec{ Spec: crdpinnipedv1alpha1.PinnipedDiscoveryInfoSpec{
Server: expectedServerURL, Server: expectedServerURL,
CertificateAuthorityData: expectedCAData, CertificateAuthorityData: expectedCAData,
}, },
} }
return expectedLoginDiscoveryConfigGVR, expectedLoginDiscoveryConfig return expectedPinnipedDiscoveryInfoGVR, expectedPinnipedDiscoveryInfo
} }
// Defer starting the informers until the last possible moment so that the // Defer starting the informers until the last possible moment so that the
@ -205,9 +205,9 @@ func TestSync(t *testing.T) {
subject = NewPublisherController( subject = NewPublisherController(
installedInNamespace, installedInNamespace,
serverOverride, serverOverride,
placeholderAPIClient, pinnipedAPIClient,
kubeInformers.Core().V1().ConfigMaps(), kubeInformers.Core().V1().ConfigMaps(),
placeholderInformers.Crds().V1alpha1().LoginDiscoveryConfigs(), pinnipedInformers.Crd().V1alpha1().PinnipedDiscoveryInfos(),
controller.WithInformer, controller.WithInformer,
) )
@ -223,7 +223,7 @@ func TestSync(t *testing.T) {
// Must start informers before calling TestRunSynchronously() // Must start informers before calling TestRunSynchronously()
kubeInformers.Start(timeoutContext.Done()) kubeInformers.Start(timeoutContext.Done())
placeholderInformers.Start(timeoutContext.Done()) pinnipedInformers.Start(timeoutContext.Done())
controller.TestRunSynchronously(t, subject) controller.TestRunSynchronously(t, subject)
} }
@ -234,9 +234,9 @@ func TestSync(t *testing.T) {
kubeInformerClient = kubernetesfake.NewSimpleClientset() kubeInformerClient = kubernetesfake.NewSimpleClientset()
kubeInformers = kubeinformers.NewSharedInformerFactory(kubeInformerClient, 0) kubeInformers = kubeinformers.NewSharedInformerFactory(kubeInformerClient, 0)
placeholderAPIClient = placeholderfake.NewSimpleClientset() pinnipedAPIClient = pinnipedfake.NewSimpleClientset()
placeholderInformerClient = placeholderfake.NewSimpleClientset() pinnipedInformerClient = pinnipedfake.NewSimpleClientset()
placeholderInformers = placeholderinformers.NewSharedInformerFactory(placeholderInformerClient, 0) pinnipedInformers = pinnipedinformers.NewSharedInformerFactory(pinnipedInformerClient, 0)
}) })
it.After(func() { it.After(func() {
@ -268,13 +268,13 @@ func TestSync(t *testing.T) {
r.NoError(err) r.NoError(err)
}) })
when("the LoginDiscoveryConfig does not already exist", func() { when("the PinnipedDiscoveryInfo does not already exist", func() {
it("creates a LoginDiscoveryConfig", func() { it("creates a PinnipedDiscoveryInfo", func() {
startInformersAndController() startInformersAndController()
err := controller.TestSync(t, subject, *syncContext) err := controller.TestSync(t, subject, *syncContext)
r.NoError(err) r.NoError(err)
expectedLoginDiscoveryConfigGVR, expectedLoginDiscoveryConfig := expectedLoginDiscoveryConfig( expectedPinnipedDiscoveryInfoGVR, expectedPinnipedDiscoveryInfo := expectedPinnipedDiscoveryInfo(
installedInNamespace, installedInNamespace,
kubeServerURL, kubeServerURL,
caData, caData,
@ -283,20 +283,20 @@ func TestSync(t *testing.T) {
r.Equal( r.Equal(
[]coretesting.Action{ []coretesting.Action{
coretesting.NewCreateAction( coretesting.NewCreateAction(
expectedLoginDiscoveryConfigGVR, expectedPinnipedDiscoveryInfoGVR,
installedInNamespace, installedInNamespace,
expectedLoginDiscoveryConfig, expectedPinnipedDiscoveryInfo,
), ),
}, },
placeholderAPIClient.Actions(), pinnipedAPIClient.Actions(),
) )
}) })
when("creating the LoginDiscoveryConfig fails", func() { when("creating the PinnipedDiscoveryInfo fails", func() {
it.Before(func() { it.Before(func() {
placeholderAPIClient.PrependReactor( pinnipedAPIClient.PrependReactor(
"create", "create",
"logindiscoveryconfigs", "pinnipeddiscoveryinfos",
func(_ coretesting.Action) (bool, runtime.Object, error) { func(_ coretesting.Action) (bool, runtime.Object, error) {
return true, nil, errors.New("create failed") return true, nil, errors.New("create failed")
}, },
@ -306,7 +306,7 @@ func TestSync(t *testing.T) {
it("returns the create error", func() { it("returns the create error", func() {
startInformersAndController() startInformersAndController()
err := controller.TestSync(t, subject, *syncContext) err := controller.TestSync(t, subject, *syncContext)
r.EqualError(err, "could not create logindiscoveryconfig: create failed") r.EqualError(err, "could not create pinnipeddiscoveryinfo: create failed")
}) })
}) })
@ -319,85 +319,85 @@ func TestSync(t *testing.T) {
err := controller.TestSync(t, subject, *syncContext) err := controller.TestSync(t, subject, *syncContext)
r.NoError(err) r.NoError(err)
expectedLoginDiscoveryConfigGVR, expectedLoginDiscoveryConfig := expectedLoginDiscoveryConfig( expectedPinnipedDiscoveryInfoGVR, expectedPinnipedDiscoveryInfo := expectedPinnipedDiscoveryInfo(
installedInNamespace, installedInNamespace,
kubeServerURL, kubeServerURL,
caData, caData,
) )
expectedLoginDiscoveryConfig.Spec.Server = "https://some-server-override" expectedPinnipedDiscoveryInfo.Spec.Server = "https://some-server-override"
r.Equal( r.Equal(
[]coretesting.Action{ []coretesting.Action{
coretesting.NewCreateAction( coretesting.NewCreateAction(
expectedLoginDiscoveryConfigGVR, expectedPinnipedDiscoveryInfoGVR,
installedInNamespace, installedInNamespace,
expectedLoginDiscoveryConfig, expectedPinnipedDiscoveryInfo,
), ),
}, },
placeholderAPIClient.Actions(), pinnipedAPIClient.Actions(),
) )
}) })
}) })
}) })
when("the LoginDiscoveryConfig already exists", func() { when("the PinnipedDiscoveryInfo already exists", func() {
when("the LoginDiscoveryConfig is already up to date according to the data in the ConfigMap", func() { when("the PinnipedDiscoveryInfo is already up to date according to the data in the ConfigMap", func() {
it.Before(func() { it.Before(func() {
_, expectedLoginDiscoveryConfig := expectedLoginDiscoveryConfig( _, expectedPinnipedDiscoveryInfo := expectedPinnipedDiscoveryInfo(
installedInNamespace, installedInNamespace,
kubeServerURL, kubeServerURL,
caData, caData,
) )
err := placeholderInformerClient.Tracker().Add(expectedLoginDiscoveryConfig) err := pinnipedInformerClient.Tracker().Add(expectedPinnipedDiscoveryInfo)
r.NoError(err) r.NoError(err)
}) })
it("does not update the LoginDiscoveryConfig to avoid unnecessary etcd writes/api calls", func() { it("does not update the PinnipedDiscoveryInfo to avoid unnecessary etcd writes/api calls", func() {
startInformersAndController() startInformersAndController()
err := controller.TestSync(t, subject, *syncContext) err := controller.TestSync(t, subject, *syncContext)
r.NoError(err) r.NoError(err)
r.Empty(placeholderAPIClient.Actions()) r.Empty(pinnipedAPIClient.Actions())
}) })
}) })
when("the LoginDiscoveryConfig is stale compared to the data in the ConfigMap", func() { when("the PinnipedDiscoveryInfo is stale compared to the data in the ConfigMap", func() {
it.Before(func() { it.Before(func() {
_, expectedLoginDiscoveryConfig := expectedLoginDiscoveryConfig( _, expectedPinnipedDiscoveryInfo := expectedPinnipedDiscoveryInfo(
installedInNamespace, installedInNamespace,
kubeServerURL, kubeServerURL,
caData, caData,
) )
expectedLoginDiscoveryConfig.Spec.Server = "https://some-other-server" expectedPinnipedDiscoveryInfo.Spec.Server = "https://some-other-server"
r.NoError(placeholderInformerClient.Tracker().Add(expectedLoginDiscoveryConfig)) r.NoError(pinnipedInformerClient.Tracker().Add(expectedPinnipedDiscoveryInfo))
r.NoError(placeholderAPIClient.Tracker().Add(expectedLoginDiscoveryConfig)) r.NoError(pinnipedAPIClient.Tracker().Add(expectedPinnipedDiscoveryInfo))
}) })
it("updates the existing LoginDiscoveryConfig", func() { it("updates the existing PinnipedDiscoveryInfo", func() {
startInformersAndController() startInformersAndController()
err := controller.TestSync(t, subject, *syncContext) err := controller.TestSync(t, subject, *syncContext)
r.NoError(err) r.NoError(err)
expectedLoginDiscoveryConfigGVR, expectedLoginDiscoveryConfig := expectedLoginDiscoveryConfig( expectedPinnipedDiscoveryInfoGVR, expectedPinnipedDiscoveryInfo := expectedPinnipedDiscoveryInfo(
installedInNamespace, installedInNamespace,
kubeServerURL, kubeServerURL,
caData, caData,
) )
expectedActions := []coretesting.Action{ expectedActions := []coretesting.Action{
coretesting.NewUpdateAction( coretesting.NewUpdateAction(
expectedLoginDiscoveryConfigGVR, expectedPinnipedDiscoveryInfoGVR,
installedInNamespace, installedInNamespace,
expectedLoginDiscoveryConfig, expectedPinnipedDiscoveryInfo,
), ),
} }
r.Equal(expectedActions, placeholderAPIClient.Actions()) r.Equal(expectedActions, pinnipedAPIClient.Actions())
}) })
when("updating the LoginDiscoveryConfig fails", func() { when("updating the PinnipedDiscoveryInfo fails", func() {
it.Before(func() { it.Before(func() {
placeholderAPIClient.PrependReactor( pinnipedAPIClient.PrependReactor(
"update", "update",
"logindiscoveryconfigs", "pinnipeddiscoveryinfos",
func(_ coretesting.Action) (bool, runtime.Object, error) { func(_ coretesting.Action) (bool, runtime.Object, error) {
return true, nil, errors.New("update failed") return true, nil, errors.New("update failed")
}, },
@ -407,7 +407,7 @@ func TestSync(t *testing.T) {
it("returns the update error", func() { it("returns the update error", func() {
startInformersAndController() startInformersAndController()
err := controller.TestSync(t, subject, *syncContext) err := controller.TestSync(t, subject, *syncContext)
r.EqualError(err, "could not update logindiscoveryconfig: update failed") r.EqualError(err, "could not update pinnipeddiscoveryinfo: update failed")
}) })
}) })
}) })
@ -430,7 +430,7 @@ func TestSync(t *testing.T) {
startInformersAndController() startInformersAndController()
err := controller.TestSync(t, subject, *syncContext) err := controller.TestSync(t, subject, *syncContext)
r.NoError(err) r.NoError(err)
r.Empty(placeholderAPIClient.Actions()) r.Empty(pinnipedAPIClient.Actions())
}) })
}) })
}) })
@ -451,7 +451,7 @@ func TestSync(t *testing.T) {
startInformersAndController() startInformersAndController()
err := controller.TestSync(t, subject, *syncContext) err := controller.TestSync(t, subject, *syncContext)
r.NoError(err) r.NoError(err)
r.Empty(placeholderAPIClient.Actions()) r.Empty(pinnipedAPIClient.Actions())
}) })
}) })
}, spec.Parallel(), spec.Report(report.Terminal{})) }, spec.Parallel(), spec.Report(report.Terminal{}))

View File

@ -1,7 +0,0 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Package logindiscovery contains controller(s) for reconciling LoginDiscoveryConfig's.
package logindiscovery

View File

@ -1,174 +0,0 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
package logindiscovery
import (
"context"
"encoding/base64"
"fmt"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
corev1informers "k8s.io/client-go/informers/core/v1"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/klog/v2"
"github.com/suzerain-io/controller-go"
placeholdernamecontroller "github.com/suzerain-io/placeholder-name/internal/controller"
crdsplaceholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1"
placeholderclientset "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
crdsplaceholderv1alpha1informers "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/crdsplaceholder/v1alpha1"
)
const (
ClusterInfoNamespace = "kube-public"
clusterInfoName = "cluster-info"
clusterInfoConfigMapKey = "kubeconfig"
configName = "placeholder-name-config"
)
type publisherController struct {
namespace string
serverOverride *string
placeholderClient placeholderclientset.Interface
configMapInformer corev1informers.ConfigMapInformer
loginDiscoveryConfigInformer crdsplaceholderv1alpha1informers.LoginDiscoveryConfigInformer
}
func NewPublisherController(
namespace string,
serverOverride *string,
placeholderClient placeholderclientset.Interface,
configMapInformer corev1informers.ConfigMapInformer,
loginDiscoveryConfigInformer crdsplaceholderv1alpha1informers.LoginDiscoveryConfigInformer,
withInformer placeholdernamecontroller.WithInformerOptionFunc,
) controller.Controller {
return controller.New(
controller.Config{
Name: "publisher-controller",
Syncer: &publisherController{
namespace: namespace,
serverOverride: serverOverride,
placeholderClient: placeholderClient,
configMapInformer: configMapInformer,
loginDiscoveryConfigInformer: loginDiscoveryConfigInformer,
},
},
withInformer(
configMapInformer,
placeholdernamecontroller.NameAndNamespaceExactMatchFilterFactory(clusterInfoName, ClusterInfoNamespace),
controller.InformerOption{},
),
withInformer(
loginDiscoveryConfigInformer,
placeholdernamecontroller.NameAndNamespaceExactMatchFilterFactory(configName, namespace),
controller.InformerOption{},
),
)
}
func (c *publisherController) Sync(ctx controller.Context) error {
configMap, err := c.configMapInformer.
Lister().
ConfigMaps(ClusterInfoNamespace).
Get(clusterInfoName)
notFound := k8serrors.IsNotFound(err)
if err != nil && !notFound {
return fmt.Errorf("failed to get %s configmap: %w", clusterInfoName, err)
}
if notFound {
klog.InfoS(
"could not find config map",
"configmap",
klog.KRef(ClusterInfoNamespace, clusterInfoName),
)
return nil
}
kubeConfig, kubeConfigPresent := configMap.Data[clusterInfoConfigMapKey]
if !kubeConfigPresent {
klog.InfoS("could not find kubeconfig configmap key")
return nil
}
config, _ := clientcmd.Load([]byte(kubeConfig))
var certificateAuthorityData, server string
for _, v := range config.Clusters {
certificateAuthorityData = base64.StdEncoding.EncodeToString(v.CertificateAuthorityData)
server = v.Server
break
}
if c.serverOverride != nil {
server = *c.serverOverride
}
discoveryConfig := crdsplaceholderv1alpha1.LoginDiscoveryConfig{
TypeMeta: metav1.TypeMeta{},
ObjectMeta: metav1.ObjectMeta{
Name: configName,
Namespace: c.namespace,
},
Spec: crdsplaceholderv1alpha1.LoginDiscoveryConfigSpec{
Server: server,
CertificateAuthorityData: certificateAuthorityData,
},
}
if err := c.createOrUpdateLoginDiscoveryConfig(ctx.Context, &discoveryConfig); err != nil {
return err
}
return nil
}
func (c *publisherController) createOrUpdateLoginDiscoveryConfig(
ctx context.Context,
discoveryConfig *crdsplaceholderv1alpha1.LoginDiscoveryConfig,
) error {
existingDiscoveryConfig, err := c.loginDiscoveryConfigInformer.
Lister().
LoginDiscoveryConfigs(c.namespace).
Get(discoveryConfig.Name)
notFound := k8serrors.IsNotFound(err)
if err != nil && !notFound {
return fmt.Errorf("could not get logindiscoveryconfig: %w", err)
}
loginDiscoveryConfigs := c.placeholderClient.
CrdsV1alpha1().
LoginDiscoveryConfigs(c.namespace)
if notFound {
if _, err := loginDiscoveryConfigs.Create(
ctx,
discoveryConfig,
metav1.CreateOptions{},
); err != nil {
return fmt.Errorf("could not create logindiscoveryconfig: %w", err)
}
} else if !equal(existingDiscoveryConfig, discoveryConfig) {
// Update just the fields we care about.
existingDiscoveryConfig.Spec.Server = discoveryConfig.Spec.Server
existingDiscoveryConfig.Spec.CertificateAuthorityData = discoveryConfig.Spec.CertificateAuthorityData
if _, err := loginDiscoveryConfigs.Update(
ctx,
existingDiscoveryConfig,
metav1.UpdateOptions{},
); err != nil {
return fmt.Errorf("could not update logindiscoveryconfig: %w", err)
}
}
return nil
}
func equal(a, b *crdsplaceholderv1alpha1.LoginDiscoveryConfig) bool {
return a.Spec.Server == b.Spec.Server &&
a.Spec.CertificateAuthorityData == b.Spec.CertificateAuthorityData
}

View File

@ -17,11 +17,11 @@ import (
aggregatorclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset" aggregatorclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset"
"github.com/suzerain-io/controller-go" "github.com/suzerain-io/controller-go"
"github.com/suzerain-io/placeholder-name/internal/controller/apicerts" "github.com/suzerain-io/pinniped/internal/controller/apicerts"
"github.com/suzerain-io/placeholder-name/internal/controller/logindiscovery" "github.com/suzerain-io/pinniped/internal/controller/discovery"
"github.com/suzerain-io/placeholder-name/internal/provider" "github.com/suzerain-io/pinniped/internal/provider"
placeholderclientset "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned" pinnipedclientset "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned"
placeholderinformers "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions" pinnipedinformers "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions"
) )
const ( const (
@ -37,25 +37,25 @@ func PrepareControllers(
servingCertRotationThreshold float32, servingCertRotationThreshold float32,
) (func(ctx context.Context), error) { ) (func(ctx context.Context), error) {
// Create k8s clients. // Create k8s clients.
k8sClient, aggregatorClient, placeholderClient, err := createClients() k8sClient, aggregatorClient, pinnipedClient, err := createClients()
if err != nil { if err != nil {
return nil, fmt.Errorf("could not create clients for the controllers: %w", err) return nil, fmt.Errorf("could not create clients for the controllers: %w", err)
} }
// Create informers. Don't forget to make sure they get started in the function returned below. // Create informers. Don't forget to make sure they get started in the function returned below.
kubePublicNamespaceK8sInformers, installationNamespaceK8sInformers, installationNamespacePlaceholderInformers := kubePublicNamespaceK8sInformers, installationNamespaceK8sInformers, installationNamespacePinnipedInformers :=
createInformers(serverInstallationNamespace, k8sClient, placeholderClient) createInformers(serverInstallationNamespace, k8sClient, pinnipedClient)
// Create controller manager. // Create controller manager.
controllerManager := controller. controllerManager := controller.
NewManager(). NewManager().
WithController( WithController(
logindiscovery.NewPublisherController( discovery.NewPublisherController(
serverInstallationNamespace, serverInstallationNamespace,
discoveryURLOverride, discoveryURLOverride,
placeholderClient, pinnipedClient,
kubePublicNamespaceK8sInformers.Core().V1().ConfigMaps(), kubePublicNamespaceK8sInformers.Core().V1().ConfigMaps(),
installationNamespacePlaceholderInformers.Crds().V1alpha1().LoginDiscoveryConfigs(), installationNamespacePinnipedInformers.Crd().V1alpha1().PinnipedDiscoveryInfos(),
controller.WithInformer, controller.WithInformer,
), ),
singletonWorker, singletonWorker,
@ -95,7 +95,7 @@ func PrepareControllers(
return func(ctx context.Context) { return func(ctx context.Context) {
kubePublicNamespaceK8sInformers.Start(ctx.Done()) kubePublicNamespaceK8sInformers.Start(ctx.Done())
installationNamespaceK8sInformers.Start(ctx.Done()) installationNamespaceK8sInformers.Start(ctx.Done())
installationNamespacePlaceholderInformers.Start(ctx.Done()) installationNamespacePinnipedInformers.Start(ctx.Done())
go controllerManager.Start(ctx) go controllerManager.Start(ctx)
}, nil }, nil
@ -105,7 +105,7 @@ func PrepareControllers(
func createClients() ( func createClients() (
k8sClient *kubernetes.Clientset, k8sClient *kubernetes.Clientset,
aggregatorClient *aggregatorclient.Clientset, aggregatorClient *aggregatorclient.Clientset,
placeholderClient *placeholderclientset.Clientset, pinnipedClient *pinnipedclientset.Clientset,
err error, err error,
) { ) {
// Load the Kubernetes client configuration. // Load the Kubernetes client configuration.
@ -129,12 +129,12 @@ func createClients() (
return nil, nil, nil, fmt.Errorf("could not initialize Kubernetes client: %w", err) return nil, nil, nil, fmt.Errorf("could not initialize Kubernetes client: %w", err)
} }
// Connect to the placeholder API. // Connect to the pinniped API.
// I think we can't use protobuf encoding here because we are using CRDs // I think we can't use protobuf encoding here because we are using CRDs
// (for which protobuf encoding is not supported). // (for which protobuf encoding is not supported).
placeholderClient, err = placeholderclientset.NewForConfig(kubeConfig) pinnipedClient, err = pinnipedclientset.NewForConfig(kubeConfig)
if err != nil { if err != nil {
return nil, nil, nil, fmt.Errorf("could not initialize placeholder client: %w", err) return nil, nil, nil, fmt.Errorf("could not initialize pinniped client: %w", err)
} }
//nolint: nakedret //nolint: nakedret
@ -145,26 +145,26 @@ func createClients() (
func createInformers( func createInformers(
serverInstallationNamespace string, serverInstallationNamespace string,
k8sClient *kubernetes.Clientset, k8sClient *kubernetes.Clientset,
placeholderClient *placeholderclientset.Clientset, pinnipedClient *pinnipedclientset.Clientset,
) ( ) (
kubePublicNamespaceK8sInformers k8sinformers.SharedInformerFactory, kubePublicNamespaceK8sInformers k8sinformers.SharedInformerFactory,
installationNamespaceK8sInformers k8sinformers.SharedInformerFactory, installationNamespaceK8sInformers k8sinformers.SharedInformerFactory,
installationNamespacePlaceholderInformers placeholderinformers.SharedInformerFactory, installationNamespacePinnipedInformers pinnipedinformers.SharedInformerFactory,
) { ) {
kubePublicNamespaceK8sInformers = k8sinformers.NewSharedInformerFactoryWithOptions( kubePublicNamespaceK8sInformers = k8sinformers.NewSharedInformerFactoryWithOptions(
k8sClient, k8sClient,
defaultResyncInterval, defaultResyncInterval,
k8sinformers.WithNamespace(logindiscovery.ClusterInfoNamespace), k8sinformers.WithNamespace(discovery.ClusterInfoNamespace),
) )
installationNamespaceK8sInformers = k8sinformers.NewSharedInformerFactoryWithOptions( installationNamespaceK8sInformers = k8sinformers.NewSharedInformerFactoryWithOptions(
k8sClient, k8sClient,
defaultResyncInterval, defaultResyncInterval,
k8sinformers.WithNamespace(serverInstallationNamespace), k8sinformers.WithNamespace(serverInstallationNamespace),
) )
installationNamespacePlaceholderInformers = placeholderinformers.NewSharedInformerFactoryWithOptions( installationNamespacePinnipedInformers = pinnipedinformers.NewSharedInformerFactoryWithOptions(
placeholderClient, pinnipedClient,
defaultResyncInterval, defaultResyncInterval,
placeholderinformers.WithNamespace(serverInstallationNamespace), pinnipedinformers.WithNamespace(serverInstallationNamespace),
) )
return return
} }

View File

@ -5,4 +5,4 @@ SPDX-License-Identifier: Apache-2.0
package mockcertissuer package mockcertissuer
//go:generate go run -v github.com/golang/mock/mockgen -destination=mockcertissuer.go -package=mockcertissuer -copyright_file=../../../hack/header.txt github.com/suzerain-io/placeholder-name/internal/registry/credentialrequest CertIssuer //go:generate go run -v github.com/golang/mock/mockgen -destination=mockcertissuer.go -package=mockcertissuer -copyright_file=../../../hack/header.txt github.com/suzerain-io/pinniped/internal/registry/credentialrequest CertIssuer

View File

@ -3,16 +3,17 @@
// //
// Code generated by MockGen. DO NOT EDIT. // Code generated by MockGen. DO NOT EDIT.
// Source: github.com/suzerain-io/placeholder-name/internal/registry/credentialrequest (interfaces: CertIssuer) // Source: github.com/suzerain-io/pinniped/internal/registry/credentialrequest (interfaces: CertIssuer)
// Package mockcertissuer is a generated GoMock package. // Package mockcertissuer is a generated GoMock package.
package mockcertissuer package mockcertissuer
import ( import (
pkix "crypto/x509/pkix" pkix "crypto/x509/pkix"
gomock "github.com/golang/mock/gomock"
reflect "reflect" reflect "reflect"
time "time" time "time"
gomock "github.com/golang/mock/gomock"
) )
// MockCertIssuer is a mock of CertIssuer interface // MockCertIssuer is a mock of CertIssuer interface

View File

@ -21,7 +21,7 @@ import (
"k8s.io/apiserver/pkg/registry/rest" "k8s.io/apiserver/pkg/registry/rest"
"k8s.io/utils/trace" "k8s.io/utils/trace"
placeholderapi "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder" pinnipedapi "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped"
) )
// clientCertificateTTL is the TTL for short-lived client certificates returned by this API. // clientCertificateTTL is the TTL for short-lived client certificates returned by this API.
@ -51,7 +51,7 @@ type REST struct {
} }
func (r *REST) New() runtime.Object { func (r *REST) New() runtime.Object {
return &placeholderapi.CredentialRequest{} return &pinnipedapi.CredentialRequest{}
} }
func (r *REST) NamespaceScoped() bool { func (r *REST) NamespaceScoped() bool {
@ -107,9 +107,9 @@ func (r *REST) Create(ctx context.Context, obj runtime.Object, createValidation
traceSuccess(t, authResponse.User, authenticated, true) traceSuccess(t, authResponse.User, authenticated, true)
return &placeholderapi.CredentialRequest{ return &pinnipedapi.CredentialRequest{
Status: placeholderapi.CredentialRequestStatus{ Status: pinnipedapi.CredentialRequestStatus{
Credential: &placeholderapi.CredentialRequestCredential{ Credential: &pinnipedapi.CredentialRequestCredential{
ExpirationTimestamp: metav1.NewTime(time.Now().UTC().Add(clientCertificateTTL)), ExpirationTimestamp: metav1.NewTime(time.Now().UTC().Add(clientCertificateTTL)),
ClientCertificateData: string(certPEM), ClientCertificateData: string(certPEM),
ClientKeyData: string(keyPEM), ClientKeyData: string(keyPEM),
@ -118,8 +118,8 @@ func (r *REST) Create(ctx context.Context, obj runtime.Object, createValidation
}, nil }, nil
} }
func validateRequest(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions, t *trace.Trace) (*placeholderapi.CredentialRequest, error) { func validateRequest(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions, t *trace.Trace) (*pinnipedapi.CredentialRequest, error) {
credentialRequest, ok := obj.(*placeholderapi.CredentialRequest) credentialRequest, ok := obj.(*pinnipedapi.CredentialRequest)
if !ok { if !ok {
traceValidationFailure(t, "not a CredentialRequest") traceValidationFailure(t, "not a CredentialRequest")
return nil, apierrors.NewBadRequest(fmt.Sprintf("not a CredentialRequest: %#v", obj)) return nil, apierrors.NewBadRequest(fmt.Sprintf("not a CredentialRequest: %#v", obj))
@ -128,20 +128,20 @@ func validateRequest(ctx context.Context, obj runtime.Object, createValidation r
if len(credentialRequest.Spec.Type) == 0 { if len(credentialRequest.Spec.Type) == 0 {
traceValidationFailure(t, "type must be supplied") traceValidationFailure(t, "type must be supplied")
errs := field.ErrorList{field.Required(field.NewPath("spec", "type"), "type must be supplied")} errs := field.ErrorList{field.Required(field.NewPath("spec", "type"), "type must be supplied")}
return nil, apierrors.NewInvalid(placeholderapi.Kind(credentialRequest.Kind), credentialRequest.Name, errs) return nil, apierrors.NewInvalid(pinnipedapi.Kind(credentialRequest.Kind), credentialRequest.Name, errs)
} }
if credentialRequest.Spec.Type != placeholderapi.TokenCredentialType { if credentialRequest.Spec.Type != pinnipedapi.TokenCredentialType {
traceValidationFailure(t, "unrecognized type") traceValidationFailure(t, "unrecognized type")
errs := field.ErrorList{field.Invalid(field.NewPath("spec", "type"), credentialRequest.Spec.Type, "unrecognized type")} errs := field.ErrorList{field.Invalid(field.NewPath("spec", "type"), credentialRequest.Spec.Type, "unrecognized type")}
return nil, apierrors.NewInvalid(placeholderapi.Kind(credentialRequest.Kind), credentialRequest.Name, errs) return nil, apierrors.NewInvalid(pinnipedapi.Kind(credentialRequest.Kind), credentialRequest.Name, errs)
} }
token := credentialRequest.Spec.Token token := credentialRequest.Spec.Token
if token == nil || len(token.Value) == 0 { if token == nil || len(token.Value) == 0 {
traceValidationFailure(t, "token must be supplied") traceValidationFailure(t, "token must be supplied")
errs := field.ErrorList{field.Required(field.NewPath("spec", "token", "value"), "token must be supplied")} errs := field.ErrorList{field.Required(field.NewPath("spec", "token", "value"), "token must be supplied")}
return nil, apierrors.NewInvalid(placeholderapi.Kind(credentialRequest.Kind), credentialRequest.Name, errs) return nil, apierrors.NewInvalid(pinnipedapi.Kind(credentialRequest.Kind), credentialRequest.Name, errs)
} }
// just a sanity check, not sure how to honor a dry run on a virtual API // just a sanity check, not sure how to honor a dry run on a virtual API
@ -149,7 +149,7 @@ func validateRequest(ctx context.Context, obj runtime.Object, createValidation r
if len(options.DryRun) != 0 { if len(options.DryRun) != 0 {
traceValidationFailure(t, "dryRun not supported") traceValidationFailure(t, "dryRun not supported")
errs := field.ErrorList{field.NotSupported(field.NewPath("dryRun"), options.DryRun, nil)} errs := field.ErrorList{field.NotSupported(field.NewPath("dryRun"), options.DryRun, nil)}
return nil, apierrors.NewInvalid(placeholderapi.Kind(credentialRequest.Kind), credentialRequest.Name, errs) return nil, apierrors.NewInvalid(pinnipedapi.Kind(credentialRequest.Kind), credentialRequest.Name, errs)
} }
} }
@ -160,7 +160,7 @@ func validateRequest(ctx context.Context, obj runtime.Object, createValidation r
// they already got the token. // they already got the token.
if createValidation != nil { if createValidation != nil {
requestForValidation := obj.DeepCopyObject() requestForValidation := obj.DeepCopyObject()
credentialRequestCopy, _ := requestForValidation.(*placeholderapi.CredentialRequest) credentialRequestCopy, _ := requestForValidation.(*pinnipedapi.CredentialRequest)
credentialRequestCopy.Spec.Token.Value = "" credentialRequestCopy.Spec.Token.Value = ""
if err := createValidation(ctx, requestForValidation); err != nil { if err := createValidation(ctx, requestForValidation); err != nil {
traceFailureWithError(t, "validation webhook", err) traceFailureWithError(t, "validation webhook", err)
@ -171,7 +171,7 @@ func validateRequest(ctx context.Context, obj runtime.Object, createValidation r
return credentialRequest, nil return credentialRequest, nil
} }
func traceSuccess(t *trace.Trace, user user.Info, webhookAuthenticated bool, placeholderNameAuthenticated bool) { func traceSuccess(t *trace.Trace, user user.Info, webhookAuthenticated bool, pinnipedAuthenticated bool) {
userID := "<none>" userID := "<none>"
if user != nil { if user != nil {
userID = user.GetUID() userID = user.GetUID()
@ -179,7 +179,7 @@ func traceSuccess(t *trace.Trace, user user.Info, webhookAuthenticated bool, pla
t.Step("success", t.Step("success",
trace.Field{Key: "userID", Value: userID}, trace.Field{Key: "userID", Value: userID},
trace.Field{Key: "idpAuthenticated", Value: webhookAuthenticated}, trace.Field{Key: "idpAuthenticated", Value: webhookAuthenticated},
trace.Field{Key: "placeholderNameAuthenticated", Value: placeholderNameAuthenticated}, trace.Field{Key: "pinnipedAuthenticated", Value: pinnipedAuthenticated},
) )
} }
@ -197,10 +197,10 @@ func traceFailureWithError(t *trace.Trace, failureType string, err error) {
) )
} }
func failureResponse() *placeholderapi.CredentialRequest { func failureResponse() *pinnipedapi.CredentialRequest {
m := "authentication failed" m := "authentication failed"
return &placeholderapi.CredentialRequest{ return &pinnipedapi.CredentialRequest{
Status: placeholderapi.CredentialRequestStatus{ Status: pinnipedapi.CredentialRequestStatus{
Credential: nil, Credential: nil,
Message: &m, Message: &m,
}, },

View File

@ -25,9 +25,9 @@ import (
"k8s.io/apiserver/pkg/registry/rest" "k8s.io/apiserver/pkg/registry/rest"
"k8s.io/klog/v2" "k8s.io/klog/v2"
"github.com/suzerain-io/placeholder-name/internal/mocks/mockcertissuer" "github.com/suzerain-io/pinniped/internal/mocks/mockcertissuer"
"github.com/suzerain-io/placeholder-name/internal/testutil" "github.com/suzerain-io/pinniped/internal/testutil"
placeholderapi "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder" pinnipedapi "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped"
) )
type contextKey struct{} type contextKey struct{}
@ -105,16 +105,16 @@ func TestCreate(t *testing.T) {
response, err := callCreate(context.Background(), storage, validCredentialRequestWithToken(requestToken)) response, err := callCreate(context.Background(), storage, validCredentialRequestWithToken(requestToken))
r.NoError(err) r.NoError(err)
r.IsType(&placeholderapi.CredentialRequest{}, response) r.IsType(&pinnipedapi.CredentialRequest{}, response)
expires := response.(*placeholderapi.CredentialRequest).Status.Credential.ExpirationTimestamp expires := response.(*pinnipedapi.CredentialRequest).Status.Credential.ExpirationTimestamp
r.NotNil(expires) r.NotNil(expires)
r.InDelta(time.Now().Add(1*time.Hour).Unix(), expires.Unix(), 5) r.InDelta(time.Now().Add(1*time.Hour).Unix(), expires.Unix(), 5)
response.(*placeholderapi.CredentialRequest).Status.Credential.ExpirationTimestamp = metav1.Time{} response.(*pinnipedapi.CredentialRequest).Status.Credential.ExpirationTimestamp = metav1.Time{}
r.Equal(response, &placeholderapi.CredentialRequest{ r.Equal(response, &pinnipedapi.CredentialRequest{
Status: placeholderapi.CredentialRequestStatus{ Status: pinnipedapi.CredentialRequestStatus{
Credential: &placeholderapi.CredentialRequestCredential{ Credential: &pinnipedapi.CredentialRequestCredential{
ExpirationTimestamp: metav1.Time{}, ExpirationTimestamp: metav1.Time{},
ClientCertificateData: "test-cert", ClientCertificateData: "test-cert",
ClientKeyData: "test-key", ClientKeyData: "test-key",
@ -164,7 +164,7 @@ func TestCreate(t *testing.T) {
requireSuccessfulResponseWithAuthenticationFailureMessage(t, err, response) requireSuccessfulResponseWithAuthenticationFailureMessage(t, err, response)
r.Equal(requestToken, webhook.calledWithToken) r.Equal(requestToken, webhook.calledWithToken)
requireOneLogStatement(r, logger, `"success" userID:test-user-uid,idpAuthenticated:false,placeholderNameAuthenticated:false`) requireOneLogStatement(r, logger, `"success" userID:test-user-uid,idpAuthenticated:false,pinnipedAuthenticated:false`)
}) })
it("CreateSucceedsWithAnUnauthenticatedStatusWhenGivenATokenAndTheWebhookReturnsUnauthenticatedWithNilUser", func() { it("CreateSucceedsWithAnUnauthenticatedStatusWhenGivenATokenAndTheWebhookReturnsUnauthenticatedWithNilUser", func() {
@ -179,7 +179,7 @@ func TestCreate(t *testing.T) {
requireSuccessfulResponseWithAuthenticationFailureMessage(t, err, response) requireSuccessfulResponseWithAuthenticationFailureMessage(t, err, response)
r.Equal(requestToken, webhook.calledWithToken) r.Equal(requestToken, webhook.calledWithToken)
requireOneLogStatement(r, logger, `"success" userID:<none>,idpAuthenticated:false,placeholderNameAuthenticated:false`) requireOneLogStatement(r, logger, `"success" userID:<none>,idpAuthenticated:false,pinnipedAuthenticated:false`)
}) })
it("CreateSucceedsWithAnUnauthenticatedStatusWhenWebhookFails", func() { it("CreateSucceedsWithAnUnauthenticatedStatusWhenWebhookFails", func() {
@ -204,7 +204,7 @@ func TestCreate(t *testing.T) {
response, err := callCreate(context.Background(), storage, validCredentialRequest()) response, err := callCreate(context.Background(), storage, validCredentialRequest())
requireSuccessfulResponseWithAuthenticationFailureMessage(t, err, response) requireSuccessfulResponseWithAuthenticationFailureMessage(t, err, response)
requireOneLogStatement(r, logger, `"success" userID:<none>,idpAuthenticated:true,placeholderNameAuthenticated:false`) requireOneLogStatement(r, logger, `"success" userID:<none>,idpAuthenticated:true,pinnipedAuthenticated:false`)
}) })
it("CreateSucceedsWithAnUnauthenticatedStatusWhenWebhookReturnsAnEmptyUsername", func() { it("CreateSucceedsWithAnUnauthenticatedStatusWhenWebhookReturnsAnEmptyUsername", func() {
@ -220,7 +220,7 @@ func TestCreate(t *testing.T) {
response, err := callCreate(context.Background(), storage, validCredentialRequest()) response, err := callCreate(context.Background(), storage, validCredentialRequest())
requireSuccessfulResponseWithAuthenticationFailureMessage(t, err, response) requireSuccessfulResponseWithAuthenticationFailureMessage(t, err, response)
requireOneLogStatement(r, logger, `"success" userID:,idpAuthenticated:true,placeholderNameAuthenticated:false`) requireOneLogStatement(r, logger, `"success" userID:,idpAuthenticated:true,pinnipedAuthenticated:false`)
}) })
it("CreateDoesNotPassAdditionalContextInfoToTheWebhook", func() { it("CreateDoesNotPassAdditionalContextInfoToTheWebhook", func() {
@ -250,49 +250,49 @@ func TestCreate(t *testing.T) {
it("CreateFailsWhenTokenIsNilInRequest", func() { it("CreateFailsWhenTokenIsNilInRequest", func() {
storage := NewREST(&FakeToken{}, nil) storage := NewREST(&FakeToken{}, nil)
response, err := callCreate(context.Background(), storage, credentialRequest(placeholderapi.CredentialRequestSpec{ response, err := callCreate(context.Background(), storage, credentialRequest(pinnipedapi.CredentialRequestSpec{
Type: placeholderapi.TokenCredentialType, Type: pinnipedapi.TokenCredentialType,
Token: nil, Token: nil,
})) }))
requireAPIError(t, response, err, apierrors.IsInvalid, requireAPIError(t, response, err, apierrors.IsInvalid,
`.placeholder.suzerain-io.github.io "request name" is invalid: spec.token.value: Required value: token must be supplied`) `.pinniped.dev "request name" is invalid: spec.token.value: Required value: token must be supplied`)
requireOneLogStatement(r, logger, `"failure" failureType:request validation,msg:token must be supplied`) requireOneLogStatement(r, logger, `"failure" failureType:request validation,msg:token must be supplied`)
}) })
it("CreateFailsWhenTypeInRequestIsMissing", func() { it("CreateFailsWhenTypeInRequestIsMissing", func() {
storage := NewREST(&FakeToken{}, nil) storage := NewREST(&FakeToken{}, nil)
response, err := callCreate(context.Background(), storage, credentialRequest(placeholderapi.CredentialRequestSpec{ response, err := callCreate(context.Background(), storage, credentialRequest(pinnipedapi.CredentialRequestSpec{
Type: "", Type: "",
Token: &placeholderapi.CredentialRequestTokenCredential{Value: "a token"}, Token: &pinnipedapi.CredentialRequestTokenCredential{Value: "a token"},
})) }))
requireAPIError(t, response, err, apierrors.IsInvalid, requireAPIError(t, response, err, apierrors.IsInvalid,
`.placeholder.suzerain-io.github.io "request name" is invalid: spec.type: Required value: type must be supplied`) `.pinniped.dev "request name" is invalid: spec.type: Required value: type must be supplied`)
requireOneLogStatement(r, logger, `"failure" failureType:request validation,msg:type must be supplied`) requireOneLogStatement(r, logger, `"failure" failureType:request validation,msg:type must be supplied`)
}) })
it("CreateFailsWhenTypeInRequestIsNotLegal", func() { it("CreateFailsWhenTypeInRequestIsNotLegal", func() {
storage := NewREST(&FakeToken{}, nil) storage := NewREST(&FakeToken{}, nil)
response, err := callCreate(context.Background(), storage, credentialRequest(placeholderapi.CredentialRequestSpec{ response, err := callCreate(context.Background(), storage, credentialRequest(pinnipedapi.CredentialRequestSpec{
Type: "this in an invalid type", Type: "this in an invalid type",
Token: &placeholderapi.CredentialRequestTokenCredential{Value: "a token"}, Token: &pinnipedapi.CredentialRequestTokenCredential{Value: "a token"},
})) }))
requireAPIError(t, response, err, apierrors.IsInvalid, requireAPIError(t, response, err, apierrors.IsInvalid,
`.placeholder.suzerain-io.github.io "request name" is invalid: spec.type: Invalid value: "this in an invalid type": unrecognized type`) `.pinniped.dev "request name" is invalid: spec.type: Invalid value: "this in an invalid type": unrecognized type`)
requireOneLogStatement(r, logger, `"failure" failureType:request validation,msg:unrecognized type`) requireOneLogStatement(r, logger, `"failure" failureType:request validation,msg:unrecognized type`)
}) })
it("CreateFailsWhenTokenValueIsEmptyInRequest", func() { it("CreateFailsWhenTokenValueIsEmptyInRequest", func() {
storage := NewREST(&FakeToken{}, nil) storage := NewREST(&FakeToken{}, nil)
response, err := callCreate(context.Background(), storage, credentialRequest(placeholderapi.CredentialRequestSpec{ response, err := callCreate(context.Background(), storage, credentialRequest(pinnipedapi.CredentialRequestSpec{
Type: placeholderapi.TokenCredentialType, Type: pinnipedapi.TokenCredentialType,
Token: &placeholderapi.CredentialRequestTokenCredential{Value: ""}, Token: &pinnipedapi.CredentialRequestTokenCredential{Value: ""},
})) }))
requireAPIError(t, response, err, apierrors.IsInvalid, requireAPIError(t, response, err, apierrors.IsInvalid,
`.placeholder.suzerain-io.github.io "request name" is invalid: spec.token.value: Required value: token must be supplied`) `.pinniped.dev "request name" is invalid: spec.token.value: Required value: token must be supplied`)
requireOneLogStatement(r, logger, `"failure" failureType:request validation,msg:token must be supplied`) requireOneLogStatement(r, logger, `"failure" failureType:request validation,msg:token must be supplied`)
}) })
@ -320,7 +320,7 @@ func TestCreate(t *testing.T) {
context.Background(), context.Background(),
validCredentialRequestWithToken(requestToken), validCredentialRequestWithToken(requestToken),
func(ctx context.Context, obj runtime.Object) error { func(ctx context.Context, obj runtime.Object) error {
credentialRequest, _ := obj.(*placeholderapi.CredentialRequest) credentialRequest, _ := obj.(*pinnipedapi.CredentialRequest)
credentialRequest.Spec.Token.Value = "foobaz" credentialRequest.Spec.Token.Value = "foobaz"
return nil return nil
}, },
@ -342,7 +342,7 @@ func TestCreate(t *testing.T) {
context.Background(), context.Background(),
validCredentialRequest(), validCredentialRequest(),
func(ctx context.Context, obj runtime.Object) error { func(ctx context.Context, obj runtime.Object) error {
credentialRequest, _ := obj.(*placeholderapi.CredentialRequest) credentialRequest, _ := obj.(*pinnipedapi.CredentialRequest)
validationFunctionWasCalled = true validationFunctionWasCalled = true
validationFunctionSawTokenValue = credentialRequest.Spec.Token.Value validationFunctionSawTokenValue = credentialRequest.Spec.Token.Value
return nil return nil
@ -364,7 +364,7 @@ func TestCreate(t *testing.T) {
}) })
requireAPIError(t, response, err, apierrors.IsInvalid, requireAPIError(t, response, err, apierrors.IsInvalid,
`.placeholder.suzerain-io.github.io "request name" is invalid: dryRun: Unsupported value: []string{"some dry run flag"}`) `.pinniped.dev "request name" is invalid: dryRun: Unsupported value: []string{"some dry run flag"}`)
requireOneLogStatement(r, logger, `"failure" failureType:request validation,msg:dryRun not supported`) requireOneLogStatement(r, logger, `"failure" failureType:request validation,msg:dryRun not supported`)
}) })
@ -431,7 +431,7 @@ func requireOneLogStatement(r *require.Assertions, logger *testutil.TranscriptLo
r.Contains(transcript[0].Message, messageContains) r.Contains(transcript[0].Message, messageContains)
} }
func callCreate(ctx context.Context, storage *REST, credentialRequest *placeholderapi.CredentialRequest) (runtime.Object, error) { func callCreate(ctx context.Context, storage *REST, credentialRequest *pinnipedapi.CredentialRequest) (runtime.Object, error) {
return storage.Create( return storage.Create(
ctx, ctx,
credentialRequest, credentialRequest,
@ -441,19 +441,19 @@ func callCreate(ctx context.Context, storage *REST, credentialRequest *placehold
}) })
} }
func validCredentialRequest() *placeholderapi.CredentialRequest { func validCredentialRequest() *pinnipedapi.CredentialRequest {
return validCredentialRequestWithToken("some token") return validCredentialRequestWithToken("some token")
} }
func validCredentialRequestWithToken(token string) *placeholderapi.CredentialRequest { func validCredentialRequestWithToken(token string) *pinnipedapi.CredentialRequest {
return credentialRequest(placeholderapi.CredentialRequestSpec{ return credentialRequest(pinnipedapi.CredentialRequestSpec{
Type: placeholderapi.TokenCredentialType, Type: pinnipedapi.TokenCredentialType,
Token: &placeholderapi.CredentialRequestTokenCredential{Value: token}, Token: &pinnipedapi.CredentialRequestTokenCredential{Value: token},
}) })
} }
func credentialRequest(spec placeholderapi.CredentialRequestSpec) *placeholderapi.CredentialRequest { func credentialRequest(spec pinnipedapi.CredentialRequestSpec) *pinnipedapi.CredentialRequest {
return &placeholderapi.CredentialRequest{ return &pinnipedapi.CredentialRequest{
TypeMeta: metav1.TypeMeta{}, TypeMeta: metav1.TypeMeta{},
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "request name", Name: "request name",
@ -483,8 +483,8 @@ func requireAPIError(t *testing.T, response runtime.Object, err error, expectedE
func requireSuccessfulResponseWithAuthenticationFailureMessage(t *testing.T, err error, response runtime.Object) { func requireSuccessfulResponseWithAuthenticationFailureMessage(t *testing.T, err error, response runtime.Object) {
t.Helper() t.Helper()
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, response, &placeholderapi.CredentialRequest{ require.Equal(t, response, &pinnipedapi.CredentialRequest{
Status: placeholderapi.CredentialRequestStatus{ Status: pinnipedapi.CredentialRequestStatus{
Credential: nil, Credential: nil,
Message: stringPtr("authentication failed"), Message: stringPtr("authentication failed"),
}, },

View File

@ -3,7 +3,7 @@ Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0 SPDX-License-Identifier: Apache-2.0
*/ */
// Package server is the command line entry point for placeholder-name-server. // Package server is the command line entry point for pinniped-server.
package server package server
import ( import (
@ -21,15 +21,15 @@ import (
"k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes"
restclient "k8s.io/client-go/rest" restclient "k8s.io/client-go/rest"
"github.com/suzerain-io/placeholder-name/internal/apiserver" "github.com/suzerain-io/pinniped/internal/apiserver"
"github.com/suzerain-io/placeholder-name/internal/certauthority/kubecertauthority" "github.com/suzerain-io/pinniped/internal/certauthority/kubecertauthority"
"github.com/suzerain-io/placeholder-name/internal/constable" "github.com/suzerain-io/pinniped/internal/constable"
"github.com/suzerain-io/placeholder-name/internal/controllermanager" "github.com/suzerain-io/pinniped/internal/controllermanager"
"github.com/suzerain-io/placeholder-name/internal/downward" "github.com/suzerain-io/pinniped/internal/downward"
"github.com/suzerain-io/placeholder-name/internal/provider" "github.com/suzerain-io/pinniped/internal/provider"
"github.com/suzerain-io/placeholder-name/internal/registry/credentialrequest" "github.com/suzerain-io/pinniped/internal/registry/credentialrequest"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1" pinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
"github.com/suzerain-io/placeholder-name/pkg/config" "github.com/suzerain-io/pinniped/pkg/config"
) )
type percentageValue struct { type percentageValue struct {
@ -57,7 +57,7 @@ func (p *percentageValue) Type() string {
return "percentage" return "percentage"
} }
// App is an object that represents the placeholder-name-server application. // App is an object that represents the pinniped-server application.
type App struct { type App struct {
cmd *cobra.Command cmd *cobra.Command
@ -69,7 +69,7 @@ type App struct {
// This is ignored for now because we turn off etcd storage below, but this is // This is ignored for now because we turn off etcd storage below, but this is
// the right prefix in case we turn it back on. // the right prefix in case we turn it back on.
const defaultEtcdPathPrefix = "/registry/" + placeholderv1alpha1.GroupName const defaultEtcdPathPrefix = "/registry/" + pinnipedv1alpha1.GroupName
// New constructs a new App with command line args, stdout and stderr. // New constructs a new App with command line args, stdout and stderr.
func New(ctx context.Context, args []string, stdout, stderr io.Writer) *App { func New(ctx context.Context, args []string, stdout, stderr io.Writer) *App {
@ -86,8 +86,8 @@ func (a *App) Run() error {
// Create the server command and save it into the App. // Create the server command and save it into the App.
func (a *App) addServerCommand(ctx context.Context, args []string, stdout, stderr io.Writer) { func (a *App) addServerCommand(ctx context.Context, args []string, stdout, stderr io.Writer) {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: `placeholder-name-server`, Use: `pinniped-server`,
Long: "placeholder-name-server provides a generic API for mapping an external\n" + Long: "pinniped-server provides a generic API for mapping an external\n" +
"credential from somewhere to an internal credential to be used for\n" + "credential from somewhere to an internal credential to be used for\n" +
"authenticating to the Kubernetes API.", "authenticating to the Kubernetes API.",
RunE: func(cmd *cobra.Command, args []string) error { return a.runServer(ctx) }, RunE: func(cmd *cobra.Command, args []string) error { return a.runServer(ctx) },
@ -108,7 +108,7 @@ func addCommandlineFlagsToCommand(cmd *cobra.Command, app *App) {
&app.configPath, &app.configPath,
"config", "config",
"c", "c",
"placeholder-name.yaml", "pinniped.yaml",
"path to configuration file", "path to configuration file",
) )
@ -166,7 +166,7 @@ func (a *App) runServer(ctx context.Context) error {
// post start hook of the aggregated API server. // post start hook of the aggregated API server.
startControllersFunc, err := controllermanager.PrepareControllers( startControllersFunc, err := controllermanager.PrepareControllers(
serverInstallationNamespace, serverInstallationNamespace,
cfg.DiscoveryConfig.URL, cfg.DiscoveryInfo.URL,
dynamicCertProvider, dynamicCertProvider,
a.servingCertRotationThreshold.percentage, a.servingCertRotationThreshold.percentage,
) )
@ -233,7 +233,7 @@ func getAggregatedAPIServerConfig(
) (*apiserver.Config, error) { ) (*apiserver.Config, error) {
recommendedOptions := genericoptions.NewRecommendedOptions( recommendedOptions := genericoptions.NewRecommendedOptions(
defaultEtcdPathPrefix, defaultEtcdPathPrefix,
apiserver.Codecs.LegacyCodec(placeholderv1alpha1.SchemeGroupVersion), apiserver.Codecs.LegacyCodec(pinnipedv1alpha1.SchemeGroupVersion),
// TODO we should check to see if all the other default settings are acceptable for us // TODO we should check to see if all the other default settings are acceptable for us
) )
recommendedOptions.Etcd = nil // turn off etcd storage because we don't need it yet recommendedOptions.Etcd = nil // turn off etcd storage because we don't need it yet

View File

@ -17,17 +17,17 @@ import (
) )
const knownGoodUsage = ` const knownGoodUsage = `
placeholder-name-server provides a generic API for mapping an external pinniped-server provides a generic API for mapping an external
credential from somewhere to an internal credential to be used for credential from somewhere to an internal credential to be used for
authenticating to the Kubernetes API. authenticating to the Kubernetes API.
Usage: Usage:
placeholder-name-server [flags] pinniped-server [flags]
Flags: Flags:
-c, --config string path to configuration file (default "placeholder-name.yaml") -c, --config string path to configuration file (default "pinniped.yaml")
--downward-api-path string path to Downward API volume mount (default "/etc/podinfo") --downward-api-path string path to Downward API volume mount (default "/etc/podinfo")
-h, --help help for placeholder-name-server -h, --help help for pinniped-server
--log-flush-frequency duration Maximum number of seconds between log flushes (default 5s) --log-flush-frequency duration Maximum number of seconds between log flushes (default 5s)
--serving-cert-rotation-threshold percentage real number between 0 and 1 indicating percentage of lifetime before rotation of serving cert (default 70.00%) --serving-cert-rotation-threshold percentage real number between 0 and 1 indicating percentage of lifetime before rotation of serving cert (default 70.00%)
` `
@ -51,7 +51,7 @@ func TestCommand(t *testing.T) {
{ {
name: "OneArgFails", name: "OneArgFails",
args: []string{"tuna"}, args: []string{"tuna"},
wantErr: `unknown command "tuna" for "placeholder-name-server"`, wantErr: `unknown command "tuna" for "pinniped-server"`,
}, },
{ {
name: "ShortConfigFlagSucceeds", name: "ShortConfigFlagSucceeds",
@ -67,7 +67,7 @@ func TestCommand(t *testing.T) {
"--config", "some/path/to/config.yaml", "--config", "some/path/to/config.yaml",
"tuna", "tuna",
}, },
wantErr: `unknown command "tuna" for "placeholder-name-server"`, wantErr: `unknown command "tuna" for "pinniped-server"`,
}, },
{ {
name: "PercentageIsNotRealNumber", name: "PercentageIsNotRealNumber",

View File

@ -0,0 +1,10 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// +k8s:deepcopy-gen=package
// +groupName=crd.pinniped.dev
// Package pinniped is the internal version of the API.
package crdpinniped

View File

@ -4,14 +4,14 @@ SPDX-License-Identifier: Apache-2.0
*/ */
//nolint:gochecknoglobals //nolint:gochecknoglobals
package crdsplaceholder package crdpinniped
import ( import (
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
) )
const GroupName = "crds.placeholder.suzerain-io.github.io" const GroupName = "crd.pinniped.dev"
// SchemeGroupVersion is group version used to register these objects. // SchemeGroupVersion is group version used to register these objects.
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}

View File

@ -3,4 +3,4 @@ Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0 SPDX-License-Identifier: Apache-2.0
*/ */
package crdsplaceholder package crdpinniped

View File

@ -5,9 +5,9 @@ SPDX-License-Identifier: Apache-2.0
// +k8s:openapi-gen=true // +k8s:openapi-gen=true
// +k8s:deepcopy-gen=package // +k8s:deepcopy-gen=package
// +k8s:conversion-gen=github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder // +k8s:conversion-gen=github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped
// +k8s:defaulter-gen=TypeMeta // +k8s:defaulter-gen=TypeMeta
// +groupName=placeholder.suzerain-io.github.io // +groupName=crd.pinniped.dev
// Package v1alpha1 is the v1alpha1 version of the API. // Package v1alpha1 is the v1alpha1 version of the API.
package v1alpha1 package v1alpha1

View File

@ -12,7 +12,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
) )
const GroupName = "crds.placeholder.suzerain-io.github.io" const GroupName = "crd.pinniped.dev"
// SchemeGroupVersion is group version used to register these objects. // SchemeGroupVersion is group version used to register these objects.
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
@ -33,8 +33,8 @@ func init() {
// Adds the list of known types to the given scheme. // Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error { func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion, scheme.AddKnownTypes(SchemeGroupVersion,
&LoginDiscoveryConfig{}, &PinnipedDiscoveryInfo{},
&LoginDiscoveryConfigList{}, &PinnipedDiscoveryInfoList{},
) )
metav1.AddToGroupVersion(scheme, SchemeGroupVersion) metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil return nil

View File

@ -7,7 +7,7 @@ package v1alpha1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
type LoginDiscoveryConfigSpec struct { type PinnipedDiscoveryInfoSpec struct {
// The K8s API server URL. Required. // The K8s API server URL. Required.
Server string `json:"server,omitempty"` Server string `json:"server,omitempty"`
@ -18,18 +18,18 @@ type LoginDiscoveryConfigSpec struct {
// +genclient // +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type LoginDiscoveryConfig struct { type PinnipedDiscoveryInfo struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"` metav1.ObjectMeta `json:"metadata,omitempty"`
Spec LoginDiscoveryConfigSpec `json:"spec"` Spec PinnipedDiscoveryInfoSpec `json:"spec"`
} }
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type LoginDiscoveryConfigList struct { type PinnipedDiscoveryInfoList struct {
metav1.TypeMeta `json:",inline"` metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"` metav1.ListMeta `json:"metadata,omitempty"`
Items []LoginDiscoveryConfig `json:"items"` Items []PinnipedDiscoveryInfo `json:"items"`
} }

View File

@ -14,7 +14,7 @@ import (
) )
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoginDiscoveryConfig) DeepCopyInto(out *LoginDiscoveryConfig) { func (in *PinnipedDiscoveryInfo) DeepCopyInto(out *PinnipedDiscoveryInfo) {
*out = *in *out = *in
out.TypeMeta = in.TypeMeta out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
@ -22,18 +22,18 @@ func (in *LoginDiscoveryConfig) DeepCopyInto(out *LoginDiscoveryConfig) {
return return
} }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoginDiscoveryConfig. // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PinnipedDiscoveryInfo.
func (in *LoginDiscoveryConfig) DeepCopy() *LoginDiscoveryConfig { func (in *PinnipedDiscoveryInfo) DeepCopy() *PinnipedDiscoveryInfo {
if in == nil { if in == nil {
return nil return nil
} }
out := new(LoginDiscoveryConfig) out := new(PinnipedDiscoveryInfo)
in.DeepCopyInto(out) in.DeepCopyInto(out)
return out return out
} }
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *LoginDiscoveryConfig) DeepCopyObject() runtime.Object { func (in *PinnipedDiscoveryInfo) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil { if c := in.DeepCopy(); c != nil {
return c return c
} }
@ -41,13 +41,13 @@ func (in *LoginDiscoveryConfig) DeepCopyObject() runtime.Object {
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoginDiscoveryConfigList) DeepCopyInto(out *LoginDiscoveryConfigList) { func (in *PinnipedDiscoveryInfoList) DeepCopyInto(out *PinnipedDiscoveryInfoList) {
*out = *in *out = *in
out.TypeMeta = in.TypeMeta out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta) in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil { if in.Items != nil {
in, out := &in.Items, &out.Items in, out := &in.Items, &out.Items
*out = make([]LoginDiscoveryConfig, len(*in)) *out = make([]PinnipedDiscoveryInfo, len(*in))
for i := range *in { for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i]) (*in)[i].DeepCopyInto(&(*out)[i])
} }
@ -55,18 +55,18 @@ func (in *LoginDiscoveryConfigList) DeepCopyInto(out *LoginDiscoveryConfigList)
return return
} }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoginDiscoveryConfigList. // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PinnipedDiscoveryInfoList.
func (in *LoginDiscoveryConfigList) DeepCopy() *LoginDiscoveryConfigList { func (in *PinnipedDiscoveryInfoList) DeepCopy() *PinnipedDiscoveryInfoList {
if in == nil { if in == nil {
return nil return nil
} }
out := new(LoginDiscoveryConfigList) out := new(PinnipedDiscoveryInfoList)
in.DeepCopyInto(out) in.DeepCopyInto(out)
return out return out
} }
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *LoginDiscoveryConfigList) DeepCopyObject() runtime.Object { func (in *PinnipedDiscoveryInfoList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil { if c := in.DeepCopy(); c != nil {
return c return c
} }
@ -74,17 +74,17 @@ func (in *LoginDiscoveryConfigList) DeepCopyObject() runtime.Object {
} }
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoginDiscoveryConfigSpec) DeepCopyInto(out *LoginDiscoveryConfigSpec) { func (in *PinnipedDiscoveryInfoSpec) DeepCopyInto(out *PinnipedDiscoveryInfoSpec) {
*out = *in *out = *in
return return
} }
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoginDiscoveryConfigSpec. // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PinnipedDiscoveryInfoSpec.
func (in *LoginDiscoveryConfigSpec) DeepCopy() *LoginDiscoveryConfigSpec { func (in *PinnipedDiscoveryInfoSpec) DeepCopy() *PinnipedDiscoveryInfoSpec {
if in == nil { if in == nil {
return nil return nil
} }
out := new(LoginDiscoveryConfigSpec) out := new(PinnipedDiscoveryInfoSpec)
in.DeepCopyInto(out) in.DeepCopyInto(out)
return out return out
} }

View File

@ -7,4 +7,4 @@ SPDX-License-Identifier: Apache-2.0
// Code generated by deepcopy-gen. DO NOT EDIT. // Code generated by deepcopy-gen. DO NOT EDIT.
package crdsplaceholder package crdpinniped

View File

@ -1,10 +0,0 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// +k8s:deepcopy-gen=package
// +groupName=crds.placeholder.suzerain-io.github.io
// Package placeholder is the internal version of the API.
package crdsplaceholder

View File

@ -0,0 +1,10 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// +k8s:deepcopy-gen=package
// +groupName=pinniped.dev
// Package pinniped is the internal version of the API.
package pinniped

View File

@ -9,13 +9,13 @@ import (
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder" "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped"
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1" "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
) )
// Install registers the API group and adds types to a scheme. // Install registers the API group and adds types to a scheme.
func Install(scheme *runtime.Scheme) { func Install(scheme *runtime.Scheme) {
utilruntime.Must(placeholder.AddToScheme(scheme)) utilruntime.Must(pinniped.AddToScheme(scheme))
utilruntime.Must(v1alpha1.AddToScheme(scheme)) utilruntime.Must(v1alpha1.AddToScheme(scheme))
utilruntime.Must(scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion)) utilruntime.Must(scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion))
} }

View File

@ -4,14 +4,14 @@ SPDX-License-Identifier: Apache-2.0
*/ */
//nolint:gochecknoglobals //nolint:gochecknoglobals
package placeholder package pinniped
import ( import (
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
) )
const GroupName = "placeholder.suzerain-io.github.io" const GroupName = "pinniped.dev"
// SchemeGroupVersion is group version used to register these objects. // SchemeGroupVersion is group version used to register these objects.
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}

View File

@ -3,7 +3,7 @@ Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0 SPDX-License-Identifier: Apache-2.0
*/ */
package placeholder package pinniped
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

View File

@ -5,9 +5,9 @@ SPDX-License-Identifier: Apache-2.0
// +k8s:openapi-gen=true // +k8s:openapi-gen=true
// +k8s:deepcopy-gen=package // +k8s:deepcopy-gen=package
// +k8s:conversion-gen=github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder // +k8s:conversion-gen=github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped
// +k8s:defaulter-gen=TypeMeta // +k8s:defaulter-gen=TypeMeta
// +groupName=crds.placeholder.suzerain-io.github.io // +groupName=pinniped.dev
// Package v1alpha1 is the v1alpha1 version of the API. // Package v1alpha1 is the v1alpha1 version of the API.
package v1alpha1 package v1alpha1

View File

@ -12,7 +12,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/schema"
) )
const GroupName = "placeholder.suzerain-io.github.io" const GroupName = "pinniped.dev"
// SchemeGroupVersion is group version used to register these objects. // SchemeGroupVersion is group version used to register these objects.
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

View File

@ -0,0 +1,233 @@
// +build !ignore_autogenerated
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by conversion-gen. DO NOT EDIT.
package v1alpha1
import (
unsafe "unsafe"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
pinniped "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped"
)
func init() {
localSchemeBuilder.Register(RegisterConversions)
}
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(s *runtime.Scheme) error {
if err := s.AddGeneratedConversionFunc((*CredentialRequest)(nil), (*pinniped.CredentialRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_CredentialRequest_To_pinniped_CredentialRequest(a.(*CredentialRequest), b.(*pinniped.CredentialRequest), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*pinniped.CredentialRequest)(nil), (*CredentialRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_pinniped_CredentialRequest_To_v1alpha1_CredentialRequest(a.(*pinniped.CredentialRequest), b.(*CredentialRequest), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*CredentialRequestCredential)(nil), (*pinniped.CredentialRequestCredential)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_CredentialRequestCredential_To_pinniped_CredentialRequestCredential(a.(*CredentialRequestCredential), b.(*pinniped.CredentialRequestCredential), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*pinniped.CredentialRequestCredential)(nil), (*CredentialRequestCredential)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_pinniped_CredentialRequestCredential_To_v1alpha1_CredentialRequestCredential(a.(*pinniped.CredentialRequestCredential), b.(*CredentialRequestCredential), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*CredentialRequestList)(nil), (*pinniped.CredentialRequestList)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_CredentialRequestList_To_pinniped_CredentialRequestList(a.(*CredentialRequestList), b.(*pinniped.CredentialRequestList), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*pinniped.CredentialRequestList)(nil), (*CredentialRequestList)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_pinniped_CredentialRequestList_To_v1alpha1_CredentialRequestList(a.(*pinniped.CredentialRequestList), b.(*CredentialRequestList), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*CredentialRequestSpec)(nil), (*pinniped.CredentialRequestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_CredentialRequestSpec_To_pinniped_CredentialRequestSpec(a.(*CredentialRequestSpec), b.(*pinniped.CredentialRequestSpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*pinniped.CredentialRequestSpec)(nil), (*CredentialRequestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_pinniped_CredentialRequestSpec_To_v1alpha1_CredentialRequestSpec(a.(*pinniped.CredentialRequestSpec), b.(*CredentialRequestSpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*CredentialRequestStatus)(nil), (*pinniped.CredentialRequestStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_CredentialRequestStatus_To_pinniped_CredentialRequestStatus(a.(*CredentialRequestStatus), b.(*pinniped.CredentialRequestStatus), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*pinniped.CredentialRequestStatus)(nil), (*CredentialRequestStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_pinniped_CredentialRequestStatus_To_v1alpha1_CredentialRequestStatus(a.(*pinniped.CredentialRequestStatus), b.(*CredentialRequestStatus), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*CredentialRequestTokenCredential)(nil), (*pinniped.CredentialRequestTokenCredential)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_CredentialRequestTokenCredential_To_pinniped_CredentialRequestTokenCredential(a.(*CredentialRequestTokenCredential), b.(*pinniped.CredentialRequestTokenCredential), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*pinniped.CredentialRequestTokenCredential)(nil), (*CredentialRequestTokenCredential)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_pinniped_CredentialRequestTokenCredential_To_v1alpha1_CredentialRequestTokenCredential(a.(*pinniped.CredentialRequestTokenCredential), b.(*CredentialRequestTokenCredential), scope)
}); err != nil {
return err
}
return nil
}
func autoConvert_v1alpha1_CredentialRequest_To_pinniped_CredentialRequest(in *CredentialRequest, out *pinniped.CredentialRequest, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1alpha1_CredentialRequestSpec_To_pinniped_CredentialRequestSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_v1alpha1_CredentialRequestStatus_To_pinniped_CredentialRequestStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
// Convert_v1alpha1_CredentialRequest_To_pinniped_CredentialRequest is an autogenerated conversion function.
func Convert_v1alpha1_CredentialRequest_To_pinniped_CredentialRequest(in *CredentialRequest, out *pinniped.CredentialRequest, s conversion.Scope) error {
return autoConvert_v1alpha1_CredentialRequest_To_pinniped_CredentialRequest(in, out, s)
}
func autoConvert_pinniped_CredentialRequest_To_v1alpha1_CredentialRequest(in *pinniped.CredentialRequest, out *CredentialRequest, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_pinniped_CredentialRequestSpec_To_v1alpha1_CredentialRequestSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_pinniped_CredentialRequestStatus_To_v1alpha1_CredentialRequestStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
// Convert_pinniped_CredentialRequest_To_v1alpha1_CredentialRequest is an autogenerated conversion function.
func Convert_pinniped_CredentialRequest_To_v1alpha1_CredentialRequest(in *pinniped.CredentialRequest, out *CredentialRequest, s conversion.Scope) error {
return autoConvert_pinniped_CredentialRequest_To_v1alpha1_CredentialRequest(in, out, s)
}
func autoConvert_v1alpha1_CredentialRequestCredential_To_pinniped_CredentialRequestCredential(in *CredentialRequestCredential, out *pinniped.CredentialRequestCredential, s conversion.Scope) error {
out.ExpirationTimestamp = in.ExpirationTimestamp
out.Token = in.Token
out.ClientCertificateData = in.ClientCertificateData
out.ClientKeyData = in.ClientKeyData
return nil
}
// Convert_v1alpha1_CredentialRequestCredential_To_pinniped_CredentialRequestCredential is an autogenerated conversion function.
func Convert_v1alpha1_CredentialRequestCredential_To_pinniped_CredentialRequestCredential(in *CredentialRequestCredential, out *pinniped.CredentialRequestCredential, s conversion.Scope) error {
return autoConvert_v1alpha1_CredentialRequestCredential_To_pinniped_CredentialRequestCredential(in, out, s)
}
func autoConvert_pinniped_CredentialRequestCredential_To_v1alpha1_CredentialRequestCredential(in *pinniped.CredentialRequestCredential, out *CredentialRequestCredential, s conversion.Scope) error {
out.ExpirationTimestamp = in.ExpirationTimestamp
out.Token = in.Token
out.ClientCertificateData = in.ClientCertificateData
out.ClientKeyData = in.ClientKeyData
return nil
}
// Convert_pinniped_CredentialRequestCredential_To_v1alpha1_CredentialRequestCredential is an autogenerated conversion function.
func Convert_pinniped_CredentialRequestCredential_To_v1alpha1_CredentialRequestCredential(in *pinniped.CredentialRequestCredential, out *CredentialRequestCredential, s conversion.Scope) error {
return autoConvert_pinniped_CredentialRequestCredential_To_v1alpha1_CredentialRequestCredential(in, out, s)
}
func autoConvert_v1alpha1_CredentialRequestList_To_pinniped_CredentialRequestList(in *CredentialRequestList, out *pinniped.CredentialRequestList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
out.Items = *(*[]pinniped.CredentialRequest)(unsafe.Pointer(&in.Items))
return nil
}
// Convert_v1alpha1_CredentialRequestList_To_pinniped_CredentialRequestList is an autogenerated conversion function.
func Convert_v1alpha1_CredentialRequestList_To_pinniped_CredentialRequestList(in *CredentialRequestList, out *pinniped.CredentialRequestList, s conversion.Scope) error {
return autoConvert_v1alpha1_CredentialRequestList_To_pinniped_CredentialRequestList(in, out, s)
}
func autoConvert_pinniped_CredentialRequestList_To_v1alpha1_CredentialRequestList(in *pinniped.CredentialRequestList, out *CredentialRequestList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
out.Items = *(*[]CredentialRequest)(unsafe.Pointer(&in.Items))
return nil
}
// Convert_pinniped_CredentialRequestList_To_v1alpha1_CredentialRequestList is an autogenerated conversion function.
func Convert_pinniped_CredentialRequestList_To_v1alpha1_CredentialRequestList(in *pinniped.CredentialRequestList, out *CredentialRequestList, s conversion.Scope) error {
return autoConvert_pinniped_CredentialRequestList_To_v1alpha1_CredentialRequestList(in, out, s)
}
func autoConvert_v1alpha1_CredentialRequestSpec_To_pinniped_CredentialRequestSpec(in *CredentialRequestSpec, out *pinniped.CredentialRequestSpec, s conversion.Scope) error {
out.Type = pinniped.CredentialType(in.Type)
out.Token = (*pinniped.CredentialRequestTokenCredential)(unsafe.Pointer(in.Token))
return nil
}
// Convert_v1alpha1_CredentialRequestSpec_To_pinniped_CredentialRequestSpec is an autogenerated conversion function.
func Convert_v1alpha1_CredentialRequestSpec_To_pinniped_CredentialRequestSpec(in *CredentialRequestSpec, out *pinniped.CredentialRequestSpec, s conversion.Scope) error {
return autoConvert_v1alpha1_CredentialRequestSpec_To_pinniped_CredentialRequestSpec(in, out, s)
}
func autoConvert_pinniped_CredentialRequestSpec_To_v1alpha1_CredentialRequestSpec(in *pinniped.CredentialRequestSpec, out *CredentialRequestSpec, s conversion.Scope) error {
out.Type = CredentialType(in.Type)
out.Token = (*CredentialRequestTokenCredential)(unsafe.Pointer(in.Token))
return nil
}
// Convert_pinniped_CredentialRequestSpec_To_v1alpha1_CredentialRequestSpec is an autogenerated conversion function.
func Convert_pinniped_CredentialRequestSpec_To_v1alpha1_CredentialRequestSpec(in *pinniped.CredentialRequestSpec, out *CredentialRequestSpec, s conversion.Scope) error {
return autoConvert_pinniped_CredentialRequestSpec_To_v1alpha1_CredentialRequestSpec(in, out, s)
}
func autoConvert_v1alpha1_CredentialRequestStatus_To_pinniped_CredentialRequestStatus(in *CredentialRequestStatus, out *pinniped.CredentialRequestStatus, s conversion.Scope) error {
out.Credential = (*pinniped.CredentialRequestCredential)(unsafe.Pointer(in.Credential))
out.Message = (*string)(unsafe.Pointer(in.Message))
return nil
}
// Convert_v1alpha1_CredentialRequestStatus_To_pinniped_CredentialRequestStatus is an autogenerated conversion function.
func Convert_v1alpha1_CredentialRequestStatus_To_pinniped_CredentialRequestStatus(in *CredentialRequestStatus, out *pinniped.CredentialRequestStatus, s conversion.Scope) error {
return autoConvert_v1alpha1_CredentialRequestStatus_To_pinniped_CredentialRequestStatus(in, out, s)
}
func autoConvert_pinniped_CredentialRequestStatus_To_v1alpha1_CredentialRequestStatus(in *pinniped.CredentialRequestStatus, out *CredentialRequestStatus, s conversion.Scope) error {
out.Credential = (*CredentialRequestCredential)(unsafe.Pointer(in.Credential))
out.Message = (*string)(unsafe.Pointer(in.Message))
return nil
}
// Convert_pinniped_CredentialRequestStatus_To_v1alpha1_CredentialRequestStatus is an autogenerated conversion function.
func Convert_pinniped_CredentialRequestStatus_To_v1alpha1_CredentialRequestStatus(in *pinniped.CredentialRequestStatus, out *CredentialRequestStatus, s conversion.Scope) error {
return autoConvert_pinniped_CredentialRequestStatus_To_v1alpha1_CredentialRequestStatus(in, out, s)
}
func autoConvert_v1alpha1_CredentialRequestTokenCredential_To_pinniped_CredentialRequestTokenCredential(in *CredentialRequestTokenCredential, out *pinniped.CredentialRequestTokenCredential, s conversion.Scope) error {
out.Value = in.Value
return nil
}
// Convert_v1alpha1_CredentialRequestTokenCredential_To_pinniped_CredentialRequestTokenCredential is an autogenerated conversion function.
func Convert_v1alpha1_CredentialRequestTokenCredential_To_pinniped_CredentialRequestTokenCredential(in *CredentialRequestTokenCredential, out *pinniped.CredentialRequestTokenCredential, s conversion.Scope) error {
return autoConvert_v1alpha1_CredentialRequestTokenCredential_To_pinniped_CredentialRequestTokenCredential(in, out, s)
}
func autoConvert_pinniped_CredentialRequestTokenCredential_To_v1alpha1_CredentialRequestTokenCredential(in *pinniped.CredentialRequestTokenCredential, out *CredentialRequestTokenCredential, s conversion.Scope) error {
out.Value = in.Value
return nil
}
// Convert_pinniped_CredentialRequestTokenCredential_To_v1alpha1_CredentialRequestTokenCredential is an autogenerated conversion function.
func Convert_pinniped_CredentialRequestTokenCredential_To_v1alpha1_CredentialRequestTokenCredential(in *pinniped.CredentialRequestTokenCredential, out *CredentialRequestTokenCredential, s conversion.Scope) error {
return autoConvert_pinniped_CredentialRequestTokenCredential_To_v1alpha1_CredentialRequestTokenCredential(in, out, s)
}

View File

@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0
// Code generated by deepcopy-gen. DO NOT EDIT. // Code generated by deepcopy-gen. DO NOT EDIT.
package placeholder package pinniped
import ( import (
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"

View File

@ -1,10 +0,0 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// +k8s:deepcopy-gen=package
// +groupName=placeholder.suzerain-io.github.io
// Package placeholder is the internal version of the API.
package placeholder

View File

@ -1,232 +0,0 @@
// +build !ignore_autogenerated
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by conversion-gen. DO NOT EDIT.
package v1alpha1
import (
unsafe "unsafe"
placeholder "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
)
func init() {
localSchemeBuilder.Register(RegisterConversions)
}
// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(s *runtime.Scheme) error {
if err := s.AddGeneratedConversionFunc((*CredentialRequest)(nil), (*placeholder.CredentialRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_CredentialRequest_To_placeholder_CredentialRequest(a.(*CredentialRequest), b.(*placeholder.CredentialRequest), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*placeholder.CredentialRequest)(nil), (*CredentialRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_placeholder_CredentialRequest_To_v1alpha1_CredentialRequest(a.(*placeholder.CredentialRequest), b.(*CredentialRequest), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*CredentialRequestCredential)(nil), (*placeholder.CredentialRequestCredential)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_CredentialRequestCredential_To_placeholder_CredentialRequestCredential(a.(*CredentialRequestCredential), b.(*placeholder.CredentialRequestCredential), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*placeholder.CredentialRequestCredential)(nil), (*CredentialRequestCredential)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_placeholder_CredentialRequestCredential_To_v1alpha1_CredentialRequestCredential(a.(*placeholder.CredentialRequestCredential), b.(*CredentialRequestCredential), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*CredentialRequestList)(nil), (*placeholder.CredentialRequestList)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_CredentialRequestList_To_placeholder_CredentialRequestList(a.(*CredentialRequestList), b.(*placeholder.CredentialRequestList), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*placeholder.CredentialRequestList)(nil), (*CredentialRequestList)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_placeholder_CredentialRequestList_To_v1alpha1_CredentialRequestList(a.(*placeholder.CredentialRequestList), b.(*CredentialRequestList), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*CredentialRequestSpec)(nil), (*placeholder.CredentialRequestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_CredentialRequestSpec_To_placeholder_CredentialRequestSpec(a.(*CredentialRequestSpec), b.(*placeholder.CredentialRequestSpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*placeholder.CredentialRequestSpec)(nil), (*CredentialRequestSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_placeholder_CredentialRequestSpec_To_v1alpha1_CredentialRequestSpec(a.(*placeholder.CredentialRequestSpec), b.(*CredentialRequestSpec), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*CredentialRequestStatus)(nil), (*placeholder.CredentialRequestStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_CredentialRequestStatus_To_placeholder_CredentialRequestStatus(a.(*CredentialRequestStatus), b.(*placeholder.CredentialRequestStatus), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*placeholder.CredentialRequestStatus)(nil), (*CredentialRequestStatus)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_placeholder_CredentialRequestStatus_To_v1alpha1_CredentialRequestStatus(a.(*placeholder.CredentialRequestStatus), b.(*CredentialRequestStatus), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*CredentialRequestTokenCredential)(nil), (*placeholder.CredentialRequestTokenCredential)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_v1alpha1_CredentialRequestTokenCredential_To_placeholder_CredentialRequestTokenCredential(a.(*CredentialRequestTokenCredential), b.(*placeholder.CredentialRequestTokenCredential), scope)
}); err != nil {
return err
}
if err := s.AddGeneratedConversionFunc((*placeholder.CredentialRequestTokenCredential)(nil), (*CredentialRequestTokenCredential)(nil), func(a, b interface{}, scope conversion.Scope) error {
return Convert_placeholder_CredentialRequestTokenCredential_To_v1alpha1_CredentialRequestTokenCredential(a.(*placeholder.CredentialRequestTokenCredential), b.(*CredentialRequestTokenCredential), scope)
}); err != nil {
return err
}
return nil
}
func autoConvert_v1alpha1_CredentialRequest_To_placeholder_CredentialRequest(in *CredentialRequest, out *placeholder.CredentialRequest, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_v1alpha1_CredentialRequestSpec_To_placeholder_CredentialRequestSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_v1alpha1_CredentialRequestStatus_To_placeholder_CredentialRequestStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
// Convert_v1alpha1_CredentialRequest_To_placeholder_CredentialRequest is an autogenerated conversion function.
func Convert_v1alpha1_CredentialRequest_To_placeholder_CredentialRequest(in *CredentialRequest, out *placeholder.CredentialRequest, s conversion.Scope) error {
return autoConvert_v1alpha1_CredentialRequest_To_placeholder_CredentialRequest(in, out, s)
}
func autoConvert_placeholder_CredentialRequest_To_v1alpha1_CredentialRequest(in *placeholder.CredentialRequest, out *CredentialRequest, s conversion.Scope) error {
out.ObjectMeta = in.ObjectMeta
if err := Convert_placeholder_CredentialRequestSpec_To_v1alpha1_CredentialRequestSpec(&in.Spec, &out.Spec, s); err != nil {
return err
}
if err := Convert_placeholder_CredentialRequestStatus_To_v1alpha1_CredentialRequestStatus(&in.Status, &out.Status, s); err != nil {
return err
}
return nil
}
// Convert_placeholder_CredentialRequest_To_v1alpha1_CredentialRequest is an autogenerated conversion function.
func Convert_placeholder_CredentialRequest_To_v1alpha1_CredentialRequest(in *placeholder.CredentialRequest, out *CredentialRequest, s conversion.Scope) error {
return autoConvert_placeholder_CredentialRequest_To_v1alpha1_CredentialRequest(in, out, s)
}
func autoConvert_v1alpha1_CredentialRequestCredential_To_placeholder_CredentialRequestCredential(in *CredentialRequestCredential, out *placeholder.CredentialRequestCredential, s conversion.Scope) error {
out.ExpirationTimestamp = in.ExpirationTimestamp
out.Token = in.Token
out.ClientCertificateData = in.ClientCertificateData
out.ClientKeyData = in.ClientKeyData
return nil
}
// Convert_v1alpha1_CredentialRequestCredential_To_placeholder_CredentialRequestCredential is an autogenerated conversion function.
func Convert_v1alpha1_CredentialRequestCredential_To_placeholder_CredentialRequestCredential(in *CredentialRequestCredential, out *placeholder.CredentialRequestCredential, s conversion.Scope) error {
return autoConvert_v1alpha1_CredentialRequestCredential_To_placeholder_CredentialRequestCredential(in, out, s)
}
func autoConvert_placeholder_CredentialRequestCredential_To_v1alpha1_CredentialRequestCredential(in *placeholder.CredentialRequestCredential, out *CredentialRequestCredential, s conversion.Scope) error {
out.ExpirationTimestamp = in.ExpirationTimestamp
out.Token = in.Token
out.ClientCertificateData = in.ClientCertificateData
out.ClientKeyData = in.ClientKeyData
return nil
}
// Convert_placeholder_CredentialRequestCredential_To_v1alpha1_CredentialRequestCredential is an autogenerated conversion function.
func Convert_placeholder_CredentialRequestCredential_To_v1alpha1_CredentialRequestCredential(in *placeholder.CredentialRequestCredential, out *CredentialRequestCredential, s conversion.Scope) error {
return autoConvert_placeholder_CredentialRequestCredential_To_v1alpha1_CredentialRequestCredential(in, out, s)
}
func autoConvert_v1alpha1_CredentialRequestList_To_placeholder_CredentialRequestList(in *CredentialRequestList, out *placeholder.CredentialRequestList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
out.Items = *(*[]placeholder.CredentialRequest)(unsafe.Pointer(&in.Items))
return nil
}
// Convert_v1alpha1_CredentialRequestList_To_placeholder_CredentialRequestList is an autogenerated conversion function.
func Convert_v1alpha1_CredentialRequestList_To_placeholder_CredentialRequestList(in *CredentialRequestList, out *placeholder.CredentialRequestList, s conversion.Scope) error {
return autoConvert_v1alpha1_CredentialRequestList_To_placeholder_CredentialRequestList(in, out, s)
}
func autoConvert_placeholder_CredentialRequestList_To_v1alpha1_CredentialRequestList(in *placeholder.CredentialRequestList, out *CredentialRequestList, s conversion.Scope) error {
out.ListMeta = in.ListMeta
out.Items = *(*[]CredentialRequest)(unsafe.Pointer(&in.Items))
return nil
}
// Convert_placeholder_CredentialRequestList_To_v1alpha1_CredentialRequestList is an autogenerated conversion function.
func Convert_placeholder_CredentialRequestList_To_v1alpha1_CredentialRequestList(in *placeholder.CredentialRequestList, out *CredentialRequestList, s conversion.Scope) error {
return autoConvert_placeholder_CredentialRequestList_To_v1alpha1_CredentialRequestList(in, out, s)
}
func autoConvert_v1alpha1_CredentialRequestSpec_To_placeholder_CredentialRequestSpec(in *CredentialRequestSpec, out *placeholder.CredentialRequestSpec, s conversion.Scope) error {
out.Type = placeholder.CredentialType(in.Type)
out.Token = (*placeholder.CredentialRequestTokenCredential)(unsafe.Pointer(in.Token))
return nil
}
// Convert_v1alpha1_CredentialRequestSpec_To_placeholder_CredentialRequestSpec is an autogenerated conversion function.
func Convert_v1alpha1_CredentialRequestSpec_To_placeholder_CredentialRequestSpec(in *CredentialRequestSpec, out *placeholder.CredentialRequestSpec, s conversion.Scope) error {
return autoConvert_v1alpha1_CredentialRequestSpec_To_placeholder_CredentialRequestSpec(in, out, s)
}
func autoConvert_placeholder_CredentialRequestSpec_To_v1alpha1_CredentialRequestSpec(in *placeholder.CredentialRequestSpec, out *CredentialRequestSpec, s conversion.Scope) error {
out.Type = CredentialType(in.Type)
out.Token = (*CredentialRequestTokenCredential)(unsafe.Pointer(in.Token))
return nil
}
// Convert_placeholder_CredentialRequestSpec_To_v1alpha1_CredentialRequestSpec is an autogenerated conversion function.
func Convert_placeholder_CredentialRequestSpec_To_v1alpha1_CredentialRequestSpec(in *placeholder.CredentialRequestSpec, out *CredentialRequestSpec, s conversion.Scope) error {
return autoConvert_placeholder_CredentialRequestSpec_To_v1alpha1_CredentialRequestSpec(in, out, s)
}
func autoConvert_v1alpha1_CredentialRequestStatus_To_placeholder_CredentialRequestStatus(in *CredentialRequestStatus, out *placeholder.CredentialRequestStatus, s conversion.Scope) error {
out.Credential = (*placeholder.CredentialRequestCredential)(unsafe.Pointer(in.Credential))
out.Message = (*string)(unsafe.Pointer(in.Message))
return nil
}
// Convert_v1alpha1_CredentialRequestStatus_To_placeholder_CredentialRequestStatus is an autogenerated conversion function.
func Convert_v1alpha1_CredentialRequestStatus_To_placeholder_CredentialRequestStatus(in *CredentialRequestStatus, out *placeholder.CredentialRequestStatus, s conversion.Scope) error {
return autoConvert_v1alpha1_CredentialRequestStatus_To_placeholder_CredentialRequestStatus(in, out, s)
}
func autoConvert_placeholder_CredentialRequestStatus_To_v1alpha1_CredentialRequestStatus(in *placeholder.CredentialRequestStatus, out *CredentialRequestStatus, s conversion.Scope) error {
out.Credential = (*CredentialRequestCredential)(unsafe.Pointer(in.Credential))
out.Message = (*string)(unsafe.Pointer(in.Message))
return nil
}
// Convert_placeholder_CredentialRequestStatus_To_v1alpha1_CredentialRequestStatus is an autogenerated conversion function.
func Convert_placeholder_CredentialRequestStatus_To_v1alpha1_CredentialRequestStatus(in *placeholder.CredentialRequestStatus, out *CredentialRequestStatus, s conversion.Scope) error {
return autoConvert_placeholder_CredentialRequestStatus_To_v1alpha1_CredentialRequestStatus(in, out, s)
}
func autoConvert_v1alpha1_CredentialRequestTokenCredential_To_placeholder_CredentialRequestTokenCredential(in *CredentialRequestTokenCredential, out *placeholder.CredentialRequestTokenCredential, s conversion.Scope) error {
out.Value = in.Value
return nil
}
// Convert_v1alpha1_CredentialRequestTokenCredential_To_placeholder_CredentialRequestTokenCredential is an autogenerated conversion function.
func Convert_v1alpha1_CredentialRequestTokenCredential_To_placeholder_CredentialRequestTokenCredential(in *CredentialRequestTokenCredential, out *placeholder.CredentialRequestTokenCredential, s conversion.Scope) error {
return autoConvert_v1alpha1_CredentialRequestTokenCredential_To_placeholder_CredentialRequestTokenCredential(in, out, s)
}
func autoConvert_placeholder_CredentialRequestTokenCredential_To_v1alpha1_CredentialRequestTokenCredential(in *placeholder.CredentialRequestTokenCredential, out *CredentialRequestTokenCredential, s conversion.Scope) error {
out.Value = in.Value
return nil
}
// Convert_placeholder_CredentialRequestTokenCredential_To_v1alpha1_CredentialRequestTokenCredential is an autogenerated conversion function.
func Convert_placeholder_CredentialRequestTokenCredential_To_v1alpha1_CredentialRequestTokenCredential(in *placeholder.CredentialRequestTokenCredential, out *CredentialRequestTokenCredential, s conversion.Scope) error {
return autoConvert_placeholder_CredentialRequestTokenCredential_To_v1alpha1_CredentialRequestTokenCredential(in, out, s)
}

View File

@ -19,15 +19,15 @@ import (
func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition {
return map[string]common.OpenAPIDefinition{ return map[string]common.OpenAPIDefinition{
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1.LoginDiscoveryConfig": schema_api_apis_crdsplaceholder_v1alpha1_LoginDiscoveryConfig(ref), "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1.PinnipedDiscoveryInfo": schema_api_apis_crdpinniped_v1alpha1_PinnipedDiscoveryInfo(ref),
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1.LoginDiscoveryConfigList": schema_api_apis_crdsplaceholder_v1alpha1_LoginDiscoveryConfigList(ref), "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1.PinnipedDiscoveryInfoList": schema_api_apis_crdpinniped_v1alpha1_PinnipedDiscoveryInfoList(ref),
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1.LoginDiscoveryConfigSpec": schema_api_apis_crdsplaceholder_v1alpha1_LoginDiscoveryConfigSpec(ref), "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1.PinnipedDiscoveryInfoSpec": schema_api_apis_crdpinniped_v1alpha1_PinnipedDiscoveryInfoSpec(ref),
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequest": schema_api_apis_placeholder_v1alpha1_CredentialRequest(ref), "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequest": schema_api_apis_pinniped_v1alpha1_CredentialRequest(ref),
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestCredential": schema_api_apis_placeholder_v1alpha1_CredentialRequestCredential(ref), "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestCredential": schema_api_apis_pinniped_v1alpha1_CredentialRequestCredential(ref),
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestList": schema_api_apis_placeholder_v1alpha1_CredentialRequestList(ref), "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestList": schema_api_apis_pinniped_v1alpha1_CredentialRequestList(ref),
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestSpec": schema_api_apis_placeholder_v1alpha1_CredentialRequestSpec(ref), "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestSpec": schema_api_apis_pinniped_v1alpha1_CredentialRequestSpec(ref),
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestStatus": schema_api_apis_placeholder_v1alpha1_CredentialRequestStatus(ref), "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestStatus": schema_api_apis_pinniped_v1alpha1_CredentialRequestStatus(ref),
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestTokenCredential": schema_api_apis_placeholder_v1alpha1_CredentialRequestTokenCredential(ref), "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestTokenCredential": schema_api_apis_pinniped_v1alpha1_CredentialRequestTokenCredential(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref),
@ -83,7 +83,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA
} }
} }
func schema_api_apis_crdsplaceholder_v1alpha1_LoginDiscoveryConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { func schema_api_apis_crdpinniped_v1alpha1_PinnipedDiscoveryInfo(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{ return common.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
@ -110,7 +110,7 @@ func schema_api_apis_crdsplaceholder_v1alpha1_LoginDiscoveryConfig(ref common.Re
}, },
"spec": { "spec": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Ref: ref("github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1.LoginDiscoveryConfigSpec"), Ref: ref("github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1.PinnipedDiscoveryInfoSpec"),
}, },
}, },
}, },
@ -118,11 +118,11 @@ func schema_api_apis_crdsplaceholder_v1alpha1_LoginDiscoveryConfig(ref common.Re
}, },
}, },
Dependencies: []string{ Dependencies: []string{
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1.LoginDiscoveryConfigSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1.PinnipedDiscoveryInfoSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
} }
} }
func schema_api_apis_crdsplaceholder_v1alpha1_LoginDiscoveryConfigList(ref common.ReferenceCallback) common.OpenAPIDefinition { func schema_api_apis_crdpinniped_v1alpha1_PinnipedDiscoveryInfoList(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{ return common.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
@ -153,7 +153,7 @@ func schema_api_apis_crdsplaceholder_v1alpha1_LoginDiscoveryConfigList(ref commo
Items: &spec.SchemaOrArray{ Items: &spec.SchemaOrArray{
Schema: &spec.Schema{ Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Ref: ref("github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1.LoginDiscoveryConfig"), Ref: ref("github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1.PinnipedDiscoveryInfo"),
}, },
}, },
}, },
@ -164,11 +164,11 @@ func schema_api_apis_crdsplaceholder_v1alpha1_LoginDiscoveryConfigList(ref commo
}, },
}, },
Dependencies: []string{ Dependencies: []string{
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1.LoginDiscoveryConfig", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1.PinnipedDiscoveryInfo", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
} }
} }
func schema_api_apis_crdsplaceholder_v1alpha1_LoginDiscoveryConfigSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { func schema_api_apis_crdpinniped_v1alpha1_PinnipedDiscoveryInfoSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{ return common.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
@ -194,7 +194,7 @@ func schema_api_apis_crdsplaceholder_v1alpha1_LoginDiscoveryConfigSpec(ref commo
} }
} }
func schema_api_apis_placeholder_v1alpha1_CredentialRequest(ref common.ReferenceCallback) common.OpenAPIDefinition { func schema_api_apis_pinniped_v1alpha1_CredentialRequest(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{ return common.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
@ -221,23 +221,23 @@ func schema_api_apis_placeholder_v1alpha1_CredentialRequest(ref common.Reference
}, },
"spec": { "spec": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Ref: ref("github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestSpec"), Ref: ref("github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestSpec"),
}, },
}, },
"status": { "status": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Ref: ref("github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestStatus"), Ref: ref("github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestStatus"),
}, },
}, },
}, },
}, },
}, },
Dependencies: []string{ Dependencies: []string{
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestSpec", "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestSpec", "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"},
} }
} }
func schema_api_apis_placeholder_v1alpha1_CredentialRequestCredential(ref common.ReferenceCallback) common.OpenAPIDefinition { func schema_api_apis_pinniped_v1alpha1_CredentialRequestCredential(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{ return common.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
@ -278,7 +278,7 @@ func schema_api_apis_placeholder_v1alpha1_CredentialRequestCredential(ref common
} }
} }
func schema_api_apis_placeholder_v1alpha1_CredentialRequestList(ref common.ReferenceCallback) common.OpenAPIDefinition { func schema_api_apis_pinniped_v1alpha1_CredentialRequestList(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{ return common.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
@ -310,7 +310,7 @@ func schema_api_apis_placeholder_v1alpha1_CredentialRequestList(ref common.Refer
Items: &spec.SchemaOrArray{ Items: &spec.SchemaOrArray{
Schema: &spec.Schema{ Schema: &spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Ref: ref("github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequest"), Ref: ref("github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequest"),
}, },
}, },
}, },
@ -321,11 +321,11 @@ func schema_api_apis_placeholder_v1alpha1_CredentialRequestList(ref common.Refer
}, },
}, },
Dependencies: []string{ Dependencies: []string{
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequest", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequest", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"},
} }
} }
func schema_api_apis_placeholder_v1alpha1_CredentialRequestSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { func schema_api_apis_pinniped_v1alpha1_CredentialRequestSpec(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{ return common.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
@ -341,18 +341,18 @@ func schema_api_apis_placeholder_v1alpha1_CredentialRequestSpec(ref common.Refer
"token": { "token": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Description: "Token credential (when Type == TokenCredentialType).", Description: "Token credential (when Type == TokenCredentialType).",
Ref: ref("github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestTokenCredential"), Ref: ref("github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestTokenCredential"),
}, },
}, },
}, },
}, },
}, },
Dependencies: []string{ Dependencies: []string{
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestTokenCredential"}, "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestTokenCredential"},
} }
} }
func schema_api_apis_placeholder_v1alpha1_CredentialRequestStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { func schema_api_apis_pinniped_v1alpha1_CredentialRequestStatus(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{ return common.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
@ -361,7 +361,7 @@ func schema_api_apis_placeholder_v1alpha1_CredentialRequestStatus(ref common.Ref
"credential": { "credential": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Description: "A Credential will be returned for a successful credential request.", Description: "A Credential will be returned for a successful credential request.",
Ref: ref("github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestCredential"), Ref: ref("github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestCredential"),
}, },
}, },
"message": { "message": {
@ -375,11 +375,11 @@ func schema_api_apis_placeholder_v1alpha1_CredentialRequestStatus(ref common.Ref
}, },
}, },
Dependencies: []string{ Dependencies: []string{
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestCredential"}, "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestCredential"},
} }
} }
func schema_api_apis_placeholder_v1alpha1_CredentialRequestTokenCredential(ref common.ReferenceCallback) common.OpenAPIDefinition { func schema_api_apis_pinniped_v1alpha1_CredentialRequestTokenCredential(ref common.ReferenceCallback) common.OpenAPIDefinition {
return common.OpenAPIDefinition{ return common.OpenAPIDefinition{
Schema: spec.Schema{ Schema: spec.Schema{
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{

View File

@ -1,4 +1,4 @@
module github.com/suzerain-io/placeholder-name/kubernetes/1.19/api module github.com/suzerain-io/pinniped/kubernetes/1.19/api
go 1.14 go 1.14

View File

@ -10,35 +10,36 @@ package versioned
import ( import (
"fmt" "fmt"
crdsv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/crdsplaceholder/v1alpha1"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/placeholder/v1alpha1"
discovery "k8s.io/client-go/discovery" discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol" flowcontrol "k8s.io/client-go/util/flowcontrol"
crdv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/typed/crdpinniped/v1alpha1"
pinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/typed/pinniped/v1alpha1"
) )
type Interface interface { type Interface interface {
Discovery() discovery.DiscoveryInterface Discovery() discovery.DiscoveryInterface
CrdsV1alpha1() crdsv1alpha1.CrdsV1alpha1Interface CrdV1alpha1() crdv1alpha1.CrdV1alpha1Interface
PlaceholderV1alpha1() placeholderv1alpha1.PlaceholderV1alpha1Interface PinnipedV1alpha1() pinnipedv1alpha1.PinnipedV1alpha1Interface
} }
// Clientset contains the clients for groups. Each group has exactly one // Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset. // version included in a Clientset.
type Clientset struct { type Clientset struct {
*discovery.DiscoveryClient *discovery.DiscoveryClient
crdsV1alpha1 *crdsv1alpha1.CrdsV1alpha1Client crdV1alpha1 *crdv1alpha1.CrdV1alpha1Client
placeholderV1alpha1 *placeholderv1alpha1.PlaceholderV1alpha1Client pinnipedV1alpha1 *pinnipedv1alpha1.PinnipedV1alpha1Client
} }
// CrdsV1alpha1 retrieves the CrdsV1alpha1Client // CrdV1alpha1 retrieves the CrdV1alpha1Client
func (c *Clientset) CrdsV1alpha1() crdsv1alpha1.CrdsV1alpha1Interface { func (c *Clientset) CrdV1alpha1() crdv1alpha1.CrdV1alpha1Interface {
return c.crdsV1alpha1 return c.crdV1alpha1
} }
// PlaceholderV1alpha1 retrieves the PlaceholderV1alpha1Client // PinnipedV1alpha1 retrieves the PinnipedV1alpha1Client
func (c *Clientset) PlaceholderV1alpha1() placeholderv1alpha1.PlaceholderV1alpha1Interface { func (c *Clientset) PinnipedV1alpha1() pinnipedv1alpha1.PinnipedV1alpha1Interface {
return c.placeholderV1alpha1 return c.pinnipedV1alpha1
} }
// Discovery retrieves the DiscoveryClient // Discovery retrieves the DiscoveryClient
@ -62,11 +63,11 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
} }
var cs Clientset var cs Clientset
var err error var err error
cs.crdsV1alpha1, err = crdsv1alpha1.NewForConfig(&configShallowCopy) cs.crdV1alpha1, err = crdv1alpha1.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
cs.placeholderV1alpha1, err = placeholderv1alpha1.NewForConfig(&configShallowCopy) cs.pinnipedV1alpha1, err = pinnipedv1alpha1.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -82,8 +83,8 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
// panics if there is an error in the config. // panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *Clientset { func NewForConfigOrDie(c *rest.Config) *Clientset {
var cs Clientset var cs Clientset
cs.crdsV1alpha1 = crdsv1alpha1.NewForConfigOrDie(c) cs.crdV1alpha1 = crdv1alpha1.NewForConfigOrDie(c)
cs.placeholderV1alpha1 = placeholderv1alpha1.NewForConfigOrDie(c) cs.pinnipedV1alpha1 = pinnipedv1alpha1.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &cs return &cs
@ -92,8 +93,8 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
// New creates a new Clientset for the given RESTClient. // New creates a new Clientset for the given RESTClient.
func New(c rest.Interface) *Clientset { func New(c rest.Interface) *Clientset {
var cs Clientset var cs Clientset
cs.crdsV1alpha1 = crdsv1alpha1.New(c) cs.crdV1alpha1 = crdv1alpha1.New(c)
cs.placeholderV1alpha1 = placeholderv1alpha1.New(c) cs.pinnipedV1alpha1 = pinnipedv1alpha1.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs return &cs

View File

@ -8,16 +8,17 @@ SPDX-License-Identifier: Apache-2.0
package fake package fake
import ( import (
clientset "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
crdsv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/crdsplaceholder/v1alpha1"
fakecrdsv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/crdsplaceholder/v1alpha1/fake"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/placeholder/v1alpha1"
fakeplaceholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/placeholder/v1alpha1/fake"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery" "k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake" fakediscovery "k8s.io/client-go/discovery/fake"
"k8s.io/client-go/testing" "k8s.io/client-go/testing"
clientset "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned"
crdv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/typed/crdpinniped/v1alpha1"
fakecrdv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/typed/crdpinniped/v1alpha1/fake"
pinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/typed/pinniped/v1alpha1"
fakepinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/typed/pinniped/v1alpha1/fake"
) )
// NewSimpleClientset returns a clientset that will respond with the provided objects. // NewSimpleClientset returns a clientset that will respond with the provided objects.
@ -67,12 +68,12 @@ func (c *Clientset) Tracker() testing.ObjectTracker {
var _ clientset.Interface = &Clientset{} var _ clientset.Interface = &Clientset{}
// CrdsV1alpha1 retrieves the CrdsV1alpha1Client // CrdV1alpha1 retrieves the CrdV1alpha1Client
func (c *Clientset) CrdsV1alpha1() crdsv1alpha1.CrdsV1alpha1Interface { func (c *Clientset) CrdV1alpha1() crdv1alpha1.CrdV1alpha1Interface {
return &fakecrdsv1alpha1.FakeCrdsV1alpha1{Fake: &c.Fake} return &fakecrdv1alpha1.FakeCrdV1alpha1{Fake: &c.Fake}
} }
// PlaceholderV1alpha1 retrieves the PlaceholderV1alpha1Client // PinnipedV1alpha1 retrieves the PinnipedV1alpha1Client
func (c *Clientset) PlaceholderV1alpha1() placeholderv1alpha1.PlaceholderV1alpha1Interface { func (c *Clientset) PinnipedV1alpha1() pinnipedv1alpha1.PinnipedV1alpha1Interface {
return &fakeplaceholderv1alpha1.FakePlaceholderV1alpha1{Fake: &c.Fake} return &fakepinnipedv1alpha1.FakePinnipedV1alpha1{Fake: &c.Fake}
} }

View File

@ -8,21 +8,22 @@ SPDX-License-Identifier: Apache-2.0
package fake package fake
import ( import (
crdsv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer" serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime"
crdv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1"
pinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
) )
var scheme = runtime.NewScheme() var scheme = runtime.NewScheme()
var codecs = serializer.NewCodecFactory(scheme) var codecs = serializer.NewCodecFactory(scheme)
var localSchemeBuilder = runtime.SchemeBuilder{ var localSchemeBuilder = runtime.SchemeBuilder{
crdsv1alpha1.AddToScheme, crdv1alpha1.AddToScheme,
placeholderv1alpha1.AddToScheme, pinnipedv1alpha1.AddToScheme,
} }
// AddToScheme adds all types of this clientset into the given scheme. This allows composition // AddToScheme adds all types of this clientset into the given scheme. This allows composition

View File

@ -8,21 +8,22 @@ SPDX-License-Identifier: Apache-2.0
package scheme package scheme
import ( import (
crdsv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer" serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime"
crdv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1"
pinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
) )
var Scheme = runtime.NewScheme() var Scheme = runtime.NewScheme()
var Codecs = serializer.NewCodecFactory(Scheme) var Codecs = serializer.NewCodecFactory(Scheme)
var ParameterCodec = runtime.NewParameterCodec(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{ var localSchemeBuilder = runtime.SchemeBuilder{
crdsv1alpha1.AddToScheme, crdv1alpha1.AddToScheme,
placeholderv1alpha1.AddToScheme, pinnipedv1alpha1.AddToScheme,
} }
// AddToScheme adds all types of this clientset into the given scheme. This allows composition // AddToScheme adds all types of this clientset into the given scheme. This allows composition

View File

@ -0,0 +1,79 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
rest "k8s.io/client-go/rest"
v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1"
"github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/scheme"
)
type CrdV1alpha1Interface interface {
RESTClient() rest.Interface
PinnipedDiscoveryInfosGetter
}
// CrdV1alpha1Client is used to interact with features provided by the crd.pinniped.dev group.
type CrdV1alpha1Client struct {
restClient rest.Interface
}
func (c *CrdV1alpha1Client) PinnipedDiscoveryInfos(namespace string) PinnipedDiscoveryInfoInterface {
return newPinnipedDiscoveryInfos(c, namespace)
}
// NewForConfig creates a new CrdV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*CrdV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &CrdV1alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new CrdV1alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *CrdV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new CrdV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *CrdV1alpha1Client {
return &CrdV1alpha1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *CrdV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View File

@ -8,22 +8,23 @@ SPDX-License-Identifier: Apache-2.0
package fake package fake
import ( import (
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/crdsplaceholder/v1alpha1"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/typed/crdpinniped/v1alpha1"
) )
type FakeCrdsV1alpha1 struct { type FakeCrdV1alpha1 struct {
*testing.Fake *testing.Fake
} }
func (c *FakeCrdsV1alpha1) LoginDiscoveryConfigs(namespace string) v1alpha1.LoginDiscoveryConfigInterface { func (c *FakeCrdV1alpha1) PinnipedDiscoveryInfos(namespace string) v1alpha1.PinnipedDiscoveryInfoInterface {
return &FakeLoginDiscoveryConfigs{c, namespace} return &FakePinnipedDiscoveryInfos{c, namespace}
} }
// RESTClient returns a RESTClient that is used to communicate // RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation. // with API server by this client implementation.
func (c *FakeCrdsV1alpha1) RESTClient() rest.Interface { func (c *FakeCrdV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient var ret *rest.RESTClient
return ret return ret
} }

View File

@ -0,0 +1,120 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1"
)
// FakePinnipedDiscoveryInfos implements PinnipedDiscoveryInfoInterface
type FakePinnipedDiscoveryInfos struct {
Fake *FakeCrdV1alpha1
ns string
}
var pinnipeddiscoveryinfosResource = schema.GroupVersionResource{Group: "crd.pinniped.dev", Version: "v1alpha1", Resource: "pinnipeddiscoveryinfos"}
var pinnipeddiscoveryinfosKind = schema.GroupVersionKind{Group: "crd.pinniped.dev", Version: "v1alpha1", Kind: "PinnipedDiscoveryInfo"}
// Get takes name of the pinnipedDiscoveryInfo, and returns the corresponding pinnipedDiscoveryInfo object, and an error if there is any.
func (c *FakePinnipedDiscoveryInfos) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PinnipedDiscoveryInfo, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(pinnipeddiscoveryinfosResource, c.ns, name), &v1alpha1.PinnipedDiscoveryInfo{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.PinnipedDiscoveryInfo), err
}
// List takes label and field selectors, and returns the list of PinnipedDiscoveryInfos that match those selectors.
func (c *FakePinnipedDiscoveryInfos) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PinnipedDiscoveryInfoList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(pinnipeddiscoveryinfosResource, pinnipeddiscoveryinfosKind, c.ns, opts), &v1alpha1.PinnipedDiscoveryInfoList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.PinnipedDiscoveryInfoList{ListMeta: obj.(*v1alpha1.PinnipedDiscoveryInfoList).ListMeta}
for _, item := range obj.(*v1alpha1.PinnipedDiscoveryInfoList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested pinnipedDiscoveryInfos.
func (c *FakePinnipedDiscoveryInfos) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(pinnipeddiscoveryinfosResource, c.ns, opts))
}
// Create takes the representation of a pinnipedDiscoveryInfo and creates it. Returns the server's representation of the pinnipedDiscoveryInfo, and an error, if there is any.
func (c *FakePinnipedDiscoveryInfos) Create(ctx context.Context, pinnipedDiscoveryInfo *v1alpha1.PinnipedDiscoveryInfo, opts v1.CreateOptions) (result *v1alpha1.PinnipedDiscoveryInfo, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(pinnipeddiscoveryinfosResource, c.ns, pinnipedDiscoveryInfo), &v1alpha1.PinnipedDiscoveryInfo{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.PinnipedDiscoveryInfo), err
}
// Update takes the representation of a pinnipedDiscoveryInfo and updates it. Returns the server's representation of the pinnipedDiscoveryInfo, and an error, if there is any.
func (c *FakePinnipedDiscoveryInfos) Update(ctx context.Context, pinnipedDiscoveryInfo *v1alpha1.PinnipedDiscoveryInfo, opts v1.UpdateOptions) (result *v1alpha1.PinnipedDiscoveryInfo, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(pinnipeddiscoveryinfosResource, c.ns, pinnipedDiscoveryInfo), &v1alpha1.PinnipedDiscoveryInfo{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.PinnipedDiscoveryInfo), err
}
// Delete takes name of the pinnipedDiscoveryInfo and deletes it. Returns an error if one occurs.
func (c *FakePinnipedDiscoveryInfos) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(pinnipeddiscoveryinfosResource, c.ns, name), &v1alpha1.PinnipedDiscoveryInfo{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakePinnipedDiscoveryInfos) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(pinnipeddiscoveryinfosResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.PinnipedDiscoveryInfoList{})
return err
}
// Patch applies the patch and returns the patched pinnipedDiscoveryInfo.
func (c *FakePinnipedDiscoveryInfos) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PinnipedDiscoveryInfo, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(pinnipeddiscoveryinfosResource, c.ns, name, pt, data, subresources...), &v1alpha1.PinnipedDiscoveryInfo{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.PinnipedDiscoveryInfo), err
}

View File

@ -7,4 +7,4 @@ SPDX-License-Identifier: Apache-2.0
package v1alpha1 package v1alpha1
type LoginDiscoveryConfigExpansion interface{} type PinnipedDiscoveryInfoExpansion interface{}

View File

@ -0,0 +1,168 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1"
scheme "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/scheme"
)
// PinnipedDiscoveryInfosGetter has a method to return a PinnipedDiscoveryInfoInterface.
// A group's client should implement this interface.
type PinnipedDiscoveryInfosGetter interface {
PinnipedDiscoveryInfos(namespace string) PinnipedDiscoveryInfoInterface
}
// PinnipedDiscoveryInfoInterface has methods to work with PinnipedDiscoveryInfo resources.
type PinnipedDiscoveryInfoInterface interface {
Create(ctx context.Context, pinnipedDiscoveryInfo *v1alpha1.PinnipedDiscoveryInfo, opts v1.CreateOptions) (*v1alpha1.PinnipedDiscoveryInfo, error)
Update(ctx context.Context, pinnipedDiscoveryInfo *v1alpha1.PinnipedDiscoveryInfo, opts v1.UpdateOptions) (*v1alpha1.PinnipedDiscoveryInfo, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PinnipedDiscoveryInfo, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PinnipedDiscoveryInfoList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PinnipedDiscoveryInfo, err error)
PinnipedDiscoveryInfoExpansion
}
// pinnipedDiscoveryInfos implements PinnipedDiscoveryInfoInterface
type pinnipedDiscoveryInfos struct {
client rest.Interface
ns string
}
// newPinnipedDiscoveryInfos returns a PinnipedDiscoveryInfos
func newPinnipedDiscoveryInfos(c *CrdV1alpha1Client, namespace string) *pinnipedDiscoveryInfos {
return &pinnipedDiscoveryInfos{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the pinnipedDiscoveryInfo, and returns the corresponding pinnipedDiscoveryInfo object, and an error if there is any.
func (c *pinnipedDiscoveryInfos) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PinnipedDiscoveryInfo, err error) {
result = &v1alpha1.PinnipedDiscoveryInfo{}
err = c.client.Get().
Namespace(c.ns).
Resource("pinnipeddiscoveryinfos").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of PinnipedDiscoveryInfos that match those selectors.
func (c *pinnipedDiscoveryInfos) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PinnipedDiscoveryInfoList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.PinnipedDiscoveryInfoList{}
err = c.client.Get().
Namespace(c.ns).
Resource("pinnipeddiscoveryinfos").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested pinnipedDiscoveryInfos.
func (c *pinnipedDiscoveryInfos) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("pinnipeddiscoveryinfos").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a pinnipedDiscoveryInfo and creates it. Returns the server's representation of the pinnipedDiscoveryInfo, and an error, if there is any.
func (c *pinnipedDiscoveryInfos) Create(ctx context.Context, pinnipedDiscoveryInfo *v1alpha1.PinnipedDiscoveryInfo, opts v1.CreateOptions) (result *v1alpha1.PinnipedDiscoveryInfo, err error) {
result = &v1alpha1.PinnipedDiscoveryInfo{}
err = c.client.Post().
Namespace(c.ns).
Resource("pinnipeddiscoveryinfos").
VersionedParams(&opts, scheme.ParameterCodec).
Body(pinnipedDiscoveryInfo).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a pinnipedDiscoveryInfo and updates it. Returns the server's representation of the pinnipedDiscoveryInfo, and an error, if there is any.
func (c *pinnipedDiscoveryInfos) Update(ctx context.Context, pinnipedDiscoveryInfo *v1alpha1.PinnipedDiscoveryInfo, opts v1.UpdateOptions) (result *v1alpha1.PinnipedDiscoveryInfo, err error) {
result = &v1alpha1.PinnipedDiscoveryInfo{}
err = c.client.Put().
Namespace(c.ns).
Resource("pinnipeddiscoveryinfos").
Name(pinnipedDiscoveryInfo.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(pinnipedDiscoveryInfo).
Do(ctx).
Into(result)
return
}
// Delete takes name of the pinnipedDiscoveryInfo and deletes it. Returns an error if one occurs.
func (c *pinnipedDiscoveryInfos) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("pinnipeddiscoveryinfos").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *pinnipedDiscoveryInfos) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("pinnipeddiscoveryinfos").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched pinnipedDiscoveryInfo.
func (c *pinnipedDiscoveryInfos) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PinnipedDiscoveryInfo, err error) {
result = &v1alpha1.PinnipedDiscoveryInfo{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("pinnipeddiscoveryinfos").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -1,78 +0,0 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1"
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)
type CrdsV1alpha1Interface interface {
RESTClient() rest.Interface
LoginDiscoveryConfigsGetter
}
// CrdsV1alpha1Client is used to interact with features provided by the crds.placeholder.suzerain-io.github.io group.
type CrdsV1alpha1Client struct {
restClient rest.Interface
}
func (c *CrdsV1alpha1Client) LoginDiscoveryConfigs(namespace string) LoginDiscoveryConfigInterface {
return newLoginDiscoveryConfigs(c, namespace)
}
// NewForConfig creates a new CrdsV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*CrdsV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &CrdsV1alpha1Client{client}, nil
}
// NewForConfigOrDie creates a new CrdsV1alpha1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *CrdsV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new CrdsV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *CrdsV1alpha1Client {
return &CrdsV1alpha1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *CrdsV1alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

View File

@ -1,119 +0,0 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package fake
import (
"context"
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeLoginDiscoveryConfigs implements LoginDiscoveryConfigInterface
type FakeLoginDiscoveryConfigs struct {
Fake *FakeCrdsV1alpha1
ns string
}
var logindiscoveryconfigsResource = schema.GroupVersionResource{Group: "crds.placeholder.suzerain-io.github.io", Version: "v1alpha1", Resource: "logindiscoveryconfigs"}
var logindiscoveryconfigsKind = schema.GroupVersionKind{Group: "crds.placeholder.suzerain-io.github.io", Version: "v1alpha1", Kind: "LoginDiscoveryConfig"}
// Get takes name of the loginDiscoveryConfig, and returns the corresponding loginDiscoveryConfig object, and an error if there is any.
func (c *FakeLoginDiscoveryConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LoginDiscoveryConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(logindiscoveryconfigsResource, c.ns, name), &v1alpha1.LoginDiscoveryConfig{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.LoginDiscoveryConfig), err
}
// List takes label and field selectors, and returns the list of LoginDiscoveryConfigs that match those selectors.
func (c *FakeLoginDiscoveryConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LoginDiscoveryConfigList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(logindiscoveryconfigsResource, logindiscoveryconfigsKind, c.ns, opts), &v1alpha1.LoginDiscoveryConfigList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.LoginDiscoveryConfigList{ListMeta: obj.(*v1alpha1.LoginDiscoveryConfigList).ListMeta}
for _, item := range obj.(*v1alpha1.LoginDiscoveryConfigList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested loginDiscoveryConfigs.
func (c *FakeLoginDiscoveryConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(logindiscoveryconfigsResource, c.ns, opts))
}
// Create takes the representation of a loginDiscoveryConfig and creates it. Returns the server's representation of the loginDiscoveryConfig, and an error, if there is any.
func (c *FakeLoginDiscoveryConfigs) Create(ctx context.Context, loginDiscoveryConfig *v1alpha1.LoginDiscoveryConfig, opts v1.CreateOptions) (result *v1alpha1.LoginDiscoveryConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(logindiscoveryconfigsResource, c.ns, loginDiscoveryConfig), &v1alpha1.LoginDiscoveryConfig{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.LoginDiscoveryConfig), err
}
// Update takes the representation of a loginDiscoveryConfig and updates it. Returns the server's representation of the loginDiscoveryConfig, and an error, if there is any.
func (c *FakeLoginDiscoveryConfigs) Update(ctx context.Context, loginDiscoveryConfig *v1alpha1.LoginDiscoveryConfig, opts v1.UpdateOptions) (result *v1alpha1.LoginDiscoveryConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(logindiscoveryconfigsResource, c.ns, loginDiscoveryConfig), &v1alpha1.LoginDiscoveryConfig{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.LoginDiscoveryConfig), err
}
// Delete takes name of the loginDiscoveryConfig and deletes it. Returns an error if one occurs.
func (c *FakeLoginDiscoveryConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(logindiscoveryconfigsResource, c.ns, name), &v1alpha1.LoginDiscoveryConfig{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeLoginDiscoveryConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(logindiscoveryconfigsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1alpha1.LoginDiscoveryConfigList{})
return err
}
// Patch applies the patch and returns the patched loginDiscoveryConfig.
func (c *FakeLoginDiscoveryConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LoginDiscoveryConfig, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(logindiscoveryconfigsResource, c.ns, name, pt, data, subresources...), &v1alpha1.LoginDiscoveryConfig{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.LoginDiscoveryConfig), err
}

View File

@ -1,167 +0,0 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1"
scheme "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// LoginDiscoveryConfigsGetter has a method to return a LoginDiscoveryConfigInterface.
// A group's client should implement this interface.
type LoginDiscoveryConfigsGetter interface {
LoginDiscoveryConfigs(namespace string) LoginDiscoveryConfigInterface
}
// LoginDiscoveryConfigInterface has methods to work with LoginDiscoveryConfig resources.
type LoginDiscoveryConfigInterface interface {
Create(ctx context.Context, loginDiscoveryConfig *v1alpha1.LoginDiscoveryConfig, opts v1.CreateOptions) (*v1alpha1.LoginDiscoveryConfig, error)
Update(ctx context.Context, loginDiscoveryConfig *v1alpha1.LoginDiscoveryConfig, opts v1.UpdateOptions) (*v1alpha1.LoginDiscoveryConfig, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.LoginDiscoveryConfig, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.LoginDiscoveryConfigList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LoginDiscoveryConfig, err error)
LoginDiscoveryConfigExpansion
}
// loginDiscoveryConfigs implements LoginDiscoveryConfigInterface
type loginDiscoveryConfigs struct {
client rest.Interface
ns string
}
// newLoginDiscoveryConfigs returns a LoginDiscoveryConfigs
func newLoginDiscoveryConfigs(c *CrdsV1alpha1Client, namespace string) *loginDiscoveryConfigs {
return &loginDiscoveryConfigs{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the loginDiscoveryConfig, and returns the corresponding loginDiscoveryConfig object, and an error if there is any.
func (c *loginDiscoveryConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LoginDiscoveryConfig, err error) {
result = &v1alpha1.LoginDiscoveryConfig{}
err = c.client.Get().
Namespace(c.ns).
Resource("logindiscoveryconfigs").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of LoginDiscoveryConfigs that match those selectors.
func (c *loginDiscoveryConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LoginDiscoveryConfigList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.LoginDiscoveryConfigList{}
err = c.client.Get().
Namespace(c.ns).
Resource("logindiscoveryconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested loginDiscoveryConfigs.
func (c *loginDiscoveryConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("logindiscoveryconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a loginDiscoveryConfig and creates it. Returns the server's representation of the loginDiscoveryConfig, and an error, if there is any.
func (c *loginDiscoveryConfigs) Create(ctx context.Context, loginDiscoveryConfig *v1alpha1.LoginDiscoveryConfig, opts v1.CreateOptions) (result *v1alpha1.LoginDiscoveryConfig, err error) {
result = &v1alpha1.LoginDiscoveryConfig{}
err = c.client.Post().
Namespace(c.ns).
Resource("logindiscoveryconfigs").
VersionedParams(&opts, scheme.ParameterCodec).
Body(loginDiscoveryConfig).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a loginDiscoveryConfig and updates it. Returns the server's representation of the loginDiscoveryConfig, and an error, if there is any.
func (c *loginDiscoveryConfigs) Update(ctx context.Context, loginDiscoveryConfig *v1alpha1.LoginDiscoveryConfig, opts v1.UpdateOptions) (result *v1alpha1.LoginDiscoveryConfig, err error) {
result = &v1alpha1.LoginDiscoveryConfig{}
err = c.client.Put().
Namespace(c.ns).
Resource("logindiscoveryconfigs").
Name(loginDiscoveryConfig.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(loginDiscoveryConfig).
Do(ctx).
Into(result)
return
}
// Delete takes name of the loginDiscoveryConfig and deletes it. Returns an error if one occurs.
func (c *loginDiscoveryConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("logindiscoveryconfigs").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *loginDiscoveryConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("logindiscoveryconfigs").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched loginDiscoveryConfig.
func (c *loginDiscoveryConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LoginDiscoveryConfig, err error) {
result = &v1alpha1.LoginDiscoveryConfig{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("logindiscoveryconfigs").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -11,12 +11,13 @@ import (
"context" "context"
"time" "time"
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1"
scheme "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
scheme "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/scheme"
) )
// CredentialRequestsGetter has a method to return a CredentialRequestInterface. // CredentialRequestsGetter has a method to return a CredentialRequestInterface.
@ -45,7 +46,7 @@ type credentialRequests struct {
} }
// newCredentialRequests returns a CredentialRequests // newCredentialRequests returns a CredentialRequests
func newCredentialRequests(c *PlaceholderV1alpha1Client) *credentialRequests { func newCredentialRequests(c *PinnipedV1alpha1Client) *credentialRequests {
return &credentialRequests{ return &credentialRequests{
client: c.RESTClient(), client: c.RESTClient(),
} }

View File

@ -10,23 +10,24 @@ package fake
import ( import (
"context" "context"
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
) )
// FakeCredentialRequests implements CredentialRequestInterface // FakeCredentialRequests implements CredentialRequestInterface
type FakeCredentialRequests struct { type FakeCredentialRequests struct {
Fake *FakePlaceholderV1alpha1 Fake *FakePinnipedV1alpha1
} }
var credentialrequestsResource = schema.GroupVersionResource{Group: "placeholder.suzerain-io.github.io", Version: "v1alpha1", Resource: "credentialrequests"} var credentialrequestsResource = schema.GroupVersionResource{Group: "pinniped.dev", Version: "v1alpha1", Resource: "credentialrequests"}
var credentialrequestsKind = schema.GroupVersionKind{Group: "placeholder.suzerain-io.github.io", Version: "v1alpha1", Kind: "CredentialRequest"} var credentialrequestsKind = schema.GroupVersionKind{Group: "pinniped.dev", Version: "v1alpha1", Kind: "CredentialRequest"}
// Get takes name of the credentialRequest, and returns the corresponding credentialRequest object, and an error if there is any. // Get takes name of the credentialRequest, and returns the corresponding credentialRequest object, and an error if there is any.
func (c *FakeCredentialRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CredentialRequest, err error) { func (c *FakeCredentialRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.CredentialRequest, err error) {

View File

@ -8,22 +8,23 @@ SPDX-License-Identifier: Apache-2.0
package fake package fake
import ( import (
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/placeholder/v1alpha1"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/typed/pinniped/v1alpha1"
) )
type FakePlaceholderV1alpha1 struct { type FakePinnipedV1alpha1 struct {
*testing.Fake *testing.Fake
} }
func (c *FakePlaceholderV1alpha1) CredentialRequests() v1alpha1.CredentialRequestInterface { func (c *FakePinnipedV1alpha1) CredentialRequests() v1alpha1.CredentialRequestInterface {
return &FakeCredentialRequests{c} return &FakeCredentialRequests{c}
} }
// RESTClient returns a RESTClient that is used to communicate // RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation. // with API server by this client implementation.
func (c *FakePlaceholderV1alpha1) RESTClient() rest.Interface { func (c *FakePinnipedV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient var ret *rest.RESTClient
return ret return ret
} }

View File

@ -8,27 +8,28 @@ SPDX-License-Identifier: Apache-2.0
package v1alpha1 package v1alpha1
import ( import (
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1"
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/scheme"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
"github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/scheme"
) )
type PlaceholderV1alpha1Interface interface { type PinnipedV1alpha1Interface interface {
RESTClient() rest.Interface RESTClient() rest.Interface
CredentialRequestsGetter CredentialRequestsGetter
} }
// PlaceholderV1alpha1Client is used to interact with features provided by the placeholder.suzerain-io.github.io group. // PinnipedV1alpha1Client is used to interact with features provided by the pinniped.dev group.
type PlaceholderV1alpha1Client struct { type PinnipedV1alpha1Client struct {
restClient rest.Interface restClient rest.Interface
} }
func (c *PlaceholderV1alpha1Client) CredentialRequests() CredentialRequestInterface { func (c *PinnipedV1alpha1Client) CredentialRequests() CredentialRequestInterface {
return newCredentialRequests(c) return newCredentialRequests(c)
} }
// NewForConfig creates a new PlaceholderV1alpha1Client for the given config. // NewForConfig creates a new PinnipedV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*PlaceholderV1alpha1Client, error) { func NewForConfig(c *rest.Config) (*PinnipedV1alpha1Client, error) {
config := *c config := *c
if err := setConfigDefaults(&config); err != nil { if err := setConfigDefaults(&config); err != nil {
return nil, err return nil, err
@ -37,12 +38,12 @@ func NewForConfig(c *rest.Config) (*PlaceholderV1alpha1Client, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
return &PlaceholderV1alpha1Client{client}, nil return &PinnipedV1alpha1Client{client}, nil
} }
// NewForConfigOrDie creates a new PlaceholderV1alpha1Client for the given config and // NewForConfigOrDie creates a new PinnipedV1alpha1Client for the given config and
// panics if there is an error in the config. // panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *PlaceholderV1alpha1Client { func NewForConfigOrDie(c *rest.Config) *PinnipedV1alpha1Client {
client, err := NewForConfig(c) client, err := NewForConfig(c)
if err != nil { if err != nil {
panic(err) panic(err)
@ -50,9 +51,9 @@ func NewForConfigOrDie(c *rest.Config) *PlaceholderV1alpha1Client {
return client return client
} }
// New creates a new PlaceholderV1alpha1Client for the given RESTClient. // New creates a new PinnipedV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *PlaceholderV1alpha1Client { func New(c rest.Interface) *PinnipedV1alpha1Client {
return &PlaceholderV1alpha1Client{c} return &PinnipedV1alpha1Client{c}
} }
func setConfigDefaults(config *rest.Config) error { func setConfigDefaults(config *rest.Config) error {
@ -70,7 +71,7 @@ func setConfigDefaults(config *rest.Config) error {
// RESTClient returns a RESTClient that is used to communicate // RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation. // with API server by this client implementation.
func (c *PlaceholderV1alpha1Client) RESTClient() rest.Interface { func (c *PinnipedV1alpha1Client) RESTClient() rest.Interface {
if c == nil { if c == nil {
return nil return nil
} }

View File

@ -1,12 +1,12 @@
module github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go module github.com/suzerain-io/pinniped/kubernetes/1.19/client-go
go 1.14 go 1.14
require ( require (
github.com/suzerain-io/placeholder-name/kubernetes/1.19/api v0.0.0-00010101000000-000000000000 github.com/suzerain-io/pinniped/kubernetes/1.19/api v0.0.0-00010101000000-000000000000
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
k8s.io/apimachinery v0.19.0-rc.0 k8s.io/apimachinery v0.19.0-rc.0
k8s.io/client-go v0.19.0-rc.0 k8s.io/client-go v0.19.0-rc.0
) )
replace github.com/suzerain-io/placeholder-name/kubernetes/1.19/api => ../api replace github.com/suzerain-io/pinniped/kubernetes/1.19/api => ../api

View File

@ -5,11 +5,11 @@ SPDX-License-Identifier: Apache-2.0
// Code generated by informer-gen. DO NOT EDIT. // Code generated by informer-gen. DO NOT EDIT.
package placeholder package crdpinniped
import ( import (
internalinterfaces "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces" v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions/crdpinniped/v1alpha1"
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/placeholder/v1alpha1" internalinterfaces "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
) )
// Interface provides access to each of this group's versions. // Interface provides access to each of this group's versions.

View File

@ -8,13 +8,13 @@ SPDX-License-Identifier: Apache-2.0
package v1alpha1 package v1alpha1
import ( import (
internalinterfaces "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces" internalinterfaces "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
) )
// Interface provides access to all the informers in this group version. // Interface provides access to all the informers in this group version.
type Interface interface { type Interface interface {
// LoginDiscoveryConfigs returns a LoginDiscoveryConfigInformer. // PinnipedDiscoveryInfos returns a PinnipedDiscoveryInfoInformer.
LoginDiscoveryConfigs() LoginDiscoveryConfigInformer PinnipedDiscoveryInfos() PinnipedDiscoveryInfoInformer
} }
type version struct { type version struct {
@ -28,7 +28,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
} }
// LoginDiscoveryConfigs returns a LoginDiscoveryConfigInformer. // PinnipedDiscoveryInfos returns a PinnipedDiscoveryInfoInformer.
func (v *version) LoginDiscoveryConfigs() LoginDiscoveryConfigInformer { func (v *version) PinnipedDiscoveryInfos() PinnipedDiscoveryInfoInformer {
return &loginDiscoveryConfigInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} return &pinnipedDiscoveryInfoInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
} }

View File

@ -0,0 +1,80 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
time "time"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
crdpinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1"
versioned "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned"
internalinterfaces "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/listers/crdpinniped/v1alpha1"
)
// PinnipedDiscoveryInfoInformer provides access to a shared informer and lister for
// PinnipedDiscoveryInfos.
type PinnipedDiscoveryInfoInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.PinnipedDiscoveryInfoLister
}
type pinnipedDiscoveryInfoInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewPinnipedDiscoveryInfoInformer constructs a new informer for PinnipedDiscoveryInfo type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewPinnipedDiscoveryInfoInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredPinnipedDiscoveryInfoInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredPinnipedDiscoveryInfoInformer constructs a new informer for PinnipedDiscoveryInfo type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredPinnipedDiscoveryInfoInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CrdV1alpha1().PinnipedDiscoveryInfos(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CrdV1alpha1().PinnipedDiscoveryInfos(namespace).Watch(context.TODO(), options)
},
},
&crdpinnipedv1alpha1.PinnipedDiscoveryInfo{},
resyncPeriod,
indexers,
)
}
func (f *pinnipedDiscoveryInfoInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredPinnipedDiscoveryInfoInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *pinnipedDiscoveryInfoInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&crdpinnipedv1alpha1.PinnipedDiscoveryInfo{}, f.defaultInformer)
}
func (f *pinnipedDiscoveryInfoInformer) Lister() v1alpha1.PinnipedDiscoveryInfoLister {
return v1alpha1.NewPinnipedDiscoveryInfoLister(f.Informer().GetIndexer())
}

View File

@ -1,79 +0,0 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
time "time"
crdsplaceholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1"
versioned "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
internalinterfaces "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/listers/crdsplaceholder/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache"
)
// LoginDiscoveryConfigInformer provides access to a shared informer and lister for
// LoginDiscoveryConfigs.
type LoginDiscoveryConfigInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.LoginDiscoveryConfigLister
}
type loginDiscoveryConfigInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewLoginDiscoveryConfigInformer constructs a new informer for LoginDiscoveryConfig type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewLoginDiscoveryConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredLoginDiscoveryConfigInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredLoginDiscoveryConfigInformer constructs a new informer for LoginDiscoveryConfig type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredLoginDiscoveryConfigInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CrdsV1alpha1().LoginDiscoveryConfigs(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.CrdsV1alpha1().LoginDiscoveryConfigs(namespace).Watch(context.TODO(), options)
},
},
&crdsplaceholderv1alpha1.LoginDiscoveryConfig{},
resyncPeriod,
indexers,
)
}
func (f *loginDiscoveryConfigInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredLoginDiscoveryConfigInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *loginDiscoveryConfigInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&crdsplaceholderv1alpha1.LoginDiscoveryConfig{}, f.defaultInformer)
}
func (f *loginDiscoveryConfigInformer) Lister() v1alpha1.LoginDiscoveryConfigLister {
return v1alpha1.NewLoginDiscoveryConfigLister(f.Informer().GetIndexer())
}

View File

@ -12,14 +12,15 @@ import (
sync "sync" sync "sync"
time "time" time "time"
versioned "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
crdsplaceholder "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/crdsplaceholder"
internalinterfaces "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
placeholder "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/placeholder"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"
versioned "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned"
crdpinniped "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions/crdpinniped"
internalinterfaces "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
pinniped "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions/pinniped"
) )
// SharedInformerOption defines the functional option type for SharedInformerFactory. // SharedInformerOption defines the functional option type for SharedInformerFactory.
@ -162,14 +163,14 @@ type SharedInformerFactory interface {
ForResource(resource schema.GroupVersionResource) (GenericInformer, error) ForResource(resource schema.GroupVersionResource) (GenericInformer, error)
WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool
Crds() crdsplaceholder.Interface Crd() crdpinniped.Interface
Placeholder() placeholder.Interface Pinniped() pinniped.Interface
} }
func (f *sharedInformerFactory) Crds() crdsplaceholder.Interface { func (f *sharedInformerFactory) Crd() crdpinniped.Interface {
return crdsplaceholder.New(f, f.namespace, f.tweakListOptions) return crdpinniped.New(f, f.namespace, f.tweakListOptions)
} }
func (f *sharedInformerFactory) Placeholder() placeholder.Interface { func (f *sharedInformerFactory) Pinniped() pinniped.Interface {
return placeholder.New(f, f.namespace, f.tweakListOptions) return pinniped.New(f, f.namespace, f.tweakListOptions)
} }

View File

@ -10,10 +10,11 @@ package externalversions
import ( import (
"fmt" "fmt"
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"
v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1"
pinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
) )
// GenericInformer is type of SharedIndexInformer which will locate and delegate to other // GenericInformer is type of SharedIndexInformer which will locate and delegate to other
@ -42,13 +43,13 @@ func (f *genericInformer) Lister() cache.GenericLister {
// TODO extend this to unknown resources with a client pool // TODO extend this to unknown resources with a client pool
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
switch resource { switch resource {
// Group=crds.placeholder.suzerain-io.github.io, Version=v1alpha1 // Group=crd.pinniped.dev, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithResource("logindiscoveryconfigs"): case v1alpha1.SchemeGroupVersion.WithResource("pinnipeddiscoveryinfos"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Crds().V1alpha1().LoginDiscoveryConfigs().Informer()}, nil return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha1().PinnipedDiscoveryInfos().Informer()}, nil
// Group=placeholder.suzerain-io.github.io, Version=v1alpha1 // Group=pinniped.dev, Version=v1alpha1
case placeholderv1alpha1.SchemeGroupVersion.WithResource("credentialrequests"): case pinnipedv1alpha1.SchemeGroupVersion.WithResource("credentialrequests"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Placeholder().V1alpha1().CredentialRequests().Informer()}, nil return &genericInformer{resource: resource.GroupResource(), informer: f.Pinniped().V1alpha1().CredentialRequests().Informer()}, nil
} }

View File

@ -10,10 +10,11 @@ package internalinterfaces
import ( import (
time "time" time "time"
versioned "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"
versioned "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned"
) )
// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. // NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer.

View File

@ -5,11 +5,11 @@ SPDX-License-Identifier: Apache-2.0
// Code generated by informer-gen. DO NOT EDIT. // Code generated by informer-gen. DO NOT EDIT.
package crdsplaceholder package pinniped
import ( import (
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/crdsplaceholder/v1alpha1" internalinterfaces "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
internalinterfaces "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces" v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions/pinniped/v1alpha1"
) )
// Interface provides access to each of this group's versions. // Interface provides access to each of this group's versions.

View File

@ -11,14 +11,15 @@ import (
"context" "context"
time "time" time "time"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1"
versioned "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
internalinterfaces "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/listers/placeholder/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"
pinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
versioned "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned"
internalinterfaces "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/listers/pinniped/v1alpha1"
) )
// CredentialRequestInformer provides access to a shared informer and lister for // CredentialRequestInformer provides access to a shared informer and lister for
@ -50,16 +51,16 @@ func NewFilteredCredentialRequestInformer(client versioned.Interface, resyncPeri
if tweakListOptions != nil { if tweakListOptions != nil {
tweakListOptions(&options) tweakListOptions(&options)
} }
return client.PlaceholderV1alpha1().CredentialRequests().List(context.TODO(), options) return client.PinnipedV1alpha1().CredentialRequests().List(context.TODO(), options)
}, },
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil { if tweakListOptions != nil {
tweakListOptions(&options) tweakListOptions(&options)
} }
return client.PlaceholderV1alpha1().CredentialRequests().Watch(context.TODO(), options) return client.PinnipedV1alpha1().CredentialRequests().Watch(context.TODO(), options)
}, },
}, },
&placeholderv1alpha1.CredentialRequest{}, &pinnipedv1alpha1.CredentialRequest{},
resyncPeriod, resyncPeriod,
indexers, indexers,
) )
@ -70,7 +71,7 @@ func (f *credentialRequestInformer) defaultInformer(client versioned.Interface,
} }
func (f *credentialRequestInformer) Informer() cache.SharedIndexInformer { func (f *credentialRequestInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&placeholderv1alpha1.CredentialRequest{}, f.defaultInformer) return f.factory.InformerFor(&pinnipedv1alpha1.CredentialRequest{}, f.defaultInformer)
} }
func (f *credentialRequestInformer) Lister() v1alpha1.CredentialRequestLister { func (f *credentialRequestInformer) Lister() v1alpha1.CredentialRequestLister {

View File

@ -8,7 +8,7 @@ SPDX-License-Identifier: Apache-2.0
package v1alpha1 package v1alpha1
import ( import (
internalinterfaces "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces" internalinterfaces "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions/internalinterfaces"
) )
// Interface provides access to all the informers in this group version. // Interface provides access to all the informers in this group version.

View File

@ -0,0 +1,16 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
// PinnipedDiscoveryInfoListerExpansion allows custom methods to be added to
// PinnipedDiscoveryInfoLister.
type PinnipedDiscoveryInfoListerExpansion interface{}
// PinnipedDiscoveryInfoNamespaceListerExpansion allows custom methods to be added to
// PinnipedDiscoveryInfoNamespaceLister.
type PinnipedDiscoveryInfoNamespaceListerExpansion interface{}

View File

@ -0,0 +1,89 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
import (
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1"
)
// PinnipedDiscoveryInfoLister helps list PinnipedDiscoveryInfos.
// All objects returned here must be treated as read-only.
type PinnipedDiscoveryInfoLister interface {
// List lists all PinnipedDiscoveryInfos in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.PinnipedDiscoveryInfo, err error)
// PinnipedDiscoveryInfos returns an object that can list and get PinnipedDiscoveryInfos.
PinnipedDiscoveryInfos(namespace string) PinnipedDiscoveryInfoNamespaceLister
PinnipedDiscoveryInfoListerExpansion
}
// pinnipedDiscoveryInfoLister implements the PinnipedDiscoveryInfoLister interface.
type pinnipedDiscoveryInfoLister struct {
indexer cache.Indexer
}
// NewPinnipedDiscoveryInfoLister returns a new PinnipedDiscoveryInfoLister.
func NewPinnipedDiscoveryInfoLister(indexer cache.Indexer) PinnipedDiscoveryInfoLister {
return &pinnipedDiscoveryInfoLister{indexer: indexer}
}
// List lists all PinnipedDiscoveryInfos in the indexer.
func (s *pinnipedDiscoveryInfoLister) List(selector labels.Selector) (ret []*v1alpha1.PinnipedDiscoveryInfo, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.PinnipedDiscoveryInfo))
})
return ret, err
}
// PinnipedDiscoveryInfos returns an object that can list and get PinnipedDiscoveryInfos.
func (s *pinnipedDiscoveryInfoLister) PinnipedDiscoveryInfos(namespace string) PinnipedDiscoveryInfoNamespaceLister {
return pinnipedDiscoveryInfoNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// PinnipedDiscoveryInfoNamespaceLister helps list and get PinnipedDiscoveryInfos.
// All objects returned here must be treated as read-only.
type PinnipedDiscoveryInfoNamespaceLister interface {
// List lists all PinnipedDiscoveryInfos in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1alpha1.PinnipedDiscoveryInfo, err error)
// Get retrieves the PinnipedDiscoveryInfo from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1alpha1.PinnipedDiscoveryInfo, error)
PinnipedDiscoveryInfoNamespaceListerExpansion
}
// pinnipedDiscoveryInfoNamespaceLister implements the PinnipedDiscoveryInfoNamespaceLister
// interface.
type pinnipedDiscoveryInfoNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all PinnipedDiscoveryInfos in the indexer for a given namespace.
func (s pinnipedDiscoveryInfoNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.PinnipedDiscoveryInfo, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.PinnipedDiscoveryInfo))
})
return ret, err
}
// Get retrieves the PinnipedDiscoveryInfo from the indexer for a given namespace and name.
func (s pinnipedDiscoveryInfoNamespaceLister) Get(name string) (*v1alpha1.PinnipedDiscoveryInfo, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("pinnipeddiscoveryinfo"), name)
}
return obj.(*v1alpha1.PinnipedDiscoveryInfo), nil
}

View File

@ -1,16 +0,0 @@
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
// LoginDiscoveryConfigListerExpansion allows custom methods to be added to
// LoginDiscoveryConfigLister.
type LoginDiscoveryConfigListerExpansion interface{}
// LoginDiscoveryConfigNamespaceListerExpansion allows custom methods to be added to
// LoginDiscoveryConfigNamespaceLister.
type LoginDiscoveryConfigNamespaceListerExpansion interface{}

Some files were not shown because too many files have changed in this diff Show More