diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 53bbf55..c14bcb3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,3 +11,15 @@ permissions: jobs: ci: uses: datum-cloud/actions/.github/workflows/ci-basic.yaml@v1.28.0 + + envtest: + # ci-basic runs go test without an API server, so the CRD tests skip + # there. This job runs them against envtest. + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-go@v7 + with: + go-version-file: 'go.mod' + - uses: go-task/setup-task@v2 + - run: task test diff --git a/CLAUDE.md b/CLAUDE.md index 0745e99..7158701 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,10 +4,10 @@ Guidance for agents working in this repository. ## What this is -`feedback-apiserver`: an aggregated Kubernetes API server for -`feedback.miloapis.com/v1alpha1`, registered with Milo through an -`APIService`. It follows `milo-os/activity` and `milo-os/search`; look there -first for patterns (OpenAPI naming, registry strategies, Milo IAM config). +`feedback`: the `feedback.miloapis.com/v1alpha1` CRDs, installed in Milo, and +the operator that reconciles them and serves their admission webhooks. It +follows `milo-os/billing` and `datum-cloud/compute`; look there first for +patterns (kubebuilder markers, controller-runtime, Milo integration). The design is `architecture/design/feedback/README.md` in `datum-cloud/enhancements`. Work is tracked in epic @@ -15,24 +15,33 @@ datum-cloud/enhancements#943. ## Rules that shape the code -- `FeedbackSource` is stored in etcd through the generic registry. Every other - resource uses custom `rest.Storage` backed by Postgres. -- The apiserver is the only component that connects to Postgres. Side effects - of a request (e.g. the `Subscription` created with a `Vote`) are written in - the same transaction. -- GitHub-derived fields live in `status` and are written only by the - `feedback-sync` service account. Staff can only patch `spec.hidden` on posts. -- `Submission` and `SecurityReport` are audited at `Metadata` only. Security - reports are never embedded, indexed, synced or sent to the AI gateway. -- Migrations in `migrations/` are forward-only. Never edit an applied one. +- Every resource is a cluster-scoped CRD in Milo's etcd. There is no + database and no aggregated API server. +- User-owned kinds carry `spec.userRef`, declare + `iam.miloapis.com/owner-field` and make it a selectable field. Milo limits + user-context requests to the caller's objects; the admission webhook sets + `spec.userRef` from the request. Never trust a client-supplied owner. +- Vote and Subscription names are `.` (`v1alpha1.OwnedName`), so + there is one per user per post. +- Anything a submitter or reporter must not see goes on a staff-only kind + (`SubmissionReview`, `SecurityReportTriage`), not on a field. +- Side effects are reconciled by the operator, not done in the request. + Every reconcile step must be idempotent and keyed on deterministic names. +- GitHub-derived fields live in `status` and are written only by + `feedback-sync`. The operator owns post `votes` and `delivery`; both use + server-side apply with their own field manager. Staff can only patch + `spec.hidden` on posts. +- `Submission`, `SubmissionReview`, `SecurityReport` and + `SecurityReportTriage` are audited at `Metadata` only (a Milo audit policy + rule). Security reports are never indexed, synced or sent to the AI gateway. ## Commands ```bash task build -task test -task generate # deepcopy, clientset, OpenAPI; CI fails if out of date +task test # needs network once, to fetch envtest binaries +task generate # deepcopy and CRDs; CI fails if out of date task vet ``` -Run long-lived processes (Postgres, the server) in containers, not on the host. +Run long-lived processes (the operator) in containers, not on the host. diff --git a/Dockerfile b/Dockerfile index 0c51eaf..c4999c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,6 @@ RUN go mod download COPY cmd/ cmd/ COPY internal/ internal/ -COPY migrations/ migrations/ COPY pkg/ pkg/ RUN CGO_ENABLED=0 GOOS=linux go build \ diff --git a/README.md b/README.md index 0debd71..be874e6 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ Feedback, votes and roadmap, built in. -`feedback` serves the `feedback.miloapis.com` API: public roadmap posts synced -from GitHub, votes, submissions, security reports, releases and changelog -entries. It runs as an aggregated API server under Milo, like -[activity](https://github.com/milo-os/activity) and -[search](https://github.com/milo-os/search), so the website, cloud portal, -`datumctl`, Patch and the staff portal all use one API. +`feedback` defines the `feedback.miloapis.com` resources: public roadmap +posts synced from GitHub, votes, submissions, security reports, releases and +changelog entries. They are CRDs installed in Milo, like billing's, so the +website, cloud portal, `datumctl`, Patch and the staff portal all use Milo's +API. The `feedback` operator reconciles them and serves their admission +webhooks. - Product: [Platform Feedback](https://github.com/datum-cloud/enhancements/blob/main/enhancements/platform/feedback/README.md) - Design: [Platform Feedback: Architecture](https://github.com/datum-cloud/enhancements/pull/925) @@ -16,63 +16,86 @@ entries. It runs as an aggregated API server under Milo, like ## Status -Early scaffold. The server runs and serves `FeedbackSource`. The other -resources in the design are tracked as sub-issues of the epic. +The CRDs are defined and the operator starts. Admission webhooks and +reconcilers are tracked as sub-issues of the epic. -| Resource | Storage | State | +| Resource | Who writes it | Who reads it | | --- | --- | --- | -| `FeedbackSource` | etcd | served | -| `Post`, `PostQuery`, `Release`, `ChangelogEntry` | Postgres | planned | -| `Vote`, `Subscription` | Postgres | planned | -| `Submission`, `SecurityReport`, `SecurityAcknowledgement` | Postgres | planned | +| `FeedbackSource` | staff | `feedback-sync` | +| `Post`, `Release`, `ChangelogEntry` | `feedback-sync`; the operator writes post votes and delivery | everyone | +| `Vote`, `Subscription`, `FeedbackProfile` | users, for themselves; the operator | the owner, staff | +| `Submission` | users, for themselves; the operator writes status | the owner, staff | +| `SubmissionReview` | staff decide; the operator writes triage | staff | +| `SecurityReport` | users, for themselves; the Security Team writes status | the owner, the Security Team | +| `SecurityReportTriage` | the Security Team | the Security Team | +| `SecurityAcknowledgement`, `FeedbackDigest` | the operator | staff, the website | + +## Who sees what + +Milo stores user-owned resources in one platform-wide collection. Each +user-owned CRD names its owner field with the `iam.miloapis.com/owner-field` +annotation, and Milo limits user-context requests to the caller's objects +([milo-os/milo#1017](https://github.com/milo-os/milo/pull/1017)). `Post` +names `spec.hidden` with `iam.miloapis.com/hidden-field`, so hidden posts are +invisible to anyone without `get` on `posts/hidden`. Fields only staff may +see live on separate staff-only kinds (`SubmissionReview`, +`SecurityReportTriage`), since a CRD can't hide a field from some readers. + +Vote and Subscription names are `.`, which gives one per user per +post across the shared collection. ## Layout ``` -cmd/feedback/ serve, migrate and version commands -internal/apiserver/ server wiring and API group installation -internal/postgres/ connection pool, readiness check, migrations runner -internal/registry/ REST storage, one package per resource -migrations/ forward-only SQL migrations (embedded) -pkg/apis/feedback/ feedback.miloapis.com/v1alpha1 types -pkg/generated/ generated clientset and OpenAPI (task generate) -config/base/ apiserver Deployment, Service, RBAC -config/components/ APIService registration -config/milo/ Milo IAM ProtectedResources, Roles, discovery -config/samples/ example resources +cmd/feedback/ operator and version commands +pkg/apis/feedback/ feedback.miloapis.com/v1alpha1 types (CRDs) +config/crd/ generated CRDs, installed in Milo +config/base/ operator Deployment, Services, leader election RBAC +config/components/ milo-integration: Milo kubeconfig, client and webhook certificates +config/milo/ Milo IAM ProtectedResources and Roles +config/samples/ an example of every resource ``` -## Postgres - -The apiserver is the only component that connects to Postgres. Other -components (`feedback-sync`, `feedback-controller`) write through the API so -every change is authorized in one place and reaches the audit log. - -The DSN comes from `--postgres-dsn` or `FEEDBACK_POSTGRES_DSN`. In a cluster -it is read from the `dsn` key of the `feedback-postgres` Secret, which the -environment provides. The database needs the `vector` extension available. - -Migrations are forward-only. `feedback migrate` applies them; the Deployment -runs it as an init container, and a Postgres session lock keeps replicas from -migrating at the same time. Add a migration as the next numbered file in -`migrations/`. - ## Development ```bash task build # bin/feedback -task test -task generate # after changing types in pkg/apis +task test # unit tests, plus CRD tests against an envtest API server +task generate # after changing types in pkg/apis: deepcopy and CRDs task docker-build ``` -Run Postgres with pgvector and apply migrations locally: +Run the operator against a Milo you can reach, in a container: ```bash -docker run -d --name feedback-pg -e POSTGRES_PASSWORD=feedback -p 127.0.0.1:5432:5432 pgvector/pgvector:pg17 -FEEDBACK_POSTGRES_DSN=postgres://postgres:feedback@127.0.0.1:5432/postgres bin/feedback migrate +docker run --rm -v "$PWD:/src" -v "$HOME/.milo:/milo:ro" -w /src golang:1.27 \ + go run ./cmd/feedback operator --milo-kubeconfig=/milo/kubeconfig --webhook-cert-dir=/tmp/certs ``` +## Before enabling for users + +These ship outside this repository and must be live in an environment before +users can reach the feedback API there: + +1. **Audit policy.** Milo's audit policy logs `Submission`, + `SubmissionReview`, `SecurityReport`, `SecurityReportTriage` and + `FeedbackDigest` at `Metadata` only + ([datum-cloud/infra#9437](https://github.com/datum-cloud/infra/pull/9437)). + Without it, private submission and report content would be written to + audit logs. +2. **Owner filtering in Milo** + ([milo-os/milo#1017](https://github.com/milo-os/milo/pull/1017)), released + to that Milo. Without it, a user listing votes or submissions would see + everyone's. +3. **User and public-reader bindings.** The `feedback.miloapis.com-user` role + bound to every signed-in user in their own context (through Milo's + `iam-user-self-manage`), and `feedback.miloapis.com-public-reader` bound to + the datum.net service account. Without them, users and the website have no + access. +4. **The operator is ready before its webhooks are registered.** The webhook + configurations fail closed, so apply them after the operator's readiness + check passes. + ## License [AGPL-3.0](LICENSE) diff --git a/Taskfile.yaml b/Taskfile.yaml index abe9bb9..60413d4 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -5,6 +5,9 @@ vars: IMAGE_NAME: "ghcr.io/milo-os/feedback" IMAGE_TAG: "dev" MODULE: "go.miloapis.com/feedback" + CONTROLLER_TOOLS_VERSION: "v0.22.0" + ENVTEST_VERSION: "release-0.25" + ENVTEST_K8S_VERSION: "1.37.x" tasks: default: @@ -34,9 +37,21 @@ tasks: silent: true generate: - desc: Generate deepcopy, clientset and OpenAPI code + desc: Generate deepcopy code and the CRD manifests + deps: [install-tools] cmds: - - ./hack/update-codegen.sh + - "{{.TOOL_DIR}}/controller-gen object:headerFile=hack/boilerplate.go.txt paths=./pkg/apis/..." + - "{{.TOOL_DIR}}/controller-gen crd paths=./pkg/apis/... output:crd:artifacts:config=config/crd/bases" + + install-tools: + desc: Install code generators into bin/ + status: + - test -x {{.TOOL_DIR}}/controller-gen-{{.CONTROLLER_TOOLS_VERSION}} + cmds: + - mkdir -p {{.TOOL_DIR}} + - GOBIN={{.TOOL_DIR}} go install sigs.k8s.io/controller-tools/cmd/controller-gen@{{.CONTROLLER_TOOLS_VERSION}} + - mv {{.TOOL_DIR}}/controller-gen {{.TOOL_DIR}}/controller-gen-{{.CONTROLLER_TOOLS_VERSION}} + - ln -sf {{.TOOL_DIR}}/controller-gen-{{.CONTROLLER_TOOLS_VERSION}} {{.TOOL_DIR}}/controller-gen fmt: desc: Format Go code @@ -49,9 +64,11 @@ tasks: - go vet ./... test: - desc: Run unit tests + desc: Run unit tests, with an envtest API server for the CRD tests cmds: - - go test ./... {{.CLI_ARGS}} + - | + KUBEBUILDER_ASSETS="$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@{{.ENVTEST_VERSION}} use {{.ENVTEST_K8S_VERSION}} --bin-dir {{.TOOL_DIR}}/envtest -p path)" \ + go test ./... {{.CLI_ARGS}} docker-build: desc: Build the container image diff --git a/cmd/feedback/main.go b/cmd/feedback/main.go index 0df925d..cb798d5 100644 --- a/cmd/feedback/main.go +++ b/cmd/feedback/main.go @@ -1,102 +1,31 @@ -// Command feedback runs the feedback.miloapis.com aggregated API server and -// its supporting tasks. +// Command feedback runs the feedback operator, which reconciles the +// feedback.miloapis.com CRDs in Milo and serves their admission webhooks. package main import ( - "context" "fmt" "os" - "strings" - "time" "github.com/spf13/cobra" - "github.com/spf13/pflag" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - apiopenapi "k8s.io/apiserver/pkg/endpoints/openapi" - genericapiserver "k8s.io/apiserver/pkg/server" - "k8s.io/apiserver/pkg/server/options" - utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/component-base/cli" - basecompatibility "k8s.io/component-base/compatibility" - "k8s.io/component-base/logs" - logsapi "k8s.io/component-base/logs/api/v1" - "k8s.io/klog/v2" - openapicommon "k8s.io/kube-openapi/pkg/common" - openapiutil "k8s.io/kube-openapi/pkg/util" - "k8s.io/kube-openapi/pkg/validation/spec" - feedbackapiserver "go.miloapis.com/feedback/internal/apiserver" - "go.miloapis.com/feedback/internal/postgres" "go.miloapis.com/feedback/internal/version" - "go.miloapis.com/feedback/pkg/generated/openapi" - - // Register the JSON logging format. - _ "k8s.io/component-base/logs/json/register" ) -// postgresDSNEnv is read when --postgres-dsn is not set, so the DSN (which -// carries a password) can come from a Secret instead of the command line. -const postgresDSNEnv = "FEEDBACK_POSTGRES_DSN" - -func init() { - utilruntime.Must(logsapi.AddFeatureGates(utilfeature.DefaultMutableFeatureGate)) - utilruntime.Must(utilfeature.DefaultMutableFeatureGate.Set("LoggingBetaOptions=true")) - utilruntime.Must(utilfeature.DefaultMutableFeatureGate.Set("RemoteRequestHeaderUID=true")) -} - func main() { - os.Exit(cli.Run(newRootCommand())) + if err := newRootCommand().Execute(); err != nil { + os.Exit(1) + } } func newRootCommand() *cobra.Command { cmd := &cobra.Command{ Use: "feedback", Short: "Feedback - roadmap, votes and submissions for Milo", - Long: `Feedback serves the feedback.miloapis.com API: public roadmap posts synced -from GitHub, votes, submissions and security reports, stored in Postgres.`, + Long: `Feedback reconciles the feedback.miloapis.com resources in Milo: public +roadmap posts synced from GitHub, votes, submissions and security reports.`, + SilenceUsage: true, } - cmd.AddCommand(newServeCommand(), newMigrateCommand(), newVersionCommand()) - return cmd -} - -func newServeCommand() *cobra.Command { - o := newServerOptions() - cmd := &cobra.Command{ - Use: "serve", - Short: "Start the API server", - RunE: func(cmd *cobra.Command, _ []string) error { - if err := o.Complete(); err != nil { - return err - } - if err := o.Validate(); err != nil { - return err - } - return run(cmd.Context(), o) - }, - } - o.AddFlags(cmd.Flags()) - logsapi.AddFlags(o.Logs, cmd.Flags()) - return cmd -} - -func newMigrateCommand() *cobra.Command { - var cfg postgres.Config - cmd := &cobra.Command{ - Use: "migrate", - Short: "Apply pending Postgres schema migrations", - Long: `Apply every pending schema migration and exit. Migrations are forward-only -and run as a Job before the apiserver rolls out.`, - RunE: func(cmd *cobra.Command, _ []string) error { - if cfg.DSN == "" { - cfg.DSN = os.Getenv(postgresDSNEnv) - } - if err := cfg.Validate(); err != nil { - return err - } - return postgres.Migrate(cmd.Context(), cfg) - }, - } - cmd.Flags().StringVar(&cfg.DSN, "postgres-dsn", "", "Postgres connection string. Defaults to $"+postgresDSNEnv+".") + cmd.AddCommand(newOperatorCommand(), newVersionCommand()) return cmd } @@ -106,7 +35,7 @@ func newVersionCommand() *cobra.Command { Short: "Show version information", Run: func(*cobra.Command, []string) { i := version.Get() - fmt.Printf("Feedback Server\n") + fmt.Printf("Feedback\n") fmt.Printf(" Version: %s\n", i.Version) fmt.Printf(" Git Commit: %s\n", i.GitCommit) fmt.Printf(" Git Tree: %s\n", i.GitTreeState) @@ -116,118 +45,3 @@ func newVersionCommand() *cobra.Command { }, } } - -type serverOptions struct { - RecommendedOptions *options.RecommendedOptions - Logs *logsapi.LoggingConfiguration - Postgres postgres.Config -} - -func newServerOptions() *serverOptions { - o := &serverOptions{ - RecommendedOptions: options.NewRecommendedOptions( - "/registry/feedback.miloapis.com", - feedbackapiserver.Codecs.LegacyCodec(feedbackapiserver.Scheme.PrioritizedVersionsAllGroups()...), - ), - Logs: logsapi.NewLoggingConfiguration(), - Postgres: postgres.Config{MaxConns: 20, ConnectTimeout: 10 * time.Second}, - } - // No admission plugins: validation lives in the registry strategies. - o.RecommendedOptions.Admission = nil - return o -} - -func (o *serverOptions) AddFlags(fs *pflag.FlagSet) { - o.RecommendedOptions.AddFlags(fs) - fs.StringVar(&o.Postgres.DSN, "postgres-dsn", o.Postgres.DSN, - "Postgres connection string. Defaults to $"+postgresDSNEnv+".") - fs.Int32Var(&o.Postgres.MaxConns, "postgres-max-conns", o.Postgres.MaxConns, - "Maximum number of connections in the Postgres pool.") - fs.DurationVar(&o.Postgres.ConnectTimeout, "postgres-connect-timeout", o.Postgres.ConnectTimeout, - "Timeout for the initial Postgres connection.") -} - -func (o *serverOptions) Complete() error { - if o.Postgres.DSN == "" { - o.Postgres.DSN = os.Getenv(postgresDSNEnv) - } - return nil -} - -func (o *serverOptions) Validate() error { - var errs []error - errs = append(errs, o.RecommendedOptions.Validate()...) - if err := o.Postgres.Validate(); err != nil { - errs = append(errs, fmt.Errorf("--postgres-dsn: %w", err)) - } - if len(errs) > 0 { - return fmt.Errorf("invalid options: %v", errs) - } - return nil -} - -func (o *serverOptions) Config() (*feedbackapiserver.Config, error) { - if err := o.RecommendedOptions.SecureServing.MaybeDefaultWithSelfSignedCerts("localhost", nil, nil); err != nil { - return nil, fmt.Errorf("create self-signed certificates: %w", err) - } - - genericConfig := genericapiserver.NewRecommendedConfig(feedbackapiserver.Codecs) - genericConfig.EffectiveVersion = basecompatibility.NewEffectiveVersionFromString("1.35", "", "") - - // OpenAPI definitions are keyed by Go package path, but server-side apply - // looks them up by REST-friendly name. Translate before asking the namer so - // GVK extensions are found, and build $refs with the same names. This is - // the same approach as milo-os/activity and milo-os/search. - namer := apiopenapi.NewDefinitionNamer(feedbackapiserver.Scheme) - getDefinitionName := func(name string) (string, spec.Extensions) { - if strings.Contains(name, "/") { - name = openapiutil.ToRESTFriendlyName(name) - } - return namer.GetDefinitionName(name) - } - refFor := func(prefix string) openapicommon.ReferenceCallback { - return func(name string) spec.Ref { - defName, _ := getDefinitionName(name) - return spec.MustCreateRef(prefix + openapicommon.EscapeJsonPointer(defName)) - } - } - - genericConfig.OpenAPIV3Config = genericapiserver.DefaultOpenAPIV3Config(openapi.GetOpenAPIDefinitions, namer) - genericConfig.OpenAPIV3Config.Info.Title = "Feedback" - genericConfig.OpenAPIV3Config.Info.Version = version.Version - genericConfig.OpenAPIV3Config.GetDefinitionName = getDefinitionName - genericConfig.OpenAPIV3Config.Definitions = openapi.GetOpenAPIDefinitions(refFor("#/components/schemas/")) - - genericConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(openapi.GetOpenAPIDefinitions, namer) - genericConfig.OpenAPIConfig.Info.Title = "Feedback" - genericConfig.OpenAPIConfig.Info.Version = version.Version - genericConfig.OpenAPIConfig.GetDefinitionName = getDefinitionName - genericConfig.OpenAPIConfig.Definitions = openapi.GetOpenAPIDefinitions(refFor("#/definitions/")) - - if err := o.RecommendedOptions.ApplyTo(genericConfig); err != nil { - return nil, fmt.Errorf("apply recommended options: %w", err) - } - - return &feedbackapiserver.Config{ - GenericConfig: genericConfig, - ExtraConfig: feedbackapiserver.ExtraConfig{Postgres: o.Postgres}, - }, nil -} - -func run(ctx context.Context, o *serverOptions) error { - if err := logsapi.ValidateAndApply(o.Logs, utilfeature.DefaultMutableFeatureGate); err != nil { - return fmt.Errorf("apply logging configuration: %w", err) - } - defer logs.FlushLogs() - - cfg, err := o.Config() - if err != nil { - return err - } - server, err := cfg.Complete().New(ctx) - if err != nil { - return err - } - klog.Info("Starting Feedback server") - return server.Run(ctx) -} diff --git a/cmd/feedback/operator.go b/cmd/feedback/operator.go new file mode 100644 index 0000000..e9554d6 --- /dev/null +++ b/cmd/feedback/operator.go @@ -0,0 +1,116 @@ +package main + +import ( + "flag" + "fmt" + + "github.com/spf13/cobra" + "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + clientgoscheme "k8s.io/client-go/kubernetes/scheme" + "k8s.io/client-go/rest" + "k8s.io/client-go/tools/clientcmd" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/healthz" + "sigs.k8s.io/controller-runtime/pkg/log/zap" + metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" + "sigs.k8s.io/controller-runtime/pkg/webhook" + + "go.miloapis.com/feedback/internal/version" + feedbackv1alpha1 "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1" +) + +var scheme = runtime.NewScheme() + +func init() { + utilruntime.Must(clientgoscheme.AddToScheme(scheme)) + utilruntime.Must(feedbackv1alpha1.AddToScheme(scheme)) +} + +type operatorOptions struct { + miloKubeconfig string + metricsAddr string + probeAddr string + leaderElect bool + leaderElectionNamespace string + webhookPort int + webhookCertDir string +} + +func newOperatorCommand() *cobra.Command { + o := operatorOptions{} + zapOpts := zap.Options{} + cmd := &cobra.Command{ + Use: "operator", + Short: "Reconcile feedback resources in Milo and serve their admission webhooks", + RunE: func(cmd *cobra.Command, _ []string) error { + ctrl.SetLogger(zap.New(zap.UseFlagOptions(&zapOpts))) + return runOperator(o) + }, + } + f := cmd.Flags() + f.StringVar(&o.miloKubeconfig, "milo-kubeconfig", "", "Kubeconfig for Milo, where the feedback resources live. Empty uses the in-cluster config.") + f.StringVar(&o.metricsAddr, "metrics-bind-address", ":8080", "Address the metrics endpoint binds to; 0 disables it.") + f.StringVar(&o.probeAddr, "health-probe-bind-address", ":8081", "Address the health probes bind to.") + f.BoolVar(&o.leaderElect, "leader-elect", false, "Elect a leader, so only one replica reconciles. The lease lives in the cluster the operator runs in.") + f.StringVar(&o.leaderElectionNamespace, "leader-election-namespace", "feedback-system", "Namespace of the leader election lease.") + f.IntVar(&o.webhookPort, "webhook-port", 9443, "Port the admission webhook server listens on.") + f.StringVar(&o.webhookCertDir, "webhook-cert-dir", "/etc/kubernetes/pki/webhook", "Directory holding tls.crt and tls.key for the webhook server.") + goFlags := flag.NewFlagSet("zap", flag.ExitOnError) + zapOpts.BindFlags(goFlags) + f.AddGoFlagSet(goFlags) + return cmd +} + +func runOperator(o operatorOptions) error { + log := ctrl.Log.WithName("setup") + i := version.Get() + log.Info("Starting feedback operator", "version", i.Version, "gitCommit", i.GitCommit) + + miloConfig, err := restConfig(o.miloKubeconfig) + if err != nil { + return fmt.Errorf("loading Milo config: %w", err) + } + // The lease lives where the operator runs, not in Milo. + localConfig, err := rest.InClusterConfig() + if err != nil { + localConfig = miloConfig + } + + mgr, err := ctrl.NewManager(miloConfig, ctrl.Options{ + Scheme: scheme, + Metrics: metricsserver.Options{BindAddress: o.metricsAddr}, + HealthProbeBindAddress: o.probeAddr, + LeaderElection: o.leaderElect, + LeaderElectionID: "feedback.miloapis.com", + LeaderElectionNamespace: o.leaderElectionNamespace, + LeaderElectionConfig: localConfig, + LeaderElectionReleaseOnCancel: true, + WebhookServer: webhook.NewServer(webhook.Options{Port: o.webhookPort, CertDir: o.webhookCertDir}), + }) + if err != nil { + return fmt.Errorf("creating manager: %w", err) + } + + if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil { + return err + } + // Ready only once the webhook server answers TLS: Milo calls the + // admission webhooks with failurePolicy Fail, so a pod that took + // traffic before then would fail requests during rollouts. + // GetWebhookServer also registers the server with the manager. + if err := mgr.AddReadyzCheck("webhook", mgr.GetWebhookServer().StartedChecker()); err != nil { + return err + } + + log.Info("Starting manager") + return mgr.Start(ctrl.SetupSignalHandler()) +} + +// restConfig loads kubeconfig, or the in-cluster config when it is empty. +func restConfig(kubeconfig string) (*rest.Config, error) { + if kubeconfig == "" { + return rest.InClusterConfig() + } + return clientcmd.BuildConfigFromFlags("", kubeconfig) +} diff --git a/config/base/apiserver/deployment.yaml b/config/base/apiserver/deployment.yaml deleted file mode 100644 index 2c9664e..0000000 --- a/config/base/apiserver/deployment.yaml +++ /dev/null @@ -1,181 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: feedback-apiserver -spec: - replicas: 1 - selector: - matchLabels: - app: feedback-apiserver - template: - metadata: - labels: - app: feedback-apiserver - spec: - serviceAccountName: feedback-apiserver - securityContext: - runAsNonRoot: true - runAsUser: 65532 - runAsGroup: 65532 - fsGroup: 65532 - seccompProfile: - type: RuntimeDefault - # Migrations are forward-only and applied before the server starts. - # goose takes a Postgres session lock, so replicas don't race. - initContainers: - - name: migrate - image: ghcr.io/milo-os/feedback:latest - imagePullPolicy: IfNotPresent - securityContext: - allowPrivilegeEscalation: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 65532 - capabilities: - drop: - - ALL - command: - - /feedback - - migrate - env: - - name: FEEDBACK_POSTGRES_DSN - valueFrom: - secretKeyRef: - name: feedback-postgres - key: dsn - resources: - requests: - cpu: 50m - memory: 64Mi - limits: - cpu: 200m - memory: 128Mi - containers: - - name: apiserver - image: ghcr.io/milo-os/feedback:latest - imagePullPolicy: IfNotPresent - securityContext: - allowPrivilegeEscalation: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 65532 - capabilities: - drop: - - ALL - ports: - - containerPort: 8443 - name: https - protocol: TCP - command: - - /feedback - - serve - args: - - --secure-port=$(SECURE_PORT) - - --tls-cert-file=$(TLS_CERT_FILE) - - --tls-private-key-file=$(TLS_PRIVATE_KEY_FILE) - - --kubeconfig=$(KUBECONFIG) - - --authentication-kubeconfig=$(AUTHENTICATION_KUBECONFIG) - - --authentication-skip-lookup=$(AUTHENTICATION_SKIP_LOOKUP) - - --authentication-tolerate-lookup-failure=$(AUTHENTICATION_TOLERATE_LOOKUP_FAILURE) - - --authorization-kubeconfig=$(AUTHORIZATION_KUBECONFIG) - - --authorization-always-allow-paths=$(AUTHORIZATION_ALWAYS_ALLOW_PATHS) - - --requestheader-client-ca-file=$(REQUESTHEADER_CLIENT_CA_FILE) - - --requestheader-username-headers=$(REQUESTHEADER_USERNAME_HEADERS) - - --requestheader-group-headers=$(REQUESTHEADER_GROUP_HEADERS) - - --requestheader-uid-headers=$(REQUESTHEADER_UID_HEADERS) - - --requestheader-extra-headers-prefix=$(REQUESTHEADER_EXTRA_HEADERS_PREFIX) - - --logging-format=$(LOGGING_FORMAT) - - --tracing-config-file=$(TRACING_CONFIG_FILE) - - --v=$(LOG_LEVEL) - - --etcd-servers=$(ETCD_SERVERS) - env: - - name: ETCD_SERVERS - value: "http://etcd.etcd-system.svc.cluster.local:2379" - - name: SECURE_PORT - value: "8443" - - name: TLS_CERT_FILE - value: "/var/run/feedback-apiserver/tls/tls.crt" - - name: TLS_PRIVATE_KEY_FILE - value: "/var/run/feedback-apiserver/tls/tls.key" - - name: KUBECONFIG - value: "" - - name: AUTHENTICATION_KUBECONFIG - value: "" - - name: AUTHENTICATION_SKIP_LOOKUP - value: "false" - - name: AUTHENTICATION_TOLERATE_LOOKUP_FAILURE - value: "false" - - name: AUTHORIZATION_KUBECONFIG - value: "" - - name: AUTHORIZATION_ALWAYS_ALLOW_PATHS - value: "/healthz,/readyz,/livez" - - name: REQUESTHEADER_CLIENT_CA_FILE - value: "" - - name: REQUESTHEADER_USERNAME_HEADERS - value: "X-Remote-User" - - name: REQUESTHEADER_GROUP_HEADERS - value: "X-Remote-Group" - - name: REQUESTHEADER_UID_HEADERS - value: "X-Remote-Uid" - - name: REQUESTHEADER_EXTRA_HEADERS_PREFIX - value: "X-Remote-Extra-" - - name: LOGGING_FORMAT - value: "json" - - name: LOG_LEVEL - value: "4" - - name: TRACING_CONFIG_FILE - value: "" - - name: FEEDBACK_POSTGRES_DSN - valueFrom: - secretKeyRef: - name: feedback-postgres - key: dsn - resources: - requests: - cpu: 100m - memory: 128Mi - limits: - cpu: 500m - memory: 512Mi - livenessProbe: - httpGet: - path: /healthz - port: https - scheme: HTTPS - initialDelaySeconds: 15 - periodSeconds: 20 - readinessProbe: - httpGet: - path: /readyz - port: https - scheme: HTTPS - initialDelaySeconds: 5 - periodSeconds: 10 - volumeMounts: - - name: tls-certs - mountPath: /var/run/feedback-apiserver/tls - readOnly: true - - name: control-plane-ca - mountPath: /etc/kubernetes/pki/requestheader - readOnly: true - - name: tmp - mountPath: /tmp - volumes: - - name: tls-certs - csi: - driver: csi.cert-manager.io - readOnly: true - volumeAttributes: - csi.cert-manager.io/issuer-name: selfsigned-cluster-issuer - csi.cert-manager.io/issuer-kind: ClusterIssuer - csi.cert-manager.io/common-name: feedback-apiserver.feedback-system.svc - csi.cert-manager.io/dns-names: "feedback-apiserver,feedback-apiserver.feedback-system,feedback-apiserver.feedback-system.svc,feedback-apiserver.feedback-system.svc.cluster.local" - csi.cert-manager.io/duration: "8760h" - csi.cert-manager.io/renew-before: "720h" - csi.cert-manager.io/fs-group: "65532" - - name: control-plane-ca - configMap: - name: control-plane-ca - optional: true - - name: tmp - emptyDir: {} diff --git a/config/base/apiserver/kustomization.yaml b/config/base/apiserver/kustomization.yaml deleted file mode 100644 index 411157d..0000000 --- a/config/base/apiserver/kustomization.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization - -namespace: feedback-system - -resources: - - serviceaccount.yaml - - deployment.yaml - - service.yaml - - rbac-auth-reader.yaml - - rbac-cluster.yaml - -labels: - - includeSelectors: true - includeTemplates: true - pairs: - app.kubernetes.io/name: feedback-apiserver - app.kubernetes.io/instance: feedback-apiserver - app.kubernetes.io/component: apiserver - app.kubernetes.io/part-of: feedback.miloapis.com - app.kubernetes.io/managed-by: kustomize - -images: - - name: ghcr.io/milo-os/feedback - newTag: latest - -# Keep the auth-reader RoleBinding in kube-system. -patches: - - target: - kind: RoleBinding - name: feedback-apiserver-auth-reader - patch: |- - - op: replace - path: /metadata/namespace - value: kube-system - - op: replace - path: /subjects/0/namespace - value: feedback-system diff --git a/config/base/apiserver/rbac-auth-reader.yaml b/config/base/apiserver/rbac-auth-reader.yaml deleted file mode 100644 index c03a548..0000000 --- a/config/base/apiserver/rbac-auth-reader.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: feedback-apiserver-auth-reader - namespace: kube-system -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: extension-apiserver-authentication-reader -subjects: -- kind: ServiceAccount - name: feedback-apiserver diff --git a/config/base/apiserver/rbac-cluster.yaml b/config/base/apiserver/rbac-cluster.yaml deleted file mode 100644 index fa4089c..0000000 --- a/config/base/apiserver/rbac-cluster.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - name: feedback-apiserver -rules: -# Allow reading extension-apiserver-authentication configmap for authentication -- apiGroups: [""] - resources: ["configmaps"] - resourceNames: ["extension-apiserver-authentication"] - verbs: ["get", "list", "watch"] -# Allow reading flow control resources for API Priority and Fairness -- apiGroups: ["flowcontrol.apiserver.k8s.io"] - resources: ["flowschemas", "prioritylevelconfigurations"] - verbs: ["get", "list", "watch"] -# Allow creating subjectaccessreviews for authorization checks -- apiGroups: ["authorization.k8s.io"] - resources: ["subjectaccessreviews"] - verbs: ["create"] -# Allow reading webhooks for admission controller -- apiGroups: ["admissionregistration.k8s.io"] - resources: ["mutatingwebhookconfigurations", "validatingwebhookconfigurations"] - verbs: ["get", "list", "watch"] -# Allow reading admission policies -- apiGroups: ["admissionregistration.k8s.io"] - resources: ["validatingadmissionpolicies", "validatingadmissionpolicybindings"] - verbs: ["get", "list", "watch"] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: feedback-apiserver -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: feedback-apiserver -subjects: -- kind: ServiceAccount - name: feedback-apiserver - namespace: feedback-system diff --git a/config/base/apiserver/service.yaml b/config/base/apiserver/service.yaml deleted file mode 100644 index ab3e3f7..0000000 --- a/config/base/apiserver/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: feedback-apiserver -spec: - type: ClusterIP - ports: - - name: https - port: 443 - targetPort: 8443 - protocol: TCP - selector: - app: feedback-apiserver diff --git a/config/base/kustomization.yaml b/config/base/kustomization.yaml index e224bd0..060d2bc 100644 --- a/config/base/kustomization.yaml +++ b/config/base/kustomization.yaml @@ -2,7 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - - apiserver + - operator images: - name: ghcr.io/milo-os/feedback diff --git a/config/base/operator/deployment.yaml b/config/base/operator/deployment.yaml new file mode 100644 index 0000000..d5d33e7 --- /dev/null +++ b/config/base/operator/deployment.yaml @@ -0,0 +1,89 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: feedback-operator +spec: + replicas: 2 + selector: + matchLabels: + app: feedback-operator + template: + metadata: + labels: + app: feedback-operator + spec: + serviceAccountName: feedback-operator + securityContext: + runAsNonRoot: true + runAsUser: 65532 + runAsGroup: 65532 + fsGroup: 65532 + seccompProfile: + type: RuntimeDefault + containers: + - name: operator + image: ghcr.io/milo-os/feedback:latest + imagePullPolicy: IfNotPresent + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 65532 + capabilities: + drop: + - ALL + command: + - /feedback + - operator + args: + # The milo-integration component mounts this kubeconfig. + - --milo-kubeconfig=/etc/kubernetes/milo/kubeconfig + - --leader-elect + - --leader-election-namespace=$(POD_NAMESPACE) + - --webhook-cert-dir=/etc/kubernetes/pki/webhook + - --zap-encoder=json + env: + - name: POD_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + ports: + - containerPort: 9443 + name: webhook + protocol: TCP + - containerPort: 8080 + name: metrics + protocol: TCP + - containerPort: 8081 + name: probes + protocol: TCP + resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 500m + memory: 512Mi + livenessProbe: + httpGet: + path: /healthz + port: probes + initialDelaySeconds: 15 + periodSeconds: 20 + readinessProbe: + httpGet: + path: /readyz + port: probes + initialDelaySeconds: 5 + periodSeconds: 10 + volumeMounts: + - name: webhook-cert + mountPath: /etc/kubernetes/pki/webhook + readOnly: true + volumes: + # Replaced by the milo-integration component with a certificate Milo + # trusts. + - name: webhook-cert + secret: + secretName: feedback-operator-webhook-cert + optional: true diff --git a/config/base/operator/kustomization.yaml b/config/base/operator/kustomization.yaml new file mode 100644 index 0000000..4063620 --- /dev/null +++ b/config/base/operator/kustomization.yaml @@ -0,0 +1,9 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - serviceaccount.yaml + - rbac.yaml + - deployment.yaml + - service.yaml + - pdb.yaml diff --git a/config/base/operator/pdb.yaml b/config/base/operator/pdb.yaml new file mode 100644 index 0000000..09ccc65 --- /dev/null +++ b/config/base/operator/pdb.yaml @@ -0,0 +1,9 @@ +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: feedback-operator +spec: + minAvailable: 1 + selector: + matchLabels: + app: feedback-operator diff --git a/config/base/operator/rbac.yaml b/config/base/operator/rbac.yaml new file mode 100644 index 0000000..8c2a754 --- /dev/null +++ b/config/base/operator/rbac.yaml @@ -0,0 +1,25 @@ +# Leader election happens in the cluster the operator runs in. Everything +# else it does is in Milo, with its Milo identity. +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: feedback-operator-leader-election +rules: +- apiGroups: [coordination.k8s.io] + resources: [leases] + verbs: [get, list, watch, create, update, patch, delete] +- apiGroups: [""] + resources: [events] + verbs: [create, patch] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: feedback-operator-leader-election +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: feedback-operator-leader-election +subjects: +- kind: ServiceAccount + name: feedback-operator diff --git a/config/base/operator/service.yaml b/config/base/operator/service.yaml new file mode 100644 index 0000000..e6902be --- /dev/null +++ b/config/base/operator/service.yaml @@ -0,0 +1,26 @@ +# Milo calls the admission webhooks through this Service. +apiVersion: v1 +kind: Service +metadata: + name: feedback-operator-webhook +spec: + selector: + app: feedback-operator + ports: + - name: webhook + port: 443 + targetPort: webhook +--- +apiVersion: v1 +kind: Service +metadata: + name: feedback-operator-metrics + labels: + app: feedback-operator +spec: + selector: + app: feedback-operator + ports: + - name: metrics + port: 8080 + targetPort: metrics diff --git a/config/base/apiserver/serviceaccount.yaml b/config/base/operator/serviceaccount.yaml similarity index 63% rename from config/base/apiserver/serviceaccount.yaml rename to config/base/operator/serviceaccount.yaml index 20c4c61..80e919f 100644 --- a/config/base/apiserver/serviceaccount.yaml +++ b/config/base/operator/serviceaccount.yaml @@ -1,4 +1,4 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: feedback-apiserver + name: feedback-operator diff --git a/config/components/api-registration/apiservice.yaml b/config/components/api-registration/apiservice.yaml deleted file mode 100644 index be319aa..0000000 --- a/config/components/api-registration/apiservice.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: apiregistration.k8s.io/v1 -kind: APIService -metadata: - name: v1alpha1.feedback.miloapis.com -spec: - service: - name: feedback-apiserver - namespace: feedback-system - port: 443 - group: feedback.miloapis.com - version: v1alpha1 - insecureSkipTLSVerify: false - groupPriorityMinimum: 1000 - versionPriority: 15 diff --git a/config/components/api-registration/kustomization.yaml b/config/components/api-registration/kustomization.yaml deleted file mode 100644 index 1538d2b..0000000 --- a/config/components/api-registration/kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1alpha1 -kind: Component - -resources: - - apiservice.yaml diff --git a/config/components/milo-integration/kustomization.yaml b/config/components/milo-integration/kustomization.yaml new file mode 100644 index 0000000..c3746aa --- /dev/null +++ b/config/components/milo-integration/kustomization.yaml @@ -0,0 +1,80 @@ +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +# milo-integration connects the operator to a Milo control plane: +# +# - Mounts the datum-control-plane-trust-bundle ConfigMap (populated by +# trust-manager) so the operator can verify Milo's server certificate. +# - Mounts a client certificate issued by the datum-control-plane +# ClusterIssuer. Its common name, +# system:feedback-operator@feedback.miloapis.com, is the operator's user +# in Milo, which Milo's RBAC grants what the operator needs. It is not +# system:masters. +# - Replaces the webhook certificate with one from the same issuer, so Milo +# trusts the admission webhooks. +# - Mounts the feedback-milo-kubeconfig ConfigMap, which consumers provide +# in the feedback-system namespace. It points at Milo and at the mounted +# client certificate and trust bundle. +# +# The namespace needs the label +# `infra.datum.net/inject-datum-control-plane-trust-bundle: ""` so +# trust-manager populates the trust bundle ConfigMap. + +patches: + - target: + kind: Deployment + name: feedback-operator + patch: |- + - op: replace + path: /spec/template/spec/volumes/0 + value: + name: webhook-cert + csi: + driver: csi.cert-manager.io + readOnly: true + volumeAttributes: + csi.cert-manager.io/common-name: feedback-operator-webhook + csi.cert-manager.io/fs-group: "65532" + csi.cert-manager.io/issuer-kind: ClusterIssuer + csi.cert-manager.io/issuer-name: datum-control-plane + csi.cert-manager.io/dns-names: feedback-operator-webhook.feedback-system.svc,feedback-operator-webhook.feedback-system.svc.cluster.local + - target: + kind: Deployment + name: feedback-operator + patch: |- + apiVersion: apps/v1 + kind: Deployment + metadata: + name: feedback-operator + spec: + template: + spec: + containers: + - name: operator + volumeMounts: + - mountPath: /etc/kubernetes/pki/trust + name: trust-bundle + readOnly: true + - mountPath: /etc/kubernetes/pki/client + name: client-cert + readOnly: true + - mountPath: /etc/kubernetes/milo + name: milo-kubeconfig + readOnly: true + volumes: + - name: trust-bundle + configMap: + name: datum-control-plane-trust-bundle + - name: milo-kubeconfig + configMap: + name: feedback-milo-kubeconfig + - name: client-cert + csi: + driver: csi.cert-manager.io + readOnly: true + volumeAttributes: + csi.cert-manager.io/common-name: system:feedback-operator@feedback.miloapis.com + csi.cert-manager.io/fs-group: "65532" + csi.cert-manager.io/issuer-kind: ClusterIssuer + csi.cert-manager.io/issuer-name: datum-control-plane + csi.cert-manager.io/key-usages: client auth diff --git a/config/crd/bases/feedback.miloapis.com_changelogentries.yaml b/config/crd/bases/feedback.miloapis.com_changelogentries.yaml new file mode 100644 index 0000000..0c4108d --- /dev/null +++ b/config/crd/bases/feedback.miloapis.com_changelogentries.yaml @@ -0,0 +1,111 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.22.0 + discovery.miloapis.com/parent-contexts: Platform;User + name: changelogentries.feedback.miloapis.com +spec: + group: feedback.miloapis.com + names: + kind: ChangelogEntry + listKind: ChangelogEntryList + plural: changelogentries + singular: changelogentry + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.title + name: Title + type: string + - jsonPath: .status.publishedAt + name: Published + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + ChangelogEntry maps to a discussion in the FeedbackSource's changelog + category. Only feedback-sync writes entries; everyone can read them. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + status: + description: ChangelogEntryStatus is synced from the discussion. + properties: + bodyHTML: + description: BodyHTML is the discussion body, sanitised like post + bodies. + type: string + categories: + description: Categories are mapped from discussion labels. + items: + type: string + type: array + x-kubernetes-list-type: set + github: + description: GitHubLink identifies a GitHub issue, milestone or discussion. + properties: + number: + description: Number is the issue, milestone or discussion number. + format: int32 + type: integer + url: + description: URL is the HTML URL on github.com. + type: string + required: + - number + - url + type: object + issueRefs: + description: |- + IssueRefs are every issue referenced in the body, as + "/#". A reference to a post's work item rather than + the post marks that post part-shipped. + items: + type: string + type: array + x-kubernetes-list-type: set + posts: + description: Posts are the names of posts referenced in the body. + items: + type: string + type: array + x-kubernetes-list-type: set + publishedAt: + format: date-time + type: string + reactions: + description: ChangelogReactions are reaction counts on the discussion. + properties: + thumbsUp: + format: int32 + type: integer + type: object + title: + type: string + required: + - publishedAt + - title + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/bases/feedback.miloapis.com_feedbackdigests.yaml b/config/crd/bases/feedback.miloapis.com_feedbackdigests.yaml new file mode 100644 index 0000000..1e26b62 --- /dev/null +++ b/config/crd/bases/feedback.miloapis.com_feedbackdigests.yaml @@ -0,0 +1,125 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.22.0 + discovery.miloapis.com/parent-contexts: Platform + name: feedbackdigests.feedback.miloapis.com +spec: + group: feedback.miloapis.com + names: + kind: FeedbackDigest + listKind: FeedbackDigestList + plural: feedbackdigests + singular: feedbackdigest + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.itemCount + name: Items + type: integer + - jsonPath: .status.lastSentAt + name: Last sent + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + FeedbackDigest is one user's queue of events for their next daily digest, + named after the user. Only the operator writes it; staff can read it. The + operator clears it once the digest Email is created. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: FeedbackDigestSpec is the pending queue. + properties: + itemCount: + description: ItemCount is len(items), for the printer column. + format: int32 + type: integer + items: + description: |- + Items holds at most one line per post or submission; a later event + replaces an earlier one. + items: + description: DigestItem is one line of a digest. + properties: + at: + format: date-time + type: string + changelog: + description: Changelog is the ChangelogEntry for part-shipped + and released. + type: string + event: + description: DigestEvent is something a follower or submitter + is told about. + enum: + - picked-up + - part-shipped + - released + - closed + - approved + - merged + - rejected + type: string + post: + description: Post is the post the event is about. + type: string + submission: + description: Submission is the submission the event is about, + for review outcomes. + type: string + required: + - at + - event + type: object + maxItems: 500 + type: array + x-kubernetes-list-type: atomic + userRef: + description: UserReference names a Milo User by its metadata.name. + properties: + name: + maxLength: 63 + minLength: 1 + type: string + required: + - name + type: object + required: + - userRef + type: object + status: + description: FeedbackDigestStatus records sends. + properties: + lastEmail: + description: LastEmail is the name of the last Email created. + type: string + lastSentAt: + format: date-time + type: string + type: object + required: + - spec + type: object + served: true + storage: true + subresources: {} diff --git a/config/crd/bases/feedback.miloapis.com_feedbackprofiles.yaml b/config/crd/bases/feedback.miloapis.com_feedbackprofiles.yaml new file mode 100644 index 0000000..fa7ce71 --- /dev/null +++ b/config/crd/bases/feedback.miloapis.com_feedbackprofiles.yaml @@ -0,0 +1,88 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.22.0 + discovery.miloapis.com/parent-contexts: Platform;User + iam.miloapis.com/owner-field: spec.userRef.name + name: feedbackprofiles.feedback.miloapis.com +spec: + group: feedback.miloapis.com + names: + kind: FeedbackProfile + listKind: FeedbackProfileList + plural: feedbackprofiles + singular: feedbackprofile + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.showPublicVotes + name: Public votes + type: boolean + - jsonPath: .spec.digestEmails + name: Emails + type: boolean + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + FeedbackProfile holds a user's feedback settings. Users create and update + their own in the user context; it is named after the user. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: FeedbackProfileSpec is the user's settings. + properties: + digestEmails: + description: DigestEmails turns the daily digest on or off. Unset + means on. + type: boolean + showPublicVotes: + description: |- + ShowPublicVotes shows the user's avatar and name on posts they voted + on, including past votes. + type: boolean + userRef: + description: UserRef is the user, set by the admission webhook. + properties: + name: + maxLength: 63 + minLength: 1 + type: string + required: + - name + type: object + x-kubernetes-validations: + - message: userRef is immutable + rule: self == oldSelf + required: + - userRef + type: object + required: + - spec + type: object + x-kubernetes-validations: + - message: metadata.name must be the user's name + rule: self.metadata.name == self.spec.userRef.name + selectableFields: + - jsonPath: .spec.userRef.name + served: true + storage: true + subresources: {} diff --git a/config/crd/bases/feedback.miloapis.com_feedbacksources.yaml b/config/crd/bases/feedback.miloapis.com_feedbacksources.yaml new file mode 100644 index 0000000..85da192 --- /dev/null +++ b/config/crd/bases/feedback.miloapis.com_feedbacksources.yaml @@ -0,0 +1,279 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.22.0 + discovery.miloapis.com/parent-contexts: Platform + name: feedbacksources.feedback.miloapis.com +spec: + group: feedback.miloapis.com + names: + kind: FeedbackSource + listKind: FeedbackSourceList + plural: feedbacksources + singular: feedbacksource + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.github.org + name: Org + type: string + - jsonPath: .status.lastReconcile.completedAt + name: Last reconcile + type: date + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + FeedbackSource configures what the feedback service syncs from one GitHub + organization and how GitHub fields map onto posts. There is one per org. + + FeedbackSource is a Platform resource stored in etcd. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: FeedbackSourceSpec defines what to sync and how to map it. + properties: + categoryMapping: + additionalProperties: + type: string + description: CategoryMapping maps GitHub label names to post categories. + type: object + github: + description: GitHub configures the GitHub organization this source + syncs. + properties: + changelog: + description: |- + Changelog configures the discussion category that becomes changelog + entries. + properties: + discussionCategory: + type: string + repository: + type: string + required: + - discussionCategory + - repository + type: object + installationID: + description: InstallationID is the GitHub App installation ID + for Org. + format: int64 + type: integer + issues: + description: |- + Issues selects which issues become posts. An issue is included when it + matches any issue type or label, and is not excluded. + properties: + excludeLabels: + items: + type: string + type: array + x-kubernetes-list-type: set + issueTypes: + items: + type: string + type: array + x-kubernetes-list-type: set + labels: + items: + type: string + type: array + x-kubernetes-list-type: set + type: object + milestones: + description: Milestones configures the repository whose milestones + become releases. + properties: + repository: + type: string + required: + - repository + type: object + org: + description: Org is the GitHub organization login. + type: string + project: + description: |- + Project is the GitHub project that provides status and receives vote + totals. + properties: + number: + description: Number is the project number. + format: int32 + type: integer + owner: + description: Owner is the org that owns the project. + type: string + statusField: + description: StatusField is the single-select field that holds + item status. + type: string + votesField: + description: VotesField is the number field the service writes + vote totals to. + type: string + required: + - number + - owner + type: object + repositories: + description: |- + Repositories selects which public repositories are synced. Private + repositories are always skipped. + properties: + exclude: + items: + type: string + type: array + x-kubernetes-list-type: set + include: + items: + type: string + type: array + x-kubernetes-list-type: set + type: object + required: + - installationID + - org + type: object + statusMapping: + additionalProperties: + description: |- + PostState is the public status of a post, derived from the Enhancements + project's Status field and the issue state. + enum: + - none + - backlog + - planning + - on-deck + - in-progress + - shipped + - closed + type: string + description: |- + StatusMapping maps Enhancements project Status option names to post + statuses. The empty key matches items with no Status set. + type: object + required: + - github + type: object + status: + description: FeedbackSourceStatus reports sync health for the source. + properties: + conditions: + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + lastReconcile: + description: LastReconcile describes the last completed reconcile. + properties: + completedAt: + format: date-time + type: string + postsSynced: + format: int32 + type: integer + required: + - completedAt + type: object + lastWebhookAt: + description: LastWebhookAt is when the last webhook for this source + was processed. + format: date-time + type: string + rateLimit: + description: RateLimit is the GitHub rate limit for this installation. + properties: + remaining: + format: int32 + type: integer + resetAt: + format: date-time + type: string + required: + - remaining + - resetAt + type: object + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/bases/feedback.miloapis.com_posts.yaml b/config/crd/bases/feedback.miloapis.com_posts.yaml new file mode 100644 index 0000000..3b0af9c --- /dev/null +++ b/config/crd/bases/feedback.miloapis.com_posts.yaml @@ -0,0 +1,364 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.22.0 + discovery.miloapis.com/parent-contexts: Platform;User + iam.miloapis.com/hidden-field: spec.hidden + name: posts.feedback.miloapis.com +spec: + group: feedback.miloapis.com + names: + kind: Post + listKind: PostList + plural: posts + singular: post + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.title + name: Title + type: string + - jsonPath: .status.state + name: State + type: string + - jsonPath: .status.votes.total + name: Votes + type: integer + - jsonPath: .status.delivery.stage + name: Stage + type: string + - jsonPath: .spec.hidden + name: Hidden + priority: 1 + type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + Post is a public roadmap item synced from a GitHub issue. Every Post is + backed by a GitHub issue; unreviewed feedback is a Submission, never a Post. + + The name is "..", e.g. datum-cloud.enhancements.912. + + Only the feedback-sync service account creates, updates and deletes posts. + feedback-sync and feedback-operator write status with server-side apply: + sync owns the GitHub fields, the operator owns votes and delivery. Staff + can only patch spec.hidden, and Milo hides hidden posts from everyone + without get on posts/hidden. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: PostSpec holds the fields staff control. + properties: + hidden: + description: Hidden removes the post from every client and from search. + type: boolean + type: object + status: + description: PostStatus holds the fields synced from GitHub and derived + by the service. + properties: + bodyHTML: + description: BodyHTML is the issue body, sanitised against an allow-list. + type: string + categories: + description: Categories are mapped from labels by the FeedbackSource. + items: + type: string + type: array + x-kubernetes-list-type: set + delivery: + description: Delivery tracks the post from request to release. + properties: + highestNotified: + description: |- + HighestNotified is the highest stage announced to followers. A stage is + only announced when it passes this one. + enum: + - requested + - planned + - picked-up + - released + - closed + type: string + history: + description: History records each stage change. + items: + description: DeliveryEvent is one stage change. + properties: + at: + format: date-time + type: string + cause: + description: Cause describes what moved the stage, e.g. + a pull request opening. + type: string + stage: + description: |- + DeliveryStage is where a post is in delivery. Stages are ordered + requested < planned < picked-up < released; closed is terminal. + enum: + - requested + - planned + - picked-up + - released + - closed + type: string + required: + - at + - stage + type: object + type: array + x-kubernetes-list-type: atomic + stage: + description: Stage is the highest stage whose condition currently + holds. + enum: + - requested + - planned + - picked-up + - released + - closed + type: string + work: + description: Work is the related work behind the post. + properties: + done: + format: int32 + type: integer + items: + items: + description: WorkItem is a sub-issue or linked pull request. + properties: + kind: + description: Kind is "issue" or "pullRequest". + type: string + pullRequests: + description: PullRequests are the pull requests that + close this issue. + items: + description: PullRequestRef is a pull request linked + to a work item. + properties: + ref: + type: string + state: + type: string + required: + - ref + - state + type: object + type: array + x-kubernetes-list-type: atomic + ref: + description: Ref is "/#". + type: string + state: + description: State is "open", "closed" or "merged". + type: string + title: + type: string + url: + type: string + required: + - kind + - ref + - state + type: object + type: array + x-kubernetes-list-type: atomic + partShipped: + description: PartShipped records changelog entries that shipped + part of the work. + items: + description: |- + PartShipped records a changelog entry that linked a work item before the + post itself was released. + properties: + at: + format: date-time + type: string + changelog: + description: Changelog is the ChangelogEntry name. + type: string + required: + - at + - changelog + type: object + type: array + x-kubernetes-list-type: atomic + total: + description: |- + Total and Done count sub-issues when there are any, otherwise linked + pull requests. + format: int32 + type: integer + type: object + type: object + github: + description: GitHub identifies the backing issue. + properties: + createdAt: + format: date-time + type: string + number: + format: int32 + type: integer + org: + type: string + repository: + type: string + state: + description: State is "open" or "closed". + type: string + stateReason: + description: 'StateReason is GitHub''s close reason: "completed" + or "not_planned".' + type: string + updatedAt: + format: date-time + type: string + url: + type: string + required: + - number + - org + - repository + - state + - url + type: object + issueType: + description: IssueType is the GitHub issue type, e.g. Enhancement. + type: string + labels: + description: Labels are the issue's GitHub labels. + items: + type: string + type: array + x-kubernetes-list-type: set + lastSyncedAt: + description: LastSyncedAt is when feedback-sync last wrote this post. + format: date-time + type: string + mergedInto: + description: |- + MergedInto is the post this one was closed as a duplicate of. When + feedback-sync sets it, the operator moves votes and subscriptions to + that post. + type: string + publicVoters: + description: PublicVoters are up to 10 voters who opted in to showing + their votes. + items: + description: PublicVoter is a voter who opted in to being shown. + properties: + avatarURL: + type: string + displayName: + type: string + required: + - displayName + type: object + type: array + x-kubernetes-list-type: atomic + release: + description: Release is the name of the Release whose milestone the + issue is on. + type: string + state: + description: State is the public status, mapped from the Enhancements + project. + enum: + - none + - backlog + - planning + - on-deck + - in-progress + - shipped + - closed + type: string + summary: + description: Summary is a plain-text excerpt of the body. + type: string + title: + description: Title is the issue title. + type: string + votes: + description: Votes are the vote totals. + properties: + datum: + description: Datum is the number of Vote resources. + format: int32 + type: integer + github: + description: "GitHub is the \U0001F44D reaction count on the issue." + format: int32 + type: integer + githubReactions: + description: "GitHubReactions are the issue's \U0001F44D reactions, + written by feedback-sync\nwhen the count changes. Used to match + linked voters and for the\ntrending score. GitHub reactions + are public." + items: + description: "GitHubReaction is one \U0001F44D on a GitHub issue." + properties: + at: + description: At is when they reacted. + format: date-time + type: string + login: + description: Login is the reactor's GitHub username. + type: string + required: + - login + type: object + type: array + x-kubernetes-list-type: atomic + linked: + description: "Linked is how many people both voted and reacted + \U0001F44D, matched by the\nGitHub username linked to their + Datum account. They count once in\nTotal." + format: int32 + type: integer + total: + description: "Total is Datum votes plus GitHub \U0001F44D, minus + people matched as doing both." + format: int32 + type: integer + trendingScore: + description: "TrendingScore weights votes with a 7-day half-life:\nΣ + 0.5^(age_days / 7) over Datum votes and GitHub \U0001F44D reactions + whose\ntime is known, counting linked people once. Stored multiplied + by 1000\nand rounded, so it sorts as an integer." + format: int64 + type: integer + type: object + type: object + type: object + selectableFields: + - jsonPath: .spec.hidden + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/bases/feedback.miloapis.com_releases.yaml b/config/crd/bases/feedback.miloapis.com_releases.yaml new file mode 100644 index 0000000..793883e --- /dev/null +++ b/config/crd/bases/feedback.miloapis.com_releases.yaml @@ -0,0 +1,100 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.22.0 + discovery.miloapis.com/parent-contexts: Platform;User + name: releases.feedback.miloapis.com +spec: + group: feedback.miloapis.com + names: + kind: Release + listKind: ReleaseList + plural: releases + singular: release + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.title + name: Title + type: string + - jsonPath: .status.dueOn + name: Due + type: string + - jsonPath: .status.shipped + name: Shipped + type: boolean + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + Release maps to a milestone in the FeedbackSource's milestones repository. + Only feedback-sync writes releases; everyone can read them. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + status: + description: ReleaseStatus is synced from the milestone. + properties: + codename: + type: string + coverImage: + description: CoverImage is a key into the website's static assets. + type: string + descriptionHTML: + type: string + dueOn: + description: DueOn is the milestone due date, as YYYY-MM-DD. + type: string + github: + description: GitHubLink identifies a GitHub issue, milestone or discussion. + properties: + number: + description: Number is the issue, milestone or discussion number. + format: int32 + type: integer + url: + description: URL is the HTML URL on github.com. + type: string + required: + - number + - url + type: object + posts: + description: Posts are the names of posts on the milestone. + items: + type: string + type: array + x-kubernetes-list-type: set + shipped: + description: Shipped is set when the milestone is closed. + type: boolean + title: + description: 'Title is the milestone title, e.g. "Hedy: 2.0".' + type: string + version: + type: string + required: + - title + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/bases/feedback.miloapis.com_securityacknowledgements.yaml b/config/crd/bases/feedback.miloapis.com_securityacknowledgements.yaml new file mode 100644 index 0000000..7d97bd3 --- /dev/null +++ b/config/crd/bases/feedback.miloapis.com_securityacknowledgements.yaml @@ -0,0 +1,80 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.22.0 + discovery.miloapis.com/parent-contexts: Platform + name: securityacknowledgements.feedback.miloapis.com +spec: + group: feedback.miloapis.com + names: + kind: SecurityAcknowledgement + listKind: SecurityAcknowledgementList + plural: securityacknowledgements + singular: securityacknowledgement + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.name + name: Name + type: string + - jsonPath: .status.month + name: Month + type: string + - jsonPath: .status.severity + name: Severity + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + SecurityAcknowledgement is a public credit for a fixed or disclosed + SecurityReport whose reporter chose public credit, with the same name as + the report. The operator creates and updates it; it holds only what the + acknowledgements page shows. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + status: + description: SecurityAcknowledgementStatus is the public credit. + properties: + month: + description: Month is when the report was fixed, as YYYY-MM. + type: string + name: + type: string + severity: + description: Severity is the Security Team's rating. + enum: + - critical + - high + - medium + - low + - informational + type: string + url: + type: string + required: + - month + - name + type: object + type: object + served: true + storage: true + subresources: {} diff --git a/config/crd/bases/feedback.miloapis.com_securityreports.yaml b/config/crd/bases/feedback.miloapis.com_securityreports.yaml new file mode 100644 index 0000000..a4a0a6c --- /dev/null +++ b/config/crd/bases/feedback.miloapis.com_securityreports.yaml @@ -0,0 +1,277 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.22.0 + discovery.miloapis.com/parent-contexts: Platform;User + iam.miloapis.com/owner-field: spec.userRef.name + name: securityreports.feedback.miloapis.com +spec: + group: feedback.miloapis.com + names: + kind: SecurityReport + listKind: SecurityReportList + plural: securityreports + singular: securityreport + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.title + name: Title + type: string + - jsonPath: .status.phase + name: Phase + type: string + - jsonPath: .status.severity + name: Severity + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + SecurityReport is a private vulnerability report. Reporters create and read + their own in the user context. Only the Security Team role can list every + report and write status; what the reporter must not see lives on its + SecurityReportTriage. Reports are never synced to GitHub, indexed or sent + to the AI gateway, and are audited at Metadata level only. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: SecurityReportSpec is what the reporter submitted. + properties: + affected: + description: Affected is free text that helps routing, e.g. "connectors". + maxLength: 200 + type: string + attachments: + description: Attachments reference files uploaded to feedback-uploads. + items: + description: AttachmentReference points at a file uploaded to feedback-uploads. + properties: + contentType: + description: |- + ContentType is the file's media type. Set by the admission webhook from + the upload. + maxLength: 255 + type: string + name: + description: |- + Name is the file name shown to reviewers. Set by the admission webhook + from the upload. + maxLength: 255 + type: string + uploadRef: + description: UploadRef is the reference feedback-uploads returned. + maxLength: 128 + minLength: 1 + type: string + required: + - uploadRef + type: object + maxItems: 5 + type: array + x-kubernetes-list-type: atomic + context: + description: SecurityReportContext is where the report came from. + properties: + client: + description: Client is the surface a request came from. + enum: + - website + - portal + - datumctl + - patch + - email + - github + type: string + clientVersion: + type: string + filedByAgent: + description: |- + FiledByAgent is set when an agent (Patch, non-interactive datumctl) + filed the report. + type: boolean + organization: + type: string + type: object + credit: + description: Credit is how the reporter wants to be credited. + properties: + name: + type: string + public: + description: |- + Public lists the reporter on the acknowledgements page once the report + is Fixed or Disclosed. + type: boolean + url: + type: string + type: object + description: + maxLength: 50000 + minLength: 1 + type: string + impact: + maxLength: 10000 + type: string + reporter: + description: |- + Reporter is set only on reports the Security Team logs for someone + without a Datum account (from email or GitHub private reporting). + properties: + email: + type: string + githubLogin: + type: string + type: object + stepsToReproduce: + maxLength: 50000 + type: string + title: + maxLength: 200 + minLength: 1 + type: string + userRef: + description: |- + UserRef is the reporter, set by the admission webhook. Empty for reports + the Security Team logs for someone without a Datum account. + properties: + name: + maxLength: 63 + minLength: 1 + type: string + required: + - name + type: object + required: + - description + - title + type: object + x-kubernetes-validations: + - message: reports can't be changed after they are sent + rule: self == oldSelf + status: + description: SecurityReportStatus is written by the Security Team. + properties: + advisory: + description: SecurityAdvisory is the published advisory. + properties: + cve: + type: string + url: + type: string + type: object + cvssVector: + type: string + phase: + description: SecurityReportPhase is where a report is in handling. + enum: + - Received + - Triaged + - Fixing + - Fixed + - Disclosed + - NotApplicable + - Duplicate + type: string + reason: + description: Reason is shown to the reporter for NotApplicable and + Duplicate. + type: string + reward: + description: SecurityReward records how the reporter was thanked. + properties: + amount: + description: Amount is the credit amount, for kind credits. + type: string + creditGrantRef: + description: CreditGrantRef names the billing CreditGrant, for + kind credits. + properties: + name: + type: string + required: + - name + type: object + grantedAt: + format: date-time + type: string + kind: + description: RewardKind is how a reporter is thanked. + enum: + - none + - thanks + - swag + - credits + type: string + required: + - kind + type: object + severity: + description: Severity is the Security Team's rating. + enum: + - critical + - high + - medium + - low + - informational + type: string + timeline: + description: Timeline is visible to the reporter. + items: + description: SecurityTimelineEntry is one phase change. + properties: + at: + format: date-time + type: string + note: + type: string + phase: + description: SecurityReportPhase is where a report is in handling. + enum: + - Received + - Triaged + - Fixing + - Fixed + - Disclosed + - NotApplicable + - Duplicate + type: string + required: + - at + - phase + type: object + type: array + x-kubernetes-list-type: atomic + type: object + required: + - spec + type: object + selectableFields: + - jsonPath: .spec.userRef.name + - jsonPath: .status.phase + - jsonPath: .status.severity + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/bases/feedback.miloapis.com_securityreporttriages.yaml b/config/crd/bases/feedback.miloapis.com_securityreporttriages.yaml new file mode 100644 index 0000000..c43249f --- /dev/null +++ b/config/crd/bases/feedback.miloapis.com_securityreporttriages.yaml @@ -0,0 +1,71 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.22.0 + discovery.miloapis.com/parent-contexts: Platform + name: securityreporttriages.feedback.miloapis.com +spec: + group: feedback.miloapis.com + names: + kind: SecurityReportTriage + listKind: SecurityReportTriageList + plural: securityreporttriages + singular: securityreporttriage + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.assignee + name: Assignee + type: string + - jsonPath: .spec.duplicateOf + name: Duplicate of + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + SecurityReportTriage is the Security Team's private notes on a report, + with the same name as the report. Only the Security Team can read or write + it, so nothing here reaches the reporter. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: SecurityReportTriageSpec is Security Team only. + properties: + assignee: + type: string + duplicateOf: + description: DuplicateOf is the name of the original report. + type: string + notes: + type: string + tracking: + description: Tracking links the private issue or draft advisory for + the fix. + type: string + type: object + type: object + served: true + storage: true + subresources: {} diff --git a/config/crd/bases/feedback.miloapis.com_submissionreviews.yaml b/config/crd/bases/feedback.miloapis.com_submissionreviews.yaml new file mode 100644 index 0000000..61edc8c --- /dev/null +++ b/config/crd/bases/feedback.miloapis.com_submissionreviews.yaml @@ -0,0 +1,236 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.22.0 + discovery.miloapis.com/parent-contexts: Platform + name: submissionreviews.feedback.miloapis.com +spec: + group: feedback.miloapis.com + names: + kind: SubmissionReview + listKind: SubmissionReviewList + plural: submissionreviews + singular: submissionreview + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.decision + name: Decision + type: string + - jsonPath: .spec.reviewer + name: Reviewer + type: string + - jsonPath: .status.applied + name: Applied + type: boolean + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + SubmissionReview is the staff side of a Submission, with the same name. The + operator creates it when the submission arrives and writes triage to its + status. Staff decide by setting spec.decision, which can't change once set; + the operator then applies the decision. Submitters can't read it. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: SubmissionReviewSpec is the staff decision. Empty until staff + decide. + properties: + affected: + description: Affected sets spec.affected on the SecurityReport for + MoveToSecurity. + maxLength: 200 + type: string + decision: + description: ReviewDecision is a staff decision on a submission. + enum: + - Approved + - Merged + - Rejected + - MoveToSecurity + type: string + mergedInto: + description: MergedInto is the post name when the decision is Merged. + maxLength: 200 + type: string + publicBody: + maxLength: 20000 + type: string + publicTitle: + description: |- + PublicTitle and PublicBody are what goes to GitHub on approval. Clients + default them to the triage draft. + maxLength: 200 + type: string + reason: + description: Reason is shown to the submitter when the decision is + Rejected. + maxLength: 2000 + type: string + reviewedAt: + description: ReviewedAt is when the decision was set, by the admission + webhook. + format: date-time + type: string + reviewer: + description: |- + Reviewer is the staff member who set the decision. The admission + webhook sets it from the request; it can't be set by clients. + type: string + type: object + x-kubernetes-validations: + - message: a decision can't change once it is set + rule: '!has(oldSelf.decision) || self == oldSelf' + - message: Approved needs publicTitle and publicBody + rule: '!has(self.decision) || self.decision != ''Approved'' || (has(self.publicTitle) + && has(self.publicBody))' + - message: Merged needs mergedInto + rule: '!has(self.decision) || self.decision != ''Merged'' || has(self.mergedInto)' + - message: Rejected needs a reason for the submitter + rule: '!has(self.decision) || self.decision != ''Rejected'' || has(self.reason)' + status: + description: SubmissionReviewStatus is written by the operator. + properties: + applied: + description: Applied is set once the operator has carried out the + decision. + type: boolean + conditions: + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + triage: + description: Triage is advisory. + properties: + draftIssue: + description: DraftIssue is a public title and body with private + details stripped. + properties: + body: + type: string + title: + type: string + required: + - body + - title + type: object + fraudScore: + description: FraudScore is from the fraud service, 0 to 1, as + a decimal string. + type: string + likelySecurityIssue: + description: |- + LikelySecurityIssue flags submissions that should be moved to the + security track. + type: boolean + similarPosts: + description: SimilarPosts come from a keyword search on the submission. + items: + description: SimilarPost is a post that may cover the same feedback. + properties: + name: + type: string + required: + - name + type: object + type: array + x-kubernetes-list-type: atomic + suggestedCategories: + items: + type: string + type: array + x-kubernetes-list-type: set + suggestedKind: + description: SubmissionKind is what the submitter says the feedback + is. + enum: + - idea + - bug + - other + type: string + type: object + type: object + type: object + selectableFields: + - jsonPath: .spec.decision + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/bases/feedback.miloapis.com_submissions.yaml b/config/crd/bases/feedback.miloapis.com_submissions.yaml new file mode 100644 index 0000000..e194efb --- /dev/null +++ b/config/crd/bases/feedback.miloapis.com_submissions.yaml @@ -0,0 +1,204 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.22.0 + discovery.miloapis.com/parent-contexts: Platform;User + iam.miloapis.com/owner-field: spec.userRef.name + name: submissions.feedback.miloapis.com +spec: + group: feedback.miloapis.com + names: + kind: Submission + listKind: SubmissionList + plural: submissions + singular: submission + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.kind + name: Kind + type: string + - jsonPath: .status.phase + name: Phase + type: string + - jsonPath: .spec.title + name: Title + type: string + - jsonPath: .spec.userRef.name + name: User + priority: 1 + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + Submission is private feedback waiting for a staff decision. Submitters + create and read their own in the user context; staff list them in the + platform context and decide on its SubmissionReview. It holds only what the + submitter may see. Nothing in a submission reaches GitHub unless staff + approve it, and then only the staff-edited public title and body. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: SubmissionSpec is what the user submitted. + properties: + attachments: + description: Attachments reference files uploaded to feedback-uploads. + items: + description: AttachmentReference points at a file uploaded to feedback-uploads. + properties: + contentType: + description: |- + ContentType is the file's media type. Set by the admission webhook from + the upload. + maxLength: 255 + type: string + name: + description: |- + Name is the file name shown to reviewers. Set by the admission webhook + from the upload. + maxLength: 255 + type: string + uploadRef: + description: UploadRef is the reference feedback-uploads returned. + maxLength: 128 + minLength: 1 + type: string + required: + - uploadRef + type: object + maxItems: 5 + type: array + x-kubernetes-list-type: atomic + body: + maxLength: 20000 + minLength: 1 + type: string + context: + description: Context is filled by the client and never sent to GitHub. + properties: + client: + description: Client is the surface a request came from. + enum: + - website + - portal + - datumctl + - patch + - email + - github + type: string + clientVersion: + description: ClientVersion is e.g. cloud-portal@2026.10.1. + maxLength: 128 + type: string + organization: + maxLength: 253 + type: string + pageURL: + maxLength: 2048 + type: string + project: + maxLength: 253 + type: string + requestIDs: + description: RequestIDs are recent API request IDs, for debugging. + items: + maxLength: 128 + type: string + maxItems: 20 + type: array + x-kubernetes-list-type: atomic + type: object + kind: + description: SubmissionKind is what the submitter says the feedback + is. + enum: + - idea + - bug + - other + type: string + title: + maxLength: 200 + minLength: 1 + type: string + userRef: + description: UserRef is the submitter, set by the admission webhook. + properties: + name: + maxLength: 63 + minLength: 1 + type: string + required: + - name + type: object + required: + - body + - kind + - title + - userRef + type: object + x-kubernetes-validations: + - message: submissions can't be changed after they are sent + rule: self == oldSelf + status: + description: |- + SubmissionStatus is written by the operator from the SubmissionReview, and + is all the submitter learns about the review. + properties: + phase: + description: SubmissionPhase is where a submission is in review. + enum: + - PendingReview + - Approved + - Merged + - Rejected + type: string + postRef: + description: PostRef is the post the submission became or was merged + into. + properties: + name: + description: Name of the Post, e.g. datum-cloud.enhancements.912. + maxLength: 200 + minLength: 1 + type: string + required: + - name + type: object + reason: + description: Reason is shown to the submitter when the submission + is Rejected. + type: string + type: object + required: + - spec + type: object + selectableFields: + - jsonPath: .spec.userRef.name + - jsonPath: .spec.kind + - jsonPath: .status.phase + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/bases/feedback.miloapis.com_subscriptions.yaml b/config/crd/bases/feedback.miloapis.com_subscriptions.yaml new file mode 100644 index 0000000..fa2dce4 --- /dev/null +++ b/config/crd/bases/feedback.miloapis.com_subscriptions.yaml @@ -0,0 +1,110 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.22.0 + discovery.miloapis.com/parent-contexts: Platform;User + iam.miloapis.com/owner-field: spec.userRef.name + name: subscriptions.feedback.miloapis.com +spec: + group: feedback.miloapis.com + names: + kind: Subscription + listKind: SubscriptionList + plural: subscriptions + singular: subscription + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.postRef.name + name: Post + type: string + - jsonPath: .spec.userRef.name + name: User + priority: 1 + type: string + - jsonPath: .spec.reason + name: Reason + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + Subscription links a user to a post they follow. The operator creates one + when a user votes or their submission is approved or merged; users create + and delete their own in the user context. Named like a Vote. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: SubscriptionSpec identifies the post and the follower. + properties: + postRef: + description: PostReference names a Post. + properties: + name: + description: Name of the Post, e.g. datum-cloud.enhancements.912. + maxLength: 200 + minLength: 1 + type: string + required: + - name + type: object + reason: + description: |- + Reason is "manual" when the user follows a post themselves; the operator + sets the others. + enum: + - voted + - submitted + - merged + - manual + type: string + userRef: + description: UserRef is the follower, set by the admission webhook. + properties: + name: + maxLength: 63 + minLength: 1 + type: string + required: + - name + type: object + required: + - postRef + - userRef + type: object + x-kubernetes-validations: + - message: spec is immutable + rule: self == oldSelf + required: + - spec + type: object + x-kubernetes-validations: + - message: metadata.name must be . + rule: self.metadata.name == self.spec.postRef.name + '.' + self.spec.userRef.name + selectableFields: + - jsonPath: .spec.userRef.name + - jsonPath: .spec.postRef.name + served: true + storage: true + subresources: {} diff --git a/config/crd/bases/feedback.miloapis.com_votes.yaml b/config/crd/bases/feedback.miloapis.com_votes.yaml new file mode 100644 index 0000000..7b9b98d --- /dev/null +++ b/config/crd/bases/feedback.miloapis.com_votes.yaml @@ -0,0 +1,137 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.22.0 + discovery.miloapis.com/parent-contexts: Platform;User + iam.miloapis.com/owner-field: spec.userRef.name + name: votes.feedback.miloapis.com +spec: + group: feedback.miloapis.com + names: + kind: Vote + listKind: VoteList + plural: votes + singular: vote + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.postRef.name + name: Post + type: string + - jsonPath: .spec.userRef.name + name: User + priority: 1 + type: string + - jsonPath: .spec.source + name: Source + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: |- + Vote is a user's vote on a post. Users create and delete their own in the + user context; staff list every vote in the platform context. + + Every user's votes share one collection, so the name is + "." (see OwnedName), which allows one vote per user per post. + The admission webhook sets spec.userRef from the request. The operator + follows the post for the voter and recomputes the post's totals. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: VoteSpec identifies the post and where the vote came from. + properties: + postRef: + description: PostReference names a Post. + properties: + name: + description: Name of the Post, e.g. datum-cloud.enhancements.912. + maxLength: 200 + minLength: 1 + type: string + required: + - name + type: object + source: + description: Source is the client the vote was cast from. + enum: + - website + - portal + - datumctl + - patch + - email + - github + type: string + userRef: + description: UserRef is the voter, set by the admission webhook. + properties: + name: + maxLength: 63 + minLength: 1 + type: string + required: + - name + type: object + required: + - postRef + - userRef + type: object + x-kubernetes-validations: + - message: spec is immutable; delete the vote and vote again + rule: self == oldSelf + status: + description: VoteStatus is written by the operator. + properties: + githubLogin: + description: "GitHubLogin is the GitHub username linked to the voter's + account when\nthey voted, so a \U0001F44D from the same person isn't + counted twice. Never\npublic." + type: string + organizations: + description: |- + Organizations the voter belonged to when voting. Used for staff + analytics and never public. + items: + type: string + type: array + x-kubernetes-list-type: set + subscribed: + description: |- + Subscribed is set once the operator has followed the post for the + voter, so a follow the voter later deletes isn't recreated. + type: boolean + type: object + required: + - spec + type: object + x-kubernetes-validations: + - message: metadata.name must be . + rule: self.metadata.name == self.spec.postRef.name + '.' + self.spec.userRef.name + selectableFields: + - jsonPath: .spec.userRef.name + - jsonPath: .spec.postRef.name + served: true + storage: true + subresources: + status: {} diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml new file mode 100644 index 0000000..f9ed635 --- /dev/null +++ b/config/crd/kustomization.yaml @@ -0,0 +1,19 @@ +# The feedback CRDs. They are installed in Milo, not in the cluster the +# operator runs in. +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - bases/feedback.miloapis.com_feedbacksources.yaml + - bases/feedback.miloapis.com_posts.yaml + - bases/feedback.miloapis.com_releases.yaml + - bases/feedback.miloapis.com_changelogentries.yaml + - bases/feedback.miloapis.com_votes.yaml + - bases/feedback.miloapis.com_subscriptions.yaml + - bases/feedback.miloapis.com_submissions.yaml + - bases/feedback.miloapis.com_submissionreviews.yaml + - bases/feedback.miloapis.com_securityreports.yaml + - bases/feedback.miloapis.com_securityreporttriages.yaml + - bases/feedback.miloapis.com_securityacknowledgements.yaml + - bases/feedback.miloapis.com_feedbackprofiles.yaml + - bases/feedback.miloapis.com_feedbackdigests.yaml diff --git a/config/milo/discovery/discovery-context-policy.yaml b/config/milo/discovery/discovery-context-policy.yaml deleted file mode 100644 index 71781d5..0000000 --- a/config/milo/discovery/discovery-context-policy.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: discovery.miloapis.com/v1alpha1 -kind: DiscoveryContextPolicy -metadata: - name: feedback-service -spec: - rules: - # FeedbackSource is staff configuration. User-context resources (Vote, - # Submission, Subscription, ...) get their own rules as they are added. - - group: feedback.miloapis.com - resources: ["feedbacksources"] - contexts: ["Platform"] diff --git a/config/milo/discovery/kustomization.yaml b/config/milo/discovery/kustomization.yaml deleted file mode 100644 index d2719ec..0000000 --- a/config/milo/discovery/kustomization.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1alpha1 -kind: Component - -resources: - - discovery-context-policy.yaml diff --git a/config/milo/kustomization.yaml b/config/milo/kustomization.yaml index a25611b..66e668c 100644 --- a/config/milo/kustomization.yaml +++ b/config/milo/kustomization.yaml @@ -1,6 +1,7 @@ apiVersion: kustomize.config.k8s.io/v1alpha1 kind: Component +# Applied to Milo. The CRDs themselves are in config/crd; each CRD declares +# its discovery contexts and access rules with annotations. components: - iam/ - - discovery/ diff --git a/config/overlays/core-control-plane/kustomization.yaml b/config/overlays/core-control-plane/kustomization.yaml index dc79c35..92cdbcf 100644 --- a/config/overlays/core-control-plane/kustomization.yaml +++ b/config/overlays/core-control-plane/kustomization.yaml @@ -1,9 +1,14 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization +namespace: feedback-system + resources: - ../../base +components: + - ../../components/milo-integration + images: - name: ghcr.io/milo-os/feedback newTag: latest diff --git a/config/samples/changelogentry.yaml b/config/samples/changelogentry.yaml new file mode 100644 index 0000000..d2ea02d --- /dev/null +++ b/config/samples/changelogentry.yaml @@ -0,0 +1,19 @@ +# Changelog entries are written by feedback-sync. Shown here for reference. +apiVersion: feedback.miloapis.com/v1alpha1 +kind: ChangelogEntry +metadata: + name: datum-cloud.datum.303 +status: + title: "Application Load Balancer: wildcard hostnames" + publishedAt: "2026-10-07T13:23:39Z" + categories: [deliver] + bodyHTML: "

...

" + posts: + - datum-cloud.enhancements.913 + issueRefs: + - datum-cloud/enhancements#913 + - datum-cloud/compute#311 + reactions: {thumbsUp: 4} + github: + url: https://github.com/datum-cloud/datum/discussions/303 + number: 303 diff --git a/config/samples/feedbackdigest.yaml b/config/samples/feedbackdigest.yaml new file mode 100644 index 0000000..8b6d83d --- /dev/null +++ b/config/samples/feedbackdigest.yaml @@ -0,0 +1,13 @@ +# Written by the operator. +apiVersion: feedback.miloapis.com/v1alpha1 +kind: FeedbackDigest +metadata: + name: "312983457298312345" +spec: + userRef: + name: "312983457298312345" + items: + - event: picked-up + post: datum-cloud.enhancements.912 + at: "2026-10-07T09:40:00Z" + itemCount: 1 diff --git a/config/samples/feedbackprofile.yaml b/config/samples/feedbackprofile.yaml new file mode 100644 index 0000000..e405cde --- /dev/null +++ b/config/samples/feedbackprofile.yaml @@ -0,0 +1,8 @@ +apiVersion: feedback.miloapis.com/v1alpha1 +kind: FeedbackProfile +metadata: + name: "312983457298312345" +spec: + userRef: + name: "312983457298312345" + showPublicVotes: true diff --git a/config/samples/post.yaml b/config/samples/post.yaml new file mode 100644 index 0000000..41dcefa --- /dev/null +++ b/config/samples/post.yaml @@ -0,0 +1,60 @@ +# Posts are written by feedback-sync. Shown here for reference. +apiVersion: feedback.miloapis.com/v1alpha1 +kind: Post +metadata: + name: datum-cloud.enhancements.912 + labels: + feedback.miloapis.com/org: datum-cloud + feedback.miloapis.com/status: in-progress + feedback.miloapis.com/stage: picked-up + category.feedback.miloapis.com/build: "" +spec: + hidden: false +status: + title: Bare Metal Infrastructure service + summary: Expands Datum's platform to support full lifecycle management of bare metal. + bodyHTML: "

High-Level Summary

This enhancement ...

" + state: in-progress + categories: [build] + labels: [Build] + issueType: Enhancement + github: + org: datum-cloud + repository: enhancements + number: 912 + url: https://github.com/datum-cloud/enhancements/issues/912 + state: open + createdAt: "2026-09-30T14:12:00Z" + updatedAt: "2026-10-07T09:40:00Z" + release: hedy-2-0 + votes: + total: 9 + datum: 6 + github: 4 + trendingScore: 3420 + publicVoters: + - displayName: Ada L. + avatarURL: https://example.com/ada.png + delivery: + stage: picked-up + highestNotified: picked-up + history: + - {stage: requested, at: "2026-09-30T14:12:00Z"} + - {stage: planned, at: "2026-10-02T09:00:00Z"} + - stage: picked-up + at: "2026-10-07T09:40:00Z" + cause: datum-cloud/compute#318 opened, closes datum-cloud/compute#311 + work: + total: 5 + done: 3 + items: + - kind: issue + ref: datum-cloud/compute#311 + title: BMC inventory API + state: open + url: https://github.com/datum-cloud/compute/issues/311 + pullRequests: + - {ref: datum-cloud/compute#318, state: open} + partShipped: + - {changelog: datum-cloud.datum.303, at: "2026-10-07T13:23:39Z"} + lastSyncedAt: "2026-10-08T12:00:00Z" diff --git a/config/samples/release.yaml b/config/samples/release.yaml new file mode 100644 index 0000000..03f0853 --- /dev/null +++ b/config/samples/release.yaml @@ -0,0 +1,19 @@ +# Releases are written by feedback-sync. Shown here for reference. +apiVersion: feedback.miloapis.com/v1alpha1 +kind: Release +metadata: + name: hedy-2-0 +status: + title: "Hedy: 2.0" + codename: Hedy + version: "2.0" + dueOn: "2026-10-31" + shipped: false + descriptionHTML: "

...

" + coverImage: hedy-2-0 + posts: + - datum-cloud.enhancements.912 + - datum-cloud.enhancements.913 + github: + url: https://github.com/datum-cloud/enhancements/milestone/14 + number: 14 diff --git a/config/samples/securityacknowledgement.yaml b/config/samples/securityacknowledgement.yaml new file mode 100644 index 0000000..e0f8242 --- /dev/null +++ b/config/samples/securityacknowledgement.yaml @@ -0,0 +1,10 @@ +# Written by the operator from a fixed or disclosed SecurityReport. +apiVersion: feedback.miloapis.com/v1alpha1 +kind: SecurityAcknowledgement +metadata: + name: sec-4m8q1 +status: + name: Ada L. + url: https://example.com + month: "2026-11" + severity: high diff --git a/config/samples/securityreport.yaml b/config/samples/securityreport.yaml new file mode 100644 index 0000000..60447d9 --- /dev/null +++ b/config/samples/securityreport.yaml @@ -0,0 +1,25 @@ +apiVersion: feedback.miloapis.com/v1alpha1 +kind: SecurityReport +metadata: + generateName: sec- +spec: + userRef: + name: "312983457298312345" + title: Project viewer can read connector credentials + description: | + A user with the viewer role on a project can read connector credentials. + affected: connectors + stepsToReproduce: | + 1. ... + impact: Credential disclosure across users in one project + attachments: + - uploadRef: att-c71e + credit: + public: true + name: Ada L. + url: https://example.com + context: + client: patch + filedByAgent: true + organization: acme-corp + clientVersion: patch@2026.10.2 diff --git a/config/samples/securityreporttriage.yaml b/config/samples/securityreporttriage.yaml new file mode 100644 index 0000000..2d4645e --- /dev/null +++ b/config/samples/securityreporttriage.yaml @@ -0,0 +1,8 @@ +apiVersion: feedback.miloapis.com/v1alpha1 +kind: SecurityReportTriage +metadata: + name: sec-4m8q1 +spec: + assignee: staff:jdoe@datum.net + tracking: https://github.com/datum-cloud/datum/security/advisories/GHSA-xxxx + notes: Reproduced on staging. diff --git a/config/samples/submission.yaml b/config/samples/submission.yaml new file mode 100644 index 0000000..6df5a18 --- /dev/null +++ b/config/samples/submission.yaml @@ -0,0 +1,21 @@ +# Created in the user context. The admission webhook sets spec.userRef. +apiVersion: feedback.miloapis.com/v1alpha1 +kind: Submission +metadata: + generateName: sub- +spec: + userRef: + name: "312983457298312345" + kind: idea + title: Let me pick the region for Galactic VPC attachments + body: | + When I attach a VPC I can't choose which region it lands in. + attachments: + - uploadRef: att-91ac + context: + client: portal + pageURL: https://cloud.datum.net/org/acme/projects/web/vpc + organization: acme-corp + project: web + requestIDs: [req-01HZX] + clientVersion: cloud-portal@2026.10.1 diff --git a/config/samples/submissionreview.yaml b/config/samples/submissionreview.yaml new file mode 100644 index 0000000..26c6c9a --- /dev/null +++ b/config/samples/submissionreview.yaml @@ -0,0 +1,12 @@ +# Created by the operator with the same name as the submission. Staff set the +# decision; the webhook records the reviewer. +apiVersion: feedback.miloapis.com/v1alpha1 +kind: SubmissionReview +metadata: + name: sub-7f3k2 +spec: + decision: Approved + publicTitle: Region selection for Galactic VPC attachments + publicBody: | + ### Summary + Choose the region a VPC attachment lands in. diff --git a/config/samples/subscription.yaml b/config/samples/subscription.yaml new file mode 100644 index 0000000..8da3f68 --- /dev/null +++ b/config/samples/subscription.yaml @@ -0,0 +1,10 @@ +apiVersion: feedback.miloapis.com/v1alpha1 +kind: Subscription +metadata: + name: datum-cloud.enhancements.912.312983457298312345 +spec: + postRef: + name: datum-cloud.enhancements.912 + userRef: + name: "312983457298312345" + reason: manual diff --git a/config/samples/vote.yaml b/config/samples/vote.yaml new file mode 100644 index 0000000..ced4675 --- /dev/null +++ b/config/samples/vote.yaml @@ -0,0 +1,12 @@ +# Created in the user context. The admission webhook sets spec.userRef from +# the request; the name is .. +apiVersion: feedback.miloapis.com/v1alpha1 +kind: Vote +metadata: + name: datum-cloud.enhancements.912.312983457298312345 +spec: + postRef: + name: datum-cloud.enhancements.912 + userRef: + name: "312983457298312345" + source: website diff --git a/go.mod b/go.mod index 1ea1838..cc87fb8 100644 --- a/go.mod +++ b/go.mod @@ -5,36 +5,21 @@ go 1.27.0 toolchain go1.27.4 require ( - github.com/jackc/pgx/v5 v5.12.0 - github.com/pressly/goose/v3 v3.30.0 github.com/spf13/cobra v1.10.2 - github.com/spf13/pflag v1.0.10 k8s.io/apimachinery v0.37.2 - k8s.io/apiserver v0.37.2 k8s.io/client-go v0.37.2 - k8s.io/component-base v0.37.2 - k8s.io/klog/v2 v2.140.0 - k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad - sigs.k8s.io/structured-merge-diff/v6 v6.4.2 + sigs.k8s.io/controller-runtime v0.25.3 ) require ( - cel.dev/expr v0.25.3 // indirect - github.com/NYTimes/gziphandler v1.1.1 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/blang/semver/v4 v4.0.0 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/coreos/go-semver v0.3.1 // indirect - github.com/coreos/go-systemd/v22 v22.7.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.13.0 // indirect - github.com/felixge/httpsnoop v1.1.0 // indirect + github.com/evanphx/json-patch/v5 v5.9.11 // indirect github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/fxamacker/cbor/v2 v2.9.1 // indirect github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect github.com/go-logr/zapr v1.3.0 // indirect github.com/go-openapi/jsonpointer v1.0.0 // indirect github.com/go-openapi/jsonreference v1.0.0 // indirect @@ -50,20 +35,11 @@ require ( github.com/go-openapi/swag/stringutils v0.27.1 // indirect github.com/go-openapi/swag/typeutils v0.27.1 // indirect github.com/go-openapi/swag/yamlutils v0.27.1 // indirect - github.com/golang/protobuf v1.5.4 // indirect - github.com/google/cel-go v0.30.0 // indirect github.com/google/gnostic-models v0.7.0 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 // indirect - github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect - github.com/jackc/puddle/v2 v2.2.3 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/mfridman/interpolate v0.0.2 // indirect + github.com/klauspost/compress v1.20.4 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -72,28 +48,13 @@ require ( github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.70.0 // indirect github.com/prometheus/procfs v0.23.0 // indirect - github.com/sethvargo/go-retry v0.5.0 // indirect + github.com/spf13/pflag v1.0.10 // indirect + github.com/stretchr/testify v1.12.1 // indirect github.com/x448/float16 v0.8.4 // indirect - go.etcd.io/etcd/api/v3 v3.7.0 // indirect - go.etcd.io/etcd/client/pkg/v3 v3.7.1 // indirect - go.etcd.io/etcd/client/v3 v3.7.0 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.68.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.45.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.45.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.1 // indirect go.yaml.in/yaml/v2 v2.4.4 // indirect go.yaml.in/yaml/v3 v3.0.6 // indirect - golang.org/x/crypto v0.59.0 // indirect - golang.org/x/exp v0.0.0-20261109185158-a52e3aef5920 // indirect golang.org/x/mod v0.42.0 // indirect golang.org/x/net v0.62.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect @@ -103,22 +64,20 @@ require ( golang.org/x/text v0.44.0 // indirect golang.org/x/time v0.15.0 // indirect golang.org/x/tools v0.52.1-0.20261106145633-d407941a339a // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20261110000943-09e21b237f2c // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20261110000943-09e21b237f2c // indirect - google.golang.org/grpc v1.85.0 // indirect + gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/protobuf v1.36.12 // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect k8s.io/api v0.37.2 // indirect + k8s.io/apiextensions-apiserver v0.37.0 // indirect k8s.io/code-generator v0.37.2 // indirect k8s.io/gengo/v2 v2.0.0-20260408192533-25e2208e0dc3 // indirect - k8s.io/kms v0.37.2 // indirect - k8s.io/streaming v0.37.2 // indirect + k8s.io/klog/v2 v2.140.0 // indirect + k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad // indirect k8s.io/utils v0.0.0-20260626114624-be93311217bd // indirect - sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.36.0 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect sigs.k8s.io/randfill v1.0.0 // indirect + sigs.k8s.io/structured-merge-diff/v6 v6.4.2 // indirect sigs.k8s.io/yaml v1.6.0 // indirect ) diff --git a/go.sum b/go.sum index 35bc1b2..64147a6 100644 --- a/go.sum +++ b/go.sum @@ -1,41 +1,26 @@ -cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= -cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= -github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= -github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= -github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= -github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= -github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= -github.com/coreos/go-systemd/v22 v22.7.0 h1:LAEzFkke61DFROc7zNLX/WA2i5J8gYqe0rSj9KI28KA= -github.com/coreos/go-systemd/v22 v22.7.0/go.mod h1:xNUYtjHu2EDXbsxz1i41wouACIwT7Ybq9o0BQhMwD0w= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dustin/go-humanize v1.1.0 h1:dbKTrvD0klcbBV/h4AWJdMuZogJACoMlvWIWZ5b2xWg= -github.com/dustin/go-humanize v1.1.0/go.mod h1:hc1CvRkJMsgxqjmjMQF3QNRAZBwY8AXBAzKYoSX9sFI= github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= github.com/emicklei/go-restful/v3 v3.13.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc= -github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE= +github.com/evanphx/json-patch v0.5.2 h1:xVCHIVMUu1wtM/VkR9jVZ45N3FhZfYMMYGorLCR8P3k= +github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= +github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU= +github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM= github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k= github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/fxamacker/cbor/v2 v2.9.1 h1:2rWm8B193Ll4VdjsJY28jxs70IdDsHRWgQYAI80+rMQ= github.com/fxamacker/cbor/v2 v2.9.1/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= github.com/go-openapi/jsonpointer v1.0.0 h1:kR9tHqY0CtZaOPVFm622dPVNhrvYpwr4uCxgL3h1H8s= @@ -72,49 +57,27 @@ github.com/go-openapi/testify/enable/yaml/v2 v2.6.0 h1:gGHwAJ0R/5jU8BEGDbfRNR3hL github.com/go-openapi/testify/enable/yaml/v2 v2.6.0/go.mod h1:tY+St1SGq4NFl0QIqdTY4aEdbChAHxhyB77XQi9iJCo= github.com/go-openapi/testify/v2 v2.6.0 h1:5PKH2HE7YJ/LuRPQGvSxBRlFXNQhSetBLlGAgUEu3ug= github.com/go-openapi/testify/v2 v2.6.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw= -github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= -github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/cel-go v0.30.0 h1:ll54AkzKunWkBn9wSoiUXbFZXYZTkdJGNXTBXUoolGo= -github.com/google/cel-go v0.30.0/go.mod h1:X0bD6iVNR8pkROSOoHVdgTkzmRcosof7WQqCD6wcMc8= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo= github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8= +github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= -github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= -github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0 h1:QGLs/O40yoNK9vmy4rhUGBVyMf1lISBGtXRpsu/Qu/o= -github.com/grpc-ecosystem/go-grpc-middleware/providers/prometheus v1.1.0/go.mod h1:hM2alZsMUni80N33RBe6J0e423LB+odMj7d3EMP9l20= -github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 h1:B+8ClL/kCQkRiU82d9xajRPKYMrB7E0MbtzWVi1K4ns= -github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3/go.mod h1:NbCUVmiS4foBGBHOYlCT25+YmGpJ32dZPi75pGEUpj4= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 h1:5VipnvEpbqr2gA2VbM+nYVbkIF28c5ZQfqCBQ5g2xfk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0/go.mod h1:Hyl3n6Twe1hvtd9XUXDec4pTvgMSEixRuQKPTMH2bNs= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= -github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= -github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.12.0 h1:hWwax8YiGT0YiN50U1oIDn5kgR7KC2tG3rmavwpPkxY= -github.com/jackc/pgx/v5 v5.12.0/go.mod h1:u2Fi6no03HCSBYE+ZVdLxbwdu3xyi2vU+K/YNJioSds= -github.com/jackc/puddle/v2 v2.2.3 h1:f8HoREISb3l5eO9coPgK7U3hKLhWGokOFVcThl5jrao= -github.com/jackc/puddle/v2 v2.2.3/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= -github.com/jonboulle/clockwork v0.5.0 h1:Hyh9A8u51kptdkR+cqRpT1EebBwTn1oK9YfGYbdFz6I= -github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/klauspost/compress v1.20.4 h1:dD0v/bvxtjCBqQu6sx1TNWkalEY5lNTIe+HY9w8TeNI= github.com/klauspost/compress v1.20.4/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI= -github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A= -github.com/mfridman/interpolate v0.0.2 h1:pnuTK7MQIxxFz1Gr+rjSIx9u7qVjf5VOoM/u6BbAxPY= -github.com/mfridman/interpolate v0.0.2/go.mod h1:p+7uk6oE07mpE/Ik1b8EckO0O4ZXiGAfshKBWLUM9Xg= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -123,13 +86,15 @@ github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFd github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/ncruces/go-strftime v1.1.0 h1:vtPmPWMkb539RGV9WpWT9EwJGvrOCKvMNI4obWL47Hk= -github.com/ncruces/go-strftime v1.1.0/go.mod h1:yVaq7iwCN09vHRrKBrrflXT0M9tTMG2KmZ9Fj7xeG/g= +github.com/onsi/ginkgo/v2 v2.27.4 h1:fcEcQW/A++6aZAZQNUmNjvA9PSOzefMJBerHJ4t8v8Y= +github.com/onsi/ginkgo/v2 v2.27.4/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo= +github.com/onsi/gomega v1.39.0 h1:y2ROC3hKFmQZJNFeGAMeHZKkjBL65mIZcvrLQBF9k6Q= +github.com/onsi/gomega v1.39.0/go.mod h1:ZCU1pkQcXDO5Sl9/VVEGlDyp+zm0m1cmeG5TOzLgdh4= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/pressly/goose/v3 v3.30.0 h1:hmsrzlpLLKiIxukTV1YKCfSoM/F0QZGGmJLsbXcYD/I= -github.com/pressly/goose/v3 v3.30.0/go.mod h1:aw7C4/P6xjcOoa3Nsj9H2xGmLyIs+JgSLTUImg2KaWE= github.com/prometheus/client_golang v1.24.0 h1:5XStIklKuAtJSNpdD3s8XJj/Yv78IQmE1kbNk87JrAI= github.com/prometheus/client_golang v1.24.0/go.mod h1:QcsNdotprC2nS4BTM2ucbcqxd2CeXTEa9jW7zHO9iDE= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= @@ -138,15 +103,7 @@ github.com/prometheus/common v0.70.0 h1:bcpru3tWPVnxGnETLgOV5jbp/JRXgYEyv65CuBLA github.com/prometheus/common v0.70.0/go.mod h1:S/SFasQmgGiYH6C81LKCtYa8QACgthGg5zxL2udV7SY= github.com/prometheus/procfs v0.23.0 h1:ad+S6FTkzwaMgacKLM5h6bNKExS+DMH0YiUwXItH/o4= github.com/prometheus/procfs v0.23.0/go.mod h1:3AVXO0FqLafyYFU/V/IQRZlC8Rgqz8Dm/x6pKLK+RIk= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= -github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sethvargo/go-retry v0.5.0 h1:JYfFKmVJ8ER06GReN1efzc5cm52BrVsFVzmcHiKJwfY= -github.com/sethvargo/go-retry v0.5.0/go.mod h1:tvsjdKG6xfiCx4LSiUZ06kcv38xvdVQwv8R6/VnnVWg= -github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= -github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= -github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -156,53 +113,10 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4= github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= -github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE= -github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= -github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510 h1:S2dVYn90KE98chqDkyE9Z4N61UnQd+KOfgp5Iu53llk= -github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -go.etcd.io/bbolt v1.5.0 h1:S7GAl7Fxv12yohbwFfIbQCGDWbQbtDGPET4P/bD4lxU= -go.etcd.io/bbolt v1.5.0/go.mod h1:mkltfYE5aUHQxUct9N9V+Kp7aSjFqjgrhcXIS70Lrdk= -go.etcd.io/etcd/api/v3 v3.7.0 h1:WZlGK7pRtYGDB8ti8wkrQ5D2oWGMbtNL9VA5e+vF2Fg= -go.etcd.io/etcd/api/v3 v3.7.0/go.mod h1:EcTihnwAQ0BQNh5dfAdaFVFdchuo7EP0HlX7TV3jz/A= -go.etcd.io/etcd/client/pkg/v3 v3.7.1 h1:rKYsj3pRkR0eK3yjT3XOgrhqfmIfj9pzNgxjh7mfFv4= -go.etcd.io/etcd/client/pkg/v3 v3.7.1/go.mod h1:cnzZGIUzSfjEwLC6UBVsSXlEK1eepS/JUD7wE6PLRT0= -go.etcd.io/etcd/client/v3 v3.7.0 h1:5MHO37VbPB87VRPKUXEcicjeQWiTSjpPv3Ume8xPx20= -go.etcd.io/etcd/client/v3 v3.7.0/go.mod h1:DJ382WuwjmbowjPDyaaQ0idWXy4dh91XRhe4FOrb9vM= -go.etcd.io/etcd/pkg/v3 v3.7.0 h1:aUBHGzXnYL2m3AlZfKp0ZhHQLVZIKfu9QsIlYdr+mxc= -go.etcd.io/etcd/pkg/v3 v3.7.0/go.mod h1:fDQYyc8rOC1Yl4EZLh0O1OjHzwJW7jAly80+BpD1M9o= -go.etcd.io/etcd/server/v3 v3.7.0 h1:ScdUdN8ljuimp0lZaNq0otLMrHcFSFT+dQyT1j7JSFo= -go.etcd.io/etcd/server/v3 v3.7.0/go.mod h1:v7N1dPdSW2vzyxGsbDwK4X0sCe3SYNlQ+9eNIMGzdxQ= -go.etcd.io/raft/v3 v3.7.0 h1:BGzlwx07bLv8PW6OU5HObuz1y4hlPZUXA07pM1mPUh4= -go.etcd.io/raft/v3 v3.7.0/go.mod h1:6gX6T2X907DjnjsFLODnTxba77stjs84W9gTTI0GUNA= -go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= -go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.68.0 h1:0Qx7VGBacMm9ZENQ7TnNObTYI4ShC+lHI16seduaxZo= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.68.0/go.mod h1:Sje3i3MjSPKTSPvVWCaL8ugBzJwik3u4smCjUeuupqg= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0 h1:LxwW/9ctSCv+QkE/cLR7M91ZIkXNMqJtEMi1vCw9U8s= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.72.0/go.mod h1:tOsftB4SslBwwErVEPaenU2RpThXWPIU8DoJHEC4dyw= -go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= -go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.45.0 h1:QRefszxJmfPdjXUUm3j6iDzY03mTPXMjqErFqQ67vUg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.45.0/go.mod h1:Tiz03lTBVBrm7eWZBOidzEaYaJa8tjwGUGv6d8mlTyk= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.45.0 h1:fG5MCxGz8+2VtrN/WgqSpJFctVz24gpxj8CxkKmc8Ww= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.45.0/go.mod h1:BmAYTn+3ysbRe+IU2msxmf5Rx3g6DHvex+tWI3LdhYI= -go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= -go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= -go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= -go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU= -go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I= -go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0= -go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw= -go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw= -go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM= -go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0= -go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= -go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -214,10 +128,6 @@ go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= go.yaml.in/yaml/v3 v3.0.6 h1:zcDfvjXEqTQmpjniUBLc91xYJMB2c4QOFxEF/LCEckM= go.yaml.in/yaml/v3 v3.0.6/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= -golang.org/x/crypto v0.59.0 h1:xS2jhqYbzNrpvkWP2YTDf4TJwBy3ykR03i8vFDxEc7c= -golang.org/x/crypto v0.59.0/go.mod h1:veDyUwATGs3c+vN3VfTbzViMGXeTBk3WyhBOkn+F/4U= -golang.org/x/exp v0.0.0-20261109185158-a52e3aef5920 h1:qr+tk4P56rtbVVAJDyAr5LAOiaD/XhZCoRTr4SfLxAk= -golang.org/x/exp v0.0.0-20261109185158-a52e3aef5920/go.mod h1:J3U+E8RzytcGvwz+uJuAP4zULJ2TkAQBnmPZMexpdXs= golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg= golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs= golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY= @@ -240,14 +150,8 @@ golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnps golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated/go.mod h1:RVAQXBGNv1ib0J382/DPCRS/BPnsGebyM1Gj5VSDpG8= -gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= -gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= -google.golang.org/genproto/googleapis/api v0.0.0-20261110000943-09e21b237f2c h1:ofk4SEqvpf6M5VWh88xRp42IYgdVOh7gffebnDj3OqU= -google.golang.org/genproto/googleapis/api v0.0.0-20261110000943-09e21b237f2c/go.mod h1:OzYcNQzaMRKcOFRMtyLzG/cfW1SmS2eh+7UmOLLFblk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20261110000943-09e21b237f2c h1:XXChExL+Tm7Ubp0x0VXUEncPLHrkXIgoVWqnxmKNbAA= -google.golang.org/genproto/googleapis/rpc v0.0.0-20261110000943-09e21b237f2c/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= -google.golang.org/grpc v1.85.0 h1:BPBCfuVRQ1qvBhKDOq9uvQllMvO59rKsYhXpp7Dd8vw= -google.golang.org/grpc v1.85.0/go.mod h1:0rQrOD58yjal/0EaVbGBANindixsCZNQPDV3VKtaKuQ= +gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= +gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -255,45 +159,28 @@ gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnf gopkg.in/evanphx/json-patch.v4 v4.13.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= -gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= k8s.io/api v0.37.2 h1:PnxqnUFy93jr2GcpWDkKOm8wfy25kT9wa572MuQS8oc= k8s.io/api v0.37.2/go.mod h1:+NVRLft99kx+Jg9v34GmHw867Dapim89TSyCsn2hK+M= +k8s.io/apiextensions-apiserver v0.37.0 h1:zRMQ3+/LIE5oZ0tVvXwYHC+dIkSP5cjNWju7AZU1LOI= +k8s.io/apiextensions-apiserver v0.37.0/go.mod h1:HU0PfSBwchHL5iDau6jjt9zU6ryWkDDlaVUiq91NK80= k8s.io/apimachinery v0.37.2 h1:G4t9RGoPDbQML38hz/kQQiltttgd3egg2ODCR8aIc2o= k8s.io/apimachinery v0.37.2/go.mod h1:qaAvSNvgU2x07wRM95MSHSJTPQ/ob/LeNAGbeDgqQJg= -k8s.io/apiserver v0.37.2 h1:9Jq73PeHAA0RThpW7ou6lBcO2+SxLcPrAgleONSMUNQ= -k8s.io/apiserver v0.37.2/go.mod h1:d0P4WZtt6XMYAo6VN8dDPRnvY3O34quI3pOuxtfgAgM= k8s.io/client-go v0.37.2 h1:sgFtyRZukGkOrsu+QgS7LYnbFFJ5ut3MchdBNduD//E= k8s.io/client-go v0.37.2/go.mod h1:bo3LFC8YbCtKFPX21Yj8puMsoJLAv/+SvuOODma0s54= k8s.io/code-generator v0.37.2 h1:wfx7G5OkCTJktFu7HkEDTEa6iBYr3RMi2TTC3LBLfOE= k8s.io/code-generator v0.37.2/go.mod h1:k24CS91bM7Kk5b776drjJYvvfLT5vceiLeOzTxNsEUc= -k8s.io/component-base v0.37.2 h1:Ia9IKTg1yWrUntJU5lVetapkC9pXlLg9L6P3R1IkbcY= -k8s.io/component-base v0.37.2/go.mod h1:qq+ueHZyLfzRJzxyDoyxHWNhF1JPv4zm3hcaddXWDvY= k8s.io/gengo/v2 v2.0.0-20260408192533-25e2208e0dc3 h1:3L6PNkMLXkU/pz3jWzaaIUz0Rs2V9h+5O51AeRC7poc= k8s.io/gengo/v2 v2.0.0-20260408192533-25e2208e0dc3/go.mod h1:yvyl3l9E+UxlqOMUULdKTAYB0rEhsmjr7+2Vb/1pCSo= k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= -k8s.io/kms v0.37.2 h1:d9u/eizxE9pSa3jjnvoaLvvb9LwiypwkZ9xD4I4ZbTo= -k8s.io/kms v0.37.2/go.mod h1:0U6zfwLkfJr9O/jLgz2GARnKLh2uIhkq2EeaU66J5ow= k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad h1:oXImqH8mQNk7PmvzKhmN3ddJoY6OnyM225MXwGHPm0A= k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad/go.mod h1:0/mqHCVhlumdJ3BhCfnjSZQE037nAhNodh1/hK0T8/I= -k8s.io/streaming v0.37.2 h1:xmzp9nbqIbjvsRcqrBYa+K5XPQ6Jy/Dm3zZ8mN916AI= -k8s.io/streaming v0.37.2/go.mod h1:APlJR26ZWRcVy5bIEj0QRrKUXROtBHPcxl2NT7EAzPU= k8s.io/utils v0.0.0-20260626114624-be93311217bd h1:Ea7fgQ5we8Y9T0OX5o0dAHzQOBRI07D/dEYRaB9ZZEs= k8s.io/utils v0.0.0-20260626114624-be93311217bd/go.mod h1:xDxuJ0whA3d0I4mf/C4ppKHxXynQ+fxnkmQH0vTHnuk= -modernc.org/libc v1.80.2 h1:3+a4fJZvvzg920ZC0mOepnKPGn7cqCaVeDxm/UnrM1A= -modernc.org/libc v1.80.2/go.mod h1:pvo25Rs3OJEbDqhUV9jdEGevxeLJrJeDmNid/AcQV1g= -modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= -modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= -modernc.org/memory v1.12.1 h1:nFMiWrpStgZczNl6XI9GnIk/rWhYIyHGUaR04pGbp9g= -modernc.org/memory v1.12.1/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw= -modernc.org/sqlite v1.62.0 h1:gMaCjSM1qpl+iOjiWhR1LYP3zqrYDI+5GYLGt6veP2g= -modernc.org/sqlite v1.62.0/go.mod h1:Jzjh1mt4s0HuQ0KvtB1LIuHiGRmU2D5pgj8dUhW7/SE= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.36.0 h1:/YpDJ4vReG7ZmzSpBGxduXgywWkJU9zHubgJG03MT+Y= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.36.0/go.mod h1:tJo1aepTXyR+8Xs3sUsGBDk4Ub2AM5dPAPKJx0mpm5c= +sigs.k8s.io/controller-runtime v0.25.3 h1:b4OcZSY/aKHY8JG+rBlQmQ1xLs574+ZBEjv1dtfLd80= +sigs.k8s.io/controller-runtime v0.25.3/go.mod h1:4QqLdT6z/L6Olj8JJCtvztid4/fnIiYsfaTFScegctc= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh deleted file mode 100755 index 24a9720..0000000 --- a/hack/update-codegen.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -set -o errexit -set -o nounset -set -o pipefail - -SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -MODULE_NAME="go.miloapis.com/feedback" - -CODEGEN_PKG=$(go list -m -f '{{.Dir}}' k8s.io/code-generator 2>/dev/null) -if [ -z "${CODEGEN_PKG}" ]; then - echo "ERROR: k8s.io/code-generator not found in go.mod" >&2 - exit 1 -fi -source "${CODEGEN_PKG}/kube_codegen.sh" - -echo "Generating deepcopy..." -kube::codegen::gen_helpers \ - --boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \ - "${SCRIPT_ROOT}/pkg/apis" - -echo "Generating clientset..." -kube::codegen::gen_client \ - --boilerplate "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \ - --output-dir "${SCRIPT_ROOT}/pkg/generated" \ - --output-pkg "${MODULE_NAME}/pkg/generated" \ - "${SCRIPT_ROOT}/pkg/apis" - -echo "Generating OpenAPI definitions..." -go run k8s.io/kube-openapi/cmd/openapi-gen \ - --go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt" \ - --output-dir "${SCRIPT_ROOT}/pkg/generated/openapi" \ - --output-pkg "${MODULE_NAME}/pkg/generated/openapi" \ - --output-file zz_generated.openapi.go \ - --report-filename /dev/null \ - "${MODULE_NAME}/pkg/apis/feedback/v1alpha1" \ - "k8s.io/apimachinery/pkg/apis/meta/v1" \ - "k8s.io/apimachinery/pkg/api/resource" \ - "k8s.io/apimachinery/pkg/runtime" \ - "k8s.io/apimachinery/pkg/version" diff --git a/internal/apiserver/apiserver.go b/internal/apiserver/apiserver.go deleted file mode 100644 index 8ec2793..0000000 --- a/internal/apiserver/apiserver.go +++ /dev/null @@ -1,132 +0,0 @@ -// Package apiserver wires the feedback.miloapis.com aggregated API server. -package apiserver - -import ( - "context" - "fmt" - - "github.com/jackc/pgx/v5/pgxpool" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/apiserver/pkg/registry/rest" - genericapiserver "k8s.io/apiserver/pkg/server" - "k8s.io/klog/v2" - - "go.miloapis.com/feedback/internal/postgres" - "go.miloapis.com/feedback/internal/registry/feedbacksource" - "go.miloapis.com/feedback/pkg/apis/feedback/install" - feedbackv1alpha1 "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1" -) - -var ( - // Scheme is the runtime type registry for the server. - Scheme = runtime.NewScheme() - // Codecs serializes objects in Scheme. - Codecs = serializer.NewCodecFactory(Scheme) -) - -func init() { - install.Install(Scheme) - - metav1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - - // There is no separate internal version: register the v1alpha1 types as - // internal too so the generic registry can convert and watch them. - Scheme.AddKnownTypes(schema.GroupVersion{Group: feedbackv1alpha1.GroupName, Version: runtime.APIVersionInternal}, - &feedbackv1alpha1.FeedbackSource{}, - &feedbackv1alpha1.FeedbackSourceList{}, - ) - - unversioned := schema.GroupVersion{Group: "", Version: "v1"} - Scheme.AddUnversionedTypes(unversioned, - &metav1.Status{}, - &metav1.APIVersions{}, - &metav1.APIGroupList{}, - &metav1.APIGroup{}, - &metav1.APIResourceList{}, - ) -} - -// ExtraConfig holds feedback-specific configuration. -type ExtraConfig struct { - Postgres postgres.Config -} - -// Config combines the generic and feedback-specific configuration. -type Config struct { - GenericConfig *genericapiserver.RecommendedConfig - ExtraConfig ExtraConfig -} - -type completedConfig struct { - GenericConfig genericapiserver.CompletedConfig - ExtraConfig *ExtraConfig -} - -// CompletedConfig can only be built by Complete. -type CompletedConfig struct { - *completedConfig -} - -// Complete fills in defaults. -func (cfg *Config) Complete() CompletedConfig { - return CompletedConfig{&completedConfig{cfg.GenericConfig.Complete(), &cfg.ExtraConfig}} -} - -// FeedbackServer is the feedback aggregated API server. -type FeedbackServer struct { - GenericAPIServer *genericapiserver.GenericAPIServer - pool *pgxpool.Pool -} - -// New connects to Postgres and installs the feedback API group. -func (c completedConfig) New(ctx context.Context) (*FeedbackServer, error) { - pool, err := postgres.NewPool(ctx, c.ExtraConfig.Postgres) - if err != nil { - return nil, err - } - - genericServer, err := c.GenericConfig.New("feedback-apiserver", genericapiserver.NewEmptyDelegate()) - if err != nil { - pool.Close() - return nil, err - } - if err := genericServer.AddReadyzChecks(postgres.HealthCheck{Pool: pool}); err != nil { - pool.Close() - return nil, fmt.Errorf("add postgres readyz check: %w", err) - } - - s := &FeedbackServer{GenericAPIServer: genericServer, pool: pool} - - apiGroupInfo := genericapiserver.NewDefaultAPIGroupInfo(feedbackv1alpha1.GroupName, Scheme, metav1.ParameterCodec, Codecs) - v1alpha1Storage := map[string]rest.Storage{} - - // FeedbackSource is the one resource stored in etcd. - sourceStorage, err := feedbacksource.NewREST(Scheme, c.GenericConfig.RESTOptionsGetter) - if err != nil { - pool.Close() - return nil, fmt.Errorf("create FeedbackSource storage: %w", err) - } - v1alpha1Storage["feedbacksources"] = sourceStorage.Store - v1alpha1Storage["feedbacksources/status"] = sourceStorage.Status - - // Postgres-backed resources (Post, PostQuery, Vote, Submission, ...) are - // added here as they are implemented. See datum-cloud/enhancements#943. - - apiGroupInfo.VersionedResourcesStorageMap[feedbackv1alpha1.SchemeGroupVersion.Version] = v1alpha1Storage - if err := genericServer.InstallAPIGroup(&apiGroupInfo); err != nil { - pool.Close() - return nil, err - } - - klog.Info("Feedback server initialized") - return s, nil -} - -// Run serves until ctx is cancelled, then closes the Postgres pool. -func (s *FeedbackServer) Run(ctx context.Context) error { - defer s.pool.Close() - return s.GenericAPIServer.PrepareRun().RunWithContext(ctx) -} diff --git a/internal/postgres/postgres.go b/internal/postgres/postgres.go deleted file mode 100644 index aff5fb0..0000000 --- a/internal/postgres/postgres.go +++ /dev/null @@ -1,118 +0,0 @@ -// Package postgres manages the feedback apiserver's Postgres connection and -// schema migrations. The apiserver is the only component that connects to -// Postgres; every other component writes through the Feedback API. -package postgres - -import ( - "context" - "database/sql" - "errors" - "fmt" - "net/http" - "time" - - "github.com/jackc/pgx/v5/pgxpool" - "github.com/jackc/pgx/v5/stdlib" - "github.com/pressly/goose/v3" - "github.com/pressly/goose/v3/lock" - "k8s.io/klog/v2" - - "go.miloapis.com/feedback/migrations" -) - -// Config holds connection settings. -type Config struct { - // DSN is a libpq connection string or postgres:// URL. - DSN string - // MaxConns caps the pool size. Zero uses the pgx default. - MaxConns int32 - // ConnectTimeout bounds the initial connection attempt. - ConnectTimeout time.Duration -} - -// Validate checks that the config can be used to connect. -func (c Config) Validate() error { - if c.DSN == "" { - return errors.New("a Postgres DSN is required") - } - _, err := pgxpool.ParseConfig(c.DSN) - return err -} - -// NewPool opens a connection pool and verifies it with a ping. -func NewPool(ctx context.Context, cfg Config) (*pgxpool.Pool, error) { - pc, err := pgxpool.ParseConfig(cfg.DSN) - if err != nil { - return nil, fmt.Errorf("parse postgres DSN: %w", err) - } - if cfg.MaxConns > 0 { - pc.MaxConns = cfg.MaxConns - } - timeout := cfg.ConnectTimeout - if timeout == 0 { - timeout = 10 * time.Second - } - ctx, cancel := context.WithTimeout(ctx, timeout) - defer cancel() - - pool, err := pgxpool.NewWithConfig(ctx, pc) - if err != nil { - return nil, fmt.Errorf("connect to postgres: %w", err) - } - if err := pool.Ping(ctx); err != nil { - pool.Close() - return nil, fmt.Errorf("ping postgres: %w", err) - } - return pool, nil -} - -// HealthCheck is a readyz check that pings the pool. -type HealthCheck struct { - Pool *pgxpool.Pool -} - -// Name implements healthz.HealthChecker. -func (HealthCheck) Name() string { return "postgres" } - -// Check implements healthz.HealthChecker. -func (h HealthCheck) Check(r *http.Request) error { - ctx, cancel := context.WithTimeout(r.Context(), 2*time.Second) - defer cancel() - return h.Pool.Ping(ctx) -} - -// Migrate applies every pending migration. Migrations are forward-only. -func Migrate(ctx context.Context, cfg Config) error { - pc, err := pgxpool.ParseConfig(cfg.DSN) - if err != nil { - return fmt.Errorf("parse postgres DSN: %w", err) - } - db := stdlib.OpenDB(*pc.ConnConfig) - defer func() { _ = db.Close() }() - return migrate(ctx, db) -} - -func migrate(ctx context.Context, db *sql.DB) error { - // A session lock stops two replicas' init containers migrating at once. - locker, err := lock.NewPostgresSessionLocker() - if err != nil { - return fmt.Errorf("create migration lock: %w", err) - } - provider, err := goose.NewProvider(goose.DialectPostgres, db, migrations.FS, goose.WithSessionLocker(locker)) - if err != nil { - return fmt.Errorf("load migrations: %w", err) - } - results, err := provider.Up(ctx) - for _, r := range results { - klog.InfoS("Applied migration", "version", r.Source.Version, "path", r.Source.Path, "duration", r.Duration) - } - if err != nil { - return fmt.Errorf("apply migrations: %w", err) - } - v, err := provider.GetDBVersion(ctx) - if err != nil { - return fmt.Errorf("read schema version: %w", err) - } - klog.InfoS("Schema is up to date", "version", v) - return nil -} diff --git a/internal/registry/feedbacksource/storage.go b/internal/registry/feedbacksource/storage.go deleted file mode 100644 index db8a8e2..0000000 --- a/internal/registry/feedbacksource/storage.go +++ /dev/null @@ -1,99 +0,0 @@ -package feedbacksource - -import ( - "context" - - apimeta "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/duration" - "k8s.io/apiserver/pkg/registry/generic" - genericregistry "k8s.io/apiserver/pkg/registry/generic/registry" - "k8s.io/apiserver/pkg/registry/rest" - - feedbackv1alpha1 "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1" -) - -// REST is the storage for FeedbackSource and its status subresource. -type REST struct { - *genericregistry.Store - Status *StatusREST -} - -// StatusREST serves the status subresource. -type StatusREST struct { - *genericregistry.Store -} - -// NewREST returns etcd-backed storage for FeedbackSource. -func NewREST(scheme *runtime.Scheme, optsGetter generic.RESTOptionsGetter) (*REST, error) { - s := NewStrategy(scheme) - - store := &genericregistry.Store{ - NewFunc: func() runtime.Object { return &feedbackv1alpha1.FeedbackSource{} }, - NewListFunc: func() runtime.Object { return &feedbackv1alpha1.FeedbackSourceList{} }, - PredicateFunc: Match, - DefaultQualifiedResource: feedbackv1alpha1.Resource("feedbacksources"), - SingularQualifiedResource: feedbackv1alpha1.Resource("feedbacksource"), - - CreateStrategy: s, - UpdateStrategy: s, - DeleteStrategy: s, - - TableConvertor: tableConvertor{}, - } - if err := store.CompleteWithOptions(&generic.StoreOptions{RESTOptions: optsGetter, AttrFunc: GetAttrs}); err != nil { - return nil, err - } - - statusStore := *store - ss := statusStrategy{s} - statusStore.UpdateStrategy = ss - statusStore.ResetFieldsStrategy = ss - - return &REST{Store: store, Status: &StatusREST{Store: &statusStore}}, nil -} - -type tableConvertor struct{} - -var _ rest.TableConvertor = tableConvertor{} - -func (tableConvertor) ConvertToTable(_ context.Context, obj runtime.Object, _ runtime.Object) (*metav1.Table, error) { - table := &metav1.Table{ - ColumnDefinitions: []metav1.TableColumnDefinition{ - {Name: "Name", Type: "string", Format: "name"}, - {Name: "Org", Type: "string", Description: "GitHub organization"}, - {Name: "Ready", Type: "string"}, - {Name: "Last Reconcile", Type: "string"}, - {Name: "Age", Type: "string"}, - }, - } - switch t := obj.(type) { - case *feedbackv1alpha1.FeedbackSource: - table.Rows = append(table.Rows, row(t)) - case *feedbackv1alpha1.FeedbackSourceList: - for i := range t.Items { - table.Rows = append(table.Rows, row(&t.Items[i])) - } - } - return table, nil -} - -func row(src *feedbackv1alpha1.FeedbackSource) metav1.TableRow { - ready := "Unknown" - if c := apimeta.FindStatusCondition(src.Status.Conditions, "Ready"); c != nil { - ready = string(c.Status) - } - lastReconcile := "" - if lr := src.Status.LastReconcile; lr != nil && !lr.CompletedAt.IsZero() { - lastReconcile = duration.HumanDuration(metav1.Now().Sub(lr.CompletedAt.Time)) + " ago" - } - age := "" - if !src.CreationTimestamp.IsZero() { - age = duration.HumanDuration(metav1.Now().Sub(src.CreationTimestamp.Time)) - } - return metav1.TableRow{ - Object: runtime.RawExtension{Object: src}, - Cells: []any{src.Name, src.Spec.GitHub.Org, ready, lastReconcile, age}, - } -} diff --git a/internal/registry/feedbacksource/strategy.go b/internal/registry/feedbacksource/strategy.go deleted file mode 100644 index a3b0e7c..0000000 --- a/internal/registry/feedbacksource/strategy.go +++ /dev/null @@ -1,161 +0,0 @@ -// Package feedbacksource implements etcd-backed REST storage for FeedbackSource. -package feedbacksource - -import ( - "context" - "fmt" - "slices" - - "k8s.io/apimachinery/pkg/api/equality" - "k8s.io/apimachinery/pkg/fields" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - "k8s.io/apiserver/pkg/registry/generic" - "k8s.io/apiserver/pkg/storage" - "k8s.io/apiserver/pkg/storage/names" - "sigs.k8s.io/structured-merge-diff/v6/fieldpath" - - feedbackv1alpha1 "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1" -) - -type strategy struct { - runtime.ObjectTyper - names.NameGenerator -} - -// NewStrategy returns the create/update/delete strategy for FeedbackSource. -func NewStrategy(typer runtime.ObjectTyper) strategy { - return strategy{ObjectTyper: typer, NameGenerator: names.SimpleNameGenerator} -} - -func (strategy) NamespaceScoped() bool { return false } - -func (strategy) PrepareForCreate(_ context.Context, obj runtime.Object) { - src := obj.(*feedbackv1alpha1.FeedbackSource) - src.Status = feedbackv1alpha1.FeedbackSourceStatus{} - src.Generation = 1 -} - -func (strategy) PrepareForUpdate(_ context.Context, obj, old runtime.Object) { - newSrc := obj.(*feedbackv1alpha1.FeedbackSource) - oldSrc := old.(*feedbackv1alpha1.FeedbackSource) - newSrc.Status = oldSrc.Status - newSrc.Generation = oldSrc.Generation - if !equality.Semantic.DeepEqual(newSrc.Spec, oldSrc.Spec) { - newSrc.Generation++ - } -} - -func (strategy) Validate(_ context.Context, obj runtime.Object) field.ErrorList { - return Validate(obj.(*feedbackv1alpha1.FeedbackSource)) -} - -func (strategy) ValidateUpdate(_ context.Context, obj, old runtime.Object) field.ErrorList { - newSrc := obj.(*feedbackv1alpha1.FeedbackSource) - oldSrc := old.(*feedbackv1alpha1.FeedbackSource) - errs := Validate(newSrc) - if newSrc.Spec.GitHub.Org != oldSrc.Spec.GitHub.Org { - errs = append(errs, field.Invalid(field.NewPath("spec", "github", "org"), - newSrc.Spec.GitHub.Org, "org is immutable; create a new FeedbackSource instead")) - } - return errs -} - -func (strategy) WarningsOnCreate(context.Context, runtime.Object) []string { return nil } -func (strategy) WarningsOnUpdate(context.Context, runtime.Object, runtime.Object) []string { - return nil -} -func (strategy) AllowCreateOnUpdate(context.Context) bool { return false } -func (strategy) AllowUnconditionalUpdate(context.Context) bool { return true } -func (strategy) Canonicalize(runtime.Object) {} - -// Validate checks a FeedbackSource spec. -func Validate(src *feedbackv1alpha1.FeedbackSource) field.ErrorList { - var errs field.ErrorList - gh := field.NewPath("spec", "github") - spec := src.Spec - - if spec.GitHub.Org == "" { - errs = append(errs, field.Required(gh.Child("org"), "the GitHub organization login")) - } - if spec.GitHub.InstallationID <= 0 { - errs = append(errs, field.Invalid(gh.Child("installationID"), spec.GitHub.InstallationID, - "must be the GitHub App installation ID for the org")) - } - if p := spec.GitHub.Project; p != nil { - pp := gh.Child("project") - if p.Owner == "" { - errs = append(errs, field.Required(pp.Child("owner"), "")) - } - if p.Number <= 0 { - errs = append(errs, field.Invalid(pp.Child("number"), p.Number, "must be a positive project number")) - } - } - if m := spec.GitHub.Milestones; m != nil && m.Repository == "" { - errs = append(errs, field.Required(gh.Child("milestones", "repository"), "")) - } - if c := spec.GitHub.Changelog; c != nil { - cp := gh.Child("changelog") - if c.Repository == "" { - errs = append(errs, field.Required(cp.Child("repository"), "")) - } - if c.DiscussionCategory == "" { - errs = append(errs, field.Required(cp.Child("discussionCategory"), "")) - } - } - for k, v := range spec.StatusMapping { - if !slices.Contains(feedbackv1alpha1.ValidPostStatuses, v) { - errs = append(errs, field.NotSupported(field.NewPath("spec", "statusMapping").Key(k), v, - feedbackv1alpha1.ValidPostStatuses)) - } - } - for k, v := range spec.CategoryMapping { - if v == "" { - errs = append(errs, field.Required(field.NewPath("spec", "categoryMapping").Key(k), "category name")) - } - } - return errs -} - -// statusStrategy only allows status to change. -type statusStrategy struct { - strategy -} - -func (statusStrategy) PrepareForUpdate(_ context.Context, obj, old runtime.Object) { - newSrc := obj.(*feedbackv1alpha1.FeedbackSource) - oldSrc := old.(*feedbackv1alpha1.FeedbackSource) - newSrc.Spec = oldSrc.Spec - newSrc.Generation = oldSrc.Generation - newSrc.Labels = oldSrc.Labels - newSrc.Annotations = oldSrc.Annotations -} - -func (statusStrategy) ValidateUpdate(context.Context, runtime.Object, runtime.Object) field.ErrorList { - return nil -} - -func (statusStrategy) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set { - return map[fieldpath.APIVersion]*fieldpath.Set{ - fieldpath.APIVersion(feedbackv1alpha1.SchemeGroupVersion.String()): fieldpath.NewSet( - fieldpath.MakePathOrDie("spec"), - ), - } -} - -// GetAttrs returns the labels and fields used for selectors. -func GetAttrs(obj runtime.Object) (labels.Set, fields.Set, error) { - src, ok := obj.(*feedbackv1alpha1.FeedbackSource) - if !ok { - return nil, nil, fmt.Errorf("not a FeedbackSource: %T", obj) - } - fs := generic.ObjectMetaFieldsSet(&src.ObjectMeta, false) - fs["spec.github.org"] = src.Spec.GitHub.Org - return src.Labels, fs, nil -} - -// Match returns a selection predicate for FeedbackSource. -func Match(label labels.Selector, f fields.Selector) storage.SelectionPredicate { - return storage.SelectionPredicate{Label: label, Field: f, GetAttrs: GetAttrs} -} diff --git a/internal/registry/feedbacksource/strategy_test.go b/internal/registry/feedbacksource/strategy_test.go deleted file mode 100644 index b28c1c2..0000000 --- a/internal/registry/feedbacksource/strategy_test.go +++ /dev/null @@ -1,102 +0,0 @@ -package feedbacksource - -import ( - "context" - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - - feedbackv1alpha1 "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1" -) - -func validSource() *feedbackv1alpha1.FeedbackSource { - return &feedbackv1alpha1.FeedbackSource{ - ObjectMeta: metav1.ObjectMeta{Name: "datum-cloud"}, - Spec: feedbackv1alpha1.FeedbackSourceSpec{ - GitHub: feedbackv1alpha1.GitHubSource{ - Org: "datum-cloud", - InstallationID: 12345678, - Project: &feedbackv1alpha1.ProjectRef{Owner: "datum-cloud", Number: 22, StatusField: "Status", VotesField: "Votes"}, - Milestones: &feedbackv1alpha1.MilestoneSource{Repository: "enhancements"}, - Changelog: &feedbackv1alpha1.ChangelogSource{Repository: "datum", DiscussionCategory: "changelog"}, - }, - StatusMapping: map[string]feedbackv1alpha1.PostStatus{"": "none", "In Progress": "in-progress", "Done": "shipped"}, - CategoryMapping: map[string]string{"Build": "build"}, - }, - } -} - -func TestValidate(t *testing.T) { - tests := []struct { - name string - mutate func(*feedbackv1alpha1.FeedbackSource) - wantErr int - }{ - {name: "valid", mutate: func(*feedbackv1alpha1.FeedbackSource) {}}, - {name: "missing org", mutate: func(s *feedbackv1alpha1.FeedbackSource) { s.Spec.GitHub.Org = "" }, wantErr: 1}, - {name: "missing installation", mutate: func(s *feedbackv1alpha1.FeedbackSource) { s.Spec.GitHub.InstallationID = 0 }, wantErr: 1}, - {name: "bad project", mutate: func(s *feedbackv1alpha1.FeedbackSource) { - s.Spec.GitHub.Project.Owner = "" - s.Spec.GitHub.Project.Number = 0 - }, wantErr: 2}, - {name: "bad changelog", mutate: func(s *feedbackv1alpha1.FeedbackSource) { s.Spec.GitHub.Changelog.DiscussionCategory = "" }, wantErr: 1}, - {name: "unknown status", mutate: func(s *feedbackv1alpha1.FeedbackSource) { s.Spec.StatusMapping["Backlog"] = "someday" }, wantErr: 1}, - {name: "empty category", mutate: func(s *feedbackv1alpha1.FeedbackSource) { s.Spec.CategoryMapping["Deliver"] = "" }, wantErr: 1}, - {name: "no optional blocks", mutate: func(s *feedbackv1alpha1.FeedbackSource) { - s.Spec.GitHub.Project, s.Spec.GitHub.Milestones, s.Spec.GitHub.Changelog = nil, nil, nil - }}, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - src := validSource() - tc.mutate(src) - if errs := Validate(src); len(errs) != tc.wantErr { - t.Fatalf("got %d errors, want %d: %v", len(errs), tc.wantErr, errs) - } - }) - } -} - -func TestOrgImmutable(t *testing.T) { - s := NewStrategy(runtime.NewScheme()) - old := validSource() - updated := validSource() - updated.Spec.GitHub.Org = "milo-os" - if errs := s.ValidateUpdate(context.Background(), updated, old); len(errs) != 1 { - t.Fatalf("expected org change to be rejected, got %v", errs) - } -} - -func TestPrepareForUpdate(t *testing.T) { - s := NewStrategy(runtime.NewScheme()) - old := validSource() - old.Generation = 3 - old.Status.Conditions = []metav1.Condition{{Type: "Ready", Status: metav1.ConditionTrue}} - - // Spec unchanged and status edited: generation and status stay. - same := validSource() - same.Generation = 3 - s.PrepareForUpdate(context.Background(), same, old) - if same.Generation != 3 || len(same.Status.Conditions) != 1 { - t.Fatalf("unexpected result: generation=%d status=%v", same.Generation, same.Status) - } - - // Spec changed: generation bumps. - changed := validSource() - changed.Generation = 3 - changed.Spec.GitHub.InstallationID = 99 - s.PrepareForUpdate(context.Background(), changed, old) - if changed.Generation != 4 { - t.Fatalf("generation = %d, want 4", changed.Generation) - } - - // Status subresource ignores spec edits. - ss := statusStrategy{s} - statusEdit := validSource() - statusEdit.Spec.GitHub.InstallationID = 99 - ss.PrepareForUpdate(context.Background(), statusEdit, old) - if statusEdit.Spec.GitHub.InstallationID != old.Spec.GitHub.InstallationID { - t.Fatal("status update changed spec") - } -} diff --git a/migrations/00001_extensions.sql b/migrations/00001_extensions.sql deleted file mode 100644 index 20b1e01..0000000 --- a/migrations/00001_extensions.sql +++ /dev/null @@ -1,7 +0,0 @@ --- +goose Up --- pgvector backs similar-feedback matching (PostQuery.spec.similarTo). -CREATE EXTENSION IF NOT EXISTS vector; - --- +goose Down --- Migrations are forward-only; see README.md. -SELECT 1; diff --git a/migrations/migrations.go b/migrations/migrations.go deleted file mode 100644 index ef02f7c..0000000 --- a/migrations/migrations.go +++ /dev/null @@ -1,11 +0,0 @@ -// Package migrations embeds the forward-only Postgres schema migrations for -// the feedback apiserver. They are applied by `feedback migrate`, run as a Job -// before the apiserver rolls out. -package migrations - -import "embed" - -// FS holds the SQL migration files. -// -//go:embed *.sql -var FS embed.FS diff --git a/pkg/apis/feedback/v1alpha1/common_types.go b/pkg/apis/feedback/v1alpha1/common_types.go new file mode 100644 index 0000000..d5cba8f --- /dev/null +++ b/pkg/apis/feedback/v1alpha1/common_types.go @@ -0,0 +1,76 @@ +package v1alpha1 + +// Annotations on feedback CRDs that Milo reads. +const ( + // ParentContextsAnnotation lists the contexts a resource is discoverable + // in. + ParentContextsAnnotation = "discovery.miloapis.com/parent-contexts" + // OwnerFieldAnnotation names the field holding the owner's user ID. Milo + // limits user-context requests to the caller's objects. + OwnerFieldAnnotation = "iam.miloapis.com/owner-field" + // HiddenFieldAnnotation names a boolean that hides an object from + // callers without get on the hidden subresource. + HiddenFieldAnnotation = "iam.miloapis.com/hidden-field" +) + +// Client is the surface a request came from. +// +kubebuilder:validation:Enum=website;portal;datumctl;patch;email;github +type Client string + +const ( + ClientWebsite Client = "website" + ClientPortal Client = "portal" + ClientDatumctl Client = "datumctl" + ClientPatch Client = "patch" + // ClientEmail and ClientGitHub are only used for security reports the + // Security Team logs on behalf of an external reporter. + ClientEmail Client = "email" + ClientGitHub Client = "github" +) + +// PostReference names a Post. +type PostReference struct { + // Name of the Post, e.g. datum-cloud.enhancements.912. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=200 + Name string `json:"name"` +} + +// UserReference names a Milo User by its metadata.name. +type UserReference struct { + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + Name string `json:"name"` +} + +// AttachmentReference points at a file uploaded to feedback-uploads. +type AttachmentReference struct { + // Name is the file name shown to reviewers. Set by the admission webhook + // from the upload. + // +optional + // +kubebuilder:validation:MaxLength=255 + Name string `json:"name,omitempty"` + // ContentType is the file's media type. Set by the admission webhook from + // the upload. + // +optional + // +kubebuilder:validation:MaxLength=255 + ContentType string `json:"contentType,omitempty"` + // UploadRef is the reference feedback-uploads returned. + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=128 + UploadRef string `json:"uploadRef"` +} + +// GitHubLink identifies a GitHub issue, milestone or discussion. +type GitHubLink struct { + // URL is the HTML URL on github.com. + URL string `json:"url"` + // Number is the issue, milestone or discussion number. + Number int32 `json:"number"` +} + +// OwnedName is the name of a user-owned object about a post: the post name +// and the user's name, so a user has at most one per post. +func OwnedName(post, user string) string { + return post + "." + user +} diff --git a/pkg/apis/feedback/v1alpha1/crd_test.go b/pkg/apis/feedback/v1alpha1/crd_test.go new file mode 100644 index 0000000..52ef683 --- /dev/null +++ b/pkg/apis/feedback/v1alpha1/crd_test.go @@ -0,0 +1,168 @@ +package v1alpha1_test + +import ( + "context" + "os" + "path/filepath" + "strings" + "testing" + + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/runtime/serializer" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/envtest" + + v1 "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1" +) + +// newAPIServer starts an API server with the generated CRDs installed. It +// needs KUBEBUILDER_ASSETS (task test sets it) and skips without it. +func newAPIServer(t *testing.T) client.Client { + t.Helper() + if os.Getenv("KUBEBUILDER_ASSETS") == "" { + t.Skip("KUBEBUILDER_ASSETS not set; run with task test") + } + env := &envtest.Environment{ + CRDDirectoryPaths: []string{filepath.Join("..", "..", "..", "..", "config", "crd", "bases")}, + ErrorIfCRDPathMissing: true, + } + cfg, err := env.Start() + if err != nil { + t.Fatalf("start API server: %v", err) + } + t.Cleanup(func() { _ = env.Stop() }) + c, err := client.New(cfg, client.Options{Scheme: newScheme(t)}) + if err != nil { + t.Fatal(err) + } + return c +} + +func TestCRDs(t *testing.T) { + c := newAPIServer(t) + ctx := context.Background() + + t.Run("every sample is accepted", func(t *testing.T) { + scheme := newScheme(t) + decoder := serializer.NewCodecFactory(scheme).UniversalDeserializer() + files, _ := filepath.Glob("../../../../config/samples/*.yaml") + for _, f := range files { + data, err := os.ReadFile(f) + if err != nil { + t.Fatal(err) + } + obj, _, err := decoder.Decode(data, nil, nil) + if err != nil { + t.Fatalf("%s: %v", f, err) + } + if err := c.Create(ctx, obj.(client.Object)); err != nil { + t.Errorf("%s: %v", filepath.Base(f), err) + } + } + }) + + t.Run("vote names are post.user", func(t *testing.T) { + v := vote("p1", "u1") + v.Name = "p1" + expectInvalid(t, c.Create(ctx, v), "metadata.name must be") + if err := c.Create(ctx, vote("p1", "u1")); err != nil { + t.Fatal(err) + } + }) + + t.Run("vote spec is immutable", func(t *testing.T) { + v := vote("p2", "u1") + if err := c.Create(ctx, v); err != nil { + t.Fatal(err) + } + v.Spec.Source = v1.ClientPortal + expectInvalid(t, c.Update(ctx, v), "spec is immutable") + }) + + t.Run("field selectors on owner and post", func(t *testing.T) { + if err := c.Create(ctx, vote("p1", "u2")); err != nil { + t.Fatal(err) + } + var list v1.VoteList + if err := c.List(ctx, &list, client.MatchingFieldsSelector{Selector: fields.OneTermEqualSelector("spec.userRef.name", "u2")}); err != nil { + t.Fatal(err) + } + if len(list.Items) != 1 || list.Items[0].Spec.UserRef.Name != "u2" { + t.Errorf("by user: %d votes", len(list.Items)) + } + if err := c.List(ctx, &list, client.MatchingFieldsSelector{Selector: fields.OneTermEqualSelector("spec.postRef.name", "p1")}); err != nil { + t.Fatal(err) + } + if len(list.Items) != 2 { + t.Errorf("by post: %d votes, want 2", len(list.Items)) + } + }) + + t.Run("hidden posts can be filtered out", func(t *testing.T) { + for name, hidden := range map[string]bool{"a.b.1": false, "a.b.2": true} { + if err := c.Create(ctx, &v1.Post{ObjectMeta: metav1.ObjectMeta{Name: name}, Spec: v1.PostSpec{Hidden: hidden}}); err != nil { + t.Fatal(err) + } + } + var list v1.PostList + if err := c.List(ctx, &list, client.MatchingFieldsSelector{Selector: fields.OneTermNotEqualSelector("spec.hidden", "true")}); err != nil { + t.Fatal(err) + } + for _, p := range list.Items { + if p.Spec.Hidden { + t.Errorf("hidden post %s listed", p.Name) + } + } + }) + + t.Run("review decisions", func(t *testing.T) { + r := &v1.SubmissionReview{ObjectMeta: metav1.ObjectMeta{Name: "sub-1"}} + if err := c.Create(ctx, r); err != nil { + t.Fatal(err) + } + r.Spec.Decision = v1.ReviewDecisionApproved + expectInvalid(t, c.Update(ctx, r), "Approved needs publicTitle and publicBody") + r.Spec.Decision = v1.ReviewDecisionRejected + expectInvalid(t, c.Update(ctx, r), "Rejected needs a reason") + r.Spec.Reason = "Out of scope" + if err := c.Update(ctx, r); err != nil { + t.Fatal(err) + } + r.Spec.Decision = v1.ReviewDecisionMerged + r.Spec.MergedInto = "a.b.1" + expectInvalid(t, c.Update(ctx, r), "can't change once it is set") + }) + + t.Run("submissions can't change", func(t *testing.T) { + s := &v1.Submission{ + ObjectMeta: metav1.ObjectMeta{Name: "sub-2"}, + Spec: v1.SubmissionSpec{UserRef: v1.UserReference{Name: "u1"}, Kind: v1.SubmissionKindIdea, Title: "t", Body: "b"}, + } + if err := c.Create(ctx, s); err != nil { + t.Fatal(err) + } + s.Spec.Title = "changed" + expectInvalid(t, c.Update(ctx, s), "can't be changed after they are sent") + }) + + t.Run("profiles are named after their user", func(t *testing.T) { + p := &v1.FeedbackProfile{ObjectMeta: metav1.ObjectMeta{Name: "u9"}, Spec: v1.FeedbackProfileSpec{UserRef: v1.UserReference{Name: "u8"}}} + expectInvalid(t, c.Create(ctx, p), "must be the user's name") + }) +} + +func vote(post, user string) *v1.Vote { + return &v1.Vote{ + ObjectMeta: metav1.ObjectMeta{Name: v1.OwnedName(post, user)}, + Spec: v1.VoteSpec{PostRef: v1.PostReference{Name: post}, UserRef: v1.UserReference{Name: user}, Source: v1.ClientWebsite}, + } +} + +func expectInvalid(t *testing.T, err error, msg string) { + t.Helper() + if !apierrors.IsInvalid(err) || !strings.Contains(err.Error(), msg) { + t.Errorf("err = %v, want Invalid containing %q", err, msg) + } +} diff --git a/pkg/apis/feedback/v1alpha1/digest_types.go b/pkg/apis/feedback/v1alpha1/digest_types.go new file mode 100644 index 0000000..f267a9c --- /dev/null +++ b/pkg/apis/feedback/v1alpha1/digest_types.go @@ -0,0 +1,83 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// DigestEvent is something a follower or submitter is told about. +// +kubebuilder:validation:Enum=picked-up;part-shipped;released;closed;approved;merged;rejected +type DigestEvent string + +const ( + DigestEventPickedUp DigestEvent = "picked-up" + DigestEventPartShipped DigestEvent = "part-shipped" + DigestEventReleased DigestEvent = "released" + DigestEventClosed DigestEvent = "closed" + DigestEventApproved DigestEvent = "approved" + DigestEventMerged DigestEvent = "merged" + DigestEventRejected DigestEvent = "rejected" +) + +// FeedbackDigest is one user's queue of events for their next daily digest, +// named after the user. Only the operator writes it; staff can read it. The +// operator clears it once the digest Email is created. +// +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Cluster +// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Platform" +// +kubebuilder:printcolumn:name="Items",type=integer,JSONPath=`.spec.itemCount` +// +kubebuilder:printcolumn:name="Last sent",type=date,JSONPath=`.status.lastSentAt` +type FeedbackDigest struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec FeedbackDigestSpec `json:"spec"` + Status FeedbackDigestStatus `json:"status,omitempty"` +} + +// FeedbackDigestSpec is the pending queue. +type FeedbackDigestSpec struct { + UserRef UserReference `json:"userRef"` + // Items holds at most one line per post or submission; a later event + // replaces an earlier one. + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=500 + Items []DigestItem `json:"items,omitempty"` + // ItemCount is len(items), for the printer column. + // +optional + ItemCount int32 `json:"itemCount,omitempty"` +} + +// DigestItem is one line of a digest. +type DigestItem struct { + Event DigestEvent `json:"event"` + // Post is the post the event is about. + // +optional + Post string `json:"post,omitempty"` + // Submission is the submission the event is about, for review outcomes. + // +optional + Submission string `json:"submission,omitempty"` + // Changelog is the ChangelogEntry for part-shipped and released. + // +optional + Changelog string `json:"changelog,omitempty"` + At metav1.Time `json:"at"` +} + +// FeedbackDigestStatus records sends. +type FeedbackDigestStatus struct { + // +optional + LastSentAt *metav1.Time `json:"lastSentAt,omitempty"` + // LastEmail is the name of the last Email created. + // +optional + LastEmail string `json:"lastEmail,omitempty"` +} + +// FeedbackDigestList is a list of FeedbackDigest. +// +kubebuilder:object:root=true +type FeedbackDigestList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []FeedbackDigest `json:"items"` +} diff --git a/pkg/apis/feedback/v1alpha1/doc.go b/pkg/apis/feedback/v1alpha1/doc.go index 2994060..a98ba94 100644 --- a/pkg/apis/feedback/v1alpha1/doc.go +++ b/pkg/apis/feedback/v1alpha1/doc.go @@ -1,7 +1,6 @@ -// +k8s:deepcopy-gen=package -// +k8s:openapi-gen=true -// +groupName=feedback.miloapis.com - // Package v1alpha1 contains the v1alpha1 types for the feedback.miloapis.com -// API group. +// API group. Every type is a CRD installed in Milo. +// +// +kubebuilder:object:generate=true +// +groupName=feedback.miloapis.com package v1alpha1 diff --git a/pkg/apis/feedback/v1alpha1/feedbacksource_types.go b/pkg/apis/feedback/v1alpha1/feedbacksource_types.go index 92c416c..543a083 100644 --- a/pkg/apis/feedback/v1alpha1/feedbacksource_types.go +++ b/pkg/apis/feedback/v1alpha1/feedbacksource_types.go @@ -4,34 +4,13 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// PostStatus is the public status of a post, derived from the Enhancements -// project's Status field and the issue state. -type PostStatus string - -const ( - PostStatusNone PostStatus = "none" - PostStatusBacklog PostStatus = "backlog" - PostStatusPlanning PostStatus = "planning" - PostStatusOnDeck PostStatus = "on-deck" - PostStatusInProgress PostStatus = "in-progress" - PostStatusShipped PostStatus = "shipped" - PostStatusClosed PostStatus = "closed" -) - -// ValidPostStatuses lists every PostStatus value. -var ValidPostStatuses = []PostStatus{ - PostStatusNone, - PostStatusBacklog, - PostStatusPlanning, - PostStatusOnDeck, - PostStatusInProgress, - PostStatusShipped, - PostStatusClosed, -} - -// +genclient -// +genclient:nonNamespaced -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Cluster +// +kubebuilder:subresource:status +// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Platform" +// +kubebuilder:printcolumn:name="Org",type=string,JSONPath=`.spec.github.org` +// +kubebuilder:printcolumn:name="Last reconcile",type=date,JSONPath=`.status.lastReconcile.completedAt` +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` // FeedbackSource configures what the feedback service syncs from one GitHub // organization and how GitHub fields map onto posts. There is one per org. @@ -53,7 +32,7 @@ type FeedbackSourceSpec struct { // StatusMapping maps Enhancements project Status option names to post // statuses. The empty key matches items with no Status set. // +optional - StatusMapping map[string]PostStatus `json:"statusMapping,omitempty"` + StatusMapping map[string]PostState `json:"statusMapping,omitempty"` // CategoryMapping maps GitHub label names to post categories. // +optional @@ -174,7 +153,7 @@ type RateLimitStatus struct { ResetAt metav1.Time `json:"resetAt"` } -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true // FeedbackSourceList is a list of FeedbackSource. type FeedbackSourceList struct { diff --git a/pkg/apis/feedback/v1alpha1/post_types.go b/pkg/apis/feedback/v1alpha1/post_types.go new file mode 100644 index 0000000..738d236 --- /dev/null +++ b/pkg/apis/feedback/v1alpha1/post_types.go @@ -0,0 +1,313 @@ +package v1alpha1 + +import ( + "fmt" + "strings" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// PostState is the public status of a post, derived from the Enhancements +// project's Status field and the issue state. +// +kubebuilder:validation:Enum=none;backlog;planning;on-deck;in-progress;shipped;closed +type PostState string + +const ( + PostStateNone PostState = "none" + PostStateBacklog PostState = "backlog" + PostStatePlanning PostState = "planning" + PostStateOnDeck PostState = "on-deck" + PostStateInProgress PostState = "in-progress" + PostStateShipped PostState = "shipped" + PostStateClosed PostState = "closed" +) + +// ValidPostStates lists every PostState value. +var ValidPostStates = []PostState{ + PostStateNone, + PostStateBacklog, + PostStatePlanning, + PostStateOnDeck, + PostStateInProgress, + PostStateShipped, + PostStateClosed, +} + +// DeliveryStage is where a post is in delivery. Stages are ordered +// requested < planned < picked-up < released; closed is terminal. +// +kubebuilder:validation:Enum=requested;planned;picked-up;released;closed +type DeliveryStage string + +const ( + DeliveryStageRequested DeliveryStage = "requested" + DeliveryStagePlanned DeliveryStage = "planned" + DeliveryStagePickedUp DeliveryStage = "picked-up" + DeliveryStageReleased DeliveryStage = "released" + DeliveryStageClosed DeliveryStage = "closed" +) + +// ValidDeliveryStages lists every DeliveryStage value. +var ValidDeliveryStages = []DeliveryStage{ + DeliveryStageRequested, + DeliveryStagePlanned, + DeliveryStagePickedUp, + DeliveryStageReleased, + DeliveryStageClosed, +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Cluster +// +kubebuilder:subresource:status +// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Platform;User" +// +kubebuilder:metadata:annotations="iam.miloapis.com/hidden-field=spec.hidden" +// +kubebuilder:selectablefield:JSONPath=`.spec.hidden` +// +kubebuilder:printcolumn:name="Title",type=string,JSONPath=`.status.title` +// +kubebuilder:printcolumn:name="State",type=string,JSONPath=`.status.state` +// +kubebuilder:printcolumn:name="Votes",type=integer,JSONPath=`.status.votes.total` +// +kubebuilder:printcolumn:name="Stage",type=string,JSONPath=`.status.delivery.stage` +// +kubebuilder:printcolumn:name="Hidden",type=boolean,JSONPath=`.spec.hidden`,priority=1 +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` + +// Post is a public roadmap item synced from a GitHub issue. Every Post is +// backed by a GitHub issue; unreviewed feedback is a Submission, never a Post. +// +// The name is "..", e.g. datum-cloud.enhancements.912. +// +// Only the feedback-sync service account creates, updates and deletes posts. +// feedback-sync and feedback-operator write status with server-side apply: +// sync owns the GitHub fields, the operator owns votes and delivery. Staff +// can only patch spec.hidden, and Milo hides hidden posts from everyone +// without get on posts/hidden. +type Post struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec PostSpec `json:"spec,omitempty"` + Status PostStatus `json:"status,omitempty"` +} + +// PostSpec holds the fields staff control. +type PostSpec struct { + // Hidden removes the post from every client and from search. + // +optional + Hidden bool `json:"hidden,omitempty"` +} + +// PostStatus holds the fields synced from GitHub and derived by the service. +type PostStatus struct { + // Title is the issue title. + // +optional + Title string `json:"title,omitempty"` + // Summary is a plain-text excerpt of the body. + // +optional + Summary string `json:"summary,omitempty"` + // BodyHTML is the issue body, sanitised against an allow-list. + // +optional + BodyHTML string `json:"bodyHTML,omitempty"` + // State is the public status, mapped from the Enhancements project. + // +optional + State PostState `json:"state,omitempty"` + // Categories are mapped from labels by the FeedbackSource. + // +optional + // +listType=set + Categories []string `json:"categories,omitempty"` + // Labels are the issue's GitHub labels. + // +optional + // +listType=set + Labels []string `json:"labels,omitempty"` + // IssueType is the GitHub issue type, e.g. Enhancement. + // +optional + IssueType string `json:"issueType,omitempty"` + // GitHub identifies the backing issue. + // +optional + GitHub *GitHubIssue `json:"github,omitempty"` + // Release is the name of the Release whose milestone the issue is on. + // +optional + Release string `json:"release,omitempty"` + // Votes are the vote totals. + // +optional + Votes PostVotes `json:"votes,omitempty"` + // MergedInto is the post this one was closed as a duplicate of. When + // feedback-sync sets it, the operator moves votes and subscriptions to + // that post. + // +optional + MergedInto string `json:"mergedInto,omitempty"` + // PublicVoters are up to 10 voters who opted in to showing their votes. + // +optional + // +listType=atomic + PublicVoters []PublicVoter `json:"publicVoters,omitempty"` + // Delivery tracks the post from request to release. + // +optional + Delivery *DeliveryStatus `json:"delivery,omitempty"` + // LastSyncedAt is when feedback-sync last wrote this post. + // +optional + LastSyncedAt *metav1.Time `json:"lastSyncedAt,omitempty"` +} + +// GitHubIssue identifies the issue backing a post. +type GitHubIssue struct { + Org string `json:"org"` + Repository string `json:"repository"` + Number int32 `json:"number"` + URL string `json:"url"` + // State is "open" or "closed". + State string `json:"state"` + // StateReason is GitHub's close reason: "completed" or "not_planned". + // +optional + StateReason string `json:"stateReason,omitempty"` + // +optional + CreatedAt metav1.Time `json:"createdAt,omitempty"` + // +optional + UpdatedAt metav1.Time `json:"updatedAt,omitempty"` +} + +// PostVotes are vote totals for a post. +type PostVotes struct { + // Total is Datum votes plus GitHub 👍, minus people matched as doing both. + // +optional + Total int32 `json:"total,omitempty"` + // Datum is the number of Vote resources. + // +optional + Datum int32 `json:"datum,omitempty"` + // GitHub is the 👍 reaction count on the issue. + // +optional + GitHub int32 `json:"github,omitempty"` + // Linked is how many people both voted and reacted 👍, matched by the + // GitHub username linked to their Datum account. They count once in + // Total. + // +optional + Linked int32 `json:"linked,omitempty"` + // TrendingScore weights votes with a 7-day half-life: + // Σ 0.5^(age_days / 7) over Datum votes and GitHub 👍 reactions whose + // time is known, counting linked people once. Stored multiplied by 1000 + // and rounded, so it sorts as an integer. + // +optional + TrendingScore int64 `json:"trendingScore,omitempty"` + // GitHubReactions are the issue's 👍 reactions, written by feedback-sync + // when the count changes. Used to match linked voters and for the + // trending score. GitHub reactions are public. + // +optional + // +listType=atomic + GitHubReactions []GitHubReaction `json:"githubReactions,omitempty"` +} + +// GitHubReaction is one 👍 on a GitHub issue. +type GitHubReaction struct { + // Login is the reactor's GitHub username. + Login string `json:"login"` + // At is when they reacted. + // +optional + At metav1.Time `json:"at,omitempty"` +} + +// PublicVoter is a voter who opted in to being shown. +type PublicVoter struct { + DisplayName string `json:"displayName"` + // +optional + AvatarURL string `json:"avatarURL,omitempty"` +} + +// DeliveryStatus tracks a post's delivery stage and the work behind it. +type DeliveryStatus struct { + // Stage is the highest stage whose condition currently holds. + // +optional + Stage DeliveryStage `json:"stage,omitempty"` + // HighestNotified is the highest stage announced to followers. A stage is + // only announced when it passes this one. + // +optional + HighestNotified DeliveryStage `json:"highestNotified,omitempty"` + // History records each stage change. + // +optional + // +listType=atomic + History []DeliveryEvent `json:"history,omitempty"` + // Work is the related work behind the post. + // +optional + Work *DeliveryWork `json:"work,omitempty"` +} + +// DeliveryEvent is one stage change. +type DeliveryEvent struct { + Stage DeliveryStage `json:"stage"` + At metav1.Time `json:"at"` + // Cause describes what moved the stage, e.g. a pull request opening. + // +optional + Cause string `json:"cause,omitempty"` +} + +// DeliveryWork summarises sub-issues and linked pull requests. Only public +// issues and pull requests are included. +type DeliveryWork struct { + // Total and Done count sub-issues when there are any, otherwise linked + // pull requests. + // +optional + Total int32 `json:"total,omitempty"` + // +optional + Done int32 `json:"done,omitempty"` + // +optional + // +listType=atomic + Items []WorkItem `json:"items,omitempty"` + // PartShipped records changelog entries that shipped part of the work. + // +optional + // +listType=atomic + PartShipped []PartShipped `json:"partShipped,omitempty"` +} + +// WorkItem is a sub-issue or linked pull request. +type WorkItem struct { + // Kind is "issue" or "pullRequest". + Kind string `json:"kind"` + // Ref is "/#". + Ref string `json:"ref"` + Title string `json:"title,omitempty"` + // State is "open", "closed" or "merged". + State string `json:"state"` + URL string `json:"url,omitempty"` + // PullRequests are the pull requests that close this issue. + // +optional + // +listType=atomic + PullRequests []PullRequestRef `json:"pullRequests,omitempty"` +} + +// PullRequestRef is a pull request linked to a work item. +type PullRequestRef struct { + Ref string `json:"ref"` + State string `json:"state"` +} + +// PartShipped records a changelog entry that linked a work item before the +// post itself was released. +type PartShipped struct { + // Changelog is the ChangelogEntry name. + Changelog string `json:"changelog"` + At metav1.Time `json:"at"` +} + +// +kubebuilder:object:root=true + +// PostList is a list of Post. +type PostList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []Post `json:"items"` +} + +// Labels feedback-sync and feedback-operator set on posts, so clients can +// filter with label selectors. +const ( + // LabelOrg is the GitHub org of the backing issue. + LabelOrg = "feedback.miloapis.com/org" + // LabelState is status.state. + LabelState = "feedback.miloapis.com/status" + // LabelStage is status.delivery.stage, set by the operator. + LabelStage = "feedback.miloapis.com/stage" + // CategoryLabelPrefix prefixes one label per category, with an empty + // value: category.feedback.miloapis.com/deliver. + CategoryLabelPrefix = "category.feedback.miloapis.com/" +) + +// PostName is the name of the Post for a GitHub issue: +// "..", lower-cased. +func PostName(org, repository string, number int32) string { + return fmt.Sprintf("%s.%s.%d", strings.ToLower(org), strings.ToLower(repository), number) +} diff --git a/pkg/apis/feedback/v1alpha1/profile_types.go b/pkg/apis/feedback/v1alpha1/profile_types.go new file mode 100644 index 0000000..9138d42 --- /dev/null +++ b/pkg/apis/feedback/v1alpha1/profile_types.go @@ -0,0 +1,46 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// FeedbackProfile holds a user's feedback settings. Users create and update +// their own in the user context; it is named after the user. +// +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Cluster +// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Platform;User" +// +kubebuilder:metadata:annotations="iam.miloapis.com/owner-field=spec.userRef.name" +// +kubebuilder:selectablefield:JSONPath=`.spec.userRef.name` +// +kubebuilder:printcolumn:name="Public votes",type=boolean,JSONPath=`.spec.showPublicVotes` +// +kubebuilder:printcolumn:name="Emails",type=boolean,JSONPath=`.spec.digestEmails` +// +kubebuilder:validation:XValidation:rule="self.metadata.name == self.spec.userRef.name",message="metadata.name must be the user's name" +type FeedbackProfile struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec FeedbackProfileSpec `json:"spec"` +} + +// FeedbackProfileSpec is the user's settings. +type FeedbackProfileSpec struct { + // UserRef is the user, set by the admission webhook. + // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="userRef is immutable" + UserRef UserReference `json:"userRef"` + // ShowPublicVotes shows the user's avatar and name on posts they voted + // on, including past votes. + // +optional + ShowPublicVotes bool `json:"showPublicVotes,omitempty"` + // DigestEmails turns the daily digest on or off. Unset means on. + // +optional + DigestEmails *bool `json:"digestEmails,omitempty"` +} + +// FeedbackProfileList is a list of FeedbackProfile. +// +kubebuilder:object:root=true +type FeedbackProfileList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []FeedbackProfile `json:"items"` +} diff --git a/pkg/apis/feedback/v1alpha1/register.go b/pkg/apis/feedback/v1alpha1/register.go index e2c8e78..a2f06fd 100644 --- a/pkg/apis/feedback/v1alpha1/register.go +++ b/pkg/apis/feedback/v1alpha1/register.go @@ -1,14 +1,12 @@ package v1alpha1 import ( - "fmt" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) -// GroupName is the API group served by the feedback apiserver. +// GroupName is the API group of every feedback resource. const GroupName = "feedback.miloapis.com" // SchemeGroupVersion is the group version used to register these objects. @@ -31,20 +29,27 @@ func Resource(resource string) schema.GroupResource { return SchemeGroupVersion.WithResource(resource).GroupResource() } -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &FeedbackSource{}, - &FeedbackSourceList{}, - ) - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.WithKind("FeedbackSource"), feedbackSourceFieldLabel) +// KnownTypes lists every object type in the group. +func KnownTypes() []runtime.Object { + return []runtime.Object{ + &FeedbackSource{}, &FeedbackSourceList{}, + &Post{}, &PostList{}, + &Release{}, &ReleaseList{}, + &ChangelogEntry{}, &ChangelogEntryList{}, + &Vote{}, &VoteList{}, + &Subscription{}, &SubscriptionList{}, + &Submission{}, &SubmissionList{}, + &SubmissionReview{}, &SubmissionReviewList{}, + &SecurityReport{}, &SecurityReportList{}, + &SecurityReportTriage{}, &SecurityReportTriageList{}, + &SecurityAcknowledgement{}, &SecurityAcknowledgementList{}, + &FeedbackProfile{}, &FeedbackProfileList{}, + &FeedbackDigest{}, &FeedbackDigestList{}, + } } -// feedbackSourceFieldLabel lists the field selectors FeedbackSource supports. -func feedbackSourceFieldLabel(label, value string) (string, string, error) { - switch label { - case "metadata.name", "spec.github.org": - return label, value, nil - } - return "", "", fmt.Errorf("field label not supported: %s", label) +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, KnownTypes()...) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil } diff --git a/pkg/apis/feedback/v1alpha1/register_test.go b/pkg/apis/feedback/v1alpha1/register_test.go new file mode 100644 index 0000000..d301e84 --- /dev/null +++ b/pkg/apis/feedback/v1alpha1/register_test.go @@ -0,0 +1,59 @@ +package v1alpha1_test + +import ( + "os" + "path/filepath" + "reflect" + "strings" + "testing" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/serializer/json" + + "go.miloapis.com/feedback/pkg/apis/feedback/install" + feedbackv1alpha1 "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1" +) + +func newScheme(t *testing.T) *runtime.Scheme { + t.Helper() + s := runtime.NewScheme() + install.Install(s) + return s +} + +// TestSamplesDecodeStrictly decodes every sample with unknown and duplicate +// fields rejected, so the samples can't drift from the types. Every top-level +// kind except list types needs a sample. +func TestSamplesDecodeStrictly(t *testing.T) { + scheme := newScheme(t) + dec := json.NewSerializerWithOptions(json.DefaultMetaFactory, scheme, scheme, + json.SerializerOptions{Yaml: true, Strict: true}) + + files, err := filepath.Glob("../../../../config/samples/*.yaml") + if err != nil || len(files) == 0 { + t.Fatalf("no samples found: %v", err) + } + seen := map[string]bool{} + for _, f := range files { + t.Run(filepath.Base(f), func(t *testing.T) { + data, err := os.ReadFile(f) + if err != nil { + t.Fatal(err) + } + _, gvk, err := dec.Decode(data, nil, nil) + if err != nil { + t.Fatalf("decode: %v", err) + } + seen[gvk.Kind] = true + }) + } + for _, obj := range feedbackv1alpha1.KnownTypes() { + kind := reflect.TypeOf(obj).Elem().Name() + if strings.HasSuffix(kind, "List") { + continue + } + if !seen[kind] { + t.Errorf("no sample in config/samples for %s", kind) + } + } +} diff --git a/pkg/apis/feedback/v1alpha1/release_types.go b/pkg/apis/feedback/v1alpha1/release_types.go new file mode 100644 index 0000000..7e49cc9 --- /dev/null +++ b/pkg/apis/feedback/v1alpha1/release_types.go @@ -0,0 +1,118 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Cluster +// +kubebuilder:subresource:status +// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Platform;User" +// +kubebuilder:printcolumn:name="Title",type=string,JSONPath=`.status.title` +// +kubebuilder:printcolumn:name="Due",type=string,JSONPath=`.status.dueOn` +// +kubebuilder:printcolumn:name="Shipped",type=boolean,JSONPath=`.status.shipped` + +// Release maps to a milestone in the FeedbackSource's milestones repository. +// Only feedback-sync writes releases; everyone can read them. +type Release struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Status ReleaseStatus `json:"status,omitempty"` +} + +// ReleaseStatus is synced from the milestone. +type ReleaseStatus struct { + // Title is the milestone title, e.g. "Hedy: 2.0". + Title string `json:"title"` + // +optional + Codename string `json:"codename,omitempty"` + // +optional + Version string `json:"version,omitempty"` + // DueOn is the milestone due date, as YYYY-MM-DD. + // +optional + DueOn string `json:"dueOn,omitempty"` + // Shipped is set when the milestone is closed. + // +optional + Shipped bool `json:"shipped,omitempty"` + // +optional + DescriptionHTML string `json:"descriptionHTML,omitempty"` + // CoverImage is a key into the website's static assets. + // +optional + CoverImage string `json:"coverImage,omitempty"` + // Posts are the names of posts on the milestone. + // +optional + // +listType=set + Posts []string `json:"posts,omitempty"` + // +optional + GitHub *GitHubLink `json:"github,omitempty"` +} + +// +kubebuilder:object:root=true + +// ReleaseList is a list of Release. +type ReleaseList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []Release `json:"items"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Cluster +// +kubebuilder:subresource:status +// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Platform;User" +// +kubebuilder:printcolumn:name="Title",type=string,JSONPath=`.status.title` +// +kubebuilder:printcolumn:name="Published",type=date,JSONPath=`.status.publishedAt` + +// ChangelogEntry maps to a discussion in the FeedbackSource's changelog +// category. Only feedback-sync writes entries; everyone can read them. +type ChangelogEntry struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Status ChangelogEntryStatus `json:"status,omitempty"` +} + +// ChangelogEntryStatus is synced from the discussion. +type ChangelogEntryStatus struct { + Title string `json:"title"` + PublishedAt metav1.Time `json:"publishedAt"` + // Categories are mapped from discussion labels. + // +optional + // +listType=set + Categories []string `json:"categories,omitempty"` + // BodyHTML is the discussion body, sanitised like post bodies. + // +optional + BodyHTML string `json:"bodyHTML,omitempty"` + // Posts are the names of posts referenced in the body. + // +optional + // +listType=set + Posts []string `json:"posts,omitempty"` + // IssueRefs are every issue referenced in the body, as + // "/#". A reference to a post's work item rather than + // the post marks that post part-shipped. + // +optional + // +listType=set + IssueRefs []string `json:"issueRefs,omitempty"` + // +optional + Reactions ChangelogReactions `json:"reactions,omitempty"` + // +optional + GitHub *GitHubLink `json:"github,omitempty"` +} + +// ChangelogReactions are reaction counts on the discussion. +type ChangelogReactions struct { + // +optional + ThumbsUp int32 `json:"thumbsUp,omitempty"` +} + +// +kubebuilder:object:root=true + +// ChangelogEntryList is a list of ChangelogEntry. +type ChangelogEntryList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []ChangelogEntry `json:"items"` +} diff --git a/pkg/apis/feedback/v1alpha1/securityreport_types.go b/pkg/apis/feedback/v1alpha1/securityreport_types.go new file mode 100644 index 0000000..9fdb057 --- /dev/null +++ b/pkg/apis/feedback/v1alpha1/securityreport_types.go @@ -0,0 +1,283 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// SecurityReportPhase is where a report is in handling. +// +kubebuilder:validation:Enum=Received;Triaged;Fixing;Fixed;Disclosed;NotApplicable;Duplicate +type SecurityReportPhase string + +const ( + SecurityReportPhaseReceived SecurityReportPhase = "Received" + SecurityReportPhaseTriaged SecurityReportPhase = "Triaged" + SecurityReportPhaseFixing SecurityReportPhase = "Fixing" + SecurityReportPhaseFixed SecurityReportPhase = "Fixed" + SecurityReportPhaseDisclosed SecurityReportPhase = "Disclosed" + SecurityReportPhaseNotApplicable SecurityReportPhase = "NotApplicable" + SecurityReportPhaseDuplicate SecurityReportPhase = "Duplicate" +) + +// Severity is the Security Team's rating. +// +kubebuilder:validation:Enum=critical;high;medium;low;informational +type Severity string + +const ( + SeverityCritical Severity = "critical" + SeverityHigh Severity = "high" + SeverityMedium Severity = "medium" + SeverityLow Severity = "low" + SeverityInformational Severity = "informational" +) + +// RewardKind is how a reporter is thanked. +// +kubebuilder:validation:Enum=none;thanks;swag;credits +type RewardKind string + +const ( + RewardKindNone RewardKind = "none" + RewardKindThanks RewardKind = "thanks" + RewardKindSwag RewardKind = "swag" + RewardKindCredits RewardKind = "credits" +) + +// SecurityReport is a private vulnerability report. Reporters create and read +// their own in the user context. Only the Security Team role can list every +// report and write status; what the reporter must not see lives on its +// SecurityReportTriage. Reports are never synced to GitHub, indexed or sent +// to the AI gateway, and are audited at Metadata level only. +// +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Cluster +// +kubebuilder:subresource:status +// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Platform;User" +// +kubebuilder:metadata:annotations="iam.miloapis.com/owner-field=spec.userRef.name" +// +kubebuilder:selectablefield:JSONPath=`.spec.userRef.name` +// +kubebuilder:selectablefield:JSONPath=`.status.phase` +// +kubebuilder:selectablefield:JSONPath=`.status.severity` +// +kubebuilder:printcolumn:name="Title",type=string,JSONPath=`.spec.title` +// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` +// +kubebuilder:printcolumn:name="Severity",type=string,JSONPath=`.status.severity` +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +type SecurityReport struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec SecurityReportSpec `json:"spec"` + Status SecurityReportStatus `json:"status,omitempty"` +} + +// SecurityReportSpec is what the reporter submitted. +// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="reports can't be changed after they are sent" +type SecurityReportSpec struct { + // UserRef is the reporter, set by the admission webhook. Empty for reports + // the Security Team logs for someone without a Datum account. + // +optional + UserRef *UserReference `json:"userRef,omitempty"` + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=200 + Title string `json:"title"` + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=50000 + Description string `json:"description"` + // Affected is free text that helps routing, e.g. "connectors". + // +optional + // +kubebuilder:validation:MaxLength=200 + Affected string `json:"affected,omitempty"` + // +optional + // +kubebuilder:validation:MaxLength=50000 + StepsToReproduce string `json:"stepsToReproduce,omitempty"` + // +optional + // +kubebuilder:validation:MaxLength=10000 + Impact string `json:"impact,omitempty"` + // Attachments reference files uploaded to feedback-uploads. + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=5 + Attachments []AttachmentReference `json:"attachments,omitempty"` + // Credit is how the reporter wants to be credited. + // +optional + Credit *SecurityCredit `json:"credit,omitempty"` + // Reporter is set only on reports the Security Team logs for someone + // without a Datum account (from email or GitHub private reporting). + // +optional + Reporter *ExternalReporter `json:"reporter,omitempty"` + // +optional + Context SecurityReportContext `json:"context,omitempty"` +} + +// SecurityCredit is the reporter's credit preference. +type SecurityCredit struct { + // Public lists the reporter on the acknowledgements page once the report + // is Fixed or Disclosed. + // +optional + Public bool `json:"public,omitempty"` + // +optional + Name string `json:"name,omitempty"` + // +optional + URL string `json:"url,omitempty"` +} + +// ExternalReporter identifies a reporter outside Datum. +type ExternalReporter struct { + // +optional + Email string `json:"email,omitempty"` + // +optional + GitHubLogin string `json:"githubLogin,omitempty"` +} + +// SecurityReportContext is where the report came from. +type SecurityReportContext struct { + // +optional + Client Client `json:"client,omitempty"` + // FiledByAgent is set when an agent (Patch, non-interactive datumctl) + // filed the report. + // +optional + FiledByAgent bool `json:"filedByAgent,omitempty"` + // +optional + Organization string `json:"organization,omitempty"` + // +optional + ClientVersion string `json:"clientVersion,omitempty"` +} + +// SecurityReportStatus is written by the Security Team. +type SecurityReportStatus struct { + // +optional + Phase SecurityReportPhase `json:"phase,omitempty"` + // +optional + Severity Severity `json:"severity,omitempty"` + // +optional + CVSSVector string `json:"cvssVector,omitempty"` + // Reason is shown to the reporter for NotApplicable and Duplicate. + // +optional + Reason string `json:"reason,omitempty"` + // Timeline is visible to the reporter. + // +optional + // +listType=atomic + Timeline []SecurityTimelineEntry `json:"timeline,omitempty"` + // +optional + Advisory *SecurityAdvisory `json:"advisory,omitempty"` + // +optional + Reward *SecurityReward `json:"reward,omitempty"` +} + +// SecurityTimelineEntry is one phase change. +type SecurityTimelineEntry struct { + Phase SecurityReportPhase `json:"phase"` + At metav1.Time `json:"at"` + // +optional + Note string `json:"note,omitempty"` +} + +// SecurityAdvisory is the published advisory. +type SecurityAdvisory struct { + // +optional + URL string `json:"url,omitempty"` + // +optional + CVE string `json:"cve,omitempty"` +} + +// SecurityReward records how the reporter was thanked. +type SecurityReward struct { + Kind RewardKind `json:"kind"` + // Amount is the credit amount, for kind credits. + // +optional + Amount string `json:"amount,omitempty"` + // CreditGrantRef names the billing CreditGrant, for kind credits. + // +optional + CreditGrantRef *CreditGrantReference `json:"creditGrantRef,omitempty"` + // +optional + GrantedAt *metav1.Time `json:"grantedAt,omitempty"` +} + +// CreditGrantReference names a billing.miloapis.com CreditGrant. +type CreditGrantReference struct { + Name string `json:"name"` +} + +// SecurityReportTriage is the Security Team's private notes on a report, +// with the same name as the report. Only the Security Team can read or write +// it, so nothing here reaches the reporter. +// +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Cluster +// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Platform" +// +kubebuilder:printcolumn:name="Assignee",type=string,JSONPath=`.spec.assignee` +// +kubebuilder:printcolumn:name="Duplicate of",type=string,JSONPath=`.spec.duplicateOf` +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +type SecurityReportTriage struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec SecurityReportTriageSpec `json:"spec,omitempty"` +} + +// SecurityReportTriageSpec is Security Team only. +type SecurityReportTriageSpec struct { + // +optional + Assignee string `json:"assignee,omitempty"` + // DuplicateOf is the name of the original report. + // +optional + DuplicateOf string `json:"duplicateOf,omitempty"` + // Tracking links the private issue or draft advisory for the fix. + // +optional + Tracking string `json:"tracking,omitempty"` + // +optional + Notes string `json:"notes,omitempty"` +} + +// SecurityReportTriageList is a list of SecurityReportTriage. +// +kubebuilder:object:root=true +type SecurityReportTriageList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []SecurityReportTriage `json:"items"` +} + +// SecurityReportList is a list of SecurityReport. +// +kubebuilder:object:root=true +type SecurityReportList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []SecurityReport `json:"items"` +} + +// SecurityAcknowledgement is a public credit for a fixed or disclosed +// SecurityReport whose reporter chose public credit, with the same name as +// the report. The operator creates and updates it; it holds only what the +// acknowledgements page shows. +// +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Cluster +// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Platform" +// +kubebuilder:printcolumn:name="Name",type=string,JSONPath=`.status.name` +// +kubebuilder:printcolumn:name="Month",type=string,JSONPath=`.status.month` +// +kubebuilder:printcolumn:name="Severity",type=string,JSONPath=`.status.severity` +type SecurityAcknowledgement struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Status SecurityAcknowledgementStatus `json:"status,omitempty"` +} + +// SecurityAcknowledgementStatus is the public credit. +type SecurityAcknowledgementStatus struct { + Name string `json:"name"` + // +optional + URL string `json:"url,omitempty"` + // Month is when the report was fixed, as YYYY-MM. + Month string `json:"month"` + // +optional + Severity Severity `json:"severity,omitempty"` +} + +// SecurityAcknowledgementList is a list of SecurityAcknowledgement. +// +kubebuilder:object:root=true +type SecurityAcknowledgementList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []SecurityAcknowledgement `json:"items"` +} diff --git a/pkg/apis/feedback/v1alpha1/submission_types.go b/pkg/apis/feedback/v1alpha1/submission_types.go new file mode 100644 index 0000000..75055ce --- /dev/null +++ b/pkg/apis/feedback/v1alpha1/submission_types.go @@ -0,0 +1,255 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// SubmissionKind is what the submitter says the feedback is. +// +kubebuilder:validation:Enum=idea;bug;other +type SubmissionKind string + +const ( + SubmissionKindIdea SubmissionKind = "idea" + SubmissionKindBug SubmissionKind = "bug" + SubmissionKindOther SubmissionKind = "other" +) + +// SubmissionPhase is where a submission is in review. +// +kubebuilder:validation:Enum=PendingReview;Approved;Merged;Rejected +type SubmissionPhase string + +const ( + SubmissionPhasePendingReview SubmissionPhase = "PendingReview" + SubmissionPhaseApproved SubmissionPhase = "Approved" + SubmissionPhaseMerged SubmissionPhase = "Merged" + SubmissionPhaseRejected SubmissionPhase = "Rejected" +) + +// ReviewDecision is a staff decision on a submission. +// +kubebuilder:validation:Enum=Approved;Merged;Rejected;MoveToSecurity +type ReviewDecision string + +const ( + // ReviewDecisionApproved creates a public issue from the submission. + ReviewDecisionApproved ReviewDecision = "Approved" + // ReviewDecisionMerged adds the submitter to an existing post. + ReviewDecisionMerged ReviewDecision = "Merged" + // ReviewDecisionRejected closes the submission with a reason. + ReviewDecisionRejected ReviewDecision = "Rejected" + // ReviewDecisionMoveToSecurity moves a misfiled submission to the + // security track: the operator creates a SecurityReport owned by the + // submitter, copies the attachments, and deletes the submission. + ReviewDecisionMoveToSecurity ReviewDecision = "MoveToSecurity" +) + +// Submission is private feedback waiting for a staff decision. Submitters +// create and read their own in the user context; staff list them in the +// platform context and decide on its SubmissionReview. It holds only what the +// submitter may see. Nothing in a submission reaches GitHub unless staff +// approve it, and then only the staff-edited public title and body. +// +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Cluster +// +kubebuilder:subresource:status +// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Platform;User" +// +kubebuilder:metadata:annotations="iam.miloapis.com/owner-field=spec.userRef.name" +// +kubebuilder:selectablefield:JSONPath=`.spec.userRef.name` +// +kubebuilder:selectablefield:JSONPath=`.spec.kind` +// +kubebuilder:selectablefield:JSONPath=`.status.phase` +// +kubebuilder:printcolumn:name="Kind",type=string,JSONPath=`.spec.kind` +// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase` +// +kubebuilder:printcolumn:name="Title",type=string,JSONPath=`.spec.title` +// +kubebuilder:printcolumn:name="User",type=string,JSONPath=`.spec.userRef.name`,priority=1 +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +type Submission struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec SubmissionSpec `json:"spec"` + Status SubmissionStatus `json:"status,omitempty"` +} + +// SubmissionSpec is what the user submitted. +// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="submissions can't be changed after they are sent" +type SubmissionSpec struct { + // UserRef is the submitter, set by the admission webhook. + UserRef UserReference `json:"userRef"` + Kind SubmissionKind `json:"kind"` + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=200 + Title string `json:"title"` + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=20000 + Body string `json:"body"` + // Attachments reference files uploaded to feedback-uploads. + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=5 + Attachments []AttachmentReference `json:"attachments,omitempty"` + // Context is filled by the client and never sent to GitHub. + // +optional + Context SubmissionContext `json:"context,omitempty"` +} + +// SubmissionContext is private context about where the feedback came from. +type SubmissionContext struct { + // +optional + Client Client `json:"client,omitempty"` + // +optional + // +kubebuilder:validation:MaxLength=2048 + PageURL string `json:"pageURL,omitempty"` + // +optional + // +kubebuilder:validation:MaxLength=253 + Organization string `json:"organization,omitempty"` + // +optional + // +kubebuilder:validation:MaxLength=253 + Project string `json:"project,omitempty"` + // RequestIDs are recent API request IDs, for debugging. + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=20 + // +kubebuilder:validation:items:MaxLength=128 + RequestIDs []string `json:"requestIDs,omitempty"` + // ClientVersion is e.g. cloud-portal@2026.10.1. + // +optional + // +kubebuilder:validation:MaxLength=128 + ClientVersion string `json:"clientVersion,omitempty"` +} + +// SubmissionStatus is written by the operator from the SubmissionReview, and +// is all the submitter learns about the review. +type SubmissionStatus struct { + // +optional + Phase SubmissionPhase `json:"phase,omitempty"` + // Reason is shown to the submitter when the submission is Rejected. + // +optional + Reason string `json:"reason,omitempty"` + // PostRef is the post the submission became or was merged into. + // +optional + PostRef *PostReference `json:"postRef,omitempty"` +} + +// SubmissionList is a list of Submission. +// +kubebuilder:object:root=true +type SubmissionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []Submission `json:"items"` +} + +// SubmissionReview is the staff side of a Submission, with the same name. The +// operator creates it when the submission arrives and writes triage to its +// status. Staff decide by setting spec.decision, which can't change once set; +// the operator then applies the decision. Submitters can't read it. +// +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Cluster +// +kubebuilder:subresource:status +// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Platform" +// +kubebuilder:selectablefield:JSONPath=`.spec.decision` +// +kubebuilder:printcolumn:name="Decision",type=string,JSONPath=`.spec.decision` +// +kubebuilder:printcolumn:name="Reviewer",type=string,JSONPath=`.spec.reviewer` +// +kubebuilder:printcolumn:name="Applied",type=boolean,JSONPath=`.status.applied` +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +type SubmissionReview struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec SubmissionReviewSpec `json:"spec,omitempty"` + Status SubmissionReviewStatus `json:"status,omitempty"` +} + +// SubmissionReviewSpec is the staff decision. Empty until staff decide. +// +kubebuilder:validation:XValidation:rule="!has(oldSelf.decision) || self == oldSelf",message="a decision can't change once it is set" +// +kubebuilder:validation:XValidation:rule="!has(self.decision) || self.decision != 'Approved' || (has(self.publicTitle) && has(self.publicBody))",message="Approved needs publicTitle and publicBody" +// +kubebuilder:validation:XValidation:rule="!has(self.decision) || self.decision != 'Merged' || has(self.mergedInto)",message="Merged needs mergedInto" +// +kubebuilder:validation:XValidation:rule="!has(self.decision) || self.decision != 'Rejected' || has(self.reason)",message="Rejected needs a reason for the submitter" +type SubmissionReviewSpec struct { + // +optional + Decision ReviewDecision `json:"decision,omitempty"` + // PublicTitle and PublicBody are what goes to GitHub on approval. Clients + // default them to the triage draft. + // +optional + // +kubebuilder:validation:MaxLength=200 + PublicTitle string `json:"publicTitle,omitempty"` + // +optional + // +kubebuilder:validation:MaxLength=20000 + PublicBody string `json:"publicBody,omitempty"` + // MergedInto is the post name when the decision is Merged. + // +optional + // +kubebuilder:validation:MaxLength=200 + MergedInto string `json:"mergedInto,omitempty"` + // Reason is shown to the submitter when the decision is Rejected. + // +optional + // +kubebuilder:validation:MaxLength=2000 + Reason string `json:"reason,omitempty"` + // Affected sets spec.affected on the SecurityReport for MoveToSecurity. + // +optional + // +kubebuilder:validation:MaxLength=200 + Affected string `json:"affected,omitempty"` + // Reviewer is the staff member who set the decision. The admission + // webhook sets it from the request; it can't be set by clients. + // +optional + Reviewer string `json:"reviewer,omitempty"` + // ReviewedAt is when the decision was set, by the admission webhook. + // +optional + ReviewedAt *metav1.Time `json:"reviewedAt,omitempty"` +} + +// SubmissionReviewStatus is written by the operator. +type SubmissionReviewStatus struct { + // Applied is set once the operator has carried out the decision. + // +optional + Applied bool `json:"applied,omitempty"` + // Triage is advisory. + // +optional + Triage *SubmissionTriage `json:"triage,omitempty"` + // +optional + // +listType=map + // +listMapKey=type + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +// SubmissionTriage is the operator's advisory triage. +type SubmissionTriage struct { + // +optional + // +listType=set + SuggestedCategories []string `json:"suggestedCategories,omitempty"` + // +optional + SuggestedKind SubmissionKind `json:"suggestedKind,omitempty"` + // SimilarPosts come from a keyword search on the submission. + // +optional + // +listType=atomic + SimilarPosts []SimilarPost `json:"similarPosts,omitempty"` + // DraftIssue is a public title and body with private details stripped. + // +optional + DraftIssue *DraftIssue `json:"draftIssue,omitempty"` + // FraudScore is from the fraud service, 0 to 1, as a decimal string. + // +optional + FraudScore string `json:"fraudScore,omitempty"` + // LikelySecurityIssue flags submissions that should be moved to the + // security track. + // +optional + LikelySecurityIssue bool `json:"likelySecurityIssue,omitempty"` +} + +// SimilarPost is a post that may cover the same feedback. +type SimilarPost struct { + Name string `json:"name"` +} + +// DraftIssue is a proposed public issue. +type DraftIssue struct { + Title string `json:"title"` + Body string `json:"body"` +} + +// SubmissionReviewList is a list of SubmissionReview. +// +kubebuilder:object:root=true +type SubmissionReviewList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []SubmissionReview `json:"items"` +} diff --git a/pkg/apis/feedback/v1alpha1/subscription_types.go b/pkg/apis/feedback/v1alpha1/subscription_types.go new file mode 100644 index 0000000..73c9692 --- /dev/null +++ b/pkg/apis/feedback/v1alpha1/subscription_types.go @@ -0,0 +1,59 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// SubscriptionReason is why a user follows a post. +// +kubebuilder:validation:Enum=voted;submitted;merged;manual +type SubscriptionReason string + +const ( + SubscriptionReasonVoted SubscriptionReason = "voted" + SubscriptionReasonSubmitted SubscriptionReason = "submitted" + SubscriptionReasonMerged SubscriptionReason = "merged" + SubscriptionReasonManual SubscriptionReason = "manual" +) + +// Subscription links a user to a post they follow. The operator creates one +// when a user votes or their submission is approved or merged; users create +// and delete their own in the user context. Named like a Vote. +// +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Cluster +// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Platform;User" +// +kubebuilder:metadata:annotations="iam.miloapis.com/owner-field=spec.userRef.name" +// +kubebuilder:selectablefield:JSONPath=`.spec.userRef.name` +// +kubebuilder:selectablefield:JSONPath=`.spec.postRef.name` +// +kubebuilder:printcolumn:name="Post",type=string,JSONPath=`.spec.postRef.name` +// +kubebuilder:printcolumn:name="User",type=string,JSONPath=`.spec.userRef.name`,priority=1 +// +kubebuilder:printcolumn:name="Reason",type=string,JSONPath=`.spec.reason` +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +// +kubebuilder:validation:XValidation:rule="self.metadata.name == self.spec.postRef.name + '.' + self.spec.userRef.name",message="metadata.name must be ." +type Subscription struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec SubscriptionSpec `json:"spec"` +} + +// SubscriptionSpec identifies the post and the follower. +// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="spec is immutable" +type SubscriptionSpec struct { + PostRef PostReference `json:"postRef"` + // UserRef is the follower, set by the admission webhook. + UserRef UserReference `json:"userRef"` + // Reason is "manual" when the user follows a post themselves; the operator + // sets the others. + // +optional + Reason SubscriptionReason `json:"reason,omitempty"` +} + +// SubscriptionList is a list of Subscription. +// +kubebuilder:object:root=true +type SubscriptionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []Subscription `json:"items"` +} diff --git a/pkg/apis/feedback/v1alpha1/vote_types.go b/pkg/apis/feedback/v1alpha1/vote_types.go new file mode 100644 index 0000000..835c9d8 --- /dev/null +++ b/pkg/apis/feedback/v1alpha1/vote_types.go @@ -0,0 +1,71 @@ +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// Vote is a user's vote on a post. Users create and delete their own in the +// user context; staff list every vote in the platform context. +// +// Every user's votes share one collection, so the name is +// "." (see OwnedName), which allows one vote per user per post. +// The admission webhook sets spec.userRef from the request. The operator +// follows the post for the voter and recomputes the post's totals. +// +// +kubebuilder:object:root=true +// +kubebuilder:resource:scope=Cluster +// +kubebuilder:subresource:status +// +kubebuilder:metadata:annotations="discovery.miloapis.com/parent-contexts=Platform;User" +// +kubebuilder:metadata:annotations="iam.miloapis.com/owner-field=spec.userRef.name" +// +kubebuilder:selectablefield:JSONPath=`.spec.userRef.name` +// +kubebuilder:selectablefield:JSONPath=`.spec.postRef.name` +// +kubebuilder:printcolumn:name="Post",type=string,JSONPath=`.spec.postRef.name` +// +kubebuilder:printcolumn:name="User",type=string,JSONPath=`.spec.userRef.name`,priority=1 +// +kubebuilder:printcolumn:name="Source",type=string,JSONPath=`.spec.source` +// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +// +kubebuilder:validation:XValidation:rule="self.metadata.name == self.spec.postRef.name + '.' + self.spec.userRef.name",message="metadata.name must be ." +type Vote struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec VoteSpec `json:"spec"` + Status VoteStatus `json:"status,omitempty"` +} + +// VoteSpec identifies the post and where the vote came from. +// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="spec is immutable; delete the vote and vote again" +type VoteSpec struct { + PostRef PostReference `json:"postRef"` + // UserRef is the voter, set by the admission webhook. + UserRef UserReference `json:"userRef"` + // Source is the client the vote was cast from. + // +optional + Source Client `json:"source,omitempty"` +} + +// VoteStatus is written by the operator. +type VoteStatus struct { + // Organizations the voter belonged to when voting. Used for staff + // analytics and never public. + // +optional + // +listType=set + Organizations []string `json:"organizations,omitempty"` + // GitHubLogin is the GitHub username linked to the voter's account when + // they voted, so a 👍 from the same person isn't counted twice. Never + // public. + // +optional + GitHubLogin string `json:"githubLogin,omitempty"` + // Subscribed is set once the operator has followed the post for the + // voter, so a follow the voter later deletes isn't recreated. + // +optional + Subscribed bool `json:"subscribed,omitempty"` +} + +// VoteList is a list of Vote. +// +kubebuilder:object:root=true +type VoteList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + + Items []Vote `json:"items"` +} diff --git a/pkg/apis/feedback/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/feedback/v1alpha1/zz_generated.deepcopy.go index aabf693..af5af6c 100644 --- a/pkg/apis/feedback/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/feedback/v1alpha1/zz_generated.deepcopy.go @@ -1,53 +1,1547 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated -// Code generated by deepcopy-gen. DO NOT EDIT. +// Code generated by controller-gen. DO NOT EDIT. package v1alpha1 import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AttachmentReference) DeepCopyInto(out *AttachmentReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttachmentReference. +func (in *AttachmentReference) DeepCopy() *AttachmentReference { + if in == nil { + return nil + } + out := new(AttachmentReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ChangelogEntry) DeepCopyInto(out *ChangelogEntry) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChangelogEntry. +func (in *ChangelogEntry) DeepCopy() *ChangelogEntry { + if in == nil { + return nil + } + out := new(ChangelogEntry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ChangelogEntry) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ChangelogEntryList) DeepCopyInto(out *ChangelogEntryList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ChangelogEntry, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChangelogEntryList. +func (in *ChangelogEntryList) DeepCopy() *ChangelogEntryList { + if in == nil { + return nil + } + out := new(ChangelogEntryList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ChangelogEntryList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ChangelogEntryStatus) DeepCopyInto(out *ChangelogEntryStatus) { + *out = *in + in.PublishedAt.DeepCopyInto(&out.PublishedAt) + if in.Categories != nil { + in, out := &in.Categories, &out.Categories + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Posts != nil { + in, out := &in.Posts, &out.Posts + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.IssueRefs != nil { + in, out := &in.IssueRefs, &out.IssueRefs + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.Reactions = in.Reactions + if in.GitHub != nil { + in, out := &in.GitHub, &out.GitHub + *out = new(GitHubLink) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChangelogEntryStatus. +func (in *ChangelogEntryStatus) DeepCopy() *ChangelogEntryStatus { + if in == nil { + return nil + } + out := new(ChangelogEntryStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ChangelogReactions) DeepCopyInto(out *ChangelogReactions) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChangelogReactions. +func (in *ChangelogReactions) DeepCopy() *ChangelogReactions { + if in == nil { + return nil + } + out := new(ChangelogReactions) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ChangelogSource) DeepCopyInto(out *ChangelogSource) { *out = *in - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChangelogSource. -func (in *ChangelogSource) DeepCopy() *ChangelogSource { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChangelogSource. +func (in *ChangelogSource) DeepCopy() *ChangelogSource { + if in == nil { + return nil + } + out := new(ChangelogSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CreditGrantReference) DeepCopyInto(out *CreditGrantReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CreditGrantReference. +func (in *CreditGrantReference) DeepCopy() *CreditGrantReference { + if in == nil { + return nil + } + out := new(CreditGrantReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeliveryEvent) DeepCopyInto(out *DeliveryEvent) { + *out = *in + in.At.DeepCopyInto(&out.At) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeliveryEvent. +func (in *DeliveryEvent) DeepCopy() *DeliveryEvent { + if in == nil { + return nil + } + out := new(DeliveryEvent) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeliveryStatus) DeepCopyInto(out *DeliveryStatus) { + *out = *in + if in.History != nil { + in, out := &in.History, &out.History + *out = make([]DeliveryEvent, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Work != nil { + in, out := &in.Work, &out.Work + *out = new(DeliveryWork) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeliveryStatus. +func (in *DeliveryStatus) DeepCopy() *DeliveryStatus { + if in == nil { + return nil + } + out := new(DeliveryStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeliveryWork) DeepCopyInto(out *DeliveryWork) { + *out = *in + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]WorkItem, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.PartShipped != nil { + in, out := &in.PartShipped, &out.PartShipped + *out = make([]PartShipped, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeliveryWork. +func (in *DeliveryWork) DeepCopy() *DeliveryWork { + if in == nil { + return nil + } + out := new(DeliveryWork) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DigestItem) DeepCopyInto(out *DigestItem) { + *out = *in + in.At.DeepCopyInto(&out.At) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DigestItem. +func (in *DigestItem) DeepCopy() *DigestItem { + if in == nil { + return nil + } + out := new(DigestItem) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DraftIssue) DeepCopyInto(out *DraftIssue) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DraftIssue. +func (in *DraftIssue) DeepCopy() *DraftIssue { + if in == nil { + return nil + } + out := new(DraftIssue) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalReporter) DeepCopyInto(out *ExternalReporter) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalReporter. +func (in *ExternalReporter) DeepCopy() *ExternalReporter { + if in == nil { + return nil + } + out := new(ExternalReporter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeedbackDigest) DeepCopyInto(out *FeedbackDigest) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackDigest. +func (in *FeedbackDigest) DeepCopy() *FeedbackDigest { + if in == nil { + return nil + } + out := new(FeedbackDigest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeedbackDigest) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeedbackDigestList) DeepCopyInto(out *FeedbackDigestList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FeedbackDigest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackDigestList. +func (in *FeedbackDigestList) DeepCopy() *FeedbackDigestList { + if in == nil { + return nil + } + out := new(FeedbackDigestList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeedbackDigestList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeedbackDigestSpec) DeepCopyInto(out *FeedbackDigestSpec) { + *out = *in + out.UserRef = in.UserRef + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DigestItem, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackDigestSpec. +func (in *FeedbackDigestSpec) DeepCopy() *FeedbackDigestSpec { + if in == nil { + return nil + } + out := new(FeedbackDigestSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeedbackDigestStatus) DeepCopyInto(out *FeedbackDigestStatus) { + *out = *in + if in.LastSentAt != nil { + in, out := &in.LastSentAt, &out.LastSentAt + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackDigestStatus. +func (in *FeedbackDigestStatus) DeepCopy() *FeedbackDigestStatus { + if in == nil { + return nil + } + out := new(FeedbackDigestStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeedbackProfile) DeepCopyInto(out *FeedbackProfile) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackProfile. +func (in *FeedbackProfile) DeepCopy() *FeedbackProfile { + if in == nil { + return nil + } + out := new(FeedbackProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeedbackProfile) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeedbackProfileList) DeepCopyInto(out *FeedbackProfileList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FeedbackProfile, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackProfileList. +func (in *FeedbackProfileList) DeepCopy() *FeedbackProfileList { + if in == nil { + return nil + } + out := new(FeedbackProfileList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeedbackProfileList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeedbackProfileSpec) DeepCopyInto(out *FeedbackProfileSpec) { + *out = *in + out.UserRef = in.UserRef + if in.DigestEmails != nil { + in, out := &in.DigestEmails, &out.DigestEmails + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackProfileSpec. +func (in *FeedbackProfileSpec) DeepCopy() *FeedbackProfileSpec { + if in == nil { + return nil + } + out := new(FeedbackProfileSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeedbackSource) DeepCopyInto(out *FeedbackSource) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackSource. +func (in *FeedbackSource) DeepCopy() *FeedbackSource { + if in == nil { + return nil + } + out := new(FeedbackSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeedbackSource) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeedbackSourceList) DeepCopyInto(out *FeedbackSourceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]FeedbackSource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackSourceList. +func (in *FeedbackSourceList) DeepCopy() *FeedbackSourceList { + if in == nil { + return nil + } + out := new(FeedbackSourceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *FeedbackSourceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeedbackSourceSpec) DeepCopyInto(out *FeedbackSourceSpec) { + *out = *in + in.GitHub.DeepCopyInto(&out.GitHub) + if in.StatusMapping != nil { + in, out := &in.StatusMapping, &out.StatusMapping + *out = make(map[string]PostState, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.CategoryMapping != nil { + in, out := &in.CategoryMapping, &out.CategoryMapping + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackSourceSpec. +func (in *FeedbackSourceSpec) DeepCopy() *FeedbackSourceSpec { + if in == nil { + return nil + } + out := new(FeedbackSourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FeedbackSourceStatus) DeepCopyInto(out *FeedbackSourceStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LastWebhookAt != nil { + in, out := &in.LastWebhookAt, &out.LastWebhookAt + *out = (*in).DeepCopy() + } + if in.LastReconcile != nil { + in, out := &in.LastReconcile, &out.LastReconcile + *out = new(ReconcileStatus) + (*in).DeepCopyInto(*out) + } + if in.RateLimit != nil { + in, out := &in.RateLimit, &out.RateLimit + *out = new(RateLimitStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackSourceStatus. +func (in *FeedbackSourceStatus) DeepCopy() *FeedbackSourceStatus { + if in == nil { + return nil + } + out := new(FeedbackSourceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitHubIssue) DeepCopyInto(out *GitHubIssue) { + *out = *in + in.CreatedAt.DeepCopyInto(&out.CreatedAt) + in.UpdatedAt.DeepCopyInto(&out.UpdatedAt) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitHubIssue. +func (in *GitHubIssue) DeepCopy() *GitHubIssue { + if in == nil { + return nil + } + out := new(GitHubIssue) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitHubLink) DeepCopyInto(out *GitHubLink) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitHubLink. +func (in *GitHubLink) DeepCopy() *GitHubLink { + if in == nil { + return nil + } + out := new(GitHubLink) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitHubReaction) DeepCopyInto(out *GitHubReaction) { + *out = *in + in.At.DeepCopyInto(&out.At) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitHubReaction. +func (in *GitHubReaction) DeepCopy() *GitHubReaction { + if in == nil { + return nil + } + out := new(GitHubReaction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GitHubSource) DeepCopyInto(out *GitHubSource) { + *out = *in + in.Repositories.DeepCopyInto(&out.Repositories) + in.Issues.DeepCopyInto(&out.Issues) + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(ProjectRef) + **out = **in + } + if in.Milestones != nil { + in, out := &in.Milestones, &out.Milestones + *out = new(MilestoneSource) + **out = **in + } + if in.Changelog != nil { + in, out := &in.Changelog, &out.Changelog + *out = new(ChangelogSource) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitHubSource. +func (in *GitHubSource) DeepCopy() *GitHubSource { + if in == nil { + return nil + } + out := new(GitHubSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IssueSelector) DeepCopyInto(out *IssueSelector) { + *out = *in + if in.IssueTypes != nil { + in, out := &in.IssueTypes, &out.IssueTypes + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExcludeLabels != nil { + in, out := &in.ExcludeLabels, &out.ExcludeLabels + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IssueSelector. +func (in *IssueSelector) DeepCopy() *IssueSelector { + if in == nil { + return nil + } + out := new(IssueSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MilestoneSource) DeepCopyInto(out *MilestoneSource) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MilestoneSource. +func (in *MilestoneSource) DeepCopy() *MilestoneSource { + if in == nil { + return nil + } + out := new(MilestoneSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PartShipped) DeepCopyInto(out *PartShipped) { + *out = *in + in.At.DeepCopyInto(&out.At) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PartShipped. +func (in *PartShipped) DeepCopy() *PartShipped { + if in == nil { + return nil + } + out := new(PartShipped) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Post) DeepCopyInto(out *Post) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Post. +func (in *Post) DeepCopy() *Post { + if in == nil { + return nil + } + out := new(Post) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Post) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostList) DeepCopyInto(out *PostList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Post, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostList. +func (in *PostList) DeepCopy() *PostList { + if in == nil { + return nil + } + out := new(PostList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PostList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostReference) DeepCopyInto(out *PostReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostReference. +func (in *PostReference) DeepCopy() *PostReference { + if in == nil { + return nil + } + out := new(PostReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostSpec) DeepCopyInto(out *PostSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostSpec. +func (in *PostSpec) DeepCopy() *PostSpec { + if in == nil { + return nil + } + out := new(PostSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostStatus) DeepCopyInto(out *PostStatus) { + *out = *in + if in.Categories != nil { + in, out := &in.Categories, &out.Categories + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.GitHub != nil { + in, out := &in.GitHub, &out.GitHub + *out = new(GitHubIssue) + (*in).DeepCopyInto(*out) + } + in.Votes.DeepCopyInto(&out.Votes) + if in.PublicVoters != nil { + in, out := &in.PublicVoters, &out.PublicVoters + *out = make([]PublicVoter, len(*in)) + copy(*out, *in) + } + if in.Delivery != nil { + in, out := &in.Delivery, &out.Delivery + *out = new(DeliveryStatus) + (*in).DeepCopyInto(*out) + } + if in.LastSyncedAt != nil { + in, out := &in.LastSyncedAt, &out.LastSyncedAt + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostStatus. +func (in *PostStatus) DeepCopy() *PostStatus { + if in == nil { + return nil + } + out := new(PostStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostVotes) DeepCopyInto(out *PostVotes) { + *out = *in + if in.GitHubReactions != nil { + in, out := &in.GitHubReactions, &out.GitHubReactions + *out = make([]GitHubReaction, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostVotes. +func (in *PostVotes) DeepCopy() *PostVotes { + if in == nil { + return nil + } + out := new(PostVotes) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProjectRef) DeepCopyInto(out *ProjectRef) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectRef. +func (in *ProjectRef) DeepCopy() *ProjectRef { + if in == nil { + return nil + } + out := new(ProjectRef) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PublicVoter) DeepCopyInto(out *PublicVoter) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PublicVoter. +func (in *PublicVoter) DeepCopy() *PublicVoter { + if in == nil { + return nil + } + out := new(PublicVoter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PullRequestRef) DeepCopyInto(out *PullRequestRef) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PullRequestRef. +func (in *PullRequestRef) DeepCopy() *PullRequestRef { + if in == nil { + return nil + } + out := new(PullRequestRef) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RateLimitStatus) DeepCopyInto(out *RateLimitStatus) { + *out = *in + in.ResetAt.DeepCopyInto(&out.ResetAt) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitStatus. +func (in *RateLimitStatus) DeepCopy() *RateLimitStatus { + if in == nil { + return nil + } + out := new(RateLimitStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReconcileStatus) DeepCopyInto(out *ReconcileStatus) { + *out = *in + in.CompletedAt.DeepCopyInto(&out.CompletedAt) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReconcileStatus. +func (in *ReconcileStatus) DeepCopy() *ReconcileStatus { + if in == nil { + return nil + } + out := new(ReconcileStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Release) DeepCopyInto(out *Release) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Release. +func (in *Release) DeepCopy() *Release { + if in == nil { + return nil + } + out := new(Release) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Release) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReleaseList) DeepCopyInto(out *ReleaseList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Release, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseList. +func (in *ReleaseList) DeepCopy() *ReleaseList { + if in == nil { + return nil + } + out := new(ReleaseList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ReleaseList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReleaseStatus) DeepCopyInto(out *ReleaseStatus) { + *out = *in + if in.Posts != nil { + in, out := &in.Posts, &out.Posts + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.GitHub != nil { + in, out := &in.GitHub, &out.GitHub + *out = new(GitHubLink) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseStatus. +func (in *ReleaseStatus) DeepCopy() *ReleaseStatus { + if in == nil { + return nil + } + out := new(ReleaseStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RepositorySelector) DeepCopyInto(out *RepositorySelector) { + *out = *in + if in.Include != nil { + in, out := &in.Include, &out.Include + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Exclude != nil { + in, out := &in.Exclude, &out.Exclude + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepositorySelector. +func (in *RepositorySelector) DeepCopy() *RepositorySelector { + if in == nil { + return nil + } + out := new(RepositorySelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityAcknowledgement) DeepCopyInto(out *SecurityAcknowledgement) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityAcknowledgement. +func (in *SecurityAcknowledgement) DeepCopy() *SecurityAcknowledgement { + if in == nil { + return nil + } + out := new(SecurityAcknowledgement) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SecurityAcknowledgement) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityAcknowledgementList) DeepCopyInto(out *SecurityAcknowledgementList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SecurityAcknowledgement, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityAcknowledgementList. +func (in *SecurityAcknowledgementList) DeepCopy() *SecurityAcknowledgementList { + if in == nil { + return nil + } + out := new(SecurityAcknowledgementList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SecurityAcknowledgementList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityAcknowledgementStatus) DeepCopyInto(out *SecurityAcknowledgementStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityAcknowledgementStatus. +func (in *SecurityAcknowledgementStatus) DeepCopy() *SecurityAcknowledgementStatus { + if in == nil { + return nil + } + out := new(SecurityAcknowledgementStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityAdvisory) DeepCopyInto(out *SecurityAdvisory) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityAdvisory. +func (in *SecurityAdvisory) DeepCopy() *SecurityAdvisory { + if in == nil { + return nil + } + out := new(SecurityAdvisory) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityCredit) DeepCopyInto(out *SecurityCredit) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityCredit. +func (in *SecurityCredit) DeepCopy() *SecurityCredit { + if in == nil { + return nil + } + out := new(SecurityCredit) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityReport) DeepCopyInto(out *SecurityReport) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityReport. +func (in *SecurityReport) DeepCopy() *SecurityReport { + if in == nil { + return nil + } + out := new(SecurityReport) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SecurityReport) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityReportContext) DeepCopyInto(out *SecurityReportContext) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityReportContext. +func (in *SecurityReportContext) DeepCopy() *SecurityReportContext { + if in == nil { + return nil + } + out := new(SecurityReportContext) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityReportList) DeepCopyInto(out *SecurityReportList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SecurityReport, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityReportList. +func (in *SecurityReportList) DeepCopy() *SecurityReportList { + if in == nil { + return nil + } + out := new(SecurityReportList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SecurityReportList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityReportSpec) DeepCopyInto(out *SecurityReportSpec) { + *out = *in + if in.UserRef != nil { + in, out := &in.UserRef, &out.UserRef + *out = new(UserReference) + **out = **in + } + if in.Attachments != nil { + in, out := &in.Attachments, &out.Attachments + *out = make([]AttachmentReference, len(*in)) + copy(*out, *in) + } + if in.Credit != nil { + in, out := &in.Credit, &out.Credit + *out = new(SecurityCredit) + **out = **in + } + if in.Reporter != nil { + in, out := &in.Reporter, &out.Reporter + *out = new(ExternalReporter) + **out = **in + } + out.Context = in.Context +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityReportSpec. +func (in *SecurityReportSpec) DeepCopy() *SecurityReportSpec { + if in == nil { + return nil + } + out := new(SecurityReportSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityReportStatus) DeepCopyInto(out *SecurityReportStatus) { + *out = *in + if in.Timeline != nil { + in, out := &in.Timeline, &out.Timeline + *out = make([]SecurityTimelineEntry, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Advisory != nil { + in, out := &in.Advisory, &out.Advisory + *out = new(SecurityAdvisory) + **out = **in + } + if in.Reward != nil { + in, out := &in.Reward, &out.Reward + *out = new(SecurityReward) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityReportStatus. +func (in *SecurityReportStatus) DeepCopy() *SecurityReportStatus { + if in == nil { + return nil + } + out := new(SecurityReportStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityReportTriage) DeepCopyInto(out *SecurityReportTriage) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityReportTriage. +func (in *SecurityReportTriage) DeepCopy() *SecurityReportTriage { + if in == nil { + return nil + } + out := new(SecurityReportTriage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SecurityReportTriage) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityReportTriageList) DeepCopyInto(out *SecurityReportTriageList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]SecurityReportTriage, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityReportTriageList. +func (in *SecurityReportTriageList) DeepCopy() *SecurityReportTriageList { + if in == nil { + return nil + } + out := new(SecurityReportTriageList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SecurityReportTriageList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityReportTriageSpec) DeepCopyInto(out *SecurityReportTriageSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityReportTriageSpec. +func (in *SecurityReportTriageSpec) DeepCopy() *SecurityReportTriageSpec { + if in == nil { + return nil + } + out := new(SecurityReportTriageSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityReward) DeepCopyInto(out *SecurityReward) { + *out = *in + if in.CreditGrantRef != nil { + in, out := &in.CreditGrantRef, &out.CreditGrantRef + *out = new(CreditGrantReference) + **out = **in + } + if in.GrantedAt != nil { + in, out := &in.GrantedAt, &out.GrantedAt + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityReward. +func (in *SecurityReward) DeepCopy() *SecurityReward { + if in == nil { + return nil + } + out := new(SecurityReward) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityTimelineEntry) DeepCopyInto(out *SecurityTimelineEntry) { + *out = *in + in.At.DeepCopyInto(&out.At) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityTimelineEntry. +func (in *SecurityTimelineEntry) DeepCopy() *SecurityTimelineEntry { + if in == nil { + return nil + } + out := new(SecurityTimelineEntry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SimilarPost) DeepCopyInto(out *SimilarPost) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SimilarPost. +func (in *SimilarPost) DeepCopy() *SimilarPost { + if in == nil { + return nil + } + out := new(SimilarPost) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Submission) DeepCopyInto(out *Submission) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Submission. +func (in *Submission) DeepCopy() *Submission { + if in == nil { + return nil + } + out := new(Submission) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Submission) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubmissionContext) DeepCopyInto(out *SubmissionContext) { + *out = *in + if in.RequestIDs != nil { + in, out := &in.RequestIDs, &out.RequestIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubmissionContext. +func (in *SubmissionContext) DeepCopy() *SubmissionContext { if in == nil { return nil } - out := new(ChangelogSource) + out := new(SubmissionContext) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeedbackSource) DeepCopyInto(out *FeedbackSource) { +func (in *SubmissionList) DeepCopyInto(out *SubmissionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Submission, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubmissionList. +func (in *SubmissionList) DeepCopy() *SubmissionList { + if in == nil { + return nil + } + out := new(SubmissionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SubmissionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubmissionReview) DeepCopyInto(out *SubmissionReview) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) in.Status.DeepCopyInto(&out.Status) - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackSource. -func (in *FeedbackSource) DeepCopy() *FeedbackSource { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubmissionReview. +func (in *SubmissionReview) DeepCopy() *SubmissionReview { if in == nil { return nil } - out := new(FeedbackSource) + out := new(SubmissionReview) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FeedbackSource) DeepCopyObject() runtime.Object { +func (in *SubmissionReview) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -55,32 +1549,31 @@ func (in *FeedbackSource) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeedbackSourceList) DeepCopyInto(out *FeedbackSourceList) { +func (in *SubmissionReviewList) DeepCopyInto(out *SubmissionReviewList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]FeedbackSource, len(*in)) + *out = make([]SubmissionReview, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackSourceList. -func (in *FeedbackSourceList) DeepCopy() *FeedbackSourceList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubmissionReviewList. +func (in *SubmissionReviewList) DeepCopy() *SubmissionReviewList { if in == nil { return nil } - out := new(FeedbackSourceList) + out := new(SubmissionReviewList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FeedbackSourceList) DeepCopyObject() runtime.Object { +func (in *SubmissionReviewList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -88,39 +1581,32 @@ func (in *FeedbackSourceList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeedbackSourceSpec) DeepCopyInto(out *FeedbackSourceSpec) { +func (in *SubmissionReviewSpec) DeepCopyInto(out *SubmissionReviewSpec) { *out = *in - in.GitHub.DeepCopyInto(&out.GitHub) - if in.StatusMapping != nil { - in, out := &in.StatusMapping, &out.StatusMapping - *out = make(map[string]PostStatus, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.CategoryMapping != nil { - in, out := &in.CategoryMapping, &out.CategoryMapping - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } + if in.ReviewedAt != nil { + in, out := &in.ReviewedAt, &out.ReviewedAt + *out = (*in).DeepCopy() } - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackSourceSpec. -func (in *FeedbackSourceSpec) DeepCopy() *FeedbackSourceSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubmissionReviewSpec. +func (in *SubmissionReviewSpec) DeepCopy() *SubmissionReviewSpec { if in == nil { return nil } - out := new(FeedbackSourceSpec) + out := new(SubmissionReviewSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FeedbackSourceStatus) DeepCopyInto(out *FeedbackSourceStatus) { +func (in *SubmissionReviewStatus) DeepCopyInto(out *SubmissionReviewStatus) { *out = *in + if in.Triage != nil { + in, out := &in.Triage, &out.Triage + *out = new(SubmissionTriage) + (*in).DeepCopyInto(*out) + } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]v1.Condition, len(*in)) @@ -128,185 +1614,292 @@ func (in *FeedbackSourceStatus) DeepCopyInto(out *FeedbackSourceStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.LastWebhookAt != nil { - in, out := &in.LastWebhookAt, &out.LastWebhookAt - *out = (*in).DeepCopy() - } - if in.LastReconcile != nil { - in, out := &in.LastReconcile, &out.LastReconcile - *out = new(ReconcileStatus) - (*in).DeepCopyInto(*out) - } - if in.RateLimit != nil { - in, out := &in.RateLimit, &out.RateLimit - *out = new(RateLimitStatus) - (*in).DeepCopyInto(*out) - } - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FeedbackSourceStatus. -func (in *FeedbackSourceStatus) DeepCopy() *FeedbackSourceStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubmissionReviewStatus. +func (in *SubmissionReviewStatus) DeepCopy() *SubmissionReviewStatus { if in == nil { return nil } - out := new(FeedbackSourceStatus) + out := new(SubmissionReviewStatus) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GitHubSource) DeepCopyInto(out *GitHubSource) { +func (in *SubmissionSpec) DeepCopyInto(out *SubmissionSpec) { *out = *in - in.Repositories.DeepCopyInto(&out.Repositories) - in.Issues.DeepCopyInto(&out.Issues) - if in.Project != nil { - in, out := &in.Project, &out.Project - *out = new(ProjectRef) - **out = **in + out.UserRef = in.UserRef + if in.Attachments != nil { + in, out := &in.Attachments, &out.Attachments + *out = make([]AttachmentReference, len(*in)) + copy(*out, *in) } - if in.Milestones != nil { - in, out := &in.Milestones, &out.Milestones - *out = new(MilestoneSource) - **out = **in + in.Context.DeepCopyInto(&out.Context) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubmissionSpec. +func (in *SubmissionSpec) DeepCopy() *SubmissionSpec { + if in == nil { + return nil } - if in.Changelog != nil { - in, out := &in.Changelog, &out.Changelog - *out = new(ChangelogSource) + out := new(SubmissionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubmissionStatus) DeepCopyInto(out *SubmissionStatus) { + *out = *in + if in.PostRef != nil { + in, out := &in.PostRef, &out.PostRef + *out = new(PostReference) **out = **in } - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitHubSource. -func (in *GitHubSource) DeepCopy() *GitHubSource { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubmissionStatus. +func (in *SubmissionStatus) DeepCopy() *SubmissionStatus { if in == nil { return nil } - out := new(GitHubSource) + out := new(SubmissionStatus) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IssueSelector) DeepCopyInto(out *IssueSelector) { +func (in *SubmissionTriage) DeepCopyInto(out *SubmissionTriage) { *out = *in - if in.IssueTypes != nil { - in, out := &in.IssueTypes, &out.IssueTypes + if in.SuggestedCategories != nil { + in, out := &in.SuggestedCategories, &out.SuggestedCategories *out = make([]string, len(*in)) copy(*out, *in) } - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make([]string, len(*in)) + if in.SimilarPosts != nil { + in, out := &in.SimilarPosts, &out.SimilarPosts + *out = make([]SimilarPost, len(*in)) copy(*out, *in) } - if in.ExcludeLabels != nil { - in, out := &in.ExcludeLabels, &out.ExcludeLabels - *out = make([]string, len(*in)) - copy(*out, *in) + if in.DraftIssue != nil { + in, out := &in.DraftIssue, &out.DraftIssue + *out = new(DraftIssue) + **out = **in } - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IssueSelector. -func (in *IssueSelector) DeepCopy() *IssueSelector { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubmissionTriage. +func (in *SubmissionTriage) DeepCopy() *SubmissionTriage { if in == nil { return nil } - out := new(IssueSelector) + out := new(SubmissionTriage) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MilestoneSource) DeepCopyInto(out *MilestoneSource) { +func (in *Subscription) DeepCopyInto(out *Subscription) { *out = *in - return + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MilestoneSource. -func (in *MilestoneSource) DeepCopy() *MilestoneSource { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subscription. +func (in *Subscription) DeepCopy() *Subscription { if in == nil { return nil } - out := new(MilestoneSource) + out := new(Subscription) in.DeepCopyInto(out) return out } +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Subscription) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectRef) DeepCopyInto(out *ProjectRef) { +func (in *SubscriptionList) DeepCopyInto(out *SubscriptionList) { *out = *in - return + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Subscription, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectRef. -func (in *ProjectRef) DeepCopy() *ProjectRef { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionList. +func (in *SubscriptionList) DeepCopy() *SubscriptionList { if in == nil { return nil } - out := new(ProjectRef) + out := new(SubscriptionList) in.DeepCopyInto(out) return out } +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SubscriptionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RateLimitStatus) DeepCopyInto(out *RateLimitStatus) { +func (in *SubscriptionSpec) DeepCopyInto(out *SubscriptionSpec) { *out = *in - in.ResetAt.DeepCopyInto(&out.ResetAt) - return + out.PostRef = in.PostRef + out.UserRef = in.UserRef } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitStatus. -func (in *RateLimitStatus) DeepCopy() *RateLimitStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionSpec. +func (in *SubscriptionSpec) DeepCopy() *SubscriptionSpec { if in == nil { return nil } - out := new(RateLimitStatus) + out := new(SubscriptionSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReconcileStatus) DeepCopyInto(out *ReconcileStatus) { +func (in *UserReference) DeepCopyInto(out *UserReference) { *out = *in - in.CompletedAt.DeepCopyInto(&out.CompletedAt) - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReconcileStatus. -func (in *ReconcileStatus) DeepCopy() *ReconcileStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserReference. +func (in *UserReference) DeepCopy() *UserReference { if in == nil { return nil } - out := new(ReconcileStatus) + out := new(UserReference) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RepositorySelector) DeepCopyInto(out *RepositorySelector) { +func (in *Vote) DeepCopyInto(out *Vote) { *out = *in - if in.Include != nil { - in, out := &in.Include, &out.Include + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Vote. +func (in *Vote) DeepCopy() *Vote { + if in == nil { + return nil + } + out := new(Vote) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Vote) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VoteList) DeepCopyInto(out *VoteList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Vote, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VoteList. +func (in *VoteList) DeepCopy() *VoteList { + if in == nil { + return nil + } + out := new(VoteList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *VoteList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VoteSpec) DeepCopyInto(out *VoteSpec) { + *out = *in + out.PostRef = in.PostRef + out.UserRef = in.UserRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VoteSpec. +func (in *VoteSpec) DeepCopy() *VoteSpec { + if in == nil { + return nil + } + out := new(VoteSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VoteStatus) DeepCopyInto(out *VoteStatus) { + *out = *in + if in.Organizations != nil { + in, out := &in.Organizations, &out.Organizations *out = make([]string, len(*in)) copy(*out, *in) } - if in.Exclude != nil { - in, out := &in.Exclude, &out.Exclude - *out = make([]string, len(*in)) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VoteStatus. +func (in *VoteStatus) DeepCopy() *VoteStatus { + if in == nil { + return nil + } + out := new(VoteStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkItem) DeepCopyInto(out *WorkItem) { + *out = *in + if in.PullRequests != nil { + in, out := &in.PullRequests, &out.PullRequests + *out = make([]PullRequestRef, len(*in)) copy(*out, *in) } - return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepositorySelector. -func (in *RepositorySelector) DeepCopy() *RepositorySelector { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkItem. +func (in *WorkItem) DeepCopy() *WorkItem { if in == nil { return nil } - out := new(RepositorySelector) + out := new(WorkItem) in.DeepCopyInto(out) return out } diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go deleted file mode 100644 index d065c70..0000000 --- a/pkg/generated/clientset/versioned/clientset.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package versioned - -import ( - fmt "fmt" - http "net/http" - - feedbackv1alpha1 "go.miloapis.com/feedback/pkg/generated/clientset/versioned/typed/feedback/v1alpha1" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" -) - -type Interface interface { - Discovery() discovery.DiscoveryInterfaces - FeedbackV1alpha1() feedbackv1alpha1.FeedbackV1alpha1Interface -} - -// Clientset contains the clients for groups. -type Clientset struct { - *discovery.DiscoveryClient - feedbackV1alpha1 *feedbackv1alpha1.FeedbackV1alpha1Client -} - -// FeedbackV1alpha1 retrieves the FeedbackV1alpha1Client -func (c *Clientset) FeedbackV1alpha1() feedbackv1alpha1.FeedbackV1alpha1Interface { - return c.feedbackV1alpha1 -} - -// Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterfaces { - if c == nil { - return nil - } - return c.DiscoveryClient -} - -// NewForConfig creates a new Clientset for the given config. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfig will generate a rate-limiter in configShallowCopy. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*Clientset, error) { - configShallowCopy := *c - - if configShallowCopy.UserAgent == "" { - configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() - } - - // share the transport between all clients - httpClient, err := rest.HTTPClientFor(&configShallowCopy) - if err != nil { - return nil, err - } - - return NewForConfigAndClient(&configShallowCopy, httpClient) -} - -// NewForConfigAndClient creates a new Clientset for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -// If config's RateLimiter is not set and QPS and Burst are acceptable, -// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. -func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { - configShallowCopy := *c - if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { - if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") - } - configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) - } - - var cs Clientset - var err error - cs.feedbackV1alpha1, err = feedbackv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - - cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) - if err != nil { - return nil, err - } - return &cs, nil -} - -// NewForConfigOrDie creates a new Clientset for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *Clientset { - cs, err := NewForConfig(c) - if err != nil { - panic(err) - } - return cs -} - -// New creates a new Clientset for the given RESTClient. -func New(c rest.Interface) *Clientset { - var cs Clientset - cs.feedbackV1alpha1 = feedbackv1alpha1.New(c) - - cs.DiscoveryClient = discovery.NewDiscoveryClient(c) - return &cs -} diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go deleted file mode 100644 index 73c5fa1..0000000 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - clientset "go.miloapis.com/feedback/pkg/generated/clientset/versioned" - feedbackv1alpha1 "go.miloapis.com/feedback/pkg/generated/clientset/versioned/typed/feedback/v1alpha1" - fakefeedbackv1alpha1 "go.miloapis.com/feedback/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/fake" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "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" -) - -// NewSimpleClientset returns a clientset that will respond with the provided objects. -// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement -// for a real clientset and is mostly useful in simple unit tests. -func NewSimpleClientset(objects ...runtime.Object) *Clientset { - o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) - for _, obj := range objects { - if err := o.Add(obj); err != nil { - panic(err) - } - } - - cs := &Clientset{tracker: o} - cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} - cs.AddReactor("*", "*", testing.ObjectReaction(o)) - cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { - var opts metav1.ListOptions - if watchAction, ok := action.(testing.WatchActionImpl); ok { - opts = watchAction.ListOptions - } - gvr := action.GetResource() - ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns, opts) - if err != nil { - return false, nil, err - } - return true, watch, nil - }) - - return cs -} - -// Clientset implements clientset.Interface. Meant to be embedded into a -// struct to get a default implementation. This makes faking out just the method -// you want to test easier. -type Clientset struct { - testing.Fake - discovery *fakediscovery.FakeDiscovery - tracker testing.ObjectTracker -} - -func (c *Clientset) Discovery() discovery.DiscoveryInterfaces { - return c.discovery -} - -func (c *Clientset) Tracker() testing.ObjectTracker { - return c.tracker -} - -// IsWatchListSemanticsUnSupported informs the reflector that this client -// doesn't support WatchList semantics. -// -// This is a synthetic method whose sole purpose is to satisfy the optional -// interface check performed by the reflector. -// Returning true signals that WatchList can NOT be used. -// No additional logic is implemented here. -func (c *Clientset) IsWatchListSemanticsUnSupported() bool { - return true -} - -var ( - _ clientset.Interface = &Clientset{} - _ testing.FakeClient = &Clientset{} -) - -// FeedbackV1alpha1 retrieves the FeedbackV1alpha1Client -func (c *Clientset) FeedbackV1alpha1() feedbackv1alpha1.FeedbackV1alpha1Interface { - return &fakefeedbackv1alpha1.FakeFeedbackV1alpha1{Fake: &c.Fake} -} diff --git a/pkg/generated/clientset/versioned/fake/doc.go b/pkg/generated/clientset/versioned/fake/doc.go deleted file mode 100644 index 3630ed1..0000000 --- a/pkg/generated/clientset/versioned/fake/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated fake clientset. -package fake diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go deleted file mode 100644 index 0993bec..0000000 --- a/pkg/generated/clientset/versioned/fake/register.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - feedbackv1alpha1 "go.miloapis.com/feedback/pkg/apis/feedback/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" -) - -var scheme = runtime.NewScheme() -var codecs = serializer.NewCodecFactory(scheme) - -var localSchemeBuilder = runtime.SchemeBuilder{ - feedbackv1alpha1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(scheme)) -} diff --git a/pkg/generated/clientset/versioned/scheme/doc.go b/pkg/generated/clientset/versioned/scheme/doc.go deleted file mode 100644 index 14db57a..0000000 --- a/pkg/generated/clientset/versioned/scheme/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package contains the scheme of the automatically generated clientset. -package scheme diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go deleted file mode 100644 index 6281629..0000000 --- a/pkg/generated/clientset/versioned/scheme/register.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package scheme - -import ( - feedbackv1alpha1 "go.miloapis.com/feedback/pkg/apis/feedback/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" -) - -var Scheme = runtime.NewScheme() -var Codecs = serializer.NewCodecFactory(Scheme) -var ParameterCodec = runtime.NewParameterCodec(Scheme) -var localSchemeBuilder = runtime.SchemeBuilder{ - feedbackv1alpha1.AddToScheme, -} - -// AddToScheme adds all types of this clientset into the given scheme. This allows composition -// of clientsets, like in: -// -// import ( -// "k8s.io/client-go/kubernetes" -// clientsetscheme "k8s.io/client-go/kubernetes/scheme" -// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" -// ) -// -// kclientset, _ := kubernetes.NewForConfig(c) -// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) -// -// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types -// correctly. -var AddToScheme = localSchemeBuilder.AddToScheme - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - utilruntime.Must(AddToScheme(Scheme)) -} diff --git a/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/doc.go b/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/doc.go deleted file mode 100644 index 93a7ca4..0000000 --- a/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// This package has the automatically generated typed clients. -package v1alpha1 diff --git a/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/fake/doc.go b/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/fake/doc.go deleted file mode 100644 index 2b5ba4c..0000000 --- a/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/fake/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -// Package fake has the automatically generated clients. -package fake diff --git a/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/fake/fake_feedback_client.go b/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/fake/fake_feedback_client.go deleted file mode 100644 index 68ed475..0000000 --- a/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/fake/fake_feedback_client.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "go.miloapis.com/feedback/pkg/generated/clientset/versioned/typed/feedback/v1alpha1" - rest "k8s.io/client-go/rest" - testing "k8s.io/client-go/testing" -) - -type FakeFeedbackV1alpha1 struct { - *testing.Fake -} - -func (c *FakeFeedbackV1alpha1) FeedbackSources() v1alpha1.FeedbackSourceInterface { - return newFakeFeedbackSources(c) -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FakeFeedbackV1alpha1) RESTClient() rest.Interface { - var ret *rest.RESTClient - return ret -} diff --git a/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/fake/fake_feedbacksource.go b/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/fake/fake_feedbacksource.go deleted file mode 100644 index 320dcf1..0000000 --- a/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/fake/fake_feedbacksource.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - v1alpha1 "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1" - feedbackv1alpha1 "go.miloapis.com/feedback/pkg/generated/clientset/versioned/typed/feedback/v1alpha1" - gentype "k8s.io/client-go/gentype" -) - -// fakeFeedbackSources implements FeedbackSourceInterface -type fakeFeedbackSources struct { - *gentype.FakeClientWithList[*v1alpha1.FeedbackSource, *v1alpha1.FeedbackSourceList] - Fake *FakeFeedbackV1alpha1 -} - -func newFakeFeedbackSources(fake *FakeFeedbackV1alpha1) feedbackv1alpha1.FeedbackSourceInterface { - return &fakeFeedbackSources{ - gentype.NewFakeClientWithList[*v1alpha1.FeedbackSource, *v1alpha1.FeedbackSourceList]( - fake.Fake, - "", - v1alpha1.SchemeGroupVersion.WithResource("feedbacksources"), - v1alpha1.SchemeGroupVersion.WithKind("FeedbackSource"), - func() *v1alpha1.FeedbackSource { return &v1alpha1.FeedbackSource{} }, - func() *v1alpha1.FeedbackSourceList { return &v1alpha1.FeedbackSourceList{} }, - func(dst, src *v1alpha1.FeedbackSourceList) { dst.ListMeta = src.ListMeta }, - func(list *v1alpha1.FeedbackSourceList) []*v1alpha1.FeedbackSource { - return gentype.ToPointerSlice(list.Items) - }, - func(list *v1alpha1.FeedbackSourceList, items []*v1alpha1.FeedbackSource) { - list.Items = gentype.FromPointerSlice(items) - }, - ), - fake, - } -} diff --git a/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/feedback_client.go b/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/feedback_client.go deleted file mode 100644 index e162ed6..0000000 --- a/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/feedback_client.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - http "net/http" - - feedbackv1alpha1 "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1" - scheme "go.miloapis.com/feedback/pkg/generated/clientset/versioned/scheme" - rest "k8s.io/client-go/rest" -) - -type FeedbackV1alpha1Interface interface { - RESTClient() rest.Interface - FeedbackSourcesGetter -} - -// FeedbackV1alpha1Client is used to interact with features provided by the feedback.miloapis.com group. -type FeedbackV1alpha1Client struct { - restClient rest.Interface -} - -func (c *FeedbackV1alpha1Client) FeedbackSources() FeedbackSourceInterface { - return newFeedbackSources(c) -} - -// NewForConfig creates a new FeedbackV1alpha1Client for the given config. -// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), -// where httpClient was generated with rest.HTTPClientFor(c). -func NewForConfig(c *rest.Config) (*FeedbackV1alpha1Client, error) { - config := *c - setConfigDefaults(&config) - httpClient, err := rest.HTTPClientFor(&config) - if err != nil { - return nil, err - } - return NewForConfigAndClient(&config, httpClient) -} - -// NewForConfigAndClient creates a new FeedbackV1alpha1Client for the given config and http client. -// Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FeedbackV1alpha1Client, error) { - config := *c - setConfigDefaults(&config) - client, err := rest.RESTClientForConfigAndClient(&config, h) - if err != nil { - return nil, err - } - return &FeedbackV1alpha1Client{client}, nil -} - -// NewForConfigOrDie creates a new FeedbackV1alpha1Client for the given config and -// panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *FeedbackV1alpha1Client { - client, err := NewForConfig(c) - if err != nil { - panic(err) - } - return client -} - -// New creates a new FeedbackV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *FeedbackV1alpha1Client { - return &FeedbackV1alpha1Client{c} -} - -func setConfigDefaults(config *rest.Config) { - gv := feedbackv1alpha1.SchemeGroupVersion - config.GroupVersion = &gv - config.APIPath = "/apis" - config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() - - if config.UserAgent == "" { - config.UserAgent = rest.DefaultKubernetesUserAgent() - } -} - -// RESTClient returns a RESTClient that is used to communicate -// with API server by this client implementation. -func (c *FeedbackV1alpha1Client) RESTClient() rest.Interface { - if c == nil { - return nil - } - return c.restClient -} diff --git a/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/feedbacksource.go b/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/feedbacksource.go deleted file mode 100644 index c2bf238..0000000 --- a/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/feedbacksource.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -import ( - context "context" - - feedbackv1alpha1 "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1" - scheme "go.miloapis.com/feedback/pkg/generated/clientset/versioned/scheme" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - gentype "k8s.io/client-go/gentype" -) - -// FeedbackSourcesGetter has a method to return a FeedbackSourceInterface. -// A group's client should implement this interface. -type FeedbackSourcesGetter interface { - FeedbackSources() FeedbackSourceInterface -} - -// FeedbackSourceInterface has methods to work with FeedbackSource resources. -type FeedbackSourceInterface interface { - Create(ctx context.Context, feedbackSource *feedbackv1alpha1.FeedbackSource, opts v1.CreateOptions) (*feedbackv1alpha1.FeedbackSource, error) - Update(ctx context.Context, feedbackSource *feedbackv1alpha1.FeedbackSource, opts v1.UpdateOptions) (*feedbackv1alpha1.FeedbackSource, error) - // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, feedbackSource *feedbackv1alpha1.FeedbackSource, opts v1.UpdateOptions) (*feedbackv1alpha1.FeedbackSource, 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) (*feedbackv1alpha1.FeedbackSource, error) - List(ctx context.Context, opts v1.ListOptions) (*feedbackv1alpha1.FeedbackSourceList, 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 *feedbackv1alpha1.FeedbackSource, err error) - FeedbackSourceExpansion -} - -// feedbackSources implements FeedbackSourceInterface -type feedbackSources struct { - *gentype.ClientWithList[*feedbackv1alpha1.FeedbackSource, *feedbackv1alpha1.FeedbackSourceList] -} - -// newFeedbackSources returns a FeedbackSources -func newFeedbackSources(c *FeedbackV1alpha1Client) *feedbackSources { - return &feedbackSources{ - gentype.NewClientWithList[*feedbackv1alpha1.FeedbackSource, *feedbackv1alpha1.FeedbackSourceList]( - "feedbacksources", - c.RESTClient(), - scheme.ParameterCodec, - "", - func() *feedbackv1alpha1.FeedbackSource { return &feedbackv1alpha1.FeedbackSource{} }, - func() *feedbackv1alpha1.FeedbackSourceList { return &feedbackv1alpha1.FeedbackSourceList{} }, - ), - } -} diff --git a/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/generated_expansion.go deleted file mode 100644 index 283e63b..0000000 --- a/pkg/generated/clientset/versioned/typed/feedback/v1alpha1/generated_expansion.go +++ /dev/null @@ -1,5 +0,0 @@ -// Code generated by client-gen. DO NOT EDIT. - -package v1alpha1 - -type FeedbackSourceExpansion interface{} diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go deleted file mode 100644 index 548a139..0000000 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ /dev/null @@ -1,3290 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -// Code generated by openapi-gen. DO NOT EDIT. - -package openapi - -import ( - resource "k8s.io/apimachinery/pkg/api/resource" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - version "k8s.io/apimachinery/pkg/version" - common "k8s.io/kube-openapi/pkg/common" - spec "k8s.io/kube-openapi/pkg/validation/spec" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - return map[string]common.OpenAPIDefinition{ - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.ChangelogSource": schema_pkg_apis_feedback_v1alpha1_ChangelogSource(ref), - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.FeedbackSource": schema_pkg_apis_feedback_v1alpha1_FeedbackSource(ref), - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.FeedbackSourceList": schema_pkg_apis_feedback_v1alpha1_FeedbackSourceList(ref), - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.FeedbackSourceSpec": schema_pkg_apis_feedback_v1alpha1_FeedbackSourceSpec(ref), - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.FeedbackSourceStatus": schema_pkg_apis_feedback_v1alpha1_FeedbackSourceStatus(ref), - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.GitHubSource": schema_pkg_apis_feedback_v1alpha1_GitHubSource(ref), - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.IssueSelector": schema_pkg_apis_feedback_v1alpha1_IssueSelector(ref), - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.MilestoneSource": schema_pkg_apis_feedback_v1alpha1_MilestoneSource(ref), - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.ProjectRef": schema_pkg_apis_feedback_v1alpha1_ProjectRef(ref), - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.RateLimitStatus": schema_pkg_apis_feedback_v1alpha1_RateLimitStatus(ref), - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.ReconcileStatus": schema_pkg_apis_feedback_v1alpha1_ReconcileStatus(ref), - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.RepositorySelector": schema_pkg_apis_feedback_v1alpha1_RepositorySelector(ref), - resource.Quantity{}.OpenAPIModelName(): schema_apimachinery_pkg_api_resource_Quantity(ref), - v1.APIGroup{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_APIGroup(ref), - v1.APIGroupList{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_APIGroupList(ref), - v1.APIResource{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_APIResource(ref), - v1.APIResourceList{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_APIResourceList(ref), - v1.APIVersions{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_APIVersions(ref), - v1.ApplyOptions{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_ApplyOptions(ref), - v1.Condition{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_Condition(ref), - v1.CreateOptions{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_CreateOptions(ref), - v1.DeleteOptions{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_DeleteOptions(ref), - v1.Duration{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_Duration(ref), - v1.FieldSelectorRequirement{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref), - v1.FieldsV1{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_FieldsV1(ref), - v1.GetOptions{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_GetOptions(ref), - v1.GroupKind{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_GroupKind(ref), - v1.GroupResource{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_GroupResource(ref), - v1.GroupVersion{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_GroupVersion(ref), - v1.GroupVersionForDiscovery{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref), - v1.GroupVersionKind{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_GroupVersionKind(ref), - v1.GroupVersionResource{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_GroupVersionResource(ref), - v1.InternalEvent{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_InternalEvent(ref), - v1.LabelSelector{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_LabelSelector(ref), - v1.LabelSelectorRequirement{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref), - v1.List{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_List(ref), - v1.ListMeta{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_ListMeta(ref), - v1.ListOptions{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_ListOptions(ref), - v1.ManagedFieldsEntry{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref), - v1.MicroTime{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_MicroTime(ref), - v1.ObjectMeta{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_ObjectMeta(ref), - v1.OwnerReference{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_OwnerReference(ref), - v1.PartialObjectMetadata{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_PartialObjectMetadata(ref), - v1.PartialObjectMetadataList{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref), - v1.Patch{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_Patch(ref), - v1.PatchOptions{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_PatchOptions(ref), - v1.Preconditions{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_Preconditions(ref), - v1.RootPaths{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_RootPaths(ref), - v1.ServerAddressByClientCIDR{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref), - v1.ShardInfo{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_ShardInfo(ref), - v1.Status{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_Status(ref), - v1.StatusCause{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_StatusCause(ref), - v1.StatusDetails{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_StatusDetails(ref), - v1.Table{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_Table(ref), - v1.TableColumnDefinition{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_TableColumnDefinition(ref), - v1.TableOptions{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_TableOptions(ref), - v1.TableRow{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_TableRow(ref), - v1.TableRowCondition{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_TableRowCondition(ref), - v1.Time{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_Time(ref), - v1.Timestamp{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_Timestamp(ref), - v1.TypeMeta{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_TypeMeta(ref), - v1.UpdateOptions{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_UpdateOptions(ref), - v1.WatchEvent{}.OpenAPIModelName(): schema_pkg_apis_meta_v1_WatchEvent(ref), - runtime.RawExtension{}.OpenAPIModelName(): schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref), - runtime.TypeMeta{}.OpenAPIModelName(): schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref), - runtime.Unknown{}.OpenAPIModelName(): schema_k8sio_apimachinery_pkg_runtime_Unknown(ref), - version.Info{}.OpenAPIModelName(): schema_k8sio_apimachinery_pkg_version_Info(ref), - } -} - -func schema_pkg_apis_feedback_v1alpha1_ChangelogSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ChangelogSource is the discussion category that becomes changelog entries.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "repository": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "discussionCategory": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"repository", "discussionCategory"}, - }, - }, - } -} - -func schema_pkg_apis_feedback_v1alpha1_FeedbackSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FeedbackSource configures what the feedback service syncs from one GitHub organization and how GitHub fields map onto posts. There is one per org.\n\nFeedbackSource is a Platform resource stored in etcd.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ObjectMeta{}.OpenAPIModelName()), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.FeedbackSourceSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref("go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.FeedbackSourceStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.FeedbackSourceSpec", "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.FeedbackSourceStatus", v1.ObjectMeta{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_feedback_v1alpha1_FeedbackSourceList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FeedbackSourceList is a list of FeedbackSource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Default: map[string]interface{}{}, - Ref: ref(v1.ListMeta{}.OpenAPIModelName()), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.FeedbackSource"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.FeedbackSource", v1.ListMeta{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_feedback_v1alpha1_FeedbackSourceSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FeedbackSourceSpec defines what to sync and how to map it.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "github": { - SchemaProps: spec.SchemaProps{ - Description: "GitHub configures the GitHub organization this source syncs.", - Default: map[string]interface{}{}, - Ref: ref("go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.GitHubSource"), - }, - }, - "statusMapping": { - SchemaProps: spec.SchemaProps{ - Description: "StatusMapping maps Enhancements project Status option names to post statuses. The empty key matches items with no Status set.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "categoryMapping": { - SchemaProps: spec.SchemaProps{ - Description: "CategoryMapping maps GitHub label names to post categories.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"github"}, - }, - }, - Dependencies: []string{ - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.GitHubSource"}, - } -} - -func schema_pkg_apis_feedback_v1alpha1_FeedbackSourceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FeedbackSourceStatus reports sync health for the source.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "type", - }, - "x-kubernetes-list-type": "map", - }, - }, - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.Condition{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - "lastWebhookAt": { - SchemaProps: spec.SchemaProps{ - Description: "LastWebhookAt is when the last webhook for this source was processed.", - Ref: ref(v1.Time{}.OpenAPIModelName()), - }, - }, - "lastReconcile": { - SchemaProps: spec.SchemaProps{ - Description: "LastReconcile describes the last completed reconcile.", - Ref: ref("go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.ReconcileStatus"), - }, - }, - "rateLimit": { - SchemaProps: spec.SchemaProps{ - Description: "RateLimit is the GitHub rate limit for this installation.", - Ref: ref("go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.RateLimitStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.RateLimitStatus", "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.ReconcileStatus", v1.Condition{}.OpenAPIModelName(), v1.Time{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_feedback_v1alpha1_GitHubSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GitHubSource identifies a GitHub organization and the content to sync from it.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "org": { - SchemaProps: spec.SchemaProps{ - Description: "Org is the GitHub organization login.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "installationID": { - SchemaProps: spec.SchemaProps{ - Description: "InstallationID is the GitHub App installation ID for Org.", - Default: 0, - Type: []string{"integer"}, - Format: "int64", - }, - }, - "repositories": { - SchemaProps: spec.SchemaProps{ - Description: "Repositories selects which public repositories are synced. Private repositories are always skipped.", - Default: map[string]interface{}{}, - Ref: ref("go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.RepositorySelector"), - }, - }, - "issues": { - SchemaProps: spec.SchemaProps{ - Description: "Issues selects which issues become posts. An issue is included when it matches any issue type or label, and is not excluded.", - Default: map[string]interface{}{}, - Ref: ref("go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.IssueSelector"), - }, - }, - "project": { - SchemaProps: spec.SchemaProps{ - Description: "Project is the GitHub project that provides status and receives vote totals.", - Ref: ref("go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.ProjectRef"), - }, - }, - "milestones": { - SchemaProps: spec.SchemaProps{ - Description: "Milestones configures the repository whose milestones become releases.", - Ref: ref("go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.MilestoneSource"), - }, - }, - "changelog": { - SchemaProps: spec.SchemaProps{ - Description: "Changelog configures the discussion category that becomes changelog entries.", - Ref: ref("go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.ChangelogSource"), - }, - }, - }, - Required: []string{"org", "installationID"}, - }, - }, - Dependencies: []string{ - "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.ChangelogSource", "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.IssueSelector", "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.MilestoneSource", "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.ProjectRef", "go.miloapis.com/feedback/pkg/apis/feedback/v1alpha1.RepositorySelector"}, - } -} - -func schema_pkg_apis_feedback_v1alpha1_IssueSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "IssueSelector selects issues by type and label.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "issueTypes": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "set", - }, - }, - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "labels": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "set", - }, - }, - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "excludeLabels": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "set", - }, - }, - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_feedback_v1alpha1_MilestoneSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MilestoneSource is the repository whose milestones become releases.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "repository": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"repository"}, - }, - }, - } -} - -func schema_pkg_apis_feedback_v1alpha1_ProjectRef(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ProjectRef identifies a GitHub ProjectV2 and the fields the service uses.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "owner": { - SchemaProps: spec.SchemaProps{ - Description: "Owner is the org that owns the project.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "number": { - SchemaProps: spec.SchemaProps{ - Description: "Number is the project number.", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - "statusField": { - SchemaProps: spec.SchemaProps{ - Description: "StatusField is the single-select field that holds item status.", - Type: []string{"string"}, - Format: "", - }, - }, - "votesField": { - SchemaProps: spec.SchemaProps{ - Description: "VotesField is the number field the service writes vote totals to.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"owner", "number"}, - }, - }, - } -} - -func schema_pkg_apis_feedback_v1alpha1_RateLimitStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RateLimitStatus is a snapshot of the GitHub rate limit.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "remaining": { - SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - "resetAt": { - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.Time{}.OpenAPIModelName()), - }, - }, - }, - Required: []string{"remaining", "resetAt"}, - }, - }, - Dependencies: []string{ - v1.Time{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_feedback_v1alpha1_ReconcileStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReconcileStatus describes a completed reconcile.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "completedAt": { - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.Time{}.OpenAPIModelName()), - }, - }, - "postsSynced": { - SchemaProps: spec.SchemaProps{ - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"completedAt"}, - }, - }, - Dependencies: []string{ - v1.Time{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_feedback_v1alpha1_RepositorySelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RepositorySelector includes and excludes repositories by name or glob.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "include": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "set", - }, - }, - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "exclude": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "set", - }, - }, - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - } -} - -func schema_apimachinery_pkg_api_resource_Quantity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.EmbedOpenAPIDefinitionIntoV2Extension(common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n``` ::= \n\n\t(Note that may be empty, from the \"\" case in .)\n\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n\n\t(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\n ::= m | \"\" | k | M | G | T | P | E\n\n\t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\n ::= \"e\" | \"E\" ```\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n\n- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.\n\nThe sign will be omitted unless the number is negative.\n\nExamples:\n\n- 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.", - OneOf: common.GenerateOpenAPIV3OneOfSchema(resource.Quantity{}.OpenAPIV3OneOfTypes()), - Format: resource.Quantity{}.OpenAPISchemaFormat(), - }, - }, - }, common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Quantity is a fixed-point representation of a number. It provides convenient marshaling/unmarshaling in JSON and YAML, in addition to String() and AsInt64() accessors.\n\nThe serialization format is:\n\n``` ::= \n\n\t(Note that may be empty, from the \"\" case in .)\n\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n\n\t(International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\n ::= m | \"\" | k | M | G | T | P | E\n\n\t(Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\n ::= \"e\" | \"E\" ```\n\nNo matter which of the three exponent forms is used, no quantity may represent a number greater than 2^63-1 in magnitude, nor may it have more than 3 decimal places. Numbers larger or more precise will be capped or rounded up. (E.g.: 0.1m will rounded up to 1m.) This may be extended in the future if we require larger or smaller quantities.\n\nWhen a Quantity is parsed from a string, it will remember the type of suffix it had, and will use the same type again when it is serialized.\n\nBefore serializing, Quantity will be put in \"canonical form\". This means that Exponent/suffix will be adjusted up or down (with a corresponding increase or decrease in Mantissa) such that:\n\n- No precision is lost - No fractional digits will be emitted - The exponent (or suffix) is as large as possible.\n\nThe sign will be omitted unless the number is negative.\n\nExamples:\n\n- 1.5 will be serialized as \"1500m\" - 1.5Gi will be serialized as \"1536Mi\"\n\nNote that the quantity will NEVER be internally represented by a floating point number. That is the whole point of this exercise.\n\nNon-canonical values will still parse as long as they are well formed, but will be re-emitted in their canonical form. (So always use canonical form, or don't diff.)\n\nThis format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.", - Type: resource.Quantity{}.OpenAPISchemaType(), - Format: resource.Quantity{}.OpenAPISchemaFormat(), - }, - }, - }) -} - -func schema_apimachinery_pkg_api_resource_int64Amount(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "int64Amount represents a fixed precision numerator and arbitrary scale exponent. It is faster than operations on inf.Dec for values that can be represented as int64.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "value": { - SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int64", - }, - }, - "scale": { - SchemaProps: spec.SchemaProps{ - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"value", "scale"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_APIGroup(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIGroup contains the name, the supported versions, and the preferred version of a group.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name is the name of the group.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "versions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "versions are the versions supported in this group.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.GroupVersionForDiscovery{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - "preferredVersion": { - SchemaProps: spec.SchemaProps{ - Description: "preferredVersion is the version preferred by the API server, which probably is the storage version.", - Default: map[string]interface{}{}, - Ref: ref(v1.GroupVersionForDiscovery{}.OpenAPIModelName()), - }, - }, - "serverAddressByClientCIDRs": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.ServerAddressByClientCIDR{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - }, - Required: []string{"name", "versions"}, - }, - }, - Dependencies: []string{ - v1.GroupVersionForDiscovery{}.OpenAPIModelName(), v1.ServerAddressByClientCIDR{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_APIGroupList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "groups": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "groups is a list of APIGroup.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.APIGroup{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - }, - Required: []string{"groups"}, - }, - }, - Dependencies: []string{ - v1.APIGroup{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_APIResource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIResource specifies the name of a resource and whether it is namespaced.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name is the plural name of the resource.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "singularName": { - SchemaProps: spec.SchemaProps{ - Description: "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "namespaced": { - SchemaProps: spec.SchemaProps{ - Description: "namespaced indicates if a resource is namespaced or not.", - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, - "group": { - SchemaProps: spec.SchemaProps{ - Description: "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Description: "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "verbs": { - SchemaProps: spec.SchemaProps{ - Description: "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "shortNames": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "shortNames is a list of suggested short names of the resource.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "categories": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "categories is a list of the grouped resources this resource belongs to (e.g. 'all')", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "storageVersionHash": { - SchemaProps: spec.SchemaProps{ - Description: "The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "singularName", "namespaced", "kind", "verbs"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_APIResourceList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "groupVersion": { - SchemaProps: spec.SchemaProps{ - Description: "groupVersion is the group and version this APIResourceList is for.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "resources": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "resources contains the name of the resources and if they are namespaced.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.APIResource{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - }, - Required: []string{"groupVersion", "resources"}, - }, - }, - Dependencies: []string{ - v1.APIResource{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_APIVersions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "versions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "versions are the api versions that are available.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "serverAddressByClientCIDRs": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.ServerAddressByClientCIDR{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - }, - Required: []string{"versions", "serverAddressByClientCIDRs"}, - }, - }, - Dependencies: []string{ - v1.ServerAddressByClientCIDR{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_ApplyOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ApplyOptions may be provided when applying an API object. FieldManager is required for apply requests. ApplyOptions is equivalent to PatchOptions. It is provided as a convenience with documentation that speaks specifically to how the options fields relate to apply.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "force": { - SchemaProps: spec.SchemaProps{ - Description: "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people.", - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"force", "fieldManager"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Condition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Condition contains details for one aspect of the current state of this API Resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "type of condition in CamelCase or in foo.example.com/CamelCase.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "status of the condition, one of True, False, Unknown.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "observedGeneration": { - SchemaProps: spec.SchemaProps{ - Description: "observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Description: "lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.", - Ref: ref(v1.Time{}.OpenAPIModelName()), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "message is a human readable message indicating details about the transition. This may be an empty string.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status", "lastTransitionTime", "reason", "message"}, - }, - }, - Dependencies: []string{ - v1.Time{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_CreateOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CreateOptions may be provided when creating an API object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldValidation": { - SchemaProps: spec.SchemaProps{ - Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_DeleteOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DeleteOptions may be provided when deleting an API object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "gracePeriodSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "preconditions": { - SchemaProps: spec.SchemaProps{ - Description: "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.", - Ref: ref(v1.Preconditions{}.OpenAPIModelName()), - }, - }, - "orphanDependents": { - SchemaProps: spec.SchemaProps{ - Description: "Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "propagationPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "ignoreStoreReadErrorWithClusterBreakingPotential": { - SchemaProps: spec.SchemaProps{ - Description: "if set to true, it will trigger an unsafe deletion of the resource in case the normal deletion flow fails with a corrupt object error. A resource is considered corrupt if it can not be retrieved from the underlying storage successfully because of a) its data can not be transformed e.g. decryption failure, or b) it fails to decode into an object. NOTE: unsafe deletion ignores finalizer constraints, skips precondition checks, and removes the object from the storage. WARNING: This may potentially break the cluster if the workload associated with the resource being unsafe-deleted relies on normal deletion flow. Use only if you REALLY know what you are doing. The default value is false, and the user must opt in to enable it", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - v1.Preconditions{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_Duration(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Duration is a wrapper around time.Duration which supports correct marshaling to YAML and JSON. In particular, it marshals into strings, which can be used as map keys in json.", - Type: v1.Duration{}.OpenAPISchemaType(), - Format: v1.Duration{}.OpenAPISchemaFormat(), - }, - }, - } -} - -func schema_pkg_apis_meta_v1_FieldSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FieldSelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "key is the field selector key that the requirement applies to.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "operator": { - SchemaProps: spec.SchemaProps{ - Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. The list of operators may grow in the future.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "values": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"key", "operator"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_FieldsV1(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:', where is the name of a field in a struct, or key in a map 'v:', where is the exact json formatted value of a list item 'i:', where is position of a item in a list 'k:', where is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff", - Type: []string{"object"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GetOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GetOptions is the standard query options to the standard REST get call.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupKind(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupKind specifies a Group and a Kind, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "kind"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupResource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupResource specifies a Group and a Resource, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "resource": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "resource"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersion contains the \"group\" and the \"version\", which uniquely identifies the API.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "groupVersion": { - SchemaProps: spec.SchemaProps{ - Description: "groupVersion specifies the API group and version in the form \"group/version\"", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Description: "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"groupVersion", "version"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersionKind(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersionKind unambiguously identifies a kind. It doesn't anonymously include GroupVersion to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version", "kind"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_GroupVersionResource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GroupVersionResource unambiguously identifies a resource. It doesn't anonymously include GroupVersion to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "resource": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version", "resource"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_InternalEvent(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "InternalEvent makes watch.Event versioned", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "Type": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "Object": { - SchemaProps: spec.SchemaProps{ - Description: "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Bookmark: the object (instance of a type being watched) where\n only ResourceVersion field is set. On successful restart of watch from a\n bookmark resourceVersion, client is guaranteed to not get repeat event\n nor miss any events.\n * If Type is Error: *api.Status is recommended; other types may make sense\n depending on context.", - }, - }, - }, - Required: []string{"Type", "Object"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_LabelSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "matchLabels": { - SchemaProps: spec.SchemaProps{ - Description: "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "matchExpressions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "matchExpressions is a list of label selector requirements. The requirements are ANDed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.LabelSelectorRequirement{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - }, - }, - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-map-type": "atomic", - }, - }, - }, - Dependencies: []string{ - v1.LabelSelectorRequirement{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "key is the label key that the selector applies to.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "operator": { - SchemaProps: spec.SchemaProps{ - Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "values": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"key", "operator"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_List(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "List holds a list of objects, which may not be known by the server.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]interface{}{}, - Ref: ref(v1.ListMeta{}.OpenAPIModelName()), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of objects", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(runtime.RawExtension{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - v1.ListMeta{}.OpenAPIModelName(), runtime.RawExtension{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_ListMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "selfLink": { - SchemaProps: spec.SchemaProps{ - Description: "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", - Type: []string{"string"}, - Format: "", - }, - }, - "continue": { - SchemaProps: spec.SchemaProps{ - Description: "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.", - Type: []string{"string"}, - Format: "", - }, - }, - "remainingItemCount": { - SchemaProps: spec.SchemaProps{ - Description: "remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "shardInfo": { - SchemaProps: spec.SchemaProps{ - Description: "shardInfo is set when the list is a filtered subset of the full collection, as selected by a shard selector on the request. It echoes back the selector so clients can verify which shard they received and merge sharded responses. Clients should not cache sharded list responses as a full representation of the collection.\n\nThis is an alpha field and requires enabling the ShardedListAndWatch feature gate.", - Ref: ref(v1.ShardInfo{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - Dependencies: []string{ - v1.ShardInfo{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_ListOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ListOptions is the query options to a standard REST list call.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "labelSelector": { - SchemaProps: spec.SchemaProps{ - Description: "A selector to restrict the list of returned objects by their labels. Defaults to everything.", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldSelector": { - SchemaProps: spec.SchemaProps{ - Description: "A selector to restrict the list of returned objects by their fields. Defaults to everything.", - Type: []string{"string"}, - Format: "", - }, - }, - "watch": { - SchemaProps: spec.SchemaProps{ - Description: "Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "allowWatchBookmarks": { - SchemaProps: spec.SchemaProps{ - Description: "allowWatchBookmarks requests watch events with type \"BOOKMARK\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersionMatch": { - SchemaProps: spec.SchemaProps{ - Description: "resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", - Type: []string{"string"}, - Format: "", - }, - }, - "timeoutSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "limit": { - SchemaProps: spec.SchemaProps{ - Description: "limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.\n\nThe server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "continue": { - SchemaProps: spec.SchemaProps{ - Description: "The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.", - Type: []string{"string"}, - Format: "", - }, - }, - "sendInitialEvents": { - SchemaProps: spec.SchemaProps{ - Description: "`sendInitialEvents=true` may be set together with `watch=true`. In that case, the watch stream will begin with synthetic events to produce the current state of objects in the collection. Once all such events have been sent, a synthetic \"Bookmark\" event will be sent. The bookmark will report the ResourceVersion (RV) corresponding to the set of objects, and be marked with `\"k8s.io/initial-events-end\": \"true\"` annotation. Afterwards, the watch stream will proceed as usual, sending watch events corresponding to changes (subsequent to the RV) to objects watched.\n\nWhen `sendInitialEvents` option is set, we require `resourceVersionMatch` option to also be set. The semantic of the watch request is as following: - `resourceVersionMatch` = NotOlderThan\n is interpreted as \"data at least as new as the provided `resourceVersion`\"\n and the bookmark event is send when the state is synced\n to a `resourceVersion` at least as fresh as the one provided by the ListOptions.\n If `resourceVersion` is unset, this is interpreted as \"consistent read\" and the\n bookmark event is send when the state is synced at least to the moment\n when request started being processed.\n- `resourceVersionMatch` set to any other value or unset\n Invalid error is returned.\n\nDefaults to true if `resourceVersion=\"\"` or `resourceVersion=\"0\"` (for backward compatibility reasons) and to false otherwise.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "shardSelector": { - SchemaProps: spec.SchemaProps{ - Description: "shardSelector restricts the list of returned objects using a CEL-based shard selector expression. The format uses the shardRange() function combined with || (logical OR) to specify one or more hash ranges:\n\n shardRange(object.metadata.uid, '0x0', '0x8000000000000000')\n shardRange(object.metadata.uid, '0x0', '0x8000000000000000') || shardRange(object.metadata.uid, '0x8000000000000000', '0x10000000000000000')\n\nField paths use CEL-style object-rooted syntax (e.g. \"object.metadata.uid\"), NOT the fieldSelector format (\"metadata.uid\"). Currently supported paths:\n - object.metadata.uid\n - object.metadata.namespace\n\nhexStart and hexEnd are single-quoted CEL string literals with a '0x' prefix, defining the inclusive lower and exclusive upper bounds over the 64-bit FNV-1a hash space. The full range is [0x0, 0x10000000000000000), where the exclusive upper bound equals 2^64.\n\nExamples:\n 2-shard split:\n shard 0: shardRange(object.metadata.uid, '0x0000000000000000', '0x8000000000000000')\n shard 1: shardRange(object.metadata.uid, '0x8000000000000000', '0x10000000000000000')\n 4-shard split:\n shard 0: shardRange(object.metadata.uid, '0x0000000000000000', '0x4000000000000000')\n shard 1: shardRange(object.metadata.uid, '0x4000000000000000', '0x8000000000000000')\n shard 2: shardRange(object.metadata.uid, '0x8000000000000000', '0xc000000000000000')\n shard 3: shardRange(object.metadata.uid, '0xc000000000000000', '0x10000000000000000')\n\nThis is an alpha field and requires enabling the ShardedListAndWatch feature gate.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "manager": { - SchemaProps: spec.SchemaProps{ - Description: "Manager is an identifier of the workflow managing these fields.", - Type: []string{"string"}, - Format: "", - }, - }, - "operation": { - SchemaProps: spec.SchemaProps{ - Description: "Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the version of this resource that this field set applies to. The format is \"group/version\" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.", - Type: []string{"string"}, - Format: "", - }, - }, - "time": { - SchemaProps: spec.SchemaProps{ - Description: "Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over.", - Ref: ref(v1.Time{}.OpenAPIModelName()), - }, - }, - "fieldsType": { - SchemaProps: spec.SchemaProps{ - Description: "FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldsV1": { - SchemaProps: spec.SchemaProps{ - Description: "FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type.", - Ref: ref(v1.FieldsV1{}.OpenAPIModelName()), - }, - }, - "subresource": { - SchemaProps: spec.SchemaProps{ - Description: "Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - v1.FieldsV1{}.OpenAPIModelName(), v1.Time{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_MicroTime(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MicroTime is version of Time with microsecond level precision.", - Type: v1.MicroTime{}.OpenAPISchemaType(), - Format: v1.MicroTime{}.OpenAPISchemaFormat(), - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", - Type: []string{"string"}, - Format: "", - }, - }, - "generateName": { - SchemaProps: spec.SchemaProps{ - Description: "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces", - Type: []string{"string"}, - Format: "", - }, - }, - "selfLink": { - SchemaProps: spec.SchemaProps{ - Description: "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", - Type: []string{"string"}, - Format: "", - }, - }, - "generation": { - SchemaProps: spec.SchemaProps{ - Description: "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "creationTimestamp": { - SchemaProps: spec.SchemaProps{ - Description: "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Ref: ref(v1.Time{}.OpenAPIModelName()), - }, - }, - "deletionTimestamp": { - SchemaProps: spec.SchemaProps{ - Description: "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Ref: ref(v1.Time{}.OpenAPIModelName()), - }, - }, - "deletionGracePeriodSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "labels": { - SchemaProps: spec.SchemaProps{ - Description: "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "annotations": { - SchemaProps: spec.SchemaProps{ - Description: "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "ownerReferences": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []interface{}{ - "uid", - }, - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "uid", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.OwnerReference{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - "finalizers": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "set", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "managedFields": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.ManagedFieldsEntry{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - v1.ManagedFieldsEntry{}.OpenAPIModelName(), v1.OwnerReference{}.OpenAPIModelName(), v1.Time{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_OwnerReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "API version of the referent.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "controller": { - SchemaProps: spec.SchemaProps{ - Description: "If true, this reference points to the managing controller.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "blockOwnerDeletion": { - SchemaProps: spec.SchemaProps{ - Description: "If true, AND if the owner has the \"foregroundDeletion\" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"apiVersion", "kind", "name", "uid"}, - }, - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-map-type": "atomic", - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_PartialObjectMetadata(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PartialObjectMetadata is a generic representation of any object with ObjectMeta. It allows clients to get access to a particular ObjectMeta schema without knowing the details of the version.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]interface{}{}, - Ref: ref(v1.ObjectMeta{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - Dependencies: []string{ - v1.ObjectMeta{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PartialObjectMetadataList contains a list of objects containing only their metadata", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]interface{}{}, - Ref: ref(v1.ListMeta{}.OpenAPIModelName()), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "items contains each of the included items.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.PartialObjectMetadata{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - v1.ListMeta{}.OpenAPIModelName(), v1.PartialObjectMetadata{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_Patch(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Patch is provided to give a concrete name and type to the Kubernetes PATCH request body.", - Type: []string{"object"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_PatchOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PatchOptions may be provided when patching an API object. PatchOptions is meant to be a superset of UpdateOptions.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "force": { - SchemaProps: spec.SchemaProps{ - Description: "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldValidation": { - SchemaProps: spec.SchemaProps{ - Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Preconditions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the target UID.", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the target ResourceVersion", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_RootPaths(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RootPaths lists the paths available at root. For example: \"/healthz\", \"/apis\".", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "paths": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "paths are the paths available at root.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"paths"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "clientCIDR": { - SchemaProps: spec.SchemaProps{ - Description: "The CIDR with which clients can match their IP to figure out the server address that they should use.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "serverAddress": { - SchemaProps: spec.SchemaProps{ - Description: "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"clientCIDR", "serverAddress"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_ShardInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ShardInfo describes the shard selector that was applied to produce a list response. Its presence on a list response indicates the list is a filtered subset.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "selector": { - SchemaProps: spec.SchemaProps{ - Description: "selector is the shard selector string from the request, echoed back so clients can verify which shard they received and merge responses from multiple shards.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"selector"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Status(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Status is a return value for calls that don't return other objects.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]interface{}{}, - Ref: ref(v1.ListMeta{}.OpenAPIModelName()), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the operation. One of: \"Success\" or \"Failure\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human-readable description of the status of this operation.", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "A machine-readable description of why this operation is in the \"Failure\" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it.", - Type: []string{"string"}, - Format: "", - }, - }, - "details": { - SchemaProps: spec.SchemaProps{ - Description: "Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.", - Ref: ref(v1.StatusDetails{}.OpenAPIModelName()), - }, - }, - "code": { - SchemaProps: spec.SchemaProps{ - Description: "Suggested HTTP return code for this status, 0 if not set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - v1.ListMeta{}.OpenAPIModelName(), v1.StatusDetails{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_StatusCause(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "A machine-readable description of the cause of the error. If this value is empty there is no information available.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human-readable description of the cause of the error. This field may be presented as-is to a reader.", - Type: []string{"string"}, - Format: "", - }, - }, - "field": { - SchemaProps: spec.SchemaProps{ - Description: "The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.\n\nExamples:\n \"name\" - the field \"name\" on the current resource\n \"items[0].name\" - the field \"name\" on the first array entry in \"items\"", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_StatusDetails(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described).", - Type: []string{"string"}, - Format: "", - }, - }, - "group": { - SchemaProps: spec.SchemaProps{ - Description: "The group attribute of the resource associated with the status StatusReason.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids", - Type: []string{"string"}, - Format: "", - }, - }, - "causes": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.StatusCause{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - "retryAfterSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the time in seconds before the operation should be retried. Some errors may indicate the client must take an alternate action - for those errors this field may indicate how long to wait before taking the alternate action.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - v1.StatusCause{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_Table(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Table is a tabular representation of a set of API resources. The server transforms the object into a set of preferred columns for quickly reviewing the objects.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]interface{}{}, - Ref: ref(v1.ListMeta{}.OpenAPIModelName()), - }, - }, - "columnDefinitions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "columnDefinitions describes each column in the returned items array. The number of cells per row will always match the number of column definitions.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.TableColumnDefinition{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - "rows": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "rows is the list of items in the table.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.TableRow{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - }, - Required: []string{"columnDefinitions", "rows"}, - }, - }, - Dependencies: []string{ - v1.ListMeta{}.OpenAPIModelName(), v1.TableColumnDefinition{}.OpenAPIModelName(), v1.TableRow{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_TableColumnDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableColumnDefinition contains information about a column returned in the Table.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name is a human readable name for the column.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "type is an OpenAPI type definition for this column, such as number, integer, string, or array. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "format": { - SchemaProps: spec.SchemaProps{ - Description: "format is an optional OpenAPI type modifier for this column. A format modifies the type and imposes additional rules, like date or time formatting for a string. The 'name' format is applied to the primary identifier column which has type 'string' to assist in clients identifying column is the resource name. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for more.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Description: "description is a human readable description of this column.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "priority": { - SchemaProps: spec.SchemaProps{ - Description: "priority is an integer defining the relative importance of this column compared to others. Lower numbers are considered higher priority. Columns that may be omitted in limited space scenarios should be given a higher priority.", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"name", "type", "format", "description", "priority"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_TableOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableOptions are used when a Table is requested by the caller.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "includeObject": { - SchemaProps: spec.SchemaProps{ - Description: "includeObject decides whether to include each object along with its columnar information. Specifying \"None\" will return no object, specifying \"Object\" will return the full object contents, and specifying \"Metadata\" (the default) will return the object's metadata in the PartialObjectMetadata kind in version v1beta1 of the meta.k8s.io API group.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_TableRow(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableRow is an individual row in a table.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "cells": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "cells will be as wide as the column definitions array and may contain strings, numbers (float64 or int64), booleans, simple maps, lists, or null. See the type field of the column definition for a more detailed description.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Format: "", - }, - }, - }, - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "conditions describe additional status of a row that are relevant for a human user. These conditions apply to the row, not to the object, and will be specific to table output. The only defined condition type is 'Completed', for a row that indicates a resource that has run to completion and can be given less visual priority.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref(v1.TableRowCondition{}.OpenAPIModelName()), - }, - }, - }, - }, - }, - "object": { - SchemaProps: spec.SchemaProps{ - Description: "This field contains the requested additional information about each object based on the includeObject policy when requesting the Table. If \"None\", this field is empty, if \"Object\" this will be the default serialization of the object for the current API version, and if \"Metadata\" (the default) will contain the object metadata. Check the returned kind and apiVersion of the object before parsing. The media type of the object will always match the enclosing list - if this as a JSON table, these will be JSON encoded objects.", - Ref: ref(runtime.RawExtension{}.OpenAPIModelName()), - }, - }, - }, - Required: []string{"cells"}, - }, - }, - Dependencies: []string{ - v1.TableRowCondition{}.OpenAPIModelName(), runtime.RawExtension{}.OpenAPIModelName()}, - } -} - -func schema_pkg_apis_meta_v1_TableRowCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TableRowCondition allows a row to be marked with additional information.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of row condition. The only defined value is 'Completed' indicating that the object this row represents has reached a completed state and may be given less visual priority than other rows. Clients are not required to honor any conditions but should be consistent where possible about handling the conditions.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition, one of True, False, Unknown.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "(brief) machine readable reason for the condition's last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Human readable message indicating details about last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Time(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.", - Type: v1.Time{}.OpenAPISchemaType(), - Format: v1.Time{}.OpenAPISchemaFormat(), - }, - }, - } -} - -func schema_pkg_apis_meta_v1_Timestamp(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Timestamp is a struct that is equivalent to Time, but intended for protobuf marshalling/unmarshalling. It is generated into a serialization that matches Time. Do not use in Go structs.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "seconds": { - SchemaProps: spec.SchemaProps{ - Description: "Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.", - Default: 0, - Type: []string{"integer"}, - Format: "int64", - }, - }, - "nanos": { - SchemaProps: spec.SchemaProps{ - Description: "Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. This field may be limited in precision depending on context.", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"seconds", "nanos"}, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_TypeMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TypeMeta describes an individual object in an API response or request with strings representing the type of the object and its API schema version. Structures that are versioned or persisted should inline TypeMeta.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_UpdateOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "UpdateOptions may be provided when updating an API object. All fields in UpdateOptions should also be present in PatchOptions.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", - Type: []string{"string"}, - Format: "", - }, - }, - "dryRun": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-type": "atomic", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "fieldManager": { - SchemaProps: spec.SchemaProps{ - Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldValidation": { - SchemaProps: spec.SchemaProps{ - Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_pkg_apis_meta_v1_WatchEvent(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Event represents a single event to a watched resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "object": { - SchemaProps: spec.SchemaProps{ - Description: "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Error: *Status is recommended; other types may make sense\n depending on context.", - Ref: ref(runtime.RawExtension{}.OpenAPIModelName()), - }, - }, - }, - Required: []string{"type", "object"}, - }, - }, - Dependencies: []string{ - runtime.RawExtension{}.OpenAPIModelName()}, - } -} - -func schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned struct, and Object in your internal struct. You also need to register your various plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\"\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\"\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into your external MyAPIObject. That causes the raw JSON to be stored, but not unpacked. The next step is to copy (using pkg/conversion) into the internal struct. The runtime package's DefaultScheme has conversion functions installed which will unpack the JSON stored in RawExtension, turning it into the correct object type, and storing it in the Object. (TODO: In the case where the object is of an unknown type, a runtime.Unknown object will be created and stored.)", - Type: []string{"object"}, - }, - }, - } -} - -func schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TypeMeta is shared by all top level objects. The proper way to use it is to inline it in your type, like this:\n\n\ttype MyAwesomeAPIObject struct {\n\t runtime.TypeMeta `json:\"\"`\n\t ... // other fields\n\t}\n\nfunc (obj *MyAwesomeAPIObject) SetGroupVersionKind(gvk *metav1.GroupVersionKind) { metav1.UpdateTypeMeta(obj,gvk) }; GroupVersionKind() *GroupVersionKind\n\nTypeMeta is provided here for convenience. You may use it directly from this package or define your own with the same fields.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - } -} - -func schema_k8sio_apimachinery_pkg_runtime_Unknown(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Unknown allows api objects with unknown types to be passed-through. This can be used to deal with the API objects from a plug-in. Unknown objects still have functioning TypeMeta features-- kind, version, etc. metadata and field mutatation.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "ContentEncoding": { - SchemaProps: spec.SchemaProps{ - Description: "ContentEncoding is encoding used to encode 'Raw' data. Unspecified means no encoding.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "ContentType": { - SchemaProps: spec.SchemaProps{ - Description: "ContentType is serialization method used to serialize 'Raw'. Unspecified means ContentTypeJSON.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"ContentEncoding", "ContentType"}, - }, - }, - } -} - -func schema_k8sio_apimachinery_pkg_version_Info(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Info contains versioning information. how we'll want to distribute that information.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "major": { - SchemaProps: spec.SchemaProps{ - Description: "Major is the major version of the binary version", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "minor": { - SchemaProps: spec.SchemaProps{ - Description: "Minor is the minor version of the binary version", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "emulationMajor": { - SchemaProps: spec.SchemaProps{ - Description: "EmulationMajor is the major version of the emulation version", - Type: []string{"string"}, - Format: "", - }, - }, - "emulationMinor": { - SchemaProps: spec.SchemaProps{ - Description: "EmulationMinor is the minor version of the emulation version", - Type: []string{"string"}, - Format: "", - }, - }, - "minCompatibilityMajor": { - SchemaProps: spec.SchemaProps{ - Description: "MinCompatibilityMajor is the major version of the minimum compatibility version", - Type: []string{"string"}, - Format: "", - }, - }, - "minCompatibilityMinor": { - SchemaProps: spec.SchemaProps{ - Description: "MinCompatibilityMinor is the minor version of the minimum compatibility version", - Type: []string{"string"}, - Format: "", - }, - }, - "gitVersion": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "gitCommit": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "gitTreeState": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "buildDate": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "goVersion": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "compiler": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "platform": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"major", "minor", "gitVersion", "gitCommit", "gitTreeState", "buildDate", "goVersion", "compiler", "platform"}, - }, - }, - } -}