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
# 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
FROM debian:10.5-slim
# 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
EXPOSE 443
# 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
@ -28,3 +37,9 @@ pre-commit installed at .git/hooks/pre-commit
```
[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/klog/v2"
"github.com/suzerain-io/placeholder-name/internal/server"
"github.com/suzerain-io/pinniped/internal/server"
)
func main() {

View File

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

View File

@ -12,13 +12,13 @@ import (
"testing"
"time"
"github.com/suzerain-io/placeholder-name/internal/testutil"
"github.com/suzerain-io/pinniped/internal/testutil"
"github.com/sclevine/spec"
"github.com/sclevine/spec/report"
"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) {
@ -40,29 +40,29 @@ func TestRun(t *testing.T) {
r = require.New(t)
buffer = new(bytes.Buffer)
fakeEnv = map[string]string{
"PLACEHOLDER_NAME_TOKEN": "token from env",
"PLACEHOLDER_NAME_CA_BUNDLE": "ca bundle from env",
"PLACEHOLDER_NAME_K8S_API_ENDPOINT": "k8s api from env",
"PINNIPED_TOKEN": "token from env",
"PINNIPED_CA_BUNDLE": "ca bundle from env",
"PINNIPED_K8S_API_ENDPOINT": "k8s api from env",
}
})
when("env vars are missing", func() {
it("returns an error when PLACEHOLDER_NAME_TOKEN is missing", func() {
delete(fakeEnv, "PLACEHOLDER_NAME_TOKEN")
it("returns an error when PINNIPED_TOKEN is missing", func() {
delete(fakeEnv, "PINNIPED_TOKEN")
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() {
delete(fakeEnv, "PLACEHOLDER_NAME_CA_BUNDLE")
it("returns an error when PINNIPED_CA_BUNDLE is missing", func() {
delete(fakeEnv, "PINNIPED_CA_BUNDLE")
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() {
delete(fakeEnv, "PLACEHOLDER_NAME_K8S_API_ENDPOINT")
it("returns an error when PINNIPED_K8S_API_ENDPOINT is missing", func() {
delete(fakeEnv, "PINNIPED_K8S_API_ENDPOINT")
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() {
err := run(envGetter, tokenExchanger, buffer, 30*time.Second)
r.NoError(err)
r.Equal(fakeEnv["PLACEHOLDER_NAME_TOKEN"], actualToken)
r.Equal(fakeEnv["PLACEHOLDER_NAME_CA_BUNDLE"], actualCaBundle)
r.Equal(fakeEnv["PLACEHOLDER_NAME_K8S_API_ENDPOINT"], actualAPIEndpoint)
r.Equal(fakeEnv["PINNIPED_TOKEN"], actualToken)
r.Equal(fakeEnv["PINNIPED_CA_BUNDLE"], actualCaBundle)
r.Equal(fakeEnv["PINNIPED_K8S_API_ENDPOINT"], actualAPIEndpoint)
expected := `{
"kind": "ExecCredential",
"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)
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")
#! Example of valid LoginDiscoveryConfig object:
#! Example of valid PinnipedDiscoveryInfo object:
#! ---
#! apiVersion: suzerain-io.github.io/v1alpha1
#! kind: LoginDiscoveryConfig
#! apiVersion: crd.pinniped.dev/v1alpha1
#! kind: PinnipedDiscoveryInfo
#! metadata:
#! name: login-discovery
#! namespace: integration
@ -15,12 +15,12 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: logindiscoveryconfigs.crds.placeholder.suzerain-io.github.io
name: pinnipeddiscoveryinfos.crd.pinniped.dev
spec:
group: crds.placeholder.suzerain-io.github.io
group: crd.pinniped.dev
versions:
#! 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
served: true
storage: true
@ -42,8 +42,8 @@ spec:
minLength: 1
scope: Namespaced
names:
plural: logindiscoveryconfigs
singular: logindiscoveryconfig
kind: LoginDiscoveryConfig
plural: pinnipeddiscoveryinfos
singular: pinnipeddiscoveryinfo
kind: PinnipedDiscoveryInfo
shortNames:
- ldc

View File

@ -23,7 +23,7 @@ metadata:
app: #@ data.values.app_name
data:
#@yaml/text-templated-strings
placeholder-name.yaml: |
pinniped.yaml: |
discovery:
url: (@= data.values.discovery_url or "null" @)
webhook:
@ -70,7 +70,7 @@ spec:
- name: image-pull-secret
#@ end
containers:
- name: placeholder-name
- name: pinniped
#@ if data.values.image_digest:
image: #@ data.values.image_repo + "@" + data.values.image_digest
#@ else:
@ -78,7 +78,7 @@ spec:
#@ end
imagePullPolicy: IfNotPresent
args:
- --config=/etc/config/placeholder-name.yaml
- --config=/etc/config/pinniped.yaml
- --downward-api-path=/etc/podinfo
volumeMounts:
- name: config-volume
@ -128,7 +128,7 @@ spec:
apiVersion: v1
kind: Service
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
labels:
app: #@ data.values.app_name
@ -144,16 +144,16 @@ spec:
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
name: v1alpha1.placeholder.suzerain-io.github.io
name: v1alpha1.pinniped.dev
labels:
app: #@ data.values.app_name
spec:
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
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.
service:
name: placeholder-name-api
name: pinniped-api
namespace: #@ data.values.namespace
port: 443

View File

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

View File

@ -1,9 +1,9 @@
#@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.
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
@ -12,9 +12,9 @@ require (
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.6.1
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/placeholder-name/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/kubernetes/1.19/api v0.0.0-00010101000000-000000000000
github.com/suzerain-io/pinniped/kubernetes/1.19/client-go 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/apimachinery v0.19.0-rc.0
k8s.io/apiserver v0.19.0-rc.0
@ -27,7 +27,7 @@ require (
)
replace (
github.com/suzerain-io/placeholder-name/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/placeholder-name/pkg/client => ./pkg/client
github.com/suzerain-io/pinniped/kubernetes/1.19/api => ./kubernetes/1.19/api
github.com/suzerain-io/pinniped/kubernetes/1.19/client-go => ./kubernetes/1.19/client-go
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"}"
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() {
# This should be something like "kubernetes/1.19/api".
@ -53,20 +53,20 @@ function codegen::generate_for_module() {
deepcopy,defaulter \
"${BASE_PKG}/kubernetes/1.19/api/generated" \
"${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}" \
deepcopy,defaulter,conversion,openapi \
"${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"
;;
1.19/client-go)
codegen::invoke_code_generator generate-groups "${mod_basename_for_version}" \
client,lister,informer \
"${BASE_PKG}/kubernetes/1.19/client-go" \
"${BASE_PKG}/kubernetes/1.19/api/apis" \
"placeholder:v1alpha1 crdsplaceholder:v1alpha1"
"pinniped:v1alpha1 crdpinniped:v1alpha1"
;;
esac
}

View File

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

View File

@ -24,8 +24,8 @@ import (
"k8s.io/client-go/tools/remotecommand"
"k8s.io/klog/v2"
"github.com/suzerain-io/placeholder-name/internal/certauthority"
"github.com/suzerain-io/placeholder-name/internal/constable"
"github.com/suzerain-io/pinniped/internal/certauthority"
"github.com/suzerain-io/pinniped/internal/constable"
)
// 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"
"k8s.io/klog/v2"
"github.com/suzerain-io/placeholder-name/internal/testutil"
"github.com/suzerain-io/pinniped/internal/testutil"
)
type fakePodExecutor struct {

View File

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

View File

@ -24,7 +24,7 @@ import (
kubetesting "k8s.io/client-go/testing"
"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) {

View File

@ -19,8 +19,8 @@ import (
aggregatorclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset"
"github.com/suzerain-io/controller-go"
"github.com/suzerain-io/placeholder-name/internal/certauthority"
placeholdernamecontroller "github.com/suzerain-io/placeholder-name/internal/controller"
"github.com/suzerain-io/pinniped/internal/certauthority"
pinnipedcontroller "github.com/suzerain-io/pinniped/internal/controller"
)
const (
@ -43,8 +43,8 @@ func NewCertsManagerController(
k8sClient kubernetes.Interface,
aggregatorClient aggregatorclient.Interface,
secretInformer corev1informers.SecretInformer,
withInformer placeholdernamecontroller.WithInformerOptionFunc,
withInitialEvent placeholdernamecontroller.WithInitialEventOptionFunc,
withInformer pinnipedcontroller.WithInformerOptionFunc,
withInitialEvent pinnipedcontroller.WithInitialEventOptionFunc,
) controller.Controller {
return controller.New(
controller.Config{
@ -58,7 +58,7 @@ func NewCertsManagerController(
},
withInformer(
secretInformer,
placeholdernamecontroller.NameAndNamespaceExactMatchFilterFactory(certsSecretName, namespace),
pinnipedcontroller.NameAndNamespaceExactMatchFilterFactory(certsSecretName, namespace),
controller.InformerOption{},
),
// 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.
aggregatedAPIServerCA, err := certauthority.New(pkix.Name{CommonName: "Placeholder CA"})
aggregatedAPIServerCA, err := certauthority.New(pkix.Name{CommonName: "Pinniped CA"})
if err != nil {
return fmt.Errorf("could not initialize CA: %w", err)
}
// 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.
serviceEndpoint := serviceName + "." + c.namespace + ".svc"

View File

@ -25,8 +25,8 @@ import (
aggregatorfake "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/fake"
"github.com/suzerain-io/controller-go"
"github.com/suzerain-io/placeholder-name/internal/testutil"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1"
"github.com/suzerain-io/pinniped/internal/testutil"
pinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
)
func TestManagerControllerOptions(t *testing.T) {
@ -187,7 +187,7 @@ func TestManagerControllerSync(t *testing.T) {
it.Before(func() {
apiService := &apiregistrationv1.APIService{
ObjectMeta: metav1.ObjectMeta{
Name: placeholderv1alpha1.SchemeGroupVersion.Version + "." + placeholderv1alpha1.GroupName,
Name: pinnipedv1alpha1.SchemeGroupVersion.Version + "." + pinnipedv1alpha1.GroupName,
},
Spec: apiregistrationv1.APIServiceSpec{
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
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.RequireMatchesPrivateKey(actualPrivateKey)
// Make sure we updated the APIService caBundle and left it otherwise unchanged
r.Len(aggregatorAPIClient.Actions(), 2)
r.Equal("get", aggregatorAPIClient.Actions()[0].GetVerb())
expectedAPIServiceName := placeholderv1alpha1.SchemeGroupVersion.Version + "." + placeholderv1alpha1.GroupName
expectedAPIServiceName := pinnipedv1alpha1.SchemeGroupVersion.Version + "." + pinnipedv1alpha1.GroupName
expectedUpdateAction := coretesting.NewUpdateAction(
schema.GroupVersionResource{
Group: apiregistrationv1.GroupName,

View File

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

View File

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

View File

@ -13,13 +13,13 @@ import (
"k8s.io/client-go/util/retry"
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.
func UpdateAPIService(ctx context.Context, aggregatorClient aggregatorclient.Interface, aggregatedAPIServerCA []byte) error {
apiServices := aggregatorClient.ApiregistrationV1().APIServices()
apiServiceName := placeholderv1alpha1.SchemeGroupVersion.Version + "." + placeholderv1alpha1.GroupName
apiServiceName := pinnipedv1alpha1.SchemeGroupVersion.Version + "." + pinnipedv1alpha1.GroupName
if err := retry.RetryOnConflict(retry.DefaultRetry, func() error {
// Retrieve the latest version of the Service before attempting update.

View File

@ -21,7 +21,7 @@ import (
)
func TestUpdateAPIService(t *testing.T) {
const apiServiceName = "v1alpha1.placeholder.suzerain-io.github.io"
const apiServiceName = "v1alpha1.pinniped.dev"
tests := []struct {
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
*/
package logindiscovery
package discovery
import (
"context"
@ -24,10 +24,10 @@ import (
coretesting "k8s.io/client-go/testing"
"github.com/suzerain-io/controller-go"
"github.com/suzerain-io/placeholder-name/internal/testutil"
crdsplaceholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1"
placeholderfake "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/fake"
placeholderinformers "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions"
"github.com/suzerain-io/pinniped/internal/testutil"
crdpinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1"
pinnipedfake "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/fake"
pinnipedinformers "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions"
)
func TestInformerFilters(t *testing.T) {
@ -37,23 +37,23 @@ func TestInformerFilters(t *testing.T) {
var r *require.Assertions
var observableWithInformerOption *testutil.ObservableWithInformerOption
var configMapInformerFilter controller.Filter
var loginDiscoveryConfigInformerFilter controller.Filter
var pinnipedDiscoveryInfoInformerFilter controller.Filter
it.Before(func() {
r = require.New(t)
observableWithInformerOption = testutil.NewObservableWithInformerOption()
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(
installedInNamespace,
nil,
nil,
configMapInformer,
loginDiscoveryConfigInformer,
pinnipedDiscoveryInfoInformer,
observableWithInformerOption.WithInformer, // make it possible to observe the behavior of the Filters
)
configMapInformerFilter = observableWithInformerOption.GetFilterForInformer(configMapInformer)
loginDiscoveryConfigInformerFilter = observableWithInformerOption.GetFilterForInformer(loginDiscoveryConfigInformer)
pinnipedDiscoveryInfoInformerFilter = observableWithInformerOption.GetFilterForInformer(pinnipedDiscoveryInfoInformer)
})
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 target, wrongNamespace, wrongName, unrelated *crdsplaceholderv1alpha1.LoginDiscoveryConfig
var target, wrongNamespace, wrongName, unrelated *crdpinnipedv1alpha1.PinnipedDiscoveryInfo
it.Before(func() {
subject = loginDiscoveryConfigInformerFilter
target = &crdsplaceholderv1alpha1.LoginDiscoveryConfig{
ObjectMeta: metav1.ObjectMeta{Name: "placeholder-name-config", Namespace: installedInNamespace},
subject = pinnipedDiscoveryInfoInformerFilter
target = &crdpinnipedv1alpha1.PinnipedDiscoveryInfo{
ObjectMeta: metav1.ObjectMeta{Name: "pinniped-config", Namespace: installedInNamespace},
}
wrongNamespace = &crdsplaceholderv1alpha1.LoginDiscoveryConfig{
ObjectMeta: metav1.ObjectMeta{Name: "placeholder-name-config", Namespace: "wrong-namespace"},
wrongNamespace = &crdpinnipedv1alpha1.PinnipedDiscoveryInfo{
ObjectMeta: metav1.ObjectMeta{Name: "pinniped-config", Namespace: "wrong-namespace"},
}
wrongName = &crdsplaceholderv1alpha1.LoginDiscoveryConfig{
wrongName = &crdpinnipedv1alpha1.PinnipedDiscoveryInfo{
ObjectMeta: metav1.ObjectMeta{Name: "wrong-name", Namespace: installedInNamespace},
}
unrelated = &crdsplaceholderv1alpha1.LoginDiscoveryConfig{
unrelated = &crdpinnipedv1alpha1.PinnipedDiscoveryInfo{
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() {
r.True(subject.Add(target))
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() {
r.False(subject.Add(wrongNamespace))
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() {
r.False(subject.Add(wrongName))
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() {
r.False(subject.Add(unrelated))
r.False(subject.Update(unrelated, unrelated))
@ -171,31 +171,31 @@ func TestSync(t *testing.T) {
var subject controller.Controller
var serverOverride *string
var kubeInformerClient *kubernetesfake.Clientset
var placeholderInformerClient *placeholderfake.Clientset
var pinnipedInformerClient *pinnipedfake.Clientset
var kubeInformers kubeinformers.SharedInformerFactory
var placeholderInformers placeholderinformers.SharedInformerFactory
var placeholderAPIClient *placeholderfake.Clientset
var pinnipedInformers pinnipedinformers.SharedInformerFactory
var pinnipedAPIClient *pinnipedfake.Clientset
var timeoutContext context.Context
var timeoutContextCancel context.CancelFunc
var syncContext *controller.Context
var expectedLoginDiscoveryConfig = func(expectedNamespace, expectedServerURL, expectedCAData string) (schema.GroupVersionResource, *crdsplaceholderv1alpha1.LoginDiscoveryConfig) {
expectedLoginDiscoveryConfigGVR := schema.GroupVersionResource{
Group: crdsplaceholderv1alpha1.GroupName,
var expectedPinnipedDiscoveryInfo = func(expectedNamespace, expectedServerURL, expectedCAData string) (schema.GroupVersionResource, *crdpinnipedv1alpha1.PinnipedDiscoveryInfo) {
expectedPinnipedDiscoveryInfoGVR := schema.GroupVersionResource{
Group: crdpinnipedv1alpha1.GroupName,
Version: "v1alpha1",
Resource: "logindiscoveryconfigs",
Resource: "pinnipeddiscoveryinfos",
}
expectedLoginDiscoveryConfig := &crdsplaceholderv1alpha1.LoginDiscoveryConfig{
expectedPinnipedDiscoveryInfo := &crdpinnipedv1alpha1.PinnipedDiscoveryInfo{
ObjectMeta: metav1.ObjectMeta{
Name: "placeholder-name-config",
Name: "pinniped-config",
Namespace: expectedNamespace,
},
Spec: crdsplaceholderv1alpha1.LoginDiscoveryConfigSpec{
Spec: crdpinnipedv1alpha1.PinnipedDiscoveryInfoSpec{
Server: expectedServerURL,
CertificateAuthorityData: expectedCAData,
},
}
return expectedLoginDiscoveryConfigGVR, expectedLoginDiscoveryConfig
return expectedPinnipedDiscoveryInfoGVR, expectedPinnipedDiscoveryInfo
}
// Defer starting the informers until the last possible moment so that the
@ -205,9 +205,9 @@ func TestSync(t *testing.T) {
subject = NewPublisherController(
installedInNamespace,
serverOverride,
placeholderAPIClient,
pinnipedAPIClient,
kubeInformers.Core().V1().ConfigMaps(),
placeholderInformers.Crds().V1alpha1().LoginDiscoveryConfigs(),
pinnipedInformers.Crd().V1alpha1().PinnipedDiscoveryInfos(),
controller.WithInformer,
)
@ -223,7 +223,7 @@ func TestSync(t *testing.T) {
// Must start informers before calling TestRunSynchronously()
kubeInformers.Start(timeoutContext.Done())
placeholderInformers.Start(timeoutContext.Done())
pinnipedInformers.Start(timeoutContext.Done())
controller.TestRunSynchronously(t, subject)
}
@ -234,9 +234,9 @@ func TestSync(t *testing.T) {
kubeInformerClient = kubernetesfake.NewSimpleClientset()
kubeInformers = kubeinformers.NewSharedInformerFactory(kubeInformerClient, 0)
placeholderAPIClient = placeholderfake.NewSimpleClientset()
placeholderInformerClient = placeholderfake.NewSimpleClientset()
placeholderInformers = placeholderinformers.NewSharedInformerFactory(placeholderInformerClient, 0)
pinnipedAPIClient = pinnipedfake.NewSimpleClientset()
pinnipedInformerClient = pinnipedfake.NewSimpleClientset()
pinnipedInformers = pinnipedinformers.NewSharedInformerFactory(pinnipedInformerClient, 0)
})
it.After(func() {
@ -268,13 +268,13 @@ func TestSync(t *testing.T) {
r.NoError(err)
})
when("the LoginDiscoveryConfig does not already exist", func() {
it("creates a LoginDiscoveryConfig", func() {
when("the PinnipedDiscoveryInfo does not already exist", func() {
it("creates a PinnipedDiscoveryInfo", func() {
startInformersAndController()
err := controller.TestSync(t, subject, *syncContext)
r.NoError(err)
expectedLoginDiscoveryConfigGVR, expectedLoginDiscoveryConfig := expectedLoginDiscoveryConfig(
expectedPinnipedDiscoveryInfoGVR, expectedPinnipedDiscoveryInfo := expectedPinnipedDiscoveryInfo(
installedInNamespace,
kubeServerURL,
caData,
@ -283,20 +283,20 @@ func TestSync(t *testing.T) {
r.Equal(
[]coretesting.Action{
coretesting.NewCreateAction(
expectedLoginDiscoveryConfigGVR,
expectedPinnipedDiscoveryInfoGVR,
installedInNamespace,
expectedLoginDiscoveryConfig,
expectedPinnipedDiscoveryInfo,
),
},
placeholderAPIClient.Actions(),
pinnipedAPIClient.Actions(),
)
})
when("creating the LoginDiscoveryConfig fails", func() {
when("creating the PinnipedDiscoveryInfo fails", func() {
it.Before(func() {
placeholderAPIClient.PrependReactor(
pinnipedAPIClient.PrependReactor(
"create",
"logindiscoveryconfigs",
"pinnipeddiscoveryinfos",
func(_ coretesting.Action) (bool, runtime.Object, error) {
return true, nil, errors.New("create failed")
},
@ -306,7 +306,7 @@ func TestSync(t *testing.T) {
it("returns the create error", func() {
startInformersAndController()
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)
r.NoError(err)
expectedLoginDiscoveryConfigGVR, expectedLoginDiscoveryConfig := expectedLoginDiscoveryConfig(
expectedPinnipedDiscoveryInfoGVR, expectedPinnipedDiscoveryInfo := expectedPinnipedDiscoveryInfo(
installedInNamespace,
kubeServerURL,
caData,
)
expectedLoginDiscoveryConfig.Spec.Server = "https://some-server-override"
expectedPinnipedDiscoveryInfo.Spec.Server = "https://some-server-override"
r.Equal(
[]coretesting.Action{
coretesting.NewCreateAction(
expectedLoginDiscoveryConfigGVR,
expectedPinnipedDiscoveryInfoGVR,
installedInNamespace,
expectedLoginDiscoveryConfig,
expectedPinnipedDiscoveryInfo,
),
},
placeholderAPIClient.Actions(),
pinnipedAPIClient.Actions(),
)
})
})
})
when("the LoginDiscoveryConfig already exists", func() {
when("the LoginDiscoveryConfig is already up to date according to the data in the ConfigMap", func() {
when("the PinnipedDiscoveryInfo already exists", func() {
when("the PinnipedDiscoveryInfo is already up to date according to the data in the ConfigMap", func() {
it.Before(func() {
_, expectedLoginDiscoveryConfig := expectedLoginDiscoveryConfig(
_, expectedPinnipedDiscoveryInfo := expectedPinnipedDiscoveryInfo(
installedInNamespace,
kubeServerURL,
caData,
)
err := placeholderInformerClient.Tracker().Add(expectedLoginDiscoveryConfig)
err := pinnipedInformerClient.Tracker().Add(expectedPinnipedDiscoveryInfo)
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()
err := controller.TestSync(t, subject, *syncContext)
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() {
_, expectedLoginDiscoveryConfig := expectedLoginDiscoveryConfig(
_, expectedPinnipedDiscoveryInfo := expectedPinnipedDiscoveryInfo(
installedInNamespace,
kubeServerURL,
caData,
)
expectedLoginDiscoveryConfig.Spec.Server = "https://some-other-server"
r.NoError(placeholderInformerClient.Tracker().Add(expectedLoginDiscoveryConfig))
r.NoError(placeholderAPIClient.Tracker().Add(expectedLoginDiscoveryConfig))
expectedPinnipedDiscoveryInfo.Spec.Server = "https://some-other-server"
r.NoError(pinnipedInformerClient.Tracker().Add(expectedPinnipedDiscoveryInfo))
r.NoError(pinnipedAPIClient.Tracker().Add(expectedPinnipedDiscoveryInfo))
})
it("updates the existing LoginDiscoveryConfig", func() {
it("updates the existing PinnipedDiscoveryInfo", func() {
startInformersAndController()
err := controller.TestSync(t, subject, *syncContext)
r.NoError(err)
expectedLoginDiscoveryConfigGVR, expectedLoginDiscoveryConfig := expectedLoginDiscoveryConfig(
expectedPinnipedDiscoveryInfoGVR, expectedPinnipedDiscoveryInfo := expectedPinnipedDiscoveryInfo(
installedInNamespace,
kubeServerURL,
caData,
)
expectedActions := []coretesting.Action{
coretesting.NewUpdateAction(
expectedLoginDiscoveryConfigGVR,
expectedPinnipedDiscoveryInfoGVR,
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() {
placeholderAPIClient.PrependReactor(
pinnipedAPIClient.PrependReactor(
"update",
"logindiscoveryconfigs",
"pinnipeddiscoveryinfos",
func(_ coretesting.Action) (bool, runtime.Object, error) {
return true, nil, errors.New("update failed")
},
@ -407,7 +407,7 @@ func TestSync(t *testing.T) {
it("returns the update error", func() {
startInformersAndController()
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()
err := controller.TestSync(t, subject, *syncContext)
r.NoError(err)
r.Empty(placeholderAPIClient.Actions())
r.Empty(pinnipedAPIClient.Actions())
})
})
})
@ -451,7 +451,7 @@ func TestSync(t *testing.T) {
startInformersAndController()
err := controller.TestSync(t, subject, *syncContext)
r.NoError(err)
r.Empty(placeholderAPIClient.Actions())
r.Empty(pinnipedAPIClient.Actions())
})
})
}, 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"
"github.com/suzerain-io/controller-go"
"github.com/suzerain-io/placeholder-name/internal/controller/apicerts"
"github.com/suzerain-io/placeholder-name/internal/controller/logindiscovery"
"github.com/suzerain-io/placeholder-name/internal/provider"
placeholderclientset "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
placeholderinformers "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions"
"github.com/suzerain-io/pinniped/internal/controller/apicerts"
"github.com/suzerain-io/pinniped/internal/controller/discovery"
"github.com/suzerain-io/pinniped/internal/provider"
pinnipedclientset "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned"
pinnipedinformers "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions"
)
const (
@ -37,25 +37,25 @@ func PrepareControllers(
servingCertRotationThreshold float32,
) (func(ctx context.Context), error) {
// Create k8s clients.
k8sClient, aggregatorClient, placeholderClient, err := createClients()
k8sClient, aggregatorClient, pinnipedClient, err := createClients()
if err != nil {
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.
kubePublicNamespaceK8sInformers, installationNamespaceK8sInformers, installationNamespacePlaceholderInformers :=
createInformers(serverInstallationNamespace, k8sClient, placeholderClient)
kubePublicNamespaceK8sInformers, installationNamespaceK8sInformers, installationNamespacePinnipedInformers :=
createInformers(serverInstallationNamespace, k8sClient, pinnipedClient)
// Create controller manager.
controllerManager := controller.
NewManager().
WithController(
logindiscovery.NewPublisherController(
discovery.NewPublisherController(
serverInstallationNamespace,
discoveryURLOverride,
placeholderClient,
pinnipedClient,
kubePublicNamespaceK8sInformers.Core().V1().ConfigMaps(),
installationNamespacePlaceholderInformers.Crds().V1alpha1().LoginDiscoveryConfigs(),
installationNamespacePinnipedInformers.Crd().V1alpha1().PinnipedDiscoveryInfos(),
controller.WithInformer,
),
singletonWorker,
@ -95,7 +95,7 @@ func PrepareControllers(
return func(ctx context.Context) {
kubePublicNamespaceK8sInformers.Start(ctx.Done())
installationNamespaceK8sInformers.Start(ctx.Done())
installationNamespacePlaceholderInformers.Start(ctx.Done())
installationNamespacePinnipedInformers.Start(ctx.Done())
go controllerManager.Start(ctx)
}, nil
@ -105,7 +105,7 @@ func PrepareControllers(
func createClients() (
k8sClient *kubernetes.Clientset,
aggregatorClient *aggregatorclient.Clientset,
placeholderClient *placeholderclientset.Clientset,
pinnipedClient *pinnipedclientset.Clientset,
err error,
) {
// Load the Kubernetes client configuration.
@ -129,12 +129,12 @@ func createClients() (
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
// (for which protobuf encoding is not supported).
placeholderClient, err = placeholderclientset.NewForConfig(kubeConfig)
pinnipedClient, err = pinnipedclientset.NewForConfig(kubeConfig)
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
@ -145,26 +145,26 @@ func createClients() (
func createInformers(
serverInstallationNamespace string,
k8sClient *kubernetes.Clientset,
placeholderClient *placeholderclientset.Clientset,
pinnipedClient *pinnipedclientset.Clientset,
) (
kubePublicNamespaceK8sInformers k8sinformers.SharedInformerFactory,
installationNamespaceK8sInformers k8sinformers.SharedInformerFactory,
installationNamespacePlaceholderInformers placeholderinformers.SharedInformerFactory,
installationNamespacePinnipedInformers pinnipedinformers.SharedInformerFactory,
) {
kubePublicNamespaceK8sInformers = k8sinformers.NewSharedInformerFactoryWithOptions(
k8sClient,
defaultResyncInterval,
k8sinformers.WithNamespace(logindiscovery.ClusterInfoNamespace),
k8sinformers.WithNamespace(discovery.ClusterInfoNamespace),
)
installationNamespaceK8sInformers = k8sinformers.NewSharedInformerFactoryWithOptions(
k8sClient,
defaultResyncInterval,
k8sinformers.WithNamespace(serverInstallationNamespace),
)
installationNamespacePlaceholderInformers = placeholderinformers.NewSharedInformerFactoryWithOptions(
placeholderClient,
installationNamespacePinnipedInformers = pinnipedinformers.NewSharedInformerFactoryWithOptions(
pinnipedClient,
defaultResyncInterval,
placeholderinformers.WithNamespace(serverInstallationNamespace),
pinnipedinformers.WithNamespace(serverInstallationNamespace),
)
return
}

View File

@ -5,4 +5,4 @@ SPDX-License-Identifier: Apache-2.0
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.
// 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
import (
pkix "crypto/x509/pkix"
gomock "github.com/golang/mock/gomock"
reflect "reflect"
time "time"
gomock "github.com/golang/mock/gomock"
)
// MockCertIssuer is a mock of CertIssuer interface

View File

@ -21,7 +21,7 @@ import (
"k8s.io/apiserver/pkg/registry/rest"
"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.
@ -51,7 +51,7 @@ type REST struct {
}
func (r *REST) New() runtime.Object {
return &placeholderapi.CredentialRequest{}
return &pinnipedapi.CredentialRequest{}
}
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)
return &placeholderapi.CredentialRequest{
Status: placeholderapi.CredentialRequestStatus{
Credential: &placeholderapi.CredentialRequestCredential{
return &pinnipedapi.CredentialRequest{
Status: pinnipedapi.CredentialRequestStatus{
Credential: &pinnipedapi.CredentialRequestCredential{
ExpirationTimestamp: metav1.NewTime(time.Now().UTC().Add(clientCertificateTTL)),
ClientCertificateData: string(certPEM),
ClientKeyData: string(keyPEM),
@ -118,8 +118,8 @@ func (r *REST) Create(ctx context.Context, obj runtime.Object, createValidation
}, nil
}
func validateRequest(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions, t *trace.Trace) (*placeholderapi.CredentialRequest, error) {
credentialRequest, ok := obj.(*placeholderapi.CredentialRequest)
func validateRequest(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions, t *trace.Trace) (*pinnipedapi.CredentialRequest, error) {
credentialRequest, ok := obj.(*pinnipedapi.CredentialRequest)
if !ok {
traceValidationFailure(t, "not a CredentialRequest")
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 {
traceValidationFailure(t, "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")
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
if token == nil || len(token.Value) == 0 {
traceValidationFailure(t, "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
@ -149,7 +149,7 @@ func validateRequest(ctx context.Context, obj runtime.Object, createValidation r
if len(options.DryRun) != 0 {
traceValidationFailure(t, "dryRun not supported")
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.
if createValidation != nil {
requestForValidation := obj.DeepCopyObject()
credentialRequestCopy, _ := requestForValidation.(*placeholderapi.CredentialRequest)
credentialRequestCopy, _ := requestForValidation.(*pinnipedapi.CredentialRequest)
credentialRequestCopy.Spec.Token.Value = ""
if err := createValidation(ctx, requestForValidation); err != nil {
traceFailureWithError(t, "validation webhook", err)
@ -171,7 +171,7 @@ func validateRequest(ctx context.Context, obj runtime.Object, createValidation r
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>"
if user != nil {
userID = user.GetUID()
@ -179,7 +179,7 @@ func traceSuccess(t *trace.Trace, user user.Info, webhookAuthenticated bool, pla
t.Step("success",
trace.Field{Key: "userID", Value: userID},
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"
return &placeholderapi.CredentialRequest{
Status: placeholderapi.CredentialRequestStatus{
return &pinnipedapi.CredentialRequest{
Status: pinnipedapi.CredentialRequestStatus{
Credential: nil,
Message: &m,
},

View File

@ -25,9 +25,9 @@ import (
"k8s.io/apiserver/pkg/registry/rest"
"k8s.io/klog/v2"
"github.com/suzerain-io/placeholder-name/internal/mocks/mockcertissuer"
"github.com/suzerain-io/placeholder-name/internal/testutil"
placeholderapi "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder"
"github.com/suzerain-io/pinniped/internal/mocks/mockcertissuer"
"github.com/suzerain-io/pinniped/internal/testutil"
pinnipedapi "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped"
)
type contextKey struct{}
@ -105,16 +105,16 @@ func TestCreate(t *testing.T) {
response, err := callCreate(context.Background(), storage, validCredentialRequestWithToken(requestToken))
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.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{
Status: placeholderapi.CredentialRequestStatus{
Credential: &placeholderapi.CredentialRequestCredential{
r.Equal(response, &pinnipedapi.CredentialRequest{
Status: pinnipedapi.CredentialRequestStatus{
Credential: &pinnipedapi.CredentialRequestCredential{
ExpirationTimestamp: metav1.Time{},
ClientCertificateData: "test-cert",
ClientKeyData: "test-key",
@ -164,7 +164,7 @@ func TestCreate(t *testing.T) {
requireSuccessfulResponseWithAuthenticationFailureMessage(t, err, response)
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() {
@ -179,7 +179,7 @@ func TestCreate(t *testing.T) {
requireSuccessfulResponseWithAuthenticationFailureMessage(t, err, response)
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() {
@ -204,7 +204,7 @@ func TestCreate(t *testing.T) {
response, err := callCreate(context.Background(), storage, validCredentialRequest())
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() {
@ -220,7 +220,7 @@ func TestCreate(t *testing.T) {
response, err := callCreate(context.Background(), storage, validCredentialRequest())
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() {
@ -250,49 +250,49 @@ func TestCreate(t *testing.T) {
it("CreateFailsWhenTokenIsNilInRequest", func() {
storage := NewREST(&FakeToken{}, nil)
response, err := callCreate(context.Background(), storage, credentialRequest(placeholderapi.CredentialRequestSpec{
Type: placeholderapi.TokenCredentialType,
response, err := callCreate(context.Background(), storage, credentialRequest(pinnipedapi.CredentialRequestSpec{
Type: pinnipedapi.TokenCredentialType,
Token: nil,
}))
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`)
})
it("CreateFailsWhenTypeInRequestIsMissing", func() {
storage := NewREST(&FakeToken{}, nil)
response, err := callCreate(context.Background(), storage, credentialRequest(placeholderapi.CredentialRequestSpec{
response, err := callCreate(context.Background(), storage, credentialRequest(pinnipedapi.CredentialRequestSpec{
Type: "",
Token: &placeholderapi.CredentialRequestTokenCredential{Value: "a token"},
Token: &pinnipedapi.CredentialRequestTokenCredential{Value: "a token"},
}))
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`)
})
it("CreateFailsWhenTypeInRequestIsNotLegal", func() {
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",
Token: &placeholderapi.CredentialRequestTokenCredential{Value: "a token"},
Token: &pinnipedapi.CredentialRequestTokenCredential{Value: "a token"},
}))
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`)
})
it("CreateFailsWhenTokenValueIsEmptyInRequest", func() {
storage := NewREST(&FakeToken{}, nil)
response, err := callCreate(context.Background(), storage, credentialRequest(placeholderapi.CredentialRequestSpec{
Type: placeholderapi.TokenCredentialType,
Token: &placeholderapi.CredentialRequestTokenCredential{Value: ""},
response, err := callCreate(context.Background(), storage, credentialRequest(pinnipedapi.CredentialRequestSpec{
Type: pinnipedapi.TokenCredentialType,
Token: &pinnipedapi.CredentialRequestTokenCredential{Value: ""},
}))
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`)
})
@ -320,7 +320,7 @@ func TestCreate(t *testing.T) {
context.Background(),
validCredentialRequestWithToken(requestToken),
func(ctx context.Context, obj runtime.Object) error {
credentialRequest, _ := obj.(*placeholderapi.CredentialRequest)
credentialRequest, _ := obj.(*pinnipedapi.CredentialRequest)
credentialRequest.Spec.Token.Value = "foobaz"
return nil
},
@ -342,7 +342,7 @@ func TestCreate(t *testing.T) {
context.Background(),
validCredentialRequest(),
func(ctx context.Context, obj runtime.Object) error {
credentialRequest, _ := obj.(*placeholderapi.CredentialRequest)
credentialRequest, _ := obj.(*pinnipedapi.CredentialRequest)
validationFunctionWasCalled = true
validationFunctionSawTokenValue = credentialRequest.Spec.Token.Value
return nil
@ -364,7 +364,7 @@ func TestCreate(t *testing.T) {
})
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`)
})
@ -431,7 +431,7 @@ func requireOneLogStatement(r *require.Assertions, logger *testutil.TranscriptLo
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(
ctx,
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")
}
func validCredentialRequestWithToken(token string) *placeholderapi.CredentialRequest {
return credentialRequest(placeholderapi.CredentialRequestSpec{
Type: placeholderapi.TokenCredentialType,
Token: &placeholderapi.CredentialRequestTokenCredential{Value: token},
func validCredentialRequestWithToken(token string) *pinnipedapi.CredentialRequest {
return credentialRequest(pinnipedapi.CredentialRequestSpec{
Type: pinnipedapi.TokenCredentialType,
Token: &pinnipedapi.CredentialRequestTokenCredential{Value: token},
})
}
func credentialRequest(spec placeholderapi.CredentialRequestSpec) *placeholderapi.CredentialRequest {
return &placeholderapi.CredentialRequest{
func credentialRequest(spec pinnipedapi.CredentialRequestSpec) *pinnipedapi.CredentialRequest {
return &pinnipedapi.CredentialRequest{
TypeMeta: metav1.TypeMeta{},
ObjectMeta: metav1.ObjectMeta{
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) {
t.Helper()
require.NoError(t, err)
require.Equal(t, response, &placeholderapi.CredentialRequest{
Status: placeholderapi.CredentialRequestStatus{
require.Equal(t, response, &pinnipedapi.CredentialRequest{
Status: pinnipedapi.CredentialRequestStatus{
Credential: nil,
Message: stringPtr("authentication failed"),
},

View File

@ -3,7 +3,7 @@ Copyright 2020 VMware, Inc.
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
import (
@ -21,15 +21,15 @@ import (
"k8s.io/client-go/kubernetes"
restclient "k8s.io/client-go/rest"
"github.com/suzerain-io/placeholder-name/internal/apiserver"
"github.com/suzerain-io/placeholder-name/internal/certauthority/kubecertauthority"
"github.com/suzerain-io/placeholder-name/internal/constable"
"github.com/suzerain-io/placeholder-name/internal/controllermanager"
"github.com/suzerain-io/placeholder-name/internal/downward"
"github.com/suzerain-io/placeholder-name/internal/provider"
"github.com/suzerain-io/placeholder-name/internal/registry/credentialrequest"
placeholderv1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1"
"github.com/suzerain-io/placeholder-name/pkg/config"
"github.com/suzerain-io/pinniped/internal/apiserver"
"github.com/suzerain-io/pinniped/internal/certauthority/kubecertauthority"
"github.com/suzerain-io/pinniped/internal/constable"
"github.com/suzerain-io/pinniped/internal/controllermanager"
"github.com/suzerain-io/pinniped/internal/downward"
"github.com/suzerain-io/pinniped/internal/provider"
"github.com/suzerain-io/pinniped/internal/registry/credentialrequest"
pinnipedv1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
"github.com/suzerain-io/pinniped/pkg/config"
)
type percentageValue struct {
@ -57,7 +57,7 @@ func (p *percentageValue) Type() string {
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 {
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
// 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.
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.
func (a *App) addServerCommand(ctx context.Context, args []string, stdout, stderr io.Writer) {
cmd := &cobra.Command{
Use: `placeholder-name-server`,
Long: "placeholder-name-server provides a generic API for mapping an external\n" +
Use: `pinniped-server`,
Long: "pinniped-server provides a generic API for mapping an external\n" +
"credential from somewhere to an internal credential to be used for\n" +
"authenticating to the Kubernetes API.",
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,
"config",
"c",
"placeholder-name.yaml",
"pinniped.yaml",
"path to configuration file",
)
@ -166,7 +166,7 @@ func (a *App) runServer(ctx context.Context) error {
// post start hook of the aggregated API server.
startControllersFunc, err := controllermanager.PrepareControllers(
serverInstallationNamespace,
cfg.DiscoveryConfig.URL,
cfg.DiscoveryInfo.URL,
dynamicCertProvider,
a.servingCertRotationThreshold.percentage,
)
@ -233,7 +233,7 @@ func getAggregatedAPIServerConfig(
) (*apiserver.Config, error) {
recommendedOptions := genericoptions.NewRecommendedOptions(
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
)
recommendedOptions.Etcd = nil // turn off etcd storage because we don't need it yet

View File

@ -17,17 +17,17 @@ import (
)
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
authenticating to the Kubernetes API.
Usage:
placeholder-name-server [flags]
pinniped-server [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")
-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)
--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",
args: []string{"tuna"},
wantErr: `unknown command "tuna" for "placeholder-name-server"`,
wantErr: `unknown command "tuna" for "pinniped-server"`,
},
{
name: "ShortConfigFlagSucceeds",
@ -67,7 +67,7 @@ func TestCommand(t *testing.T) {
"--config", "some/path/to/config.yaml",
"tuna",
},
wantErr: `unknown command "tuna" for "placeholder-name-server"`,
wantErr: `unknown command "tuna" for "pinniped-server"`,
},
{
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
package crdsplaceholder
package crdpinniped
import (
"k8s.io/apimachinery/pkg/runtime"
"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.
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
*/
package crdsplaceholder
package crdpinniped

View File

@ -5,9 +5,9 @@ SPDX-License-Identifier: Apache-2.0
// +k8s:openapi-gen=true
// +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
// +groupName=placeholder.suzerain-io.github.io
// +groupName=crd.pinniped.dev
// Package v1alpha1 is the v1alpha1 version of the API.
package v1alpha1

View File

@ -12,7 +12,7 @@ import (
"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.
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
@ -33,8 +33,8 @@ func init() {
// Adds the list of known types to the given scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&LoginDiscoveryConfig{},
&LoginDiscoveryConfigList{},
&PinnipedDiscoveryInfo{},
&PinnipedDiscoveryInfoList{},
)
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil

View File

@ -7,7 +7,7 @@ package v1alpha1
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
type LoginDiscoveryConfigSpec struct {
type PinnipedDiscoveryInfoSpec struct {
// The K8s API server URL. Required.
Server string `json:"server,omitempty"`
@ -18,18 +18,18 @@ type LoginDiscoveryConfigSpec struct {
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type LoginDiscoveryConfig struct {
type PinnipedDiscoveryInfo struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec LoginDiscoveryConfigSpec `json:"spec"`
Spec PinnipedDiscoveryInfoSpec `json:"spec"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
type LoginDiscoveryConfigList struct {
type PinnipedDiscoveryInfoList struct {
metav1.TypeMeta `json:",inline"`
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.
func (in *LoginDiscoveryConfig) DeepCopyInto(out *LoginDiscoveryConfig) {
func (in *PinnipedDiscoveryInfo) DeepCopyInto(out *PinnipedDiscoveryInfo) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
@ -22,18 +22,18 @@ func (in *LoginDiscoveryConfig) DeepCopyInto(out *LoginDiscoveryConfig) {
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoginDiscoveryConfig.
func (in *LoginDiscoveryConfig) DeepCopy() *LoginDiscoveryConfig {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PinnipedDiscoveryInfo.
func (in *PinnipedDiscoveryInfo) DeepCopy() *PinnipedDiscoveryInfo {
if in == nil {
return nil
}
out := new(LoginDiscoveryConfig)
out := new(PinnipedDiscoveryInfo)
in.DeepCopyInto(out)
return out
}
// 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 {
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.
func (in *LoginDiscoveryConfigList) DeepCopyInto(out *LoginDiscoveryConfigList) {
func (in *PinnipedDiscoveryInfoList) DeepCopyInto(out *PinnipedDiscoveryInfoList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]LoginDiscoveryConfig, len(*in))
*out = make([]PinnipedDiscoveryInfo, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
@ -55,18 +55,18 @@ func (in *LoginDiscoveryConfigList) DeepCopyInto(out *LoginDiscoveryConfigList)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoginDiscoveryConfigList.
func (in *LoginDiscoveryConfigList) DeepCopy() *LoginDiscoveryConfigList {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PinnipedDiscoveryInfoList.
func (in *PinnipedDiscoveryInfoList) DeepCopy() *PinnipedDiscoveryInfoList {
if in == nil {
return nil
}
out := new(LoginDiscoveryConfigList)
out := new(PinnipedDiscoveryInfoList)
in.DeepCopyInto(out)
return out
}
// 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 {
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.
func (in *LoginDiscoveryConfigSpec) DeepCopyInto(out *LoginDiscoveryConfigSpec) {
func (in *PinnipedDiscoveryInfoSpec) DeepCopyInto(out *PinnipedDiscoveryInfoSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoginDiscoveryConfigSpec.
func (in *LoginDiscoveryConfigSpec) DeepCopy() *LoginDiscoveryConfigSpec {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PinnipedDiscoveryInfoSpec.
func (in *PinnipedDiscoveryInfoSpec) DeepCopy() *PinnipedDiscoveryInfoSpec {
if in == nil {
return nil
}
out := new(LoginDiscoveryConfigSpec)
out := new(PinnipedDiscoveryInfoSpec)
in.DeepCopyInto(out)
return out
}

View File

@ -7,4 +7,4 @@ SPDX-License-Identifier: Apache-2.0
// 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"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder"
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1"
"github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped"
"github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
)
// Install registers the API group and adds types to a scheme.
func Install(scheme *runtime.Scheme) {
utilruntime.Must(placeholder.AddToScheme(scheme))
utilruntime.Must(pinniped.AddToScheme(scheme))
utilruntime.Must(v1alpha1.AddToScheme(scheme))
utilruntime.Must(scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion))
}

View File

@ -4,14 +4,14 @@ SPDX-License-Identifier: Apache-2.0
*/
//nolint:gochecknoglobals
package placeholder
package pinniped
import (
"k8s.io/apimachinery/pkg/runtime"
"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.
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
*/
package placeholder
package pinniped
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: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
// +groupName=crds.placeholder.suzerain-io.github.io
// +groupName=pinniped.dev
// Package v1alpha1 is the v1alpha1 version of the API.
package v1alpha1

View File

@ -12,7 +12,7 @@ import (
"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.
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.
package placeholder
package pinniped
import (
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,71 +19,71 @@ import (
func GetOpenAPIDefinitions(ref common.ReferenceCallback) 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/placeholder-name/kubernetes/1.19/api/apis/crdsplaceholder/v1alpha1.LoginDiscoveryConfigList": schema_api_apis_crdsplaceholder_v1alpha1_LoginDiscoveryConfigList(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/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequest": schema_api_apis_placeholder_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/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestList": schema_api_apis_placeholder_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/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestStatus": schema_api_apis_placeholder_v1alpha1_CredentialRequestStatus(ref),
"github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/v1alpha1.CredentialRequestTokenCredential": schema_api_apis_placeholder_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.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.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Condition": schema_pkg_apis_meta_v1_Condition(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ExportOptions": schema_pkg_apis_meta_v1_ExportOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry": schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata": schema_pkg_apis_meta_v1_PartialObjectMetadata(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadataList": schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.PatchOptions": schema_pkg_apis_meta_v1_PatchOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Table": schema_pkg_apis_meta_v1_Table(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition": schema_pkg_apis_meta_v1_TableColumnDefinition(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableOptions": schema_pkg_apis_meta_v1_TableOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableRow": schema_pkg_apis_meta_v1_TableRow(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition": schema_pkg_apis_meta_v1_TableRowCondition(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.UpdateOptions": schema_pkg_apis_meta_v1_UpdateOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref),
"k8s.io/apimachinery/pkg/runtime.RawExtension": schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref),
"k8s.io/apimachinery/pkg/runtime.TypeMeta": schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref),
"k8s.io/apimachinery/pkg/runtime.Unknown": schema_k8sio_apimachinery_pkg_runtime_Unknown(ref),
"k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(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/pinniped/kubernetes/1.19/api/apis/crdpinniped/v1alpha1.PinnipedDiscoveryInfoList": schema_api_apis_crdpinniped_v1alpha1_PinnipedDiscoveryInfoList(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/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequest": schema_api_apis_pinniped_v1alpha1_CredentialRequest(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/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestList": schema_api_apis_pinniped_v1alpha1_CredentialRequestList(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/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1.CredentialRequestStatus": schema_api_apis_pinniped_v1alpha1_CredentialRequestStatus(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.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.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Condition": schema_pkg_apis_meta_v1_Condition(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ExportOptions": schema_pkg_apis_meta_v1_ExportOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry": schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata": schema_pkg_apis_meta_v1_PartialObjectMetadata(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadataList": schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.PatchOptions": schema_pkg_apis_meta_v1_PatchOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Table": schema_pkg_apis_meta_v1_Table(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition": schema_pkg_apis_meta_v1_TableColumnDefinition(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableOptions": schema_pkg_apis_meta_v1_TableOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableRow": schema_pkg_apis_meta_v1_TableRow(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition": schema_pkg_apis_meta_v1_TableRowCondition(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.UpdateOptions": schema_pkg_apis_meta_v1_UpdateOptions(ref),
"k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref),
"k8s.io/apimachinery/pkg/runtime.RawExtension": schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref),
"k8s.io/apimachinery/pkg/runtime.TypeMeta": schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref),
"k8s.io/apimachinery/pkg/runtime.Unknown": schema_k8sio_apimachinery_pkg_runtime_Unknown(ref),
"k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(ref),
}
}
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{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -110,7 +110,7 @@ func schema_api_apis_crdsplaceholder_v1alpha1_LoginDiscoveryConfig(ref common.Re
},
"spec": {
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{
"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{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -153,7 +153,7 @@ func schema_api_apis_crdsplaceholder_v1alpha1_LoginDiscoveryConfigList(ref commo
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
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{
"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{
Schema: spec.Schema{
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{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -221,23 +221,23 @@ func schema_api_apis_placeholder_v1alpha1_CredentialRequest(ref common.Reference
},
"spec": {
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": {
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{
"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{
Schema: spec.Schema{
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{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -310,7 +310,7 @@ func schema_api_apis_placeholder_v1alpha1_CredentialRequestList(ref common.Refer
Items: &spec.SchemaOrArray{
Schema: &spec.Schema{
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{
"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{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -341,18 +341,18 @@ func schema_api_apis_placeholder_v1alpha1_CredentialRequestSpec(ref common.Refer
"token": {
SchemaProps: spec.SchemaProps{
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{
"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{
Schema: spec.Schema{
SchemaProps: spec.SchemaProps{
@ -361,7 +361,7 @@ func schema_api_apis_placeholder_v1alpha1_CredentialRequestStatus(ref common.Ref
"credential": {
SchemaProps: spec.SchemaProps{
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": {
@ -375,11 +375,11 @@ func schema_api_apis_placeholder_v1alpha1_CredentialRequestStatus(ref common.Ref
},
},
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{
Schema: spec.Schema{
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

View File

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

View File

@ -8,16 +8,17 @@ SPDX-License-Identifier: Apache-2.0
package fake
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/watch"
"k8s.io/client-go/discovery"
fakediscovery "k8s.io/client-go/discovery/fake"
"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.
@ -67,12 +68,12 @@ func (c *Clientset) Tracker() testing.ObjectTracker {
var _ clientset.Interface = &Clientset{}
// CrdsV1alpha1 retrieves the CrdsV1alpha1Client
func (c *Clientset) CrdsV1alpha1() crdsv1alpha1.CrdsV1alpha1Interface {
return &fakecrdsv1alpha1.FakeCrdsV1alpha1{Fake: &c.Fake}
// CrdV1alpha1 retrieves the CrdV1alpha1Client
func (c *Clientset) CrdV1alpha1() crdv1alpha1.CrdV1alpha1Interface {
return &fakecrdv1alpha1.FakeCrdV1alpha1{Fake: &c.Fake}
}
// PlaceholderV1alpha1 retrieves the PlaceholderV1alpha1Client
func (c *Clientset) PlaceholderV1alpha1() placeholderv1alpha1.PlaceholderV1alpha1Interface {
return &fakeplaceholderv1alpha1.FakePlaceholderV1alpha1{Fake: &c.Fake}
// PinnipedV1alpha1 retrieves the PinnipedV1alpha1Client
func (c *Clientset) PinnipedV1alpha1() pinnipedv1alpha1.PinnipedV1alpha1Interface {
return &fakepinnipedv1alpha1.FakePinnipedV1alpha1{Fake: &c.Fake}
}

View File

@ -8,21 +8,22 @@ SPDX-License-Identifier: Apache-2.0
package fake
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"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
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 codecs = serializer.NewCodecFactory(scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
crdsv1alpha1.AddToScheme,
placeholderv1alpha1.AddToScheme,
crdv1alpha1.AddToScheme,
pinnipedv1alpha1.AddToScheme,
}
// 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
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"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
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 Codecs = serializer.NewCodecFactory(Scheme)
var ParameterCodec = runtime.NewParameterCodec(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
crdsv1alpha1.AddToScheme,
placeholderv1alpha1.AddToScheme,
crdv1alpha1.AddToScheme,
pinnipedv1alpha1.AddToScheme,
}
// 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
import (
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/crdsplaceholder/v1alpha1"
rest "k8s.io/client-go/rest"
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
}
func (c *FakeCrdsV1alpha1) LoginDiscoveryConfigs(namespace string) v1alpha1.LoginDiscoveryConfigInterface {
return &FakeLoginDiscoveryConfigs{c, namespace}
func (c *FakeCrdV1alpha1) PinnipedDiscoveryInfos(namespace string) v1alpha1.PinnipedDiscoveryInfoInterface {
return &FakePinnipedDiscoveryInfos{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeCrdsV1alpha1) RESTClient() rest.Interface {
func (c *FakeCrdV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient
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
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"
"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"
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/pinniped/v1alpha1"
scheme "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/clientset/versioned/scheme"
)
// CredentialRequestsGetter has a method to return a CredentialRequestInterface.
@ -45,7 +46,7 @@ type credentialRequests struct {
}
// newCredentialRequests returns a CredentialRequests
func newCredentialRequests(c *PlaceholderV1alpha1Client) *credentialRequests {
func newCredentialRequests(c *PinnipedV1alpha1Client) *credentialRequests {
return &credentialRequests{
client: c.RESTClient(),
}

View File

@ -10,23 +10,24 @@ package fake
import (
"context"
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/api/apis/placeholder/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"
v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/api/apis/pinniped/v1alpha1"
)
// FakeCredentialRequests implements CredentialRequestInterface
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.
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
import (
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned/typed/placeholder/v1alpha1"
rest "k8s.io/client-go/rest"
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
}
func (c *FakePlaceholderV1alpha1) CredentialRequests() v1alpha1.CredentialRequestInterface {
func (c *FakePinnipedV1alpha1) CredentialRequests() v1alpha1.CredentialRequestInterface {
return &FakeCredentialRequests{c}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakePlaceholderV1alpha1) RESTClient() rest.Interface {
func (c *FakePinnipedV1alpha1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View File

@ -8,27 +8,28 @@ SPDX-License-Identifier: Apache-2.0
package v1alpha1
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"
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
CredentialRequestsGetter
}
// PlaceholderV1alpha1Client is used to interact with features provided by the placeholder.suzerain-io.github.io group.
type PlaceholderV1alpha1Client struct {
// PinnipedV1alpha1Client is used to interact with features provided by the pinniped.dev group.
type PinnipedV1alpha1Client struct {
restClient rest.Interface
}
func (c *PlaceholderV1alpha1Client) CredentialRequests() CredentialRequestInterface {
func (c *PinnipedV1alpha1Client) CredentialRequests() CredentialRequestInterface {
return newCredentialRequests(c)
}
// NewForConfig creates a new PlaceholderV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*PlaceholderV1alpha1Client, error) {
// NewForConfig creates a new PinnipedV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*PinnipedV1alpha1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
@ -37,12 +38,12 @@ func NewForConfig(c *rest.Config) (*PlaceholderV1alpha1Client, error) {
if err != nil {
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.
func NewForConfigOrDie(c *rest.Config) *PlaceholderV1alpha1Client {
func NewForConfigOrDie(c *rest.Config) *PinnipedV1alpha1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
@ -50,9 +51,9 @@ func NewForConfigOrDie(c *rest.Config) *PlaceholderV1alpha1Client {
return client
}
// New creates a new PlaceholderV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *PlaceholderV1alpha1Client {
return &PlaceholderV1alpha1Client{c}
// New creates a new PinnipedV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *PinnipedV1alpha1Client {
return &PinnipedV1alpha1Client{c}
}
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
// with API server by this client implementation.
func (c *PlaceholderV1alpha1Client) RESTClient() rest.Interface {
func (c *PinnipedV1alpha1Client) RESTClient() rest.Interface {
if c == 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
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
k8s.io/apimachinery 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.
package placeholder
package crdpinniped
import (
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/informers/externalversions/placeholder/v1alpha1"
v1alpha1 "github.com/suzerain-io/pinniped/kubernetes/1.19/client-go/informers/externalversions/crdpinniped/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.

View File

@ -8,13 +8,13 @@ SPDX-License-Identifier: Apache-2.0
package v1alpha1
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.
type Interface interface {
// LoginDiscoveryConfigs returns a LoginDiscoveryConfigInformer.
LoginDiscoveryConfigs() LoginDiscoveryConfigInformer
// PinnipedDiscoveryInfos returns a PinnipedDiscoveryInfoInformer.
PinnipedDiscoveryInfos() PinnipedDiscoveryInfoInformer
}
type version struct {
@ -28,7 +28,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// LoginDiscoveryConfigs returns a LoginDiscoveryConfigInformer.
func (v *version) LoginDiscoveryConfigs() LoginDiscoveryConfigInformer {
return &loginDiscoveryConfigInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
// PinnipedDiscoveryInfos returns a PinnipedDiscoveryInfoInformer.
func (v *version) PinnipedDiscoveryInfos() PinnipedDiscoveryInfoInformer {
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"
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"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
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.
@ -162,14 +163,14 @@ type SharedInformerFactory interface {
ForResource(resource schema.GroupVersionResource) (GenericInformer, error)
WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool
Crds() crdsplaceholder.Interface
Placeholder() placeholder.Interface
Crd() crdpinniped.Interface
Pinniped() pinniped.Interface
}
func (f *sharedInformerFactory) Crds() crdsplaceholder.Interface {
return crdsplaceholder.New(f, f.namespace, f.tweakListOptions)
func (f *sharedInformerFactory) Crd() crdpinniped.Interface {
return crdpinniped.New(f, f.namespace, f.tweakListOptions)
}
func (f *sharedInformerFactory) Placeholder() placeholder.Interface {
return placeholder.New(f, f.namespace, f.tweakListOptions)
func (f *sharedInformerFactory) Pinniped() pinniped.Interface {
return pinniped.New(f, f.namespace, f.tweakListOptions)
}

View File

@ -10,10 +10,11 @@ package externalversions
import (
"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"
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
@ -42,13 +43,13 @@ func (f *genericInformer) Lister() cache.GenericLister {
// TODO extend this to unknown resources with a client pool
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
switch resource {
// Group=crds.placeholder.suzerain-io.github.io, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithResource("logindiscoveryconfigs"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Crds().V1alpha1().LoginDiscoveryConfigs().Informer()}, nil
// Group=crd.pinniped.dev, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithResource("pinnipeddiscoveryinfos"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha1().PinnipedDiscoveryInfos().Informer()}, nil
// Group=placeholder.suzerain-io.github.io, Version=v1alpha1
case placeholderv1alpha1.SchemeGroupVersion.WithResource("credentialrequests"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Placeholder().V1alpha1().CredentialRequests().Informer()}, nil
// Group=pinniped.dev, Version=v1alpha1
case pinnipedv1alpha1.SchemeGroupVersion.WithResource("credentialrequests"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Pinniped().V1alpha1().CredentialRequests().Informer()}, nil
}

View File

@ -10,10 +10,11 @@ package internalinterfaces
import (
time "time"
versioned "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/clientset/versioned"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
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.

View File

@ -5,11 +5,11 @@ SPDX-License-Identifier: Apache-2.0
// Code generated by informer-gen. DO NOT EDIT.
package crdsplaceholder
package pinniped
import (
v1alpha1 "github.com/suzerain-io/placeholder-name/kubernetes/1.19/client-go/informers/externalversions/crdsplaceholder/v1alpha1"
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"
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.

View File

@ -11,14 +11,15 @@ import (
"context"
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"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
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
@ -50,16 +51,16 @@ func NewFilteredCredentialRequestInformer(client versioned.Interface, resyncPeri
if tweakListOptions != nil {
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) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.PlaceholderV1alpha1().CredentialRequests().Watch(context.TODO(), options)
return client.PinnipedV1alpha1().CredentialRequests().Watch(context.TODO(), options)
},
},
&placeholderv1alpha1.CredentialRequest{},
&pinnipedv1alpha1.CredentialRequest{},
resyncPeriod,
indexers,
)
@ -70,7 +71,7 @@ func (f *credentialRequestInformer) defaultInformer(client versioned.Interface,
}
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 {

View File

@ -8,7 +8,7 @@ SPDX-License-Identifier: Apache-2.0
package v1alpha1
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.

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