From 4301adeb251d5230f854b65a201d319580681aab Mon Sep 17 00:00:00 2001 From: James Rawlings Date: Wed, 30 Sep 2020 20:00:21 +0100 Subject: [PATCH 1/9] feat: upgrade kubernetes deps to 0.19.2, use golang 1.15 --- Makefile.codegen | 14 +- README.md | 4 +- cmd/codegen/app/generate_clientset.go | 2 +- cmd/codegen/app/generate_docs.go | 2 +- cmd/codegen/app/generate_openapi.go | 2 +- cmd/codegen/generator/client_set.go | 2 +- cmd/codegen/generator/common.go | 2 +- cmd/codegen/generator/docs.go | 2 +- cmd/codegen/generator/open_api.go | 2 +- cmd/codegen/util/commands.go | 2 +- cmd/codegen/util/files.go | 2 +- cmd/codegen/util/go.go | 2 +- docs/apidocs/openapi-spec/openapiv2.json | 2 +- docs/apidocs/openapi-spec/openapiv2.yaml | 302 ++++++++++++++---- go.mod | 19 +- go.sum | 250 +++++++++------ pkg/apis/jenkins.io/v1/types_environment.go | 2 +- .../jenkins.io/v1/types_environment_test.go | 2 +- pkg/apis/jenkins.io/v1/types_extensions.go | 10 +- pkg/client/clientset/versioned/clientset.go | 7 + .../clientset/versioned/fake/register.go | 2 +- .../versioned/typed/jenkins.io/v1/app.go | 64 ++-- .../typed/jenkins.io/v1/buildpack.go | 64 ++-- .../typed/jenkins.io/v1/commitstatus.go | 64 ++-- .../typed/jenkins.io/v1/environment.go | 64 ++-- .../jenkins.io/v1/environmentrolebinding.go | 64 ++-- .../typed/jenkins.io/v1/extension.go | 64 ++-- .../versioned/typed/jenkins.io/v1/fact.go | 64 ++-- .../typed/jenkins.io/v1/fake/fake_app.go | 20 +- .../jenkins.io/v1/fake/fake_buildpack.go | 20 +- .../jenkins.io/v1/fake/fake_commitstatus.go | 20 +- .../jenkins.io/v1/fake/fake_environment.go | 20 +- .../v1/fake/fake_environmentrolebinding.go | 20 +- .../jenkins.io/v1/fake/fake_extension.go | 20 +- .../typed/jenkins.io/v1/fake/fake_fact.go | 20 +- .../jenkins.io/v1/fake/fake_gitservice.go | 20 +- .../v1/fake/fake_pipelineactivity.go | 20 +- .../v1/fake/fake_pipelinestructure.go | 20 +- .../typed/jenkins.io/v1/fake/fake_plugin.go | 20 +- .../typed/jenkins.io/v1/fake/fake_release.go | 20 +- .../jenkins.io/v1/fake/fake_scheduler.go | 20 +- .../v1/fake/fake_sourcerepository.go | 20 +- .../v1/fake/fake_sourcerepositorygroup.go | 20 +- .../typed/jenkins.io/v1/fake/fake_team.go | 20 +- .../typed/jenkins.io/v1/fake/fake_user.go | 20 +- .../typed/jenkins.io/v1/fake/fake_workflow.go | 20 +- .../typed/jenkins.io/v1/gitservice.go | 64 ++-- .../typed/jenkins.io/v1/pipelineactivity.go | 64 ++-- .../typed/jenkins.io/v1/pipelinestructure.go | 64 ++-- .../versioned/typed/jenkins.io/v1/plugin.go | 64 ++-- .../versioned/typed/jenkins.io/v1/release.go | 64 ++-- .../typed/jenkins.io/v1/scheduler.go | 64 ++-- .../typed/jenkins.io/v1/sourcerepository.go | 64 ++-- .../jenkins.io/v1/sourcerepositorygroup.go | 64 ++-- .../versioned/typed/jenkins.io/v1/team.go | 64 ++-- .../versioned/typed/jenkins.io/v1/user.go | 64 ++-- .../versioned/typed/jenkins.io/v1/workflow.go | 64 ++-- .../externalversions/jenkins.io/v1/app.go | 5 +- .../jenkins.io/v1/buildpack.go | 5 +- .../jenkins.io/v1/commitstatus.go | 5 +- .../jenkins.io/v1/environment.go | 5 +- .../jenkins.io/v1/environmentrolebinding.go | 5 +- .../jenkins.io/v1/extension.go | 5 +- .../externalversions/jenkins.io/v1/fact.go | 5 +- .../jenkins.io/v1/gitservice.go | 5 +- .../jenkins.io/v1/pipelineactivity.go | 5 +- .../jenkins.io/v1/pipelinestructure.go | 5 +- .../externalversions/jenkins.io/v1/plugin.go | 5 +- .../externalversions/jenkins.io/v1/release.go | 5 +- .../jenkins.io/v1/scheduler.go | 5 +- .../jenkins.io/v1/sourcerepository.go | 5 +- .../jenkins.io/v1/sourcerepositorygroup.go | 5 +- .../externalversions/jenkins.io/v1/team.go | 5 +- .../externalversions/jenkins.io/v1/user.go | 5 +- .../jenkins.io/v1/workflow.go | 5 +- pkg/client/listers/jenkins.io/v1/app.go | 5 + pkg/client/listers/jenkins.io/v1/buildpack.go | 5 + .../listers/jenkins.io/v1/commitstatus.go | 5 + .../listers/jenkins.io/v1/environment.go | 5 + .../jenkins.io/v1/environmentrolebinding.go | 5 + pkg/client/listers/jenkins.io/v1/extension.go | 5 + pkg/client/listers/jenkins.io/v1/fact.go | 5 + .../listers/jenkins.io/v1/gitservice.go | 5 + .../listers/jenkins.io/v1/pipelineactivity.go | 5 + .../jenkins.io/v1/pipelinestructure.go | 5 + pkg/client/listers/jenkins.io/v1/plugin.go | 5 + pkg/client/listers/jenkins.io/v1/release.go | 5 + pkg/client/listers/jenkins.io/v1/scheduler.go | 5 + .../listers/jenkins.io/v1/sourcerepository.go | 5 + .../jenkins.io/v1/sourcerepositorygroup.go | 5 + pkg/client/listers/jenkins.io/v1/team.go | 5 + pkg/client/listers/jenkins.io/v1/user.go | 5 + pkg/client/listers/jenkins.io/v1/workflow.go | 5 + .../k8s_io_api_batch_v1/openapi_generated.go | 4 +- .../k8s_io_api_core_v1/openapi_generated.go | 258 ++++++++++++--- .../openapi_generated.go | 75 ++++- pkg/config/install_requirements.go | 2 +- pkg/config/install_requirements_test.go | 2 +- 98 files changed, 1671 insertions(+), 996 deletions(-) diff --git a/Makefile.codegen b/Makefile.codegen index 11cc4a6..17e03aa 100644 --- a/Makefile.codegen +++ b/Makefile.codegen @@ -5,8 +5,7 @@ ifdef DEBUG CODE_GEN_BUILDFLAGS := -gcflags "all=-N -l" $(CODE_GEN_BUILDFLAGS) endif -PEGOMOCK_VERSION := v2.7.0 -CLIENTSET_GENERATOR_VERSION := kubernetes-1.15.12 +CLIENTSET_GENERATOR_VERSION := kubernetes-1.19.2 GEN_APIDOCS_VERSION := v0.0.0-20190912061656-a61bc210ee54 OPENAPI_GEN_VERSION := 36ebc4887cdc @@ -20,20 +19,11 @@ test-codegen: ## Test the code geneator # Generate go code using generate directives in files and kubernetes code generation # Anything generated by this target should be checked in -generate: build-codegen install-generate-deps generate-mocks generate-openapi generate-client ## Generate the Go code (crds, mocks, openapi, client) +generate: build-codegen generate-openapi generate-client ## Generate the Go code (crds, mocks, openapi, client) @$(MAKE) fmt @$(MAKE) importfmt @echo "Generation complete" -install-generate-deps: - $(GO) get github.com/petergtz/pegomock/...@$(PEGOMOCK_VERSION) - -generate-mocks: install-generate-deps go-generate fmt importfmt ## Generate the mocks - -go-generate: - @echo "Generating Mocks using pegomock" - $(GO) generate ./... - generate-client: codegen-clientset codegen-config fmt importfmt ## Generate the client codegen-clientset: build-codegen ## Generate the k8s types and clients diff --git a/README.md b/README.md index 369e5bb..77a5906 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ Here's an example which also uses [Jenkins X logging](https://github.com/jenkins ```go import ( - "github.com/jenkins-x/jx-kube-client/pkg/kubeclient" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-kube-client/v3/pkg/kubeclient" + "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" ) diff --git a/cmd/codegen/app/generate_clientset.go b/cmd/codegen/app/generate_clientset.go index 4d379a1..0d2daa3 100644 --- a/cmd/codegen/app/generate_clientset.go +++ b/cmd/codegen/app/generate_clientset.go @@ -5,7 +5,7 @@ import ( "os" "path/filepath" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/jenkins-x/jx-api/cmd/codegen/generator" "github.com/jenkins-x/jx-api/cmd/codegen/util" diff --git a/cmd/codegen/app/generate_docs.go b/cmd/codegen/app/generate_docs.go index 2c2be74..daefe37 100644 --- a/cmd/codegen/app/generate_docs.go +++ b/cmd/codegen/app/generate_docs.go @@ -4,7 +4,7 @@ import ( "os" "path/filepath" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/jenkins-x/jx-api/cmd/codegen/generator" "github.com/jenkins-x/jx-api/cmd/codegen/util" diff --git a/cmd/codegen/app/generate_openapi.go b/cmd/codegen/app/generate_openapi.go index 3b85e82..08c95e6 100644 --- a/cmd/codegen/app/generate_openapi.go +++ b/cmd/codegen/app/generate_openapi.go @@ -6,7 +6,7 @@ import ( "path/filepath" "strings" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/jenkins-x/jx-api/cmd/codegen/generator" "github.com/jenkins-x/jx-api/cmd/codegen/util" diff --git a/cmd/codegen/generator/client_set.go b/cmd/codegen/generator/client_set.go index 64b76de..6ea4ecd 100644 --- a/cmd/codegen/generator/client_set.go +++ b/cmd/codegen/generator/client_set.go @@ -12,7 +12,7 @@ import ( "path/filepath" "strings" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/jenkins-x/jx-api/cmd/codegen/util" "github.com/pkg/errors" diff --git a/cmd/codegen/generator/common.go b/cmd/codegen/generator/common.go index fe56dc7..580d721 100644 --- a/cmd/codegen/generator/common.go +++ b/cmd/codegen/generator/common.go @@ -5,7 +5,7 @@ import ( "path/filepath" "strings" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/jenkins-x/jx-api/cmd/codegen/util" "github.com/pkg/errors" diff --git a/cmd/codegen/generator/docs.go b/cmd/codegen/generator/docs.go index 429e03d..e4c8edd 100644 --- a/cmd/codegen/generator/docs.go +++ b/cmd/codegen/generator/docs.go @@ -4,7 +4,7 @@ import ( "os" "path/filepath" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/jenkins-x/jx-api/cmd/codegen/util" "github.com/pkg/errors" diff --git a/cmd/codegen/generator/open_api.go b/cmd/codegen/generator/open_api.go index 6d95c47..29fc8e6 100644 --- a/cmd/codegen/generator/open_api.go +++ b/cmd/codegen/generator/open_api.go @@ -15,7 +15,7 @@ import ( "strconv" "strings" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/jenkins-x/jx-api/cmd/codegen/util" diff --git a/cmd/codegen/util/commands.go b/cmd/codegen/util/commands.go index 60ad710..79fa826 100644 --- a/cmd/codegen/util/commands.go +++ b/cmd/codegen/util/commands.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/cenkalti/backoff" ) diff --git a/cmd/codegen/util/files.go b/cmd/codegen/util/files.go index c83aa34..b8688c1 100644 --- a/cmd/codegen/util/files.go +++ b/cmd/codegen/util/files.go @@ -9,7 +9,7 @@ import ( "path/filepath" "time" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/pkg/errors" ) diff --git a/cmd/codegen/util/go.go b/cmd/codegen/util/go.go index c4732c8..45f005c 100644 --- a/cmd/codegen/util/go.go +++ b/cmd/codegen/util/go.go @@ -6,7 +6,7 @@ import ( "path/filepath" "strings" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" uuid "github.com/satori/go.uuid" diff --git a/docs/apidocs/openapi-spec/openapiv2.json b/docs/apidocs/openapi-spec/openapiv2.json index bc36c1f..2bf91d3 100644 --- a/docs/apidocs/openapi-spec/openapiv2.json +++ b/docs/apidocs/openapi-spec/openapiv2.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"title":"Jenkins X","version":"1.0"},"paths":{},"definitions":{"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.AccountReference":{"description":"AccountReference is a reference to a user account in another system that is attached to this user","type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.App":{"description":"App is the metadata for an App","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.AppSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.AppList":{"description":"AppList is a structure used by k8s to store lists of apps","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.App"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.AppSpec":{"description":"AppSpec provides details of the metadata for an App","type":"object","properties":{"pipelineExtension":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineExtension"},"schemaPreprocessor":{"$ref":"#/definitions/io.k8s.api.core.v1.Container"},"schemaPreprocessorRole":{"$ref":"#/definitions/io.k8s.api.rbac.v1.Role"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Approve":{"description":"Approve specifies a configuration for a single approve.\n\nThe configuration for the approve plugin is defined as a list of these structures.","type":"object","properties":{"ignoreReviewState":{"description":"IgnoreReviewState causes the approve plugin to ignore the GitHub review state. Otherwise: * an APPROVE github review is equivalent to leaving an \"/approve\" message. * A REQUEST_CHANGES github review is equivalent to leaving an /approve cancel\" message.","type":"boolean"},"issueRequired":{"description":"IssueRequired indicates if an associated issue is required for approval in the specified repos.","type":"boolean"},"lgtmActsAsApprove":{"description":"LgtmActsAsApprove indicates that the lgtm command should be used to indicate approval","type":"boolean"},"requireSelfApproval":{"description":"RequireSelfApproval requires PR authors to explicitly approve their PRs. Otherwise the plugin assumes the author of the PR approves the changes in the PR.","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Attachment":{"type":"object","properties":{"name":{"type":"string"},"urls":{"type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BatchPipelineActivity":{"description":"BatchPipelineActivity contains information about a batch build, used by both the batch build and its comprising PRs for linking them together","type":"object","properties":{"batchBranchName":{"type":"string"},"batchBuildNumber":{"type":"string"},"pullRequestInfo":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PullRequestInfo"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Binary":{"description":"Binary provies the details of a downloadable binary","type":"object","properties":{"goarch":{"type":"string"},"goos":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BranchProtectionContextPolicy":{"description":"BranchProtectionContextPolicy configures required git provider contexts. Strict determines whether merging to the branch invalidates existing contexts.","type":"object","properties":{"contexts":{"description":"Contexts appends required contexts that must be green to merge","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"strict":{"description":"Strict overrides whether new commits in the base branch require updating the PR if set","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Brancher":{"description":"Brancher is for shared code between jobs that only run against certain branches. An empty brancher runs against all branches.","type":"object","properties":{"branches":{"description":"Only run against these branches. Default is all branches.","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"skipBranches":{"description":"Do not run against these branches. Default is no branches.","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BuildPack":{"description":"BuildPack represents a set of language specific build packs and associated quickstarts","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BuildPackSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BuildPackList":{"description":"BuildPackList is a list of TypeMeta resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BuildPack"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BuildPackSpec":{"description":"BuildPackSpec is the specification of an BuildPack","type":"object","properties":{"gitRef":{"type":"string"},"gitUrl":{"type":"string"},"label":{"type":"string"},"quickstartLocations":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.QuickStartLocation"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ChartRef":{"type":"object","properties":{"name":{"type":"string"},"repo":{"type":"string"},"repoName":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatus":{"description":"CommitStatus represents the commit statuses for a particular pull request","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusCommitReference":{"type":"object","properties":{"gitUrl":{"type":"string"},"pullRequest":{"type":"string"},"sha":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusDetails":{"type":"object","required":["pipelineActivity","checked","commit","context"],"properties":{"Items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusItem"}},"checked":{"type":"boolean"},"commit":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusCommitReference"},"context":{"type":"string"},"pipelineActivity":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ResourceReference"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusItem":{"type":"object","required":["pass"],"properties":{"description":{"type":"string"},"name":{"type":"string"},"pass":{"type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusList":{"description":"CommitStatusList is a structure used by k8s to store lists of commit statuses","type":"object","required":["metadata","Items"],"properties":{"Items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatus"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusSpec":{"description":"CommitStatusSpec provides details of a particular commit status","type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusDetails"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitSummary":{"description":"CommitSummary is the summary of a commit","type":"object","properties":{"author":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails"},"branch":{"type":"string"},"committer":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails"},"issueIds":{"type":"array","items":{"type":"string"}},"message":{"type":"string"},"sha":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ConfigMapSpec":{"description":"ConfigMapSpec contains configuration options for the configMap being updated by the config-updater plugin.","type":"object","required":["name"],"properties":{"additional_namespaces":{"description":"Namespaces in which the configMap needs to be deployed, in addition to the above namespace provided, or the default if it is not set.","type":"array","items":{"type":"string"}},"key":{"description":"Key is the key in the ConfigMap to update with the file contents. If no explicit key is given, the basename of the file will be used.","type":"string"},"name":{"description":"Name of ConfigMap","type":"string"},"namespace":{"description":"Namespace in which the configMap needs to be deployed. If no namespace is specified it will be deployed to the ProwJobNamespace.","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ConfigUpdater":{"description":"ConfigUpdater holds configuration for the config updater plugin","type":"object","properties":{"ConfigMap":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ConfigMapSpec"},"configFile":{"type":"string"},"map":{"type":"object","additionalProperties":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ConfigMapSpec"}},"pluginFile":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ContextPolicy":{"description":"ContextPolicy configures options about how to handle various contexts.","type":"object","properties":{"fromBranchProtection":{"description":"Infer required and optional jobs from Branch Protection configuration","type":"boolean"},"optionalContexts":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"requiredContexts":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"requiredIfPresentContexts":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"skipUnknownContexts":{"description":"whether to consider unknown contexts optional (skip) or required.","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CoreActivityStep":{"description":"CoreActivityStep is a base step included in Stages of a pipeline or other kinds of step","type":"object","properties":{"completedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"description":{"type":"string"},"name":{"type":"string"},"startedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"status":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.DependencyUpdate":{"description":"DependencyUpdate describes an dependency update message from the commit log","type":"object","required":["host","owner","repo","component","url","fromVersion","fromReleaseHTMLURL","fromReleaseName","toVersion","toReleaseHTMLURL","toReleaseName"],"properties":{"component":{"type":"string"},"fromReleaseHTMLURL":{"type":"string"},"fromReleaseName":{"type":"string"},"fromVersion":{"type":"string"},"host":{"type":"string"},"owner":{"type":"string"},"paths":{"type":"array","items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.DependencyUpdateDetails"}}},"repo":{"type":"string"},"toReleaseHTMLURL":{"type":"string"},"toReleaseName":{"type":"string"},"toVersion":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.DependencyUpdateDetails":{"description":"DependencyUpdateDetails are the details of a dependency update","type":"object","required":["host","owner","repo","component","url","fromVersion","fromReleaseHTMLURL","fromReleaseName","toVersion","toReleaseHTMLURL","toReleaseName"],"properties":{"component":{"type":"string"},"fromReleaseHTMLURL":{"type":"string"},"fromReleaseName":{"type":"string"},"fromVersion":{"type":"string"},"host":{"type":"string"},"owner":{"type":"string"},"repo":{"type":"string"},"toReleaseHTMLURL":{"type":"string"},"toReleaseName":{"type":"string"},"toVersion":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.DeployOptions":{"description":"DeployOptions configures options for how to deploy applications by default such as using progressive delivery or using horizontal pod autoscaler","type":"object","properties":{"canary":{"description":"Canary should we enable canary rollouts (progressive delivery) for apps by default","type":"boolean"},"hpa":{"description":"should we use the horizontal pod autoscaler on new apps by default?","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Environment":{"description":"Environment represents an environment like Dev, Test, Staging, Production where code lives","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentSpec"},"status":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentStatus"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentFilter":{"description":"EnvironmentFilter specifies the environments to apply the role binding to","type":"object","properties":{"excludes":{"type":"array","items":{"type":"string"}},"includes":{"type":"array","items":{"type":"string"}},"kind":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentList":{"description":"EnvironmentList is a list of TypeMeta resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Environment"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRepository":{"description":"EnvironmentRepository is the repository for an environment using GitOps","type":"object","properties":{"kind":{"type":"string"},"ref":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRoleBinding":{"description":"EnvironmentRoleBinding is like a vanilla RoleBinding but applies to a set of Namespaces based on an Environment filter so that roles can be bound to multiple namespaces easily.\n\nFor example to specify the binding of roles on all Preview environments or on all permanent environments.","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRoleBindingSpec"},"status":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRoleBindingStatus"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRoleBindingList":{"description":"EnvironmentRoleBindingList is a list of TypeMeta resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRoleBinding"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRoleBindingSpec":{"description":"EnvironmentRoleBindingSpec is the specification of an EnvironmentRoleBinding","type":"object","required":["subjects","roleRef"],"properties":{"environments":{"description":"specifies which sets of environments this binding applies to","type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentFilter"}},"roleRef":{"description":"RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.","$ref":"#/definitions/io.k8s.api.rbac.v1.RoleRef"},"subjects":{"description":"Subjects holds references to the objects the role applies to.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.rbac.v1.Subject"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRoleBindingStatus":{"description":"EnvironmentRoleBindingStatus is the status for an EnvironmentRoleBinding resource","type":"object","properties":{"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentSpec":{"description":"EnvironmentSpec is the specification of an Environment","type":"object","properties":{"cluster":{"type":"string"},"kind":{"type":"string"},"label":{"type":"string"},"namespace":{"type":"string"},"order":{"type":"integer","format":"int32"},"previewGitInfo":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PreviewGitSpec"},"promotionStrategy":{"type":"string"},"pullRequestURL":{"type":"string"},"remoteCluster":{"description":"RemoteCluster flag indicates if the Environment is deployed in a separate cluster to the Development Environment","type":"boolean"},"source":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRepository"},"teamSettings":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.TeamSettings"},"webHookEngine":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentStatus":{"description":"EnvironmentStatus is the status for an Environment resource","type":"object","properties":{"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentVariable":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Extension":{"description":"Extension represents an extension available to this Jenkins X install","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionConfig":{"description":"ExtensionConfig is the configuration and enablement for an extension inside an app","type":"object","required":["name","namespace","parameters"],"properties":{"name":{"type":"string"},"namespace":{"type":"string"},"parameters":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionParameterValue"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionConfigList":{"description":"ExtensionsConfigList contains a list of ExtensionConfig items","type":"object","required":["extensions"],"properties":{"extensions":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionConfig"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinition":{"description":"ExtensionDefinition defines an Extension","type":"object","required":["name","namespace","uuid"],"properties":{"children":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinitionChildReference"}},"description":{"type":"string"},"given":{"type":"string"},"name":{"type":"string"},"namespace":{"type":"string"},"parameters":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionParameter"}},"scriptFile":{"type":"string"},"uuid":{"type":"string"},"when":{"type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinitionChildReference":{"description":"ExtensionDefinitionChildReference provides a reference to a child","type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string"},"remote":{"type":"string"},"tag":{"type":"string"},"uuid":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinitionList":{"description":"ExtensionDefinitionList contains a list of ExtensionDefinition items","type":"object","required":["extensions"],"properties":{"extensions":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinition"}},"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinitionReference":{"description":"ExtensionRepositoryReference references a GitHub repo that contains extension definitions","type":"object","required":["remote","tag"],"properties":{"remote":{"type":"string"},"tag":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinitionReferenceList":{"description":"ExtensionDefinitionReferenceList contains a list of ExtensionRepository items","type":"object","required":["remotes"],"properties":{"remotes":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinitionReference"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionExecution":{"description":"ExtensionExecution is an executable instance of an extension which can be attached into a pipeline for later execution. It differs from an Extension as it cannot have children and parameters have been resolved to environment variables","type":"object","properties":{"description":{"type":"string"},"environmentVariables":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentVariable"}},"given":{"type":"string"},"name":{"type":"string"},"namespace":{"type":"string"},"script":{"type":"string"},"uuid":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionList":{"description":"ExtensionList is a list of Extensions available for a team","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Extension"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionParameter":{"description":"ExtensionParameter describes a parameter definition for an extension","type":"object","properties":{"defaultValue":{"type":"string"},"description":{"type":"string"},"environmentVariableName":{"type":"string"},"name":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionParameterValue":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionRepositoryReference":{"type":"object","properties":{"chart":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ChartRef"},"github":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionRepositoryReferenceList":{"type":"object","properties":{"repositories":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionRepositoryReference"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionSpec":{"description":"ExtensionSpec provides details of an extension available for a team","type":"object","properties":{"children":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"given":{"type":"string"},"name":{"type":"string"},"namespace":{"type":"string"},"parameters":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionParameter"}},"script":{"type":"string"},"uuid":{"type":"string"},"version":{"type":"string"},"when":{"type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExternalPlugin":{"description":"ExternalPlugin holds configuration for registering an external plugin.","type":"object","required":["name"],"properties":{"endpoint":{"description":"Endpoint is the location of the external plugin. Defaults to the name of the plugin, ie. \"http://{{name}}\".","type":"string"},"events":{"description":"ReplaceableSliceOfStrings are the events that need to be demuxed by the hook server to the external plugin. If no events are specified, everything is sent.","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"name":{"description":"Name of the plugin.","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Fact":{"description":"Fact represents observed facts. Apps will generate Facts about the system. A naming schema is required since each Fact has a name that's unique for the whole system. Apps should prefix their generated Facts with the name of the App, like \u003capp-name\u003e-\u003cfact\u003e. This makes that different Apps can't possibly have conflicting Fact names.\n\nFor an app generating facts on a pipeline, which will be have several different executions, we recommend \u003capp\u003e-\u003cfact\u003e-\u003cpipeline\u003e.","type":"object","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":{"description":"The Fact labels will be used to query the API for interesting Facts. The Apps responsible for creating Facts need to add the relevant labels. For example, creating Facts on a pipeline would create Facts with the following labels {\n subjectkind: PipelineActivity\n pipelineName: my-org-my-app-master-23\n org: my-org\n repo: my-app\n branch: master\n buildNumber: 23\n}","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.FactSpec"},"status":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.FactStatus"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.FactList":{"description":"FactList is a list of Fact resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Fact"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.FactSpec":{"description":"FactSpec is the specification of a Fact","type":"object","required":["name","factType","subject"],"properties":{"factType":{"type":"string"},"measurements":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Measurement"}},"name":{"type":"string"},"original":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Original"},"statements":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Statement"}},"subject":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ResourceReference"},"tags":{"type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.FactStatus":{"description":"FactStatus is the status for an Fact resource","type":"object","properties":{"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GitService":{"description":"GitService represents a git provider so we can map the host name to a kinda of git service","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GitServiceSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GitServiceList":{"description":"GitServiceList is a list of GitService resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GitService"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GitServiceSpec":{"description":"GitServiceSpec is the specification of an GitService","type":"object","properties":{"gitKind":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GitStatus":{"description":"GitStatus the status of a git commit in terms of CI/CD","type":"object","properties":{"status":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GlobalProtectionPolicy":{"description":"GlobalProtectionPolicy defines the default branch protection policy for the scheduler","type":"object","properties":{"ProtectionPolicy":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ProtectionPolicy"},"protectTested":{"type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.IssueLabel":{"type":"object","properties":{"color":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.IssueSummary":{"description":"IssueSummary is the summary of an issue","type":"object","properties":{"assignees":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails"}},"body":{"type":"string"},"closedBy":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails"},"creationTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"id":{"type":"string"},"labels":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.IssueLabel"}},"message":{"type":"string"},"state":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"user":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.JobBase":{"description":"JobBase contains attributes common to all job types","type":"object","required":["name","agent"],"properties":{"agent":{"description":"Agent that will take care of running this job.","type":"string"},"cluster":{"description":"Cluster is the alias of the cluster to run this job in. (Default: kube.DefaultClusterAlias)","type":"string"},"labels":{"description":"ReplaceableMapOfStringString are added to jobs and pods created for this job.","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableMapOfStringString"},"maxConcurrency":{"description":"MaximumConcurrency of this job, 0 implies no limit.","type":"integer","format":"int32"},"name":{"description":"The name of the job. Must match regex [A-Za-z0-9-._]+ e.g. pull-test-infra-bazel-build","type":"string"},"namespace":{"description":"Namespace is the namespace in which pods schedule.\n empty: results in scheduler.DefaultNamespace","type":"string"},"spec":{"description":"Spec is the Kubernetes pod spec used if Agent is kubernetes.","$ref":"#/definitions/io.k8s.api.core.v1.PodSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Lgtm":{"description":"Lgtm specifies a configuration for a single lgtm. The configuration for the lgtm plugin is defined as a list of these structures.","type":"object","properties":{"reviewActsAsLgtm":{"description":"ReviewActsAsLgtm indicates that a Github review of \"approve\" or \"request changes\" acts as adding or removing the lgtm label","type":"boolean"},"storeTreeHash":{"description":"StoreTreeHash indicates if tree_hash should be stored inside a comment to detect squashed commits before removing lgtm labels","type":"boolean"},"trustedTeamForStickyLgtm":{"description":"WARNING: This disables the security mechanism that prevents a malicious member (or compromised GitHub account) from merging arbitrary code. Use with caution.\n\nStickyLgtmTeam specifies the Github team whose members are trusted with sticky LGTM, which eliminates the need to re-lgtm minor fixes/updates.","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Measurement":{"description":"Measurement is a percentage or a count, something measured that the system will capture within a fact","type":"object","required":["name","measurementType","measurementValue"],"properties":{"measurementType":{"type":"string"},"measurementValue":{"type":"integer","format":"int32"},"name":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Merger":{"description":"Merger defines the options used to merge the PR","type":"object","properties":{"blockerLabel":{"description":"BlockerLabel is an optional label that is used to identify merge blocking Git Provider issues. Leave this blank to disable this feature and save 1 API token per sync loop.","type":"string"},"maxGoroutines":{"description":"MaxGoroutines is the maximum number of goroutines spawned inside the controller to handle org/repo:branch pools. Defaults to 20. Needs to be a positive number.","type":"integer","format":"int32"},"mergeMethod":{"description":"Override the default method of merge. Valid options are squash, rebase, and merge.","type":"string"},"policy":{"description":"ContextOptions defines the default merge options. If not set it will infer the required and optional contexts from the jobs configured and use the Git Provider combined status; otherwise it may apply the branch protection setting or let user define their own options in case branch protection is not used.","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ContextPolicy"},"prStatusBaseUrl":{"description":"PRStatusBaseURL is the base URL for the PR status page. This is used to link to a merge requirements overview in the status context.","type":"string"},"squashLabel":{"description":"SquashLabel is an optional label that is used to identify PRs that should always be squash merged. Leave this blank to disable this feature.","type":"string"},"targetUrl":{"description":"URL for status contexts.","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Original":{"description":"Original contains the report","type":"object","properties":{"mimetype":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Periodic":{"description":"Periodic defines a job to be run periodically","type":"object","required":["interval","cron"],"properties":{"JobBase":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.JobBase"},"cron":{"description":"Cron representation of job trigger time","type":"string"},"interval":{"description":"Interval to wait between two runs of the job.","type":"string"},"tags":{"description":"Tags for config entries","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Periodics":{"description":"Periodics is a list of jobs to be run periodically","type":"object","properties":{"entries":{"description":"Items are the post submit configurations","type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Periodic"}},"replace":{"description":"Replace the existing entries","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivity":{"description":"PipelineActivity represents pipeline activity for a particular run of a pipeline","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivitySpec"},"status":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivityStatus"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivityList":{"description":"PipelineActivityList is a list of PipelineActivity resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivity"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivitySpec":{"description":"PipelineActivitySpec is the specification of the pipeline activity","type":"object","properties":{"attachments":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Attachment"}},"author":{"type":"string"},"authorAvatarURL":{"type":"string"},"authorURL":{"type":"string"},"baseSHA":{"type":"string"},"batchPipelineActivity":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BatchPipelineActivity"},"build":{"type":"string"},"buildLogsUrl":{"type":"string"},"buildUrl":{"type":"string"},"completedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"context":{"type":"string"},"gitBranch":{"type":"string"},"gitOwner":{"type":"string"},"gitRepository":{"type":"string"},"gitUrl":{"type":"string"},"lastCommitMessage":{"type":"string"},"lastCommitSHA":{"type":"string"},"lastCommitURL":{"type":"string"},"pipeline":{"type":"string"},"postExtensions":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionExecution"}},"pullTitle":{"type":"string"},"releaseNotesURL":{"type":"string"},"startedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"status":{"type":"string"},"steps":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivityStep"}},"version":{"type":"string"},"workflow":{"description":"Deprecated - Workflow functionality was removed and is obsolete Keeping these fields to ensure backwards compatibility Should be removed when we increment spec version","type":"string"},"workflowMessage":{"type":"string"},"workflowStatus":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivityStatus":{"description":"PipelineActivityStatus is the status for an Environment resource","type":"object","properties":{"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivityStep":{"description":"PipelineActivityStep represents a step in a pipeline activity","type":"object","properties":{"kind":{"type":"string"},"preview":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PreviewActivityStep"},"promote":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromoteActivityStep"},"stage":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.StageActivityStep"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineExtension":{"description":"PipelineExtension defines the image and command of an app which wants to modify/extend the pipeline","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint.","type":"array","items":{"type":"string"}},"command":{"description":"Entrypoint array. Not executed within a shell.","type":"string"},"image":{"description":"Docker image name.","type":"string"},"name":{"description":"Name of the container specified as a DNS_LABEL.","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineStructure":{"description":"PipelineStructure contains references to the Pipeline and PipelineRun, and a list of PipelineStructureStages in the pipeline. This allows us to map between a running Pod to its TaskRun, to the TaskRun's Task and PipelineRun, and finally from there to the stage and potential parent stages that the Pod is actually executing, for use with populating PipelineActivity and providing logs.","type":"object","required":["pipelineRef","pipelineRunRef"],"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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"pipelineRef":{"type":"string"},"pipelineRunRef":{"type":"string"},"stages":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineStructureStage"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineStructureList":{"description":"PipelineStructureList is a list of PipelineStructureList resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineStructure"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineStructureStage":{"description":"PipelineStructureStage contains the stage's name, one of either a reference to the Task corresponding to the stage if it has steps, a list of sequential stage names nested within this stage, or a list of parallel stage names nested within this stage, and information on this stage's depth within the PipelineStructure as a whole, the name of its parent stage, if any, the name of the stage before it in execution order, if any, and the name of the stage after it in execution order, if any.","type":"object","required":["name","depth"],"properties":{"depth":{"type":"integer","format":"byte"},"name":{"type":"string"},"next":{"type":"string"},"parallel":{"type":"array","items":{"type":"string"}},"parent":{"type":"string"},"previous":{"type":"string"},"stages":{"type":"array","items":{"type":"string"}},"taskRef":{"description":"Must have one of TaskRef+TaskRunRef, Stages, or Parallel","type":"string"},"taskRunRef":{"description":"Populated during pod discovery, not at initial creation time.","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Plugin":{"description":"Plugin represents a binary plugin installed into this Jenkins X team","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PluginSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PluginList":{"description":"PluginList is a list of Plugins available for a team","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Plugin"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PluginSpec":{"description":"PluginSpec provides details of a binary plugin available for a team","type":"object","properties":{"binaries":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Binary"}},"description":{"type":"string"},"group":{"type":"string"},"name":{"type":"string"},"subCommand":{"type":"string"},"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Postsubmit":{"description":"Postsubmit runs on push events.","type":"object","required":["context"],"properties":{"Brancher":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Brancher"},"JobBase":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.JobBase"},"RegexpChangeMatcher":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.RegexpChangeMatcher"},"context":{"description":"Context is the name of the GitHub status context for the job.","type":"string"},"report":{"description":"Report will comment and set status on GitHub.","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Postsubmits":{"description":"Postsubmits is a list of Postsubmit job configurations that can optionally completely replace the Postsubmit job configurations in the parent scheduler","type":"object","properties":{"entries":{"description":"Items are the post submit configurations","type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Postsubmit"}},"replace":{"description":"Replace the existing entries","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Presubmit":{"description":"Presubmit defines a job configuration for pull requests","type":"object","required":["alwaysRun","context","trigger","rerunCommand"],"properties":{"Brancher":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Brancher"},"JobBase":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.JobBase"},"RegexpChangeMatcher":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.RegexpChangeMatcher"},"alwaysRun":{"description":"AlwaysRun automatically for every PR, or only when a comment triggers it. By default true.","type":"boolean"},"context":{"description":"Context is the name of the Git Provider status context for the job.","type":"string"},"context_options":{"description":"ContextOptions defines the merge options. If not set it will infer the required and optional contexts from the jobs configured and use the Git Provider combined status; otherwise it may apply the branch protection setting or let user define their own options in case branch protection is not used.","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.RepoContextPolicy"},"mergeMethod":{"description":"Override the default method of merge. Valid options are squash, rebase, and merge.","type":"string"},"optional":{"description":"Optional indicates that the job's status context should not be required for merge. By default false.","type":"boolean"},"policy":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ProtectionPolicies"},"queries":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Query"}},"report":{"description":"Report enables reporting the job status on the git provider","type":"boolean"},"rerunCommand":{"description":"The RerunCommand to give users. Must match Trigger. Trigger must also be specified if this field is specified. (Default: `/test \u003cjob name\u003e`)","type":"string"},"trigger":{"description":"Trigger is the regular expression to trigger the job. e.g. `@k8s-bot e2e test this` RerunCommand must also be specified if this field is specified. (Default: `(?m)^/test (?:.*? )?\u003cjob name\u003e(?: .*?)?$`)","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Presubmits":{"description":"Presubmits is a list of Presubmit job configurations that can optionally completely replace the Presubmit job configurations in the parent scheduler","type":"object","properties":{"entries":{"description":"Items are the Presubmit configurtations","type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Presubmit"}},"replace":{"description":"Replace the existing entries","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PreviewActivityStep":{"description":"PreviewActivityStep is the step of creating a preview environment as part of a Pull Request pipeline","type":"object","properties":{"applicationURL":{"type":"string"},"completedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"description":{"type":"string"},"environment":{"type":"string"},"name":{"type":"string"},"pullRequestURL":{"type":"string"},"startedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"status":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PreviewGitSpec":{"description":"PreviewGitSpec is the preview git branch/pull request details","type":"object","properties":{"appName":{"type":"string"},"applicationURL":{"type":"string"},"buildStatus":{"type":"string"},"buildStatusUrl":{"type":"string"},"description":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"user":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromoteActivityStep":{"description":"PromoteActivityStep is the step of promoting a version of an application to an environment","type":"object","properties":{"applicationURL":{"type":"string"},"completedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"description":{"type":"string"},"environment":{"type":"string"},"name":{"type":"string"},"pullRequest":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromotePullRequestStep"},"startedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"status":{"type":"string"},"update":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromoteUpdateStep"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromotePullRequestStep":{"description":"PromotePullRequestStep is the step for promoting a version to an environment by raising a Pull Request on the git repository of the environment","type":"object","properties":{"completedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"description":{"type":"string"},"mergeCommitSHA":{"type":"string"},"name":{"type":"string"},"pullRequestURL":{"type":"string"},"startedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"status":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromoteUpdateStep":{"description":"PromoteUpdateStep is the step for updating a promotion after the Pull Request merges to master","type":"object","properties":{"completedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"description":{"type":"string"},"name":{"type":"string"},"startedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"status":{"type":"string"},"statuses":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GitStatus"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromoteWorkflowStep":{"description":"PromoteWorkflowStep is the step of promoting a version of an application to an environment","type":"object","properties":{"environment":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ProtectionPolicies":{"description":"ProtectionPolicies defines the branch protection policies","type":"object","properties":{"ProtectionPolicy":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ProtectionPolicy"},"Replace":{"type":"boolean"},"entries":{"type":"object","additionalProperties":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ProtectionPolicy"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ProtectionPolicy":{"description":"ProtectionPolicy for merging.","type":"object","properties":{"enforceAdmins":{"description":"Admins overrides whether protections apply to admins if set.","type":"boolean"},"protect":{"description":"Protect overrides whether branch protection is enabled if set.","type":"boolean"},"requiredPullRequestReviews":{"description":"RequiredPullRequestReviews specifies approval/review criteria.","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReviewPolicy"},"requiredStatusChecks":{"description":"RequiredStatusChecks configures github contexts","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BranchProtectionContextPolicy"},"restrictions":{"description":"Restrictions limits who can merge","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Restrictions"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PullRequestInfo":{"description":"PullRequestInfo contains information about a PR included in a batch, like its PR number, the last build number, and SHA","type":"object","properties":{"lastBuildNumberForCommit":{"description":"LastBuildNumberForCommit is the number of the last successful build of this PR outside of a batch","type":"string"},"lastBuildSHA":{"description":"LastBuildSHA is the commit SHA in the last successful build of this PR outside of a batch.","type":"string"},"pullRequestNumber":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Query":{"description":"Query is turned into a Git Provider search query. See the docs for details: https://help.github.com/articles/searching-issues-and-pull-requests/","type":"object","properties":{"excludedBranches":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"includedBranches":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"labels":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"milestone":{"type":"string"},"missingLabels":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"reviewApprovedRequired":{"type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.QuickStartLocation":{"description":"QuickStartLocation","type":"object","properties":{"excludes":{"type":"array","items":{"type":"string"}},"gitKind":{"type":"string"},"gitUrl":{"type":"string"},"includes":{"type":"array","items":{"type":"string"}},"owner":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.RegexpChangeMatcher":{"description":"RegexpChangeMatcher is for code shared between jobs that run only when certain files are changed.","type":"object","properties":{"runIfChanged":{"description":"RunIfChanged defines a regex used to select which subset of file changes should trigger this job. If any file in the changeset matches this regex, the job will be triggered","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Release":{"description":"Release represents a single version of an app that has been released","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReleaseSpec"},"status":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReleaseStatus"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReleaseList":{"description":"ReleaseList is a list of Release resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Release"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReleaseSpec":{"description":"ReleaseSpec is the specification of the Release","type":"object","properties":{"commits":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitSummary"}},"dependencyUpdates":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.DependencyUpdate"}},"gitCloneUrl":{"type":"string"},"gitHttpUrl":{"type":"string"},"gitOwner":{"type":"string"},"gitRepository":{"type":"string"},"issues":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.IssueSummary"}},"name":{"type":"string"},"pullRequests":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.IssueSummary"}},"releaseNotesURL":{"type":"string"},"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReleaseStatus":{"description":"ReleaseStatus is the status of a release","type":"object","properties":{"status":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableMapOfStringContextPolicy":{"description":"ReplaceableMapOfStringContextPolicy is a map of context policies that can optionally completely replace any context policies defined in the parent scheduler","type":"object","required":["Items"],"properties":{"Items":{"type":"object","additionalProperties":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ContextPolicy"}},"replace":{"type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableMapOfStringString":{"description":"ReplaceableMapOfStringString is a map of strings that can optionally completely replace the map of strings in the parent scheduler","type":"object","properties":{"entries":{"type":"object","additionalProperties":{"type":"string"}},"replace":{"description":"Replace the existing entries","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfExternalPlugins":{"description":"ReplaceableSliceOfExternalPlugins is a list of external plugins that can optionally completely replace the plugins in any parent SchedulerSpec","type":"object","required":["Replace"],"properties":{"Replace":{"type":"boolean"},"entries":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExternalPlugin"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings":{"description":"ReplaceableSliceOfStrings is a slice of strings that can optionally completely replace the slice of strings defined in the parent scheduler","type":"object","properties":{"entries":{"description":"Items is the string values","type":"array","items":{"type":"string"}},"replace":{"description":"Replace the existing entries","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.RepoContextPolicy":{"description":"RepoContextPolicy overrides the policy for repo, and any branch overrides.","type":"object","required":["ContextPolicy"],"properties":{"ContextPolicy":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ContextPolicy"},"branches":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableMapOfStringContextPolicy"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ResourceReference":{"type":"object","required":["kind","name"],"properties":{"apiVersion":{"description":"API version of the referent.","type":"string"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds","type":"string"},"name":{"description":"Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names","type":"string"},"uid":{"description":"UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Restrictions":{"description":"Restrictions limits who can merge Users and Teams entries are appended to parent lists.","type":"object","required":["users","teams"],"properties":{"teams":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"users":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReviewPolicy":{"description":"ReviewPolicy specifies git provider approval/review criteria. Any nil values inherit the policy from the parent, otherwise bool/ints are overridden. Non-empty lists are appended to parent lists.","type":"object","properties":{"dismissStaleReviews":{"description":"DismissStale overrides whether new commits automatically dismiss old reviews if set","type":"boolean"},"dismissalRestrictions":{"description":"Restrictions appends users/teams that are allowed to merge","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Restrictions"},"requireCodeOwnerReviews":{"description":"RequireOwners overrides whether CODEOWNERS must approve PRs if set","type":"boolean"},"requiredApprovingReviewCount":{"description":"Approvals overrides the number of approvals required if set (set to 0 to disable)","type":"integer","format":"int32"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Scheduler":{"description":"Scheduler is configuration for a pipeline scheduler","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SchedulerSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SchedulerAgent":{"description":"SchedulerAgent defines the scheduler agent configuration","type":"object","required":["agent"],"properties":{"agent":{"description":"Agent defines the agent used to schedule jobs, by default Prow","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SchedulerList":{"description":"SchedulerList is a list of configurations for a pipeline scheduler","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Scheduler"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SchedulerSpec":{"description":"SchedulerSpec defines the pipeline scheduler (e.g. Prow) configuration","type":"object","properties":{"approve":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Approve"},"attachments":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Attachment"}},"configUpdater":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ConfigUpdater"},"externalPlugins":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfExternalPlugins"},"lgtm":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Lgtm"},"merger":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Merger"},"periodics":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Periodics"},"plugins":{"description":"Plugins is a list of plugin names enabled for a repo","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"policy":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GlobalProtectionPolicy"},"postsubmits":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Postsubmits"},"presubmits":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Presubmits"},"schedulerAgent":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SchedulerAgent"},"trigger":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Trigger"},"welcome":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Welcome"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepository":{"description":"SourceRepository is the metadata for an Application/Project/SourceRepository","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositorySpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositoryGroup":{"description":"SourceRepositoryGroup is the metadata for an Application/Project/SourceRepository","type":"object","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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositoryGroupSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositoryGroupList":{"description":"SourceRepositoryGroupList is a structure used by k8s to store lists of apps","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositoryGroup"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositoryGroupSpec":{"description":"SourceRepositoryGroupSpec is the metadata for an Application/Project/SourceRepository","type":"object","required":["repositories","scheduler"],"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"repositories":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ResourceReference"}},"scheduler":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ResourceReference"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositoryList":{"description":"SourceRepositoryList is a structure used by k8s to store lists of apps","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepository"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositorySpec":{"description":"SourceRepositorySpec provides details of the metadata for an App","type":"object","properties":{"description":{"type":"string"},"httpCloneURL":{"description":"HTTPCloneURL is the git URL to clone this repository using HTTP/HTTPS","type":"string"},"org":{"type":"string"},"provider":{"description":"Provider stores the URL of the git provider such as https://github.com","type":"string"},"providerKind":{"description":"ProviderKind is the kind of provider (github / bitbucketcloud / bitbucketserver etc)","type":"string"},"providerName":{"description":"ProviderName is a logical name for the provider without any URL scheme which can be used in a label selector","type":"string"},"repo":{"type":"string"},"scheduler":{"description":"Scheduler a reference to a custom scheduler otherwise we default to the Team's Scededuler","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ResourceReference"},"sshCloneURL":{"description":"SSHCloneURL is the git URL to clone this repository using SSH","type":"string"},"url":{"description":"URL is the web URL of the project page","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.StageActivityStep":{"description":"StageActivityStep represents a stage of zero to more sub steps in a jenkins pipeline","type":"object","properties":{"completedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"description":{"type":"string"},"name":{"type":"string"},"startedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"status":{"type":"string"},"steps":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CoreActivityStep"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Statement":{"description":"Statement represents a decision that was made, for example that a promotion was approved or denied","type":"object","required":["name","statementType","measurementValue"],"properties":{"measurementValue":{"type":"boolean"},"name":{"type":"string"},"statementType":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.StorageLocation":{"description":"StorageLocation","type":"object","properties":{"bucketUrl":{"type":"string"},"classifier":{"type":"string"},"gitBranch":{"type":"string"},"gitUrl":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Team":{"description":"Team represents a request to create an actual Team which is a group of users, a development environment and optional other environments","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.TeamSpec"},"status":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.TeamStatus"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.TeamList":{"description":"TeamList is a list of TypeMeta resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Team"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.TeamSettings":{"description":"TeamSettings the default settings for a team","type":"object","properties":{"appPrefixes":{"description":"AppsPrefixes is the list of prefixes for appNames","type":"array","items":{"type":"string"}},"appsRepository":{"type":"string"},"askOnCreate":{"type":"boolean"},"bootRequirements":{"description":"BootRequirements is a marshaled string of the jx-requirements.yml used in the most recent run for this cluster","type":"string"},"branchPatterns":{"type":"string"},"buildPackName":{"type":"string"},"buildPackRef":{"type":"string"},"buildPackUrl":{"type":"string"},"defaultScheduler":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ResourceReference"},"deployKind":{"description":"DeployKind what kind of deployment (\"default\" uses regular Kubernetes Services and Deployments, \"knative\" uses the Knative Service resource instead)","type":"string"},"deployOptions":{"description":"DeployOptions configures options for how to deploy applications by default such as using canary rollouts (progressive delivery) or using horizontal pod autoscaler","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.DeployOptions"},"dockerRegistryOrg":{"type":"string"},"envOrganisation":{"type":"string"},"forkBranchPatterns":{"type":"string"},"gitPublic":{"type":"boolean"},"gitServer":{"type":"string"},"helmBinary":{"type":"string"},"helmTemplate":{"type":"boolean"},"importMode":{"description":"ImportMode indicates what kind of","type":"string"},"kubeProvider":{"type":"string"},"noTiller":{"type":"boolean"},"organisation":{"type":"string"},"pipelineUserEmail":{"type":"string"},"pipelineUsername":{"type":"string"},"postPreviewJobs":{"type":"array","items":{"$ref":"#/definitions/io.k8s.api.batch.v1.Job"}},"profile":{"description":"Profile is the profile in use (see jx profile)","type":"string"},"promotionEngine":{"type":"string"},"prowConfig":{"description":"ProwConfig is the way we manage prow configurations","type":"string"},"prowEngine":{"description":"ProwEngine is the kind of prow engine used such as knative build or build pipeline","type":"string"},"quickstartLocations":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.QuickStartLocation"}},"storageLocations":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.StorageLocation"}},"useGitOps":{"type":"boolean"},"versionStreamRef":{"description":"VersionStreamRef contains the git ref (tag or branch) in the VersionStreamURL repository to use as the version stream","type":"string"},"versionStreamUrl":{"description":"VersionStreamURL contains the git clone URL for the Version Stream which is the set of versions to use for charts, images, packages etc","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.TeamSpec":{"description":"TeamSpec is the specification of an Team","type":"object","properties":{"kind":{"type":"string"},"label":{"type":"string"},"members":{"type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.TeamStatus":{"description":"TeamStatus is the status for an Team resource","type":"object","properties":{"message":{"type":"string"},"provisionStatus":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Trigger":{"description":"Trigger specifies a configuration for a single trigger.\n\nThe configuration for the trigger plugin is defined as a list of these structures.","type":"object","properties":{"ignoreOkToTest":{"description":"IgnoreOkToTest makes trigger ignore /ok-to-test comments. This is a security mitigation to only allow testing from trusted users.","type":"boolean"},"joinOrgUrl":{"description":"JoinOrgURL is a link that redirects users to a location where they should be able to read more about joining the organization in order to become trusted members. Defaults to the Github link of TrustedOrg.","type":"string"},"onlyOrgMembers":{"description":"OnlyOrgMembers requires PRs and/or /ok-to-test comments to come from org members. By default, trigger also include repo collaborators.","type":"boolean"},"trustedOrg":{"description":"TrustedOrg is the org whose members' PRs will be automatically built for PRs to the above repos. The default is the PR's org.","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.User":{"description":"User represents a git user so we have a cache to find by email address","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails"},"user":{"description":"Deprecated, use Spec","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails":{"description":"UserDetails containers details of a user","type":"object","properties":{"accountReference":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.AccountReference"}},"avatarUrl":{"type":"string"},"creationTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"email":{"type":"string"},"externalUser":{"type":"boolean"},"login":{"type":"string"},"name":{"type":"string"},"serviceAccount":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserList":{"description":"UserList is a list of User resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.User"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserSpec":{"description":"UserSpec is the user details","type":"object","properties":{"imageUrl":{"type":"string"},"linkUrl":{"type":"string"},"name":{"type":"string"},"username":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Welcome":{"description":"Welcome welcome plugin config","type":"object","properties":{"message_template":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Workflow":{"description":"Workflow represents pipeline activity for a particular run of a pipeline","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowSpec"},"status":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowStatus"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowList":{"description":"WorkflowList is a list of Workflow resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Workflow"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowPreconditions":{"description":"WorkflowPreconditions is the trigger to start a step","type":"object","properties":{"environments":{"description":"the names of the environments which need to have promoted before this step can be triggered","type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowSpec":{"description":"WorkflowSpec is the specification of the pipeline activity","type":"object","properties":{"pipeline":{"type":"string"},"steps":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowStep"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowStatus":{"description":"WorkflowStatus is the status for an Environment resource","type":"object","properties":{"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowStep":{"description":"WorkflowStep represents a step in a pipeline activity","type":"object","properties":{"description":{"type":"string"},"kind":{"type":"string"},"name":{"type":"string"},"promote":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromoteWorkflowStep"},"trigger":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowPreconditions"}}},"io.k8s.api.batch.v1.Job":{"description":"Job represents the configuration of a single job.","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","$ref":"#/definitions/io.k8s.api.batch.v1.JobSpec"},"status":{"description":"Current status of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","$ref":"#/definitions/io.k8s.api.batch.v1.JobStatus"}}},"io.k8s.api.batch.v1.JobCondition":{"description":"JobCondition describes current state of a job.","type":"object","required":["type","status"],"properties":{"lastProbeTime":{"description":"Last time the condition was checked.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"lastTransitionTime":{"description":"Last time the condition transit from one status to another.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"message":{"description":"Human readable message indicating details about last transition.","type":"string"},"reason":{"description":"(brief) reason for the condition's last transition.","type":"string"},"status":{"description":"Status of the condition, one of True, False, Unknown.","type":"string"},"type":{"description":"Type of job condition, Complete or Failed.","type":"string"}}},"io.k8s.api.batch.v1.JobSpec":{"description":"JobSpec describes how the job execution will look like.","type":"object","required":["template"],"properties":{"activeDeadlineSeconds":{"description":"Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer","type":"integer","format":"int64"},"backoffLimit":{"description":"Specifies the number of retries before marking this job failed. Defaults to 6","type":"integer","format":"int32"},"completions":{"description":"Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"manualSelector":{"description":"manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector","type":"boolean"},"parallelism":{"description":"Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) \u003c .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"selector":{"description":"A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"template":{"description":"Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","$ref":"#/definitions/io.k8s.api.core.v1.PodTemplateSpec"},"ttlSecondsAfterFinished":{"description":"ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature.","type":"integer","format":"int32"}}},"io.k8s.api.batch.v1.JobStatus":{"description":"JobStatus represents the current state of a Job.","type":"object","properties":{"active":{"description":"The number of actively running pods.","type":"integer","format":"int32"},"completionTime":{"description":"Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"conditions":{"description":"The latest available observations of an object's current state. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"array","items":{"$ref":"#/definitions/io.k8s.api.batch.v1.JobCondition"},"x-kubernetes-patch-merge-key":"type","x-kubernetes-patch-strategy":"merge"},"failed":{"description":"The number of pods which reached phase Failed.","type":"integer","format":"int32"},"startTime":{"description":"Represents time when the job was acknowledged by the job controller. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"succeeded":{"description":"The number of pods which reached phase Succeeded.","type":"integer","format":"int32"}}},"io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource":{"description":"Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string"},"partition":{"description":"The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).","type":"integer","format":"int32"},"readOnly":{"description":"Specify \"true\" to force and set the ReadOnly property in VolumeMounts to \"true\". If omitted, the default is \"false\". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"boolean"},"volumeID":{"description":"Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string"}}},"io.k8s.api.core.v1.Affinity":{"description":"Affinity is a group of affinity scheduling rules.","type":"object","properties":{"nodeAffinity":{"description":"Describes node affinity scheduling rules for the pod.","$ref":"#/definitions/io.k8s.api.core.v1.NodeAffinity"},"podAffinity":{"description":"Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/definitions/io.k8s.api.core.v1.PodAffinity"},"podAntiAffinity":{"description":"Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/definitions/io.k8s.api.core.v1.PodAntiAffinity"}}},"io.k8s.api.core.v1.AzureDiskVolumeSource":{"description":"AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","type":"object","required":["diskName","diskURI"],"properties":{"cachingMode":{"description":"Host Caching mode: None, Read Only, Read Write.","type":"string"},"diskName":{"description":"The Name of the data disk in the blob storage","type":"string"},"diskURI":{"description":"The URI the data disk in the blob storage","type":"string"},"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"kind":{"description":"Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared","type":"string"},"readOnly":{"description":"Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"}}},"io.k8s.api.core.v1.AzureFileVolumeSource":{"description":"AzureFile represents an Azure File Service mount on the host and bind mount to the pod.","type":"object","required":["secretName","shareName"],"properties":{"readOnly":{"description":"Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretName":{"description":"the name of secret that contains Azure Storage Account Name and Key","type":"string"},"shareName":{"description":"Share Name","type":"string"}}},"io.k8s.api.core.v1.CSIVolumeSource":{"description":"Represents a source location of a volume to mount, managed by an external CSI driver","type":"object","required":["driver"],"properties":{"driver":{"description":"Driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.","type":"string"},"fsType":{"description":"Filesystem type to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.","type":"string"},"nodePublishSecretRef":{"description":"NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed.","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"readOnly":{"description":"Specifies a read-only configuration for the volume. Defaults to false (read/write).","type":"boolean"},"volumeAttributes":{"description":"VolumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.","type":"object","additionalProperties":{"type":"string"}}}},"io.k8s.api.core.v1.Capabilities":{"description":"Adds and removes POSIX capabilities from running containers.","type":"object","properties":{"add":{"description":"Added capabilities","type":"array","items":{"type":"string"}},"drop":{"description":"Removed capabilities","type":"array","items":{"type":"string"}}}},"io.k8s.api.core.v1.CephFSVolumeSource":{"description":"Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["monitors"],"properties":{"monitors":{"description":"Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"array","items":{"type":"string"}},"path":{"description":"Optional: Used as the mounted root, rather than the full Ceph tree, default is /","type":"string"},"readOnly":{"description":"Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"boolean"},"secretFile":{"description":"Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"},"secretRef":{"description":"Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"Optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.CinderVolumeSource":{"description":"Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string"},"readOnly":{"description":"Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"boolean"},"secretRef":{"description":"Optional: points to a secret object containing parameters used to connect to OpenStack.","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"volumeID":{"description":"volume id used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string"}}},"io.k8s.api.core.v1.ConfigMapEnvSource":{"description":"ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapKeySelector":{"description":"Selects a key from a ConfigMap.","type":"object","required":["key"],"properties":{"key":{"description":"The key to select.","type":"string"},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap or its key must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapProjection":{"description":"Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.","type":"object","properties":{"items":{"description":"If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapVolumeSource":{"description":"Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.Container":{"description":"A single application container that you want to run within a pod.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string"}},"command":{"description":"Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string"}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images","type":"string"},"lifecycle":{"description":"Actions that the management system should take in response to container lifecycle events. Cannot be updated.","$ref":"#/definitions/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/definitions/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.","type":"string"},"ports":{"description":"List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.ContainerPort"},"x-kubernetes-list-map-keys":["containerPort","protocol"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"containerPort","x-kubernetes-patch-strategy":"merge"},"readinessProbe":{"description":"Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/definitions/io.k8s.api.core.v1.Probe"},"resources":{"description":"Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/","$ref":"#/definitions/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"Security options the pod should run with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/","$ref":"#/definitions/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/definitions/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container. This is a beta feature.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.ContainerPort":{"description":"ContainerPort represents a network port in a single container.","type":"object","required":["containerPort"],"properties":{"containerPort":{"description":"Number of port to expose on the pod's IP address. This must be a valid port number, 0 \u003c x \u003c 65536.","type":"integer","format":"int32"},"hostIP":{"description":"What host IP to bind the external port to.","type":"string"},"hostPort":{"description":"Number of port to expose on the host. If specified, this must be a valid port number, 0 \u003c x \u003c 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.","type":"integer","format":"int32"},"name":{"description":"If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.","type":"string"},"protocol":{"description":"Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".","type":"string"}}},"io.k8s.api.core.v1.DownwardAPIProjection":{"description":"Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.","type":"object","properties":{"items":{"description":"Items is a list of DownwardAPIVolume file","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.DownwardAPIVolumeFile":{"description":"DownwardAPIVolumeFile represents information to create the file containing the pod field","type":"object","required":["path"],"properties":{"fieldRef":{"description":"Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.","$ref":"#/definitions/io.k8s.api.core.v1.ObjectFieldSelector"},"mode":{"description":"Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'","type":"string"},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.","$ref":"#/definitions/io.k8s.api.core.v1.ResourceFieldSelector"}}},"io.k8s.api.core.v1.DownwardAPIVolumeSource":{"description":"DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"Items is a list of downward API volume file","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.EmptyDirVolumeSource":{"description":"Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.","type":"object","properties":{"medium":{"description":"What type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","type":"string"},"sizeLimit":{"description":"Total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir","$ref":"#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"}}},"io.k8s.api.core.v1.EnvFromSource":{"description":"EnvFromSource represents the source of a set of ConfigMaps","type":"object","properties":{"configMapRef":{"description":"The ConfigMap to select from","$ref":"#/definitions/io.k8s.api.core.v1.ConfigMapEnvSource"},"prefix":{"description":"An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.","type":"string"},"secretRef":{"description":"The Secret to select from","$ref":"#/definitions/io.k8s.api.core.v1.SecretEnvSource"}}},"io.k8s.api.core.v1.EnvVar":{"description":"EnvVar represents an environment variable present in a Container.","type":"object","required":["name"],"properties":{"name":{"description":"Name of the environment variable. Must be a C_IDENTIFIER.","type":"string"},"value":{"description":"Variable references $(VAR_NAME) are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".","type":"string"},"valueFrom":{"description":"Source for the environment variable's value. Cannot be used if value is not empty.","$ref":"#/definitions/io.k8s.api.core.v1.EnvVarSource"}}},"io.k8s.api.core.v1.EnvVarSource":{"description":"EnvVarSource represents a source for the value of an EnvVar.","type":"object","properties":{"configMapKeyRef":{"description":"Selects a key of a ConfigMap.","$ref":"#/definitions/io.k8s.api.core.v1.ConfigMapKeySelector"},"fieldRef":{"description":"Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP.","$ref":"#/definitions/io.k8s.api.core.v1.ObjectFieldSelector"},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.","$ref":"#/definitions/io.k8s.api.core.v1.ResourceFieldSelector"},"secretKeyRef":{"description":"Selects a key of a secret in the pod's namespace","$ref":"#/definitions/io.k8s.api.core.v1.SecretKeySelector"}}},"io.k8s.api.core.v1.EphemeralContainer":{"description":"An EphemeralContainer is a container that may be added temporarily to an existing pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a pod is removed or restarted. If an ephemeral container causes a pod to exceed its resource allocation, the pod may be evicted. Ephemeral containers may not be added by directly updating the pod spec. They must be added via the pod's ephemeralcontainers subresource, and they will appear in the pod spec once added. This is an alpha feature enabled by the EphemeralContainers feature flag.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string"}},"command":{"description":"Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string"}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images","type":"string"},"lifecycle":{"description":"Lifecycle is not allowed for ephemeral containers.","$ref":"#/definitions/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/definitions/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.","type":"string"},"ports":{"description":"Ports are not allowed for ephemeral containers.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.ContainerPort"}},"readinessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/definitions/io.k8s.api.core.v1.Probe"},"resources":{"description":"Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.","$ref":"#/definitions/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"SecurityContext is not allowed for ephemeral containers.","$ref":"#/definitions/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/definitions/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"targetContainerName":{"description":"If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container is run in whatever namespaces are shared for the pod. Note that the container runtime must support this feature.","type":"string"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container. This is a beta feature.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.ExecAction":{"description":"ExecAction describes a \"run in container\" action.","type":"object","properties":{"command":{"description":"Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.","type":"array","items":{"type":"string"}}}},"io.k8s.api.core.v1.FCVolumeSource":{"description":"Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.","type":"object","properties":{"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"lun":{"description":"Optional: FC target lun number","type":"integer","format":"int32"},"readOnly":{"description":"Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"targetWWNs":{"description":"Optional: FC target worldwide names (WWNs)","type":"array","items":{"type":"string"}},"wwids":{"description":"Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.","type":"array","items":{"type":"string"}}}},"io.k8s.api.core.v1.FlexVolumeSource":{"description":"FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","type":"object","required":["driver"],"properties":{"driver":{"description":"Driver is the name of the driver to use for this volume.","type":"string"},"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.","type":"string"},"options":{"description":"Optional: Extra command options if any.","type":"object","additionalProperties":{"type":"string"}},"readOnly":{"description":"Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"}}},"io.k8s.api.core.v1.FlockerVolumeSource":{"description":"Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.","type":"object","properties":{"datasetName":{"description":"Name of the dataset stored as metadata -\u003e name on the dataset for Flocker should be considered as deprecated","type":"string"},"datasetUUID":{"description":"UUID of the dataset. This is unique identifier of a Flocker dataset","type":"string"}}},"io.k8s.api.core.v1.GCEPersistentDiskVolumeSource":{"description":"Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.","type":"object","required":["pdName"],"properties":{"fsType":{"description":"Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string"},"partition":{"description":"The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"integer","format":"int32"},"pdName":{"description":"Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string"},"readOnly":{"description":"ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"boolean"}}},"io.k8s.api.core.v1.GitRepoVolumeSource":{"description":"Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.\n\nDEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","type":"object","required":["repository"],"properties":{"directory":{"description":"Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.","type":"string"},"repository":{"description":"Repository URL","type":"string"},"revision":{"description":"Commit hash for the specified revision.","type":"string"}}},"io.k8s.api.core.v1.GlusterfsVolumeSource":{"description":"Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["endpoints","path"],"properties":{"endpoints":{"description":"EndpointsName is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string"},"path":{"description":"Path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string"},"readOnly":{"description":"ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"boolean"}}},"io.k8s.api.core.v1.HTTPGetAction":{"description":"HTTPGetAction describes an action based on HTTP Get requests.","type":"object","required":["port"],"properties":{"host":{"description":"Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.","type":"string"},"httpHeaders":{"description":"Custom headers to set in the request. HTTP allows repeated headers.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.HTTPHeader"}},"path":{"description":"Path to access on the HTTP server.","type":"string"},"port":{"description":"Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","$ref":"#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString"},"scheme":{"description":"Scheme to use for connecting to the host. Defaults to HTTP.","type":"string"}}},"io.k8s.api.core.v1.HTTPHeader":{"description":"HTTPHeader describes a custom header to be used in HTTP probes","type":"object","required":["name","value"],"properties":{"name":{"description":"The header field name","type":"string"},"value":{"description":"The header field value","type":"string"}}},"io.k8s.api.core.v1.Handler":{"description":"Handler defines a specific action that should be taken","type":"object","properties":{"exec":{"description":"One and only one of the following should be specified. Exec specifies the action to take.","$ref":"#/definitions/io.k8s.api.core.v1.ExecAction"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/definitions/io.k8s.api.core.v1.HTTPGetAction"},"tcpSocket":{"description":"TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported","$ref":"#/definitions/io.k8s.api.core.v1.TCPSocketAction"}}},"io.k8s.api.core.v1.HostAlias":{"description":"HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.","type":"object","properties":{"hostnames":{"description":"Hostnames for the above IP address.","type":"array","items":{"type":"string"}},"ip":{"description":"IP address of the host file entry.","type":"string"}}},"io.k8s.api.core.v1.HostPathVolumeSource":{"description":"Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.","type":"object","required":["path"],"properties":{"path":{"description":"Path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string"},"type":{"description":"Type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string"}}},"io.k8s.api.core.v1.ISCSIVolumeSource":{"description":"Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.","type":"object","required":["targetPortal","iqn","lun"],"properties":{"chapAuthDiscovery":{"description":"whether support iSCSI Discovery CHAP authentication","type":"boolean"},"chapAuthSession":{"description":"whether support iSCSI Session CHAP authentication","type":"boolean"},"fsType":{"description":"Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi","type":"string"},"initiatorName":{"description":"Custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface \u003ctarget portal\u003e:\u003cvolume name\u003e will be created for the connection.","type":"string"},"iqn":{"description":"Target iSCSI Qualified Name.","type":"string"},"iscsiInterface":{"description":"iSCSI Interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).","type":"string"},"lun":{"description":"iSCSI Target Lun number.","type":"integer","format":"int32"},"portals":{"description":"iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"array","items":{"type":"string"}},"readOnly":{"description":"ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.","type":"boolean"},"secretRef":{"description":"CHAP Secret for iSCSI target and initiator authentication","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"targetPortal":{"description":"iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"string"}}},"io.k8s.api.core.v1.KeyToPath":{"description":"Maps a string key to a path within a volume.","type":"object","required":["key","path"],"properties":{"key":{"description":"The key to project.","type":"string"},"mode":{"description":"Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.","type":"string"}}},"io.k8s.api.core.v1.Lifecycle":{"description":"Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.","type":"object","properties":{"postStart":{"description":"PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/definitions/io.k8s.api.core.v1.Handler"},"preStop":{"description":"PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod's termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/definitions/io.k8s.api.core.v1.Handler"}}},"io.k8s.api.core.v1.LocalObjectReference":{"description":"LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"}}},"io.k8s.api.core.v1.NFSVolumeSource":{"description":"Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.","type":"object","required":["server","path"],"properties":{"path":{"description":"Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string"},"readOnly":{"description":"ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"boolean"},"server":{"description":"Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string"}}},"io.k8s.api.core.v1.NodeAffinity":{"description":"Node affinity is a group of node affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.PreferredSchedulingTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.","$ref":"#/definitions/io.k8s.api.core.v1.NodeSelector"}}},"io.k8s.api.core.v1.NodeSelector":{"description":"A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.","type":"object","required":["nodeSelectorTerms"],"properties":{"nodeSelectorTerms":{"description":"Required. A list of node selector terms. The terms are ORed.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.NodeSelectorTerm"}}}},"io.k8s.api.core.v1.NodeSelectorRequirement":{"description":"A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"The label key that the selector applies to.","type":"string"},"operator":{"description":"Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.","type":"string"},"values":{"description":"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. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.","type":"array","items":{"type":"string"}}}},"io.k8s.api.core.v1.NodeSelectorTerm":{"description":"A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.","type":"object","properties":{"matchExpressions":{"description":"A list of node selector requirements by node's labels.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.NodeSelectorRequirement"}},"matchFields":{"description":"A list of node selector requirements by node's fields.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.NodeSelectorRequirement"}}}},"io.k8s.api.core.v1.ObjectFieldSelector":{"description":"ObjectFieldSelector selects an APIVersioned field of an object.","type":"object","required":["fieldPath"],"properties":{"apiVersion":{"description":"Version of the schema the FieldPath is written in terms of, defaults to \"v1\".","type":"string"},"fieldPath":{"description":"Path of the field to select in the specified API version.","type":"string"}}},"io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource":{"description":"PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).","type":"object","required":["claimName"],"properties":{"claimName":{"description":"ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","type":"string"},"readOnly":{"description":"Will force the ReadOnly setting in VolumeMounts. Default false.","type":"boolean"}}},"io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource":{"description":"Represents a Photon Controller persistent disk resource.","type":"object","required":["pdID"],"properties":{"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"pdID":{"description":"ID that identifies Photon Controller persistent disk","type":"string"}}},"io.k8s.api.core.v1.PodAffinity":{"description":"Pod affinity is a group of inter pod affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodAffinityTerm":{"description":"Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key \u003ctopologyKey\u003e matches that of any node on which a pod of the set of pods is running","type":"object","required":["topologyKey"],"properties":{"labelSelector":{"description":"A label query over a set of resources, in this case pods.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"namespaces":{"description":"namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means \"this pod's namespace\"","type":"array","items":{"type":"string"}},"topologyKey":{"description":"This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.","type":"string"}}},"io.k8s.api.core.v1.PodAntiAffinity":{"description":"Pod anti affinity is a group of inter pod anti affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodDNSConfig":{"description":"PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.","type":"object","properties":{"nameservers":{"description":"A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.","type":"array","items":{"type":"string"}},"options":{"description":"A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.PodDNSConfigOption"}},"searches":{"description":"A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.","type":"array","items":{"type":"string"}}}},"io.k8s.api.core.v1.PodDNSConfigOption":{"description":"PodDNSConfigOption defines DNS resolver options of a pod.","type":"object","properties":{"name":{"description":"Required.","type":"string"},"value":{"type":"string"}}},"io.k8s.api.core.v1.PodReadinessGate":{"description":"PodReadinessGate contains the reference to a pod condition","type":"object","required":["conditionType"],"properties":{"conditionType":{"description":"ConditionType refers to a condition in the pod's condition list with matching type.","type":"string"}}},"io.k8s.api.core.v1.PodSecurityContext":{"description":"PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.","type":"object","properties":{"fsGroup":{"description":"A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume.","type":"integer","format":"int64"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.","$ref":"#/definitions/io.k8s.api.core.v1.SELinuxOptions"},"supplementalGroups":{"description":"A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container.","type":"array","items":{"type":"integer","format":"int64"}},"sysctls":{"description":"Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.Sysctl"}},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","$ref":"#/definitions/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.PodSpec":{"description":"PodSpec is a description of a pod.","type":"object","required":["containers"],"properties":{"activeDeadlineSeconds":{"description":"Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.","type":"integer","format":"int64"},"affinity":{"description":"If specified, the pod's scheduling constraints","$ref":"#/definitions/io.k8s.api.core.v1.Affinity"},"automountServiceAccountToken":{"description":"AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.","type":"boolean"},"containers":{"description":"List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"dnsConfig":{"description":"Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.","$ref":"#/definitions/io.k8s.api.core.v1.PodDNSConfig"},"dnsPolicy":{"description":"Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.","type":"string"},"enableServiceLinks":{"description":"EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.","type":"boolean"},"ephemeralContainers":{"description":"List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. This field is alpha-level and is only honored by servers that enable the EphemeralContainers feature.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.EphemeralContainer"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"hostAliases":{"description":"HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.HostAlias"},"x-kubernetes-patch-merge-key":"ip","x-kubernetes-patch-strategy":"merge"},"hostIPC":{"description":"Use the host's ipc namespace. Optional: Default to false.","type":"boolean"},"hostNetwork":{"description":"Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.","type":"boolean"},"hostPID":{"description":"Use the host's pid namespace. Optional: Default to false.","type":"boolean"},"hostname":{"description":"Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.","type":"string"},"imagePullSecrets":{"description":"ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"initContainers":{"description":"List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"nodeName":{"description":"NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.","type":"string"},"nodeSelector":{"description":"NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/","type":"object","additionalProperties":{"type":"string"}},"overhead":{"description":"Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md This field is alpha-level as of Kubernetes v1.16, and is only honored by servers that enable the PodOverhead feature.","type":"object","additionalProperties":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"preemptionPolicy":{"description":"PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature.","type":"string"},"priority":{"description":"The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.","type":"integer","format":"int32"},"priorityClassName":{"description":"If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.","type":"string"},"readinessGates":{"description":"If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.PodReadinessGate"}},"restartPolicy":{"description":"Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy","type":"string"},"runtimeClassName":{"description":"RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md This is a beta feature as of Kubernetes v1.14.","type":"string"},"schedulerName":{"description":"If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.","type":"string"},"securityContext":{"description":"SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.","$ref":"#/definitions/io.k8s.api.core.v1.PodSecurityContext"},"serviceAccount":{"description":"DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.","type":"string"},"serviceAccountName":{"description":"ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/","type":"string"},"shareProcessNamespace":{"description":"Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false. This field is beta-level and may be disabled with the PodShareProcessNamespace feature.","type":"boolean"},"subdomain":{"description":"If specified, the fully qualified Pod hostname will be \"\u003chostname\u003e.\u003csubdomain\u003e.\u003cpod namespace\u003e.svc.\u003ccluster domain\u003e\". If not specified, the pod will not have a domainname at all.","type":"string"},"terminationGracePeriodSeconds":{"description":"Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.","type":"integer","format":"int64"},"tolerations":{"description":"If specified, the pod's tolerations.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.Toleration"}},"topologySpreadConstraints":{"description":"TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. This field is alpha-level and is only honored by clusters that enables the EvenPodsSpread feature. All topologySpreadConstraints are ANDed.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.TopologySpreadConstraint"},"x-kubernetes-list-map-keys":["topologyKey","whenUnsatisfiable"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"topologyKey","x-kubernetes-patch-strategy":"merge"},"volumes":{"description":"List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.Volume"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge,retainKeys"}}},"io.k8s.api.core.v1.PodTemplateSpec":{"description":"PodTemplateSpec describes the data a pod should have when created from a template","type":"object","properties":{"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","$ref":"#/definitions/io.k8s.api.core.v1.PodSpec"}}},"io.k8s.api.core.v1.PortworxVolumeSource":{"description":"PortworxVolumeSource represents a Portworx volume resource.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"FSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"volumeID":{"description":"VolumeID uniquely identifies a Portworx volume","type":"string"}}},"io.k8s.api.core.v1.PreferredSchedulingTerm":{"description":"An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).","type":"object","required":["weight","preference"],"properties":{"preference":{"description":"A node selector term, associated with the corresponding weight.","$ref":"#/definitions/io.k8s.api.core.v1.NodeSelectorTerm"},"weight":{"description":"Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.","type":"integer","format":"int32"}}},"io.k8s.api.core.v1.Probe":{"description":"Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.","type":"object","properties":{"exec":{"description":"One and only one of the following should be specified. Exec specifies the action to take.","$ref":"#/definitions/io.k8s.api.core.v1.ExecAction"},"failureThreshold":{"description":"Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.","type":"integer","format":"int32"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/definitions/io.k8s.api.core.v1.HTTPGetAction"},"initialDelaySeconds":{"description":"Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"},"periodSeconds":{"description":"How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.","type":"integer","format":"int32"},"successThreshold":{"description":"Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.","type":"integer","format":"int32"},"tcpSocket":{"description":"TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported","$ref":"#/definitions/io.k8s.api.core.v1.TCPSocketAction"},"timeoutSeconds":{"description":"Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"}}},"io.k8s.api.core.v1.ProjectedVolumeSource":{"description":"Represents a projected volume source","type":"object","required":["sources"],"properties":{"defaultMode":{"description":"Mode bits to use on created files by default. Must be a value between 0 and 0777. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"sources":{"description":"list of volume projections","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.VolumeProjection"}}}},"io.k8s.api.core.v1.QuobyteVolumeSource":{"description":"Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.","type":"object","required":["registry","volume"],"properties":{"group":{"description":"Group to map volume access to Default is no group","type":"string"},"readOnly":{"description":"ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.","type":"boolean"},"registry":{"description":"Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes","type":"string"},"tenant":{"description":"Tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin","type":"string"},"user":{"description":"User to map volume access to Defaults to serivceaccount user","type":"string"},"volume":{"description":"Volume is a string that references an already created Quobyte volume by name.","type":"string"}}},"io.k8s.api.core.v1.RBDVolumeSource":{"description":"Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.","type":"object","required":["monitors","image"],"properties":{"fsType":{"description":"Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd","type":"string"},"image":{"description":"The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"keyring":{"description":"Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"monitors":{"description":"A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"array","items":{"type":"string"}},"pool":{"description":"The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"readOnly":{"description":"ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"boolean"},"secretRef":{"description":"SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.ResourceFieldSelector":{"description":"ResourceFieldSelector represents container resources (cpu, memory) and their output format","type":"object","required":["resource"],"properties":{"containerName":{"description":"Container name: required for volumes, optional for env vars","type":"string"},"divisor":{"description":"Specifies the output format of the exposed resources, defaults to \"1\"","$ref":"#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"},"resource":{"description":"Required: resource to select","type":"string"}}},"io.k8s.api.core.v1.ResourceRequirements":{"description":"ResourceRequirements describes the compute resource requirements.","type":"object","properties":{"limits":{"description":"Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/","type":"object","additionalProperties":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"requests":{"description":"Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/","type":"object","additionalProperties":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"}}}},"io.k8s.api.core.v1.SELinuxOptions":{"description":"SELinuxOptions are the labels to be applied to the container","type":"object","properties":{"level":{"description":"Level is SELinux level label that applies to the container.","type":"string"},"role":{"description":"Role is a SELinux role label that applies to the container.","type":"string"},"type":{"description":"Type is a SELinux type label that applies to the container.","type":"string"},"user":{"description":"User is a SELinux user label that applies to the container.","type":"string"}}},"io.k8s.api.core.v1.ScaleIOVolumeSource":{"description":"ScaleIOVolumeSource represents a persistent ScaleIO volume","type":"object","required":["gateway","system","secretRef"],"properties":{"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".","type":"string"},"gateway":{"description":"The host address of the ScaleIO API Gateway.","type":"string"},"protectionDomain":{"description":"The name of the ScaleIO Protection Domain for the configured storage.","type":"string"},"readOnly":{"description":"Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"sslEnabled":{"description":"Flag to enable/disable SSL communication with Gateway, default false","type":"boolean"},"storageMode":{"description":"Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.","type":"string"},"storagePool":{"description":"The ScaleIO Storage Pool associated with the protection domain.","type":"string"},"system":{"description":"The name of the storage system as configured in ScaleIO.","type":"string"},"volumeName":{"description":"The name of a volume already created in the ScaleIO system that is associated with this volume source.","type":"string"}}},"io.k8s.api.core.v1.SecretEnvSource":{"description":"SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretKeySelector":{"description":"SecretKeySelector selects a key of a Secret.","type":"object","required":["key"],"properties":{"key":{"description":"The key of the secret to select from. Must be a valid secret key.","type":"string"},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret or its key must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretProjection":{"description":"Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.","type":"object","properties":{"items":{"description":"If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret or its key must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretVolumeSource":{"description":"Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.KeyToPath"}},"optional":{"description":"Specify whether the Secret or its keys must be defined","type":"boolean"},"secretName":{"description":"Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","type":"string"}}},"io.k8s.api.core.v1.SecurityContext":{"description":"SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.","type":"object","properties":{"allowPrivilegeEscalation":{"description":"AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN","type":"boolean"},"capabilities":{"description":"The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime.","$ref":"#/definitions/io.k8s.api.core.v1.Capabilities"},"privileged":{"description":"Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false.","type":"boolean"},"procMount":{"description":"procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled.","type":"string"},"readOnlyRootFilesystem":{"description":"Whether this container has a read-only root filesystem. Default is false.","type":"boolean"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","$ref":"#/definitions/io.k8s.api.core.v1.SELinuxOptions"},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","$ref":"#/definitions/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.ServiceAccountTokenProjection":{"description":"ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).","type":"object","required":["path"],"properties":{"audience":{"description":"Audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.","type":"string"},"expirationSeconds":{"description":"ExpirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.","type":"integer","format":"int64"},"path":{"description":"Path is the path relative to the mount point of the file to project the token into.","type":"string"}}},"io.k8s.api.core.v1.StorageOSVolumeSource":{"description":"Represents a StorageOS persistent volume resource.","type":"object","properties":{"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"volumeName":{"description":"VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.","type":"string"},"volumeNamespace":{"description":"VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.","type":"string"}}},"io.k8s.api.core.v1.Sysctl":{"description":"Sysctl defines a kernel parameter to be set","type":"object","required":["name","value"],"properties":{"name":{"description":"Name of a property to set","type":"string"},"value":{"description":"Value of a property to set","type":"string"}}},"io.k8s.api.core.v1.TCPSocketAction":{"description":"TCPSocketAction describes an action based on opening a socket","type":"object","required":["port"],"properties":{"host":{"description":"Optional: Host name to connect to, defaults to the pod IP.","type":"string"},"port":{"description":"Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","$ref":"#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString"}}},"io.k8s.api.core.v1.Toleration":{"description":"The pod this Toleration is attached to tolerates any taint that matches the triple \u003ckey,value,effect\u003e using the matching operator \u003coperator\u003e.","type":"object","properties":{"effect":{"description":"Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.","type":"string"},"key":{"description":"Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.","type":"string"},"operator":{"description":"Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.","type":"string"},"tolerationSeconds":{"description":"TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.","type":"integer","format":"int64"},"value":{"description":"Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.","type":"string"}}},"io.k8s.api.core.v1.TopologySpreadConstraint":{"description":"TopologySpreadConstraint specifies how to spread matching pods among the given topology.","type":"object","required":["maxSkew","topologyKey","whenUnsatisfiable"],"properties":{"labelSelector":{"description":"LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"maxSkew":{"description":"MaxSkew describes the degree to which pods may be unevenly distributed. It's the maximum permitted difference between the number of matching pods in any two topology domains of a given topology type. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. It's a required field. Default value is 1 and 0 is not allowed.","type":"integer","format":"int32"},"topologyKey":{"description":"TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each \u003ckey, value\u003e as a \"bucket\", and try to put balanced number of pods into each bucket. It's a required field.","type":"string"},"whenUnsatisfiable":{"description":"WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it - ScheduleAnyway tells the scheduler to still schedule it It's considered as \"Unsatisfiable\" if and only if placing incoming pod on any topology violates \"MaxSkew\". For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.","type":"string"}}},"io.k8s.api.core.v1.Volume":{"description":"Volume represents a named volume in a pod that may be accessed by any container in the pod.","type":"object","required":["name"],"properties":{"awsElasticBlockStore":{"description":"AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","$ref":"#/definitions/io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource"},"azureDisk":{"description":"AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","$ref":"#/definitions/io.k8s.api.core.v1.AzureDiskVolumeSource"},"azureFile":{"description":"AzureFile represents an Azure File Service mount on the host and bind mount to the pod.","$ref":"#/definitions/io.k8s.api.core.v1.AzureFileVolumeSource"},"cephfs":{"description":"CephFS represents a Ceph FS mount on the host that shares a pod's lifetime","$ref":"#/definitions/io.k8s.api.core.v1.CephFSVolumeSource"},"cinder":{"description":"Cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","$ref":"#/definitions/io.k8s.api.core.v1.CinderVolumeSource"},"configMap":{"description":"ConfigMap represents a configMap that should populate this volume","$ref":"#/definitions/io.k8s.api.core.v1.ConfigMapVolumeSource"},"csi":{"description":"CSI (Container Storage Interface) represents storage that is handled by an external CSI driver (Alpha feature).","$ref":"#/definitions/io.k8s.api.core.v1.CSIVolumeSource"},"downwardAPI":{"description":"DownwardAPI represents downward API about the pod that should populate this volume","$ref":"#/definitions/io.k8s.api.core.v1.DownwardAPIVolumeSource"},"emptyDir":{"description":"EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","$ref":"#/definitions/io.k8s.api.core.v1.EmptyDirVolumeSource"},"fc":{"description":"FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.","$ref":"#/definitions/io.k8s.api.core.v1.FCVolumeSource"},"flexVolume":{"description":"FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","$ref":"#/definitions/io.k8s.api.core.v1.FlexVolumeSource"},"flocker":{"description":"Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running","$ref":"#/definitions/io.k8s.api.core.v1.FlockerVolumeSource"},"gcePersistentDisk":{"description":"GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","$ref":"#/definitions/io.k8s.api.core.v1.GCEPersistentDiskVolumeSource"},"gitRepo":{"description":"GitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","$ref":"#/definitions/io.k8s.api.core.v1.GitRepoVolumeSource"},"glusterfs":{"description":"Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md","$ref":"#/definitions/io.k8s.api.core.v1.GlusterfsVolumeSource"},"hostPath":{"description":"HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","$ref":"#/definitions/io.k8s.api.core.v1.HostPathVolumeSource"},"iscsi":{"description":"ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md","$ref":"#/definitions/io.k8s.api.core.v1.ISCSIVolumeSource"},"name":{"description":"Volume's name. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"nfs":{"description":"NFS represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","$ref":"#/definitions/io.k8s.api.core.v1.NFSVolumeSource"},"persistentVolumeClaim":{"description":"PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","$ref":"#/definitions/io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource"},"photonPersistentDisk":{"description":"PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine","$ref":"#/definitions/io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource"},"portworxVolume":{"description":"PortworxVolume represents a portworx volume attached and mounted on kubelets host machine","$ref":"#/definitions/io.k8s.api.core.v1.PortworxVolumeSource"},"projected":{"description":"Items for all in one resources secrets, configmaps, and downward API","$ref":"#/definitions/io.k8s.api.core.v1.ProjectedVolumeSource"},"quobyte":{"description":"Quobyte represents a Quobyte mount on the host that shares a pod's lifetime","$ref":"#/definitions/io.k8s.api.core.v1.QuobyteVolumeSource"},"rbd":{"description":"RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md","$ref":"#/definitions/io.k8s.api.core.v1.RBDVolumeSource"},"scaleIO":{"description":"ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.","$ref":"#/definitions/io.k8s.api.core.v1.ScaleIOVolumeSource"},"secret":{"description":"Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","$ref":"#/definitions/io.k8s.api.core.v1.SecretVolumeSource"},"storageos":{"description":"StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.","$ref":"#/definitions/io.k8s.api.core.v1.StorageOSVolumeSource"},"vsphereVolume":{"description":"VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine","$ref":"#/definitions/io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource"}}},"io.k8s.api.core.v1.VolumeDevice":{"description":"volumeDevice describes a mapping of a raw block device within a container.","type":"object","required":["name","devicePath"],"properties":{"devicePath":{"description":"devicePath is the path inside of the container that the device will be mapped to.","type":"string"},"name":{"description":"name must match the name of a persistentVolumeClaim in the pod","type":"string"}}},"io.k8s.api.core.v1.VolumeMount":{"description":"VolumeMount describes a mounting of a Volume within a container.","type":"object","required":["name","mountPath"],"properties":{"mountPath":{"description":"Path within the container at which the volume should be mounted. Must not contain ':'.","type":"string"},"mountPropagation":{"description":"mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.","type":"string"},"name":{"description":"This must match the Name of a Volume.","type":"string"},"readOnly":{"description":"Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.","type":"boolean"},"subPath":{"description":"Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).","type":"string"},"subPathExpr":{"description":"Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive. This field is beta in 1.15.","type":"string"}}},"io.k8s.api.core.v1.VolumeProjection":{"description":"Projection that may be projected along with other supported volume types","type":"object","properties":{"configMap":{"description":"information about the configMap data to project","$ref":"#/definitions/io.k8s.api.core.v1.ConfigMapProjection"},"downwardAPI":{"description":"information about the downwardAPI data to project","$ref":"#/definitions/io.k8s.api.core.v1.DownwardAPIProjection"},"secret":{"description":"information about the secret data to project","$ref":"#/definitions/io.k8s.api.core.v1.SecretProjection"},"serviceAccountToken":{"description":"information about the serviceAccountToken data to project","$ref":"#/definitions/io.k8s.api.core.v1.ServiceAccountTokenProjection"}}},"io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource":{"description":"Represents a vSphere volume resource.","type":"object","required":["volumePath"],"properties":{"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"storagePolicyID":{"description":"Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.","type":"string"},"storagePolicyName":{"description":"Storage Policy Based Management (SPBM) profile name.","type":"string"},"volumePath":{"description":"Path that identifies vSphere volume vmdk","type":"string"}}},"io.k8s.api.core.v1.WeightedPodAffinityTerm":{"description":"The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)","type":"object","required":["weight","podAffinityTerm"],"properties":{"podAffinityTerm":{"description":"Required. A pod affinity term, associated with the corresponding weight.","$ref":"#/definitions/io.k8s.api.core.v1.PodAffinityTerm"},"weight":{"description":"weight associated with matching the corresponding podAffinityTerm, in the range 1-100.","type":"integer","format":"int32"}}},"io.k8s.api.core.v1.WindowsSecurityContextOptions":{"description":"WindowsSecurityContextOptions contain Windows-specific options and credentials.","type":"object","properties":{"gmsaCredentialSpec":{"description":"GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.","type":"string"},"gmsaCredentialSpecName":{"description":"GMSACredentialSpecName is the name of the GMSA credential spec to use. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.","type":"string"},"runAsUserName":{"description":"The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. This field is alpha-level and it is only honored by servers that enable the WindowsRunAsUserName feature flag.","type":"string"}}},"io.k8s.api.rbac.v1.PolicyRule":{"description":"PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.","type":"object","required":["verbs"],"properties":{"apiGroups":{"description":"APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed.","type":"array","items":{"type":"string"}},"nonResourceURLs":{"description":"NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as \"pods\" or \"secrets\") or non-resource URL paths (such as \"/api\"), but not both.","type":"array","items":{"type":"string"}},"resourceNames":{"description":"ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.","type":"array","items":{"type":"string"}},"resources":{"description":"Resources is a list of resources this rule applies to. ResourceAll represents all resources.","type":"array","items":{"type":"string"}},"verbs":{"description":"Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds.","type":"array","items":{"type":"string"}}}},"io.k8s.api.rbac.v1.Role":{"description":"Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.","type":"object","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":{"description":"Standard object's metadata.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"rules":{"description":"Rules holds all the PolicyRules for this Role","type":"array","items":{"$ref":"#/definitions/io.k8s.api.rbac.v1.PolicyRule"}}}},"io.k8s.api.rbac.v1.RoleRef":{"description":"RoleRef contains information that points to the role being used","type":"object","required":["apiGroup","kind","name"],"properties":{"apiGroup":{"description":"APIGroup is the group for the resource being referenced","type":"string"},"kind":{"description":"Kind is the type of resource being referenced","type":"string"},"name":{"description":"Name is the name of resource being referenced","type":"string"}}},"io.k8s.api.rbac.v1.Subject":{"description":"Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names.","type":"object","required":["kind","name"],"properties":{"apiGroup":{"description":"APIGroup holds the API group of the referenced subject. Defaults to \"\" for ServiceAccount subjects. Defaults to \"rbac.authorization.k8s.io\" for User and Group subjects.","type":"string"},"kind":{"description":"Kind of object being referenced. Values defined by this API group are \"User\", \"Group\", and \"ServiceAccount\". If the Authorizer does not recognized the kind value, the Authorizer should report an error.","type":"string"},"name":{"description":"Name of the object being referenced.","type":"string"},"namespace":{"description":"Namespace of the referenced object. If the object kind is non-namespace, such as \"User\" or \"Group\", and this value is not empty the Authorizer should report an error.","type":"string"}}},"io.k8s.apimachinery.pkg.api.resource.Quantity":{"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\u003cquantity\u003e ::= \u003csignedNumber\u003e\u003csuffix\u003e\n (Note that \u003csuffix\u003e may be empty, from the \"\" case in \u003cdecimalSI\u003e.)\n\u003cdigit\u003e ::= 0 | 1 | ... | 9 \u003cdigits\u003e ::= \u003cdigit\u003e | \u003cdigit\u003e\u003cdigits\u003e \u003cnumber\u003e ::= \u003cdigits\u003e | \u003cdigits\u003e.\u003cdigits\u003e | \u003cdigits\u003e. | .\u003cdigits\u003e \u003csign\u003e ::= \"+\" | \"-\" \u003csignedNumber\u003e ::= \u003cnumber\u003e | \u003csign\u003e\u003cnumber\u003e \u003csuffix\u003e ::= \u003cbinarySI\u003e | \u003cdecimalExponent\u003e | \u003cdecimalSI\u003e \u003cbinarySI\u003e ::= Ki | Mi | Gi | Ti | Pi | Ei\n (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\u003cdecimalSI\u003e ::= m | \"\" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\u003cdecimalExponent\u003e ::= \"e\" \u003csignedNumber\u003e | \"E\" \u003csignedNumber\u003e\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 a. No precision is lost\n b. No fractional digits will be emitted\n c. The exponent (or suffix) is as large as possible.\nThe sign will be omitted unless the number is negative.\n\nExamples:\n 1.5 will be serialized as \"1500m\"\n 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":"string"},"io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1":{"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:\u003cname\u003e', where \u003cname\u003e is the name of a field in a struct, or key in a map 'v:\u003cvalue\u003e', where \u003cvalue\u003e is the exact json formatted value of a list item 'i:\u003cindex\u003e', where \u003cindex\u003e is position of a item in a list 'k:\u003ckeys\u003e', where \u003ckeys\u003e 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":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector":{"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":"object","properties":{"matchExpressions":{"description":"matchExpressions is a list of label selector requirements. The requirements are ANDed.","type":"array","items":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement"}},"matchLabels":{"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":"object","additionalProperties":{"type":"string"}}}},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement":{"description":"A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"key is the label key that the selector applies to.","type":"string","x-kubernetes-patch-merge-key":"key","x-kubernetes-patch-strategy":"merge"},"operator":{"description":"operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.","type":"string"},"values":{"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":"array","items":{"type":"string"}}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta":{"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":"object","properties":{"continue":{"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"},"remainingItemCount":{"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":"integer","format":"int64"},"resourceVersion":{"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"},"selfLink":{"description":"selfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry":{"description":"ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.","type":"object","properties":{"apiVersion":{"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"},"fieldsType":{"description":"FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"","type":"string"},"fieldsV1":{"description":"FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1"},"manager":{"description":"Manager is an identifier of the workflow managing these fields.","type":"string"},"operation":{"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"},"time":{"description":"Time is timestamp of when these fields were set. It should always be empty if Operation is 'Apply'","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta":{"description":"ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.","type":"object","properties":{"annotations":{"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: http://kubernetes.io/docs/user-guide/annotations","type":"object","additionalProperties":{"type":"string"}},"clusterName":{"description":"The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.","type":"string"},"creationTimestamp":{"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":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"deletionGracePeriodSeconds":{"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":"integer","format":"int64"},"deletionTimestamp":{"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":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"finalizers":{"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.","type":"array","items":{"type":"string"},"x-kubernetes-patch-strategy":"merge"},"generateName":{"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 NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\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"},"generation":{"description":"A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.","type":"integer","format":"int64"},"labels":{"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: http://kubernetes.io/docs/user-guide/labels","type":"object","additionalProperties":{"type":"string"}},"managedFields":{"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":"array","items":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry"}},"name":{"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: http://kubernetes.io/docs/user-guide/identifiers#names","type":"string"},"namespace":{"description":"Namespace defines the space within 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: http://kubernetes.io/docs/user-guide/namespaces","type":"string"},"ownerReferences":{"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":"array","items":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference"},"x-kubernetes-patch-merge-key":"uid","x-kubernetes-patch-strategy":"merge"},"resourceVersion":{"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"},"selfLink":{"description":"SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.","type":"string"},"uid":{"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: http://kubernetes.io/docs/user-guide/identifiers#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference":{"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":"object","required":["apiVersion","kind","name","uid"],"properties":{"apiVersion":{"description":"API version of the referent.","type":"string"},"blockOwnerDeletion":{"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. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.","type":"boolean"},"controller":{"description":"If true, this reference points to the managing controller.","type":"boolean"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"name":{"description":"Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names","type":"string"},"uid":{"description":"UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.Time":{"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":"string","format":"date-time"},"io.k8s.apimachinery.pkg.util.intstr.IntOrString":{"description":"IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.","type":"string","format":"int-or-string"}}} \ No newline at end of file +{"swagger":"2.0","info":{"title":"Jenkins X","version":"1.0"},"paths":{},"definitions":{"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.AccountReference":{"description":"AccountReference is a reference to a user account in another system that is attached to this user","type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.App":{"description":"App is the metadata for an App","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.AppSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.AppList":{"description":"AppList is a structure used by k8s to store lists of apps","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.App"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.AppSpec":{"description":"AppSpec provides details of the metadata for an App","type":"object","properties":{"pipelineExtension":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineExtension"},"schemaPreprocessor":{"$ref":"#/definitions/io.k8s.api.core.v1.Container"},"schemaPreprocessorRole":{"$ref":"#/definitions/io.k8s.api.rbac.v1.Role"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Approve":{"description":"Approve specifies a configuration for a single approve.\n\nThe configuration for the approve plugin is defined as a list of these structures.","type":"object","properties":{"ignoreReviewState":{"description":"IgnoreReviewState causes the approve plugin to ignore the GitHub review state. Otherwise: * an APPROVE github review is equivalent to leaving an \"/approve\" message. * A REQUEST_CHANGES github review is equivalent to leaving an /approve cancel\" message.","type":"boolean"},"issueRequired":{"description":"IssueRequired indicates if an associated issue is required for approval in the specified repos.","type":"boolean"},"lgtmActsAsApprove":{"description":"LgtmActsAsApprove indicates that the lgtm command should be used to indicate approval","type":"boolean"},"requireSelfApproval":{"description":"RequireSelfApproval requires PR authors to explicitly approve their PRs. Otherwise the plugin assumes the author of the PR approves the changes in the PR.","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Attachment":{"type":"object","properties":{"name":{"type":"string"},"urls":{"type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BatchPipelineActivity":{"description":"BatchPipelineActivity contains information about a batch build, used by both the batch build and its comprising PRs for linking them together","type":"object","properties":{"batchBranchName":{"type":"string"},"batchBuildNumber":{"type":"string"},"pullRequestInfo":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PullRequestInfo"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Binary":{"description":"Binary provies the details of a downloadable binary","type":"object","properties":{"goarch":{"type":"string"},"goos":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BranchProtectionContextPolicy":{"description":"BranchProtectionContextPolicy configures required git provider contexts. Strict determines whether merging to the branch invalidates existing contexts.","type":"object","properties":{"contexts":{"description":"Contexts appends required contexts that must be green to merge","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"strict":{"description":"Strict overrides whether new commits in the base branch require updating the PR if set","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Brancher":{"description":"Brancher is for shared code between jobs that only run against certain branches. An empty brancher runs against all branches.","type":"object","properties":{"branches":{"description":"Only run against these branches. Default is all branches.","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"skipBranches":{"description":"Do not run against these branches. Default is no branches.","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BuildPack":{"description":"BuildPack represents a set of language specific build packs and associated quickstarts","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BuildPackSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BuildPackList":{"description":"BuildPackList is a list of TypeMeta resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BuildPack"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BuildPackSpec":{"description":"BuildPackSpec is the specification of an BuildPack","type":"object","properties":{"gitRef":{"type":"string"},"gitUrl":{"type":"string"},"label":{"type":"string"},"quickstartLocations":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.QuickStartLocation"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ChartRef":{"type":"object","properties":{"name":{"type":"string"},"repo":{"type":"string"},"repoName":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatus":{"description":"CommitStatus represents the commit statuses for a particular pull request","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusCommitReference":{"type":"object","properties":{"gitUrl":{"type":"string"},"pullRequest":{"type":"string"},"sha":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusDetails":{"type":"object","required":["pipelineActivity","checked","commit","context"],"properties":{"Items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusItem"}},"checked":{"type":"boolean"},"commit":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusCommitReference"},"context":{"type":"string"},"pipelineActivity":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ResourceReference"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusItem":{"type":"object","required":["pass"],"properties":{"description":{"type":"string"},"name":{"type":"string"},"pass":{"type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusList":{"description":"CommitStatusList is a structure used by k8s to store lists of commit statuses","type":"object","required":["metadata","Items"],"properties":{"Items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatus"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusSpec":{"description":"CommitStatusSpec provides details of a particular commit status","type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitStatusDetails"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitSummary":{"description":"CommitSummary is the summary of a commit","type":"object","properties":{"author":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails"},"branch":{"type":"string"},"committer":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails"},"issueIds":{"type":"array","items":{"type":"string"}},"message":{"type":"string"},"sha":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ConfigMapSpec":{"description":"ConfigMapSpec contains configuration options for the configMap being updated by the config-updater plugin.","type":"object","required":["name"],"properties":{"additional_namespaces":{"description":"Namespaces in which the configMap needs to be deployed, in addition to the above namespace provided, or the default if it is not set.","type":"array","items":{"type":"string"}},"key":{"description":"Key is the key in the ConfigMap to update with the file contents. If no explicit key is given, the basename of the file will be used.","type":"string"},"name":{"description":"Name of ConfigMap","type":"string"},"namespace":{"description":"Namespace in which the configMap needs to be deployed. If no namespace is specified it will be deployed to the ProwJobNamespace.","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ConfigUpdater":{"description":"ConfigUpdater holds configuration for the config updater plugin","type":"object","properties":{"ConfigMap":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ConfigMapSpec"},"configFile":{"type":"string"},"map":{"type":"object","additionalProperties":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ConfigMapSpec"}},"pluginFile":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ContextPolicy":{"description":"ContextPolicy configures options about how to handle various contexts.","type":"object","properties":{"fromBranchProtection":{"description":"Infer required and optional jobs from Branch Protection configuration","type":"boolean"},"optionalContexts":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"requiredContexts":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"requiredIfPresentContexts":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"skipUnknownContexts":{"description":"whether to consider unknown contexts optional (skip) or required.","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CoreActivityStep":{"description":"CoreActivityStep is a base step included in Stages of a pipeline or other kinds of step","type":"object","properties":{"completedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"description":{"type":"string"},"name":{"type":"string"},"startedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"status":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.DependencyUpdate":{"description":"DependencyUpdate describes an dependency update message from the commit log","type":"object","required":["host","owner","repo","component","url","fromVersion","fromReleaseHTMLURL","fromReleaseName","toVersion","toReleaseHTMLURL","toReleaseName"],"properties":{"component":{"type":"string"},"fromReleaseHTMLURL":{"type":"string"},"fromReleaseName":{"type":"string"},"fromVersion":{"type":"string"},"host":{"type":"string"},"owner":{"type":"string"},"paths":{"type":"array","items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.DependencyUpdateDetails"}}},"repo":{"type":"string"},"toReleaseHTMLURL":{"type":"string"},"toReleaseName":{"type":"string"},"toVersion":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.DependencyUpdateDetails":{"description":"DependencyUpdateDetails are the details of a dependency update","type":"object","required":["host","owner","repo","component","url","fromVersion","fromReleaseHTMLURL","fromReleaseName","toVersion","toReleaseHTMLURL","toReleaseName"],"properties":{"component":{"type":"string"},"fromReleaseHTMLURL":{"type":"string"},"fromReleaseName":{"type":"string"},"fromVersion":{"type":"string"},"host":{"type":"string"},"owner":{"type":"string"},"repo":{"type":"string"},"toReleaseHTMLURL":{"type":"string"},"toReleaseName":{"type":"string"},"toVersion":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.DeployOptions":{"description":"DeployOptions configures options for how to deploy applications by default such as using progressive delivery or using horizontal pod autoscaler","type":"object","properties":{"canary":{"description":"Canary should we enable canary rollouts (progressive delivery) for apps by default","type":"boolean"},"hpa":{"description":"should we use the horizontal pod autoscaler on new apps by default?","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Environment":{"description":"Environment represents an environment like Dev, Test, Staging, Production where code lives","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentSpec"},"status":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentStatus"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentFilter":{"description":"EnvironmentFilter specifies the environments to apply the role binding to","type":"object","properties":{"excludes":{"type":"array","items":{"type":"string"}},"includes":{"type":"array","items":{"type":"string"}},"kind":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentList":{"description":"EnvironmentList is a list of TypeMeta resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Environment"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRepository":{"description":"EnvironmentRepository is the repository for an environment using GitOps","type":"object","properties":{"kind":{"type":"string"},"ref":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRoleBinding":{"description":"EnvironmentRoleBinding is like a vanilla RoleBinding but applies to a set of Namespaces based on an Environment filter so that roles can be bound to multiple namespaces easily.\n\nFor example to specify the binding of roles on all Preview environments or on all permanent environments.","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRoleBindingSpec"},"status":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRoleBindingStatus"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRoleBindingList":{"description":"EnvironmentRoleBindingList is a list of TypeMeta resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRoleBinding"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRoleBindingSpec":{"description":"EnvironmentRoleBindingSpec is the specification of an EnvironmentRoleBinding","type":"object","required":["subjects","roleRef"],"properties":{"environments":{"description":"specifies which sets of environments this binding applies to","type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentFilter"}},"roleRef":{"description":"RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.","$ref":"#/definitions/io.k8s.api.rbac.v1.RoleRef"},"subjects":{"description":"Subjects holds references to the objects the role applies to.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.rbac.v1.Subject"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRoleBindingStatus":{"description":"EnvironmentRoleBindingStatus is the status for an EnvironmentRoleBinding resource","type":"object","properties":{"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentSpec":{"description":"EnvironmentSpec is the specification of an Environment","type":"object","properties":{"cluster":{"type":"string"},"kind":{"type":"string"},"label":{"type":"string"},"namespace":{"type":"string"},"order":{"type":"integer","format":"int32"},"previewGitInfo":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PreviewGitSpec"},"promotionStrategy":{"type":"string"},"pullRequestURL":{"type":"string"},"remoteCluster":{"description":"RemoteCluster flag indicates if the Environment is deployed in a separate cluster to the Development Environment","type":"boolean"},"source":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentRepository"},"teamSettings":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.TeamSettings"},"webHookEngine":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentStatus":{"description":"EnvironmentStatus is the status for an Environment resource","type":"object","properties":{"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentVariable":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Extension":{"description":"Extension represents an extension available to this Jenkins X install","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionConfig":{"description":"ExtensionConfig is the configuration and enablement for an extension inside an app","type":"object","required":["name","namespace","parameters"],"properties":{"name":{"type":"string"},"namespace":{"type":"string"},"parameters":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionParameterValue"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionConfigList":{"description":"ExtensionsConfigList contains a list of ExtensionConfig items","type":"object","required":["extensions"],"properties":{"extensions":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionConfig"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinition":{"description":"ExtensionDefinition defines an Extension","type":"object","required":["name","namespace","uuid"],"properties":{"children":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinitionChildReference"}},"description":{"type":"string"},"given":{"type":"string"},"name":{"type":"string"},"namespace":{"type":"string"},"parameters":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionParameter"}},"scriptFile":{"type":"string"},"uuid":{"type":"string"},"when":{"type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinitionChildReference":{"description":"ExtensionDefinitionChildReference provides a reference to a child","type":"object","properties":{"name":{"type":"string"},"namespace":{"type":"string"},"remote":{"type":"string"},"tag":{"type":"string"},"uuid":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinitionList":{"description":"ExtensionDefinitionList contains a list of ExtensionDefinition items","type":"object","required":["extensions"],"properties":{"extensions":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinition"}},"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinitionReference":{"description":"ExtensionRepositoryReference references a GitHub repo that contains extension definitions","type":"object","required":["remote","tag"],"properties":{"remote":{"type":"string"},"tag":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinitionReferenceList":{"description":"ExtensionDefinitionReferenceList contains a list of ExtensionRepository items","type":"object","required":["remotes"],"properties":{"remotes":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionDefinitionReference"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionExecution":{"description":"ExtensionExecution is an executable instance of an extension which can be attached into a pipeline for later execution. It differs from an Extension as it cannot have children and parameters have been resolved to environment variables","type":"object","properties":{"description":{"type":"string"},"environmentVariables":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.EnvironmentVariable"}},"given":{"type":"string"},"name":{"type":"string"},"namespace":{"type":"string"},"script":{"type":"string"},"uuid":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionList":{"description":"ExtensionList is a list of Extensions available for a team","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Extension"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionParameter":{"description":"ExtensionParameter describes a parameter definition for an extension","type":"object","properties":{"defaultValue":{"type":"string"},"description":{"type":"string"},"environmentVariableName":{"type":"string"},"name":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionParameterValue":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionRepositoryReference":{"type":"object","properties":{"chart":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ChartRef"},"github":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionRepositoryReferenceList":{"type":"object","properties":{"repositories":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionRepositoryReference"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionSpec":{"description":"ExtensionSpec provides details of an extension available for a team","type":"object","properties":{"children":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"given":{"type":"string"},"name":{"type":"string"},"namespace":{"type":"string"},"parameters":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionParameter"}},"script":{"type":"string"},"uuid":{"type":"string"},"version":{"type":"string"},"when":{"type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExternalPlugin":{"description":"ExternalPlugin holds configuration for registering an external plugin.","type":"object","required":["name"],"properties":{"endpoint":{"description":"Endpoint is the location of the external plugin. Defaults to the name of the plugin, ie. \"http://{{name}}\".","type":"string"},"events":{"description":"ReplaceableSliceOfStrings are the events that need to be demuxed by the hook server to the external plugin. If no events are specified, everything is sent.","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"name":{"description":"Name of the plugin.","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Fact":{"description":"Fact represents observed facts. Apps will generate Facts about the system. A naming schema is required since each Fact has a name that's unique for the whole system. Apps should prefix their generated Facts with the name of the App, like \u003capp-name\u003e-\u003cfact\u003e. This makes that different Apps can't possibly have conflicting Fact names.\n\nFor an app generating facts on a pipeline, which will be have several different executions, we recommend \u003capp\u003e-\u003cfact\u003e-\u003cpipeline\u003e.","type":"object","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":{"description":"The Fact labels will be used to query the API for interesting Facts. The Apps responsible for creating Facts need to add the relevant labels. For example, creating Facts on a pipeline would create Facts with the following labels {\n subjectkind: PipelineActivity\n pipelineName: my-org-my-app-master-23\n org: my-org\n repo: my-app\n branch: master\n buildNumber: 23\n}","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.FactSpec"},"status":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.FactStatus"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.FactList":{"description":"FactList is a list of Fact resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Fact"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.FactSpec":{"description":"FactSpec is the specification of a Fact","type":"object","required":["name","factType","subject"],"properties":{"factType":{"type":"string"},"measurements":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Measurement"}},"name":{"type":"string"},"original":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Original"},"statements":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Statement"}},"subject":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ResourceReference"},"tags":{"type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.FactStatus":{"description":"FactStatus is the status for an Fact resource","type":"object","properties":{"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GitService":{"description":"GitService represents a git provider so we can map the host name to a kinda of git service","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GitServiceSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GitServiceList":{"description":"GitServiceList is a list of GitService resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GitService"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GitServiceSpec":{"description":"GitServiceSpec is the specification of an GitService","type":"object","properties":{"gitKind":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GitStatus":{"description":"GitStatus the status of a git commit in terms of CI/CD","type":"object","properties":{"status":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GlobalProtectionPolicy":{"description":"GlobalProtectionPolicy defines the default branch protection policy for the scheduler","type":"object","properties":{"ProtectionPolicy":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ProtectionPolicy"},"protectTested":{"type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.IssueLabel":{"type":"object","properties":{"color":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.IssueSummary":{"description":"IssueSummary is the summary of an issue","type":"object","properties":{"assignees":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails"}},"body":{"type":"string"},"closedBy":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails"},"creationTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"id":{"type":"string"},"labels":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.IssueLabel"}},"message":{"type":"string"},"state":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"user":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.JobBase":{"description":"JobBase contains attributes common to all job types","type":"object","required":["name","agent"],"properties":{"agent":{"description":"Agent that will take care of running this job.","type":"string"},"cluster":{"description":"Cluster is the alias of the cluster to run this job in. (Default: kube.DefaultClusterAlias)","type":"string"},"labels":{"description":"ReplaceableMapOfStringString are added to jobs and pods created for this job.","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableMapOfStringString"},"maxConcurrency":{"description":"MaximumConcurrency of this job, 0 implies no limit.","type":"integer","format":"int32"},"name":{"description":"The name of the job. Must match regex [A-Za-z0-9-._]+ e.g. pull-test-infra-bazel-build","type":"string"},"namespace":{"description":"Namespace is the namespace in which pods schedule.\n empty: results in scheduler.DefaultNamespace","type":"string"},"spec":{"description":"Spec is the Kubernetes pod spec used if Agent is kubernetes.","$ref":"#/definitions/io.k8s.api.core.v1.PodSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Lgtm":{"description":"Lgtm specifies a configuration for a single lgtm. The configuration for the lgtm plugin is defined as a list of these structures.","type":"object","properties":{"reviewActsAsLgtm":{"description":"ReviewActsAsLgtm indicates that a Github review of \"approve\" or \"request changes\" acts as adding or removing the lgtm label","type":"boolean"},"storeTreeHash":{"description":"StoreTreeHash indicates if tree_hash should be stored inside a comment to detect squashed commits before removing lgtm labels","type":"boolean"},"trustedTeamForStickyLgtm":{"description":"WARNING: This disables the security mechanism that prevents a malicious member (or compromised GitHub account) from merging arbitrary code. Use with caution.\n\nStickyLgtmTeam specifies the Github team whose members are trusted with sticky LGTM, which eliminates the need to re-lgtm minor fixes/updates.","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Measurement":{"description":"Measurement is a percentage or a count, something measured that the system will capture within a fact","type":"object","required":["name","measurementType","measurementValue"],"properties":{"measurementType":{"type":"string"},"measurementValue":{"type":"integer","format":"int32"},"name":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Merger":{"description":"Merger defines the options used to merge the PR","type":"object","properties":{"blockerLabel":{"description":"BlockerLabel is an optional label that is used to identify merge blocking Git Provider issues. Leave this blank to disable this feature and save 1 API token per sync loop.","type":"string"},"maxGoroutines":{"description":"MaxGoroutines is the maximum number of goroutines spawned inside the controller to handle org/repo:branch pools. Defaults to 20. Needs to be a positive number.","type":"integer","format":"int32"},"mergeMethod":{"description":"Override the default method of merge. Valid options are squash, rebase, and merge.","type":"string"},"policy":{"description":"ContextOptions defines the default merge options. If not set it will infer the required and optional contexts from the jobs configured and use the Git Provider combined status; otherwise it may apply the branch protection setting or let user define their own options in case branch protection is not used.","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ContextPolicy"},"prStatusBaseUrl":{"description":"PRStatusBaseURL is the base URL for the PR status page. This is used to link to a merge requirements overview in the status context.","type":"string"},"squashLabel":{"description":"SquashLabel is an optional label that is used to identify PRs that should always be squash merged. Leave this blank to disable this feature.","type":"string"},"targetUrl":{"description":"URL for status contexts.","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Original":{"description":"Original contains the report","type":"object","properties":{"mimetype":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Periodic":{"description":"Periodic defines a job to be run periodically","type":"object","required":["interval","cron"],"properties":{"JobBase":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.JobBase"},"cron":{"description":"Cron representation of job trigger time","type":"string"},"interval":{"description":"Interval to wait between two runs of the job.","type":"string"},"tags":{"description":"Tags for config entries","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Periodics":{"description":"Periodics is a list of jobs to be run periodically","type":"object","properties":{"entries":{"description":"Items are the post submit configurations","type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Periodic"}},"replace":{"description":"Replace the existing entries","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivity":{"description":"PipelineActivity represents pipeline activity for a particular run of a pipeline","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivitySpec"},"status":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivityStatus"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivityList":{"description":"PipelineActivityList is a list of PipelineActivity resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivity"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivitySpec":{"description":"PipelineActivitySpec is the specification of the pipeline activity","type":"object","properties":{"attachments":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Attachment"}},"author":{"type":"string"},"authorAvatarURL":{"type":"string"},"authorURL":{"type":"string"},"baseSHA":{"type":"string"},"batchPipelineActivity":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BatchPipelineActivity"},"build":{"type":"string"},"buildLogsUrl":{"type":"string"},"buildUrl":{"type":"string"},"completedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"context":{"type":"string"},"gitBranch":{"type":"string"},"gitOwner":{"type":"string"},"gitRepository":{"type":"string"},"gitUrl":{"type":"string"},"lastCommitMessage":{"type":"string"},"lastCommitSHA":{"type":"string"},"lastCommitURL":{"type":"string"},"pipeline":{"type":"string"},"postExtensions":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExtensionExecution"}},"pullTitle":{"type":"string"},"releaseNotesURL":{"type":"string"},"startedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"status":{"type":"string"},"steps":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivityStep"}},"version":{"type":"string"},"workflow":{"description":"Deprecated - Workflow functionality was removed and is obsolete Keeping these fields to ensure backwards compatibility Should be removed when we increment spec version","type":"string"},"workflowMessage":{"type":"string"},"workflowStatus":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivityStatus":{"description":"PipelineActivityStatus is the status for an Environment resource","type":"object","properties":{"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineActivityStep":{"description":"PipelineActivityStep represents a step in a pipeline activity","type":"object","properties":{"kind":{"type":"string"},"preview":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PreviewActivityStep"},"promote":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromoteActivityStep"},"stage":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.StageActivityStep"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineExtension":{"description":"PipelineExtension defines the image and command of an app which wants to modify/extend the pipeline","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint.","type":"array","items":{"type":"string"}},"command":{"description":"Entrypoint array. Not executed within a shell.","type":"string"},"image":{"description":"Docker image name.","type":"string"},"name":{"description":"Name of the container specified as a DNS_LABEL.","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineStructure":{"description":"PipelineStructure contains references to the Pipeline and PipelineRun, and a list of PipelineStructureStages in the pipeline. This allows us to map between a running Pod to its TaskRun, to the TaskRun's Task and PipelineRun, and finally from there to the stage and potential parent stages that the Pod is actually executing, for use with populating PipelineActivity and providing logs.","type":"object","required":["pipelineRef","pipelineRunRef"],"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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"pipelineRef":{"type":"string"},"pipelineRunRef":{"type":"string"},"stages":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineStructureStage"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineStructureList":{"description":"PipelineStructureList is a list of PipelineStructureList resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineStructure"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PipelineStructureStage":{"description":"PipelineStructureStage contains the stage's name, one of either a reference to the Task corresponding to the stage if it has steps, a list of sequential stage names nested within this stage, or a list of parallel stage names nested within this stage, and information on this stage's depth within the PipelineStructure as a whole, the name of its parent stage, if any, the name of the stage before it in execution order, if any, and the name of the stage after it in execution order, if any.","type":"object","required":["name","depth"],"properties":{"depth":{"type":"integer","format":"byte"},"name":{"type":"string"},"next":{"type":"string"},"parallel":{"type":"array","items":{"type":"string"}},"parent":{"type":"string"},"previous":{"type":"string"},"stages":{"type":"array","items":{"type":"string"}},"taskRef":{"description":"Must have one of TaskRef+TaskRunRef, Stages, or Parallel","type":"string"},"taskRunRef":{"description":"Populated during pod discovery, not at initial creation time.","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Plugin":{"description":"Plugin represents a binary plugin installed into this Jenkins X team","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PluginSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PluginList":{"description":"PluginList is a list of Plugins available for a team","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Plugin"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PluginSpec":{"description":"PluginSpec provides details of a binary plugin available for a team","type":"object","properties":{"binaries":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Binary"}},"description":{"type":"string"},"group":{"type":"string"},"name":{"type":"string"},"subCommand":{"type":"string"},"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Postsubmit":{"description":"Postsubmit runs on push events.","type":"object","required":["context"],"properties":{"Brancher":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Brancher"},"JobBase":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.JobBase"},"RegexpChangeMatcher":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.RegexpChangeMatcher"},"context":{"description":"Context is the name of the GitHub status context for the job.","type":"string"},"report":{"description":"Report will comment and set status on GitHub.","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Postsubmits":{"description":"Postsubmits is a list of Postsubmit job configurations that can optionally completely replace the Postsubmit job configurations in the parent scheduler","type":"object","properties":{"entries":{"description":"Items are the post submit configurations","type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Postsubmit"}},"replace":{"description":"Replace the existing entries","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Presubmit":{"description":"Presubmit defines a job configuration for pull requests","type":"object","required":["alwaysRun","context","trigger","rerunCommand"],"properties":{"Brancher":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Brancher"},"JobBase":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.JobBase"},"RegexpChangeMatcher":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.RegexpChangeMatcher"},"alwaysRun":{"description":"AlwaysRun automatically for every PR, or only when a comment triggers it. By default true.","type":"boolean"},"context":{"description":"Context is the name of the Git Provider status context for the job.","type":"string"},"context_options":{"description":"ContextOptions defines the merge options. If not set it will infer the required and optional contexts from the jobs configured and use the Git Provider combined status; otherwise it may apply the branch protection setting or let user define their own options in case branch protection is not used.","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.RepoContextPolicy"},"mergeMethod":{"description":"Override the default method of merge. Valid options are squash, rebase, and merge.","type":"string"},"optional":{"description":"Optional indicates that the job's status context should not be required for merge. By default false.","type":"boolean"},"policy":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ProtectionPolicies"},"queries":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Query"}},"report":{"description":"Report enables reporting the job status on the git provider","type":"boolean"},"rerunCommand":{"description":"The RerunCommand to give users. Must match Trigger. Trigger must also be specified if this field is specified. (Default: `/test \u003cjob name\u003e`)","type":"string"},"trigger":{"description":"Trigger is the regular expression to trigger the job. e.g. `@k8s-bot e2e test this` RerunCommand must also be specified if this field is specified. (Default: `(?m)^/test (?:.*? )?\u003cjob name\u003e(?: .*?)?$`)","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Presubmits":{"description":"Presubmits is a list of Presubmit job configurations that can optionally completely replace the Presubmit job configurations in the parent scheduler","type":"object","properties":{"entries":{"description":"Items are the Presubmit configurtations","type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Presubmit"}},"replace":{"description":"Replace the existing entries","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PreviewActivityStep":{"description":"PreviewActivityStep is the step of creating a preview environment as part of a Pull Request pipeline","type":"object","properties":{"applicationURL":{"type":"string"},"completedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"description":{"type":"string"},"environment":{"type":"string"},"name":{"type":"string"},"pullRequestURL":{"type":"string"},"startedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"status":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PreviewGitSpec":{"description":"PreviewGitSpec is the preview git branch/pull request details","type":"object","properties":{"appName":{"type":"string"},"applicationURL":{"type":"string"},"buildStatus":{"type":"string"},"buildStatusUrl":{"type":"string"},"description":{"type":"string"},"name":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"user":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromoteActivityStep":{"description":"PromoteActivityStep is the step of promoting a version of an application to an environment","type":"object","properties":{"applicationURL":{"type":"string"},"completedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"description":{"type":"string"},"environment":{"type":"string"},"name":{"type":"string"},"pullRequest":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromotePullRequestStep"},"startedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"status":{"type":"string"},"update":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromoteUpdateStep"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromotePullRequestStep":{"description":"PromotePullRequestStep is the step for promoting a version to an environment by raising a Pull Request on the git repository of the environment","type":"object","properties":{"completedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"description":{"type":"string"},"mergeCommitSHA":{"type":"string"},"name":{"type":"string"},"pullRequestURL":{"type":"string"},"startedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"status":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromoteUpdateStep":{"description":"PromoteUpdateStep is the step for updating a promotion after the Pull Request merges to master","type":"object","properties":{"completedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"description":{"type":"string"},"name":{"type":"string"},"startedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"status":{"type":"string"},"statuses":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GitStatus"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromoteWorkflowStep":{"description":"PromoteWorkflowStep is the step of promoting a version of an application to an environment","type":"object","properties":{"environment":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ProtectionPolicies":{"description":"ProtectionPolicies defines the branch protection policies","type":"object","properties":{"ProtectionPolicy":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ProtectionPolicy"},"Replace":{"type":"boolean"},"entries":{"type":"object","additionalProperties":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ProtectionPolicy"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ProtectionPolicy":{"description":"ProtectionPolicy for merging.","type":"object","properties":{"enforceAdmins":{"description":"Admins overrides whether protections apply to admins if set.","type":"boolean"},"protect":{"description":"Protect overrides whether branch protection is enabled if set.","type":"boolean"},"requiredPullRequestReviews":{"description":"RequiredPullRequestReviews specifies approval/review criteria.","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReviewPolicy"},"requiredStatusChecks":{"description":"RequiredStatusChecks configures github contexts","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.BranchProtectionContextPolicy"},"restrictions":{"description":"Restrictions limits who can merge","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Restrictions"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PullRequestInfo":{"description":"PullRequestInfo contains information about a PR included in a batch, like its PR number, the last build number, and SHA","type":"object","properties":{"lastBuildNumberForCommit":{"description":"LastBuildNumberForCommit is the number of the last successful build of this PR outside of a batch","type":"string"},"lastBuildSHA":{"description":"LastBuildSHA is the commit SHA in the last successful build of this PR outside of a batch.","type":"string"},"pullRequestNumber":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Query":{"description":"Query is turned into a Git Provider search query. See the docs for details: https://help.github.com/articles/searching-issues-and-pull-requests/","type":"object","properties":{"excludedBranches":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"includedBranches":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"labels":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"milestone":{"type":"string"},"missingLabels":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"reviewApprovedRequired":{"type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.QuickStartLocation":{"description":"QuickStartLocation","type":"object","properties":{"excludes":{"type":"array","items":{"type":"string"}},"gitKind":{"type":"string"},"gitUrl":{"type":"string"},"includes":{"type":"array","items":{"type":"string"}},"owner":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.RegexpChangeMatcher":{"description":"RegexpChangeMatcher is for code shared between jobs that run only when certain files are changed.","type":"object","properties":{"runIfChanged":{"description":"RunIfChanged defines a regex used to select which subset of file changes should trigger this job. If any file in the changeset matches this regex, the job will be triggered","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Release":{"description":"Release represents a single version of an app that has been released","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReleaseSpec"},"status":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReleaseStatus"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReleaseList":{"description":"ReleaseList is a list of Release resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Release"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReleaseSpec":{"description":"ReleaseSpec is the specification of the Release","type":"object","properties":{"commits":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CommitSummary"}},"dependencyUpdates":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.DependencyUpdate"}},"gitCloneUrl":{"type":"string"},"gitHttpUrl":{"type":"string"},"gitOwner":{"type":"string"},"gitRepository":{"type":"string"},"issues":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.IssueSummary"}},"name":{"type":"string"},"pullRequests":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.IssueSummary"}},"releaseNotesURL":{"type":"string"},"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReleaseStatus":{"description":"ReleaseStatus is the status of a release","type":"object","properties":{"status":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableMapOfStringContextPolicy":{"description":"ReplaceableMapOfStringContextPolicy is a map of context policies that can optionally completely replace any context policies defined in the parent scheduler","type":"object","required":["Items"],"properties":{"Items":{"type":"object","additionalProperties":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ContextPolicy"}},"replace":{"type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableMapOfStringString":{"description":"ReplaceableMapOfStringString is a map of strings that can optionally completely replace the map of strings in the parent scheduler","type":"object","properties":{"entries":{"type":"object","additionalProperties":{"type":"string"}},"replace":{"description":"Replace the existing entries","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfExternalPlugins":{"description":"ReplaceableSliceOfExternalPlugins is a list of external plugins that can optionally completely replace the plugins in any parent SchedulerSpec","type":"object","required":["Replace"],"properties":{"Replace":{"type":"boolean"},"entries":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ExternalPlugin"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings":{"description":"ReplaceableSliceOfStrings is a slice of strings that can optionally completely replace the slice of strings defined in the parent scheduler","type":"object","properties":{"entries":{"description":"Items is the string values","type":"array","items":{"type":"string"}},"replace":{"description":"Replace the existing entries","type":"boolean"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.RepoContextPolicy":{"description":"RepoContextPolicy overrides the policy for repo, and any branch overrides.","type":"object","required":["ContextPolicy"],"properties":{"ContextPolicy":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ContextPolicy"},"branches":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableMapOfStringContextPolicy"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ResourceReference":{"type":"object","required":["kind","name"],"properties":{"apiVersion":{"description":"API version of the referent.","type":"string"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds","type":"string"},"name":{"description":"Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names","type":"string"},"uid":{"description":"UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Restrictions":{"description":"Restrictions limits who can merge Users and Teams entries are appended to parent lists.","type":"object","required":["users","teams"],"properties":{"teams":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"users":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReviewPolicy":{"description":"ReviewPolicy specifies git provider approval/review criteria. Any nil values inherit the policy from the parent, otherwise bool/ints are overridden. Non-empty lists are appended to parent lists.","type":"object","properties":{"dismissStaleReviews":{"description":"DismissStale overrides whether new commits automatically dismiss old reviews if set","type":"boolean"},"dismissalRestrictions":{"description":"Restrictions appends users/teams that are allowed to merge","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Restrictions"},"requireCodeOwnerReviews":{"description":"RequireOwners overrides whether CODEOWNERS must approve PRs if set","type":"boolean"},"requiredApprovingReviewCount":{"description":"Approvals overrides the number of approvals required if set (set to 0 to disable)","type":"integer","format":"int32"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Scheduler":{"description":"Scheduler is configuration for a pipeline scheduler","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SchedulerSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SchedulerAgent":{"description":"SchedulerAgent defines the scheduler agent configuration","type":"object","required":["agent"],"properties":{"agent":{"description":"Agent defines the agent used to schedule jobs, by default Prow","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SchedulerList":{"description":"SchedulerList is a list of configurations for a pipeline scheduler","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Scheduler"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SchedulerSpec":{"description":"SchedulerSpec defines the pipeline scheduler (e.g. Prow) configuration","type":"object","properties":{"approve":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Approve"},"attachments":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Attachment"}},"configUpdater":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ConfigUpdater"},"externalPlugins":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfExternalPlugins"},"lgtm":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Lgtm"},"merger":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Merger"},"periodics":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Periodics"},"plugins":{"description":"Plugins is a list of plugin names enabled for a repo","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ReplaceableSliceOfStrings"},"policy":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.GlobalProtectionPolicy"},"postsubmits":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Postsubmits"},"presubmits":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Presubmits"},"schedulerAgent":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SchedulerAgent"},"trigger":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Trigger"},"welcome":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Welcome"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepository":{"description":"SourceRepository is the metadata for an Application/Project/SourceRepository","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositorySpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositoryGroup":{"description":"SourceRepositoryGroup is the metadata for an Application/Project/SourceRepository","type":"object","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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositoryGroupSpec"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositoryGroupList":{"description":"SourceRepositoryGroupList is a structure used by k8s to store lists of apps","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositoryGroup"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositoryGroupSpec":{"description":"SourceRepositoryGroupSpec is the metadata for an Application/Project/SourceRepository","type":"object","required":["repositories","scheduler"],"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"repositories":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ResourceReference"}},"scheduler":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ResourceReference"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositoryList":{"description":"SourceRepositoryList is a structure used by k8s to store lists of apps","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepository"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.SourceRepositorySpec":{"description":"SourceRepositorySpec provides details of the metadata for an App","type":"object","properties":{"description":{"type":"string"},"httpCloneURL":{"description":"HTTPCloneURL is the git URL to clone this repository using HTTP/HTTPS","type":"string"},"org":{"type":"string"},"provider":{"description":"Provider stores the URL of the git provider such as https://github.com","type":"string"},"providerKind":{"description":"ProviderKind is the kind of provider (github / bitbucketcloud / bitbucketserver etc)","type":"string"},"providerName":{"description":"ProviderName is a logical name for the provider without any URL scheme which can be used in a label selector","type":"string"},"repo":{"type":"string"},"scheduler":{"description":"Scheduler a reference to a custom scheduler otherwise we default to the Team's Scededuler","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ResourceReference"},"sshCloneURL":{"description":"SSHCloneURL is the git URL to clone this repository using SSH","type":"string"},"url":{"description":"URL is the web URL of the project page","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.StageActivityStep":{"description":"StageActivityStep represents a stage of zero to more sub steps in a jenkins pipeline","type":"object","properties":{"completedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"description":{"type":"string"},"name":{"type":"string"},"startedTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"status":{"type":"string"},"steps":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.CoreActivityStep"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Statement":{"description":"Statement represents a decision that was made, for example that a promotion was approved or denied","type":"object","required":["name","statementType","measurementValue"],"properties":{"measurementValue":{"type":"boolean"},"name":{"type":"string"},"statementType":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.StorageLocation":{"description":"StorageLocation","type":"object","properties":{"bucketUrl":{"type":"string"},"classifier":{"type":"string"},"gitBranch":{"type":"string"},"gitUrl":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Team":{"description":"Team represents a request to create an actual Team which is a group of users, a development environment and optional other environments","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.TeamSpec"},"status":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.TeamStatus"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.TeamList":{"description":"TeamList is a list of TypeMeta resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Team"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.TeamSettings":{"description":"TeamSettings the default settings for a team","type":"object","properties":{"appPrefixes":{"description":"AppsPrefixes is the list of prefixes for appNames","type":"array","items":{"type":"string"}},"appsRepository":{"type":"string"},"askOnCreate":{"type":"boolean"},"bootRequirements":{"description":"BootRequirements is a marshaled string of the jx-requirements.yml used in the most recent run for this cluster","type":"string"},"branchPatterns":{"type":"string"},"buildPackName":{"type":"string"},"buildPackRef":{"type":"string"},"buildPackUrl":{"type":"string"},"defaultScheduler":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.ResourceReference"},"deployKind":{"description":"DeployKind what kind of deployment (\"default\" uses regular Kubernetes Services and Deployments, \"knative\" uses the Knative Service resource instead)","type":"string"},"deployOptions":{"description":"DeployOptions configures options for how to deploy applications by default such as using canary rollouts (progressive delivery) or using horizontal pod autoscaler","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.DeployOptions"},"dockerRegistryOrg":{"type":"string"},"envOrganisation":{"type":"string"},"forkBranchPatterns":{"type":"string"},"gitPublic":{"type":"boolean"},"gitServer":{"type":"string"},"helmBinary":{"type":"string"},"helmTemplate":{"type":"boolean"},"importMode":{"description":"ImportMode indicates what kind of","type":"string"},"kubeProvider":{"type":"string"},"noTiller":{"type":"boolean"},"organisation":{"type":"string"},"pipelineUserEmail":{"type":"string"},"pipelineUsername":{"type":"string"},"postPreviewJobs":{"type":"array","items":{"$ref":"#/definitions/io.k8s.api.batch.v1.Job"}},"profile":{"description":"Profile is the profile in use (see jx profile)","type":"string"},"promotionEngine":{"type":"string"},"prowConfig":{"description":"ProwConfig is the way we manage prow configurations","type":"string"},"prowEngine":{"description":"ProwEngine is the kind of prow engine used such as knative build or build pipeline","type":"string"},"quickstartLocations":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.QuickStartLocation"}},"storageLocations":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.StorageLocation"}},"useGitOps":{"type":"boolean"},"versionStreamRef":{"description":"VersionStreamRef contains the git ref (tag or branch) in the VersionStreamURL repository to use as the version stream","type":"string"},"versionStreamUrl":{"description":"VersionStreamURL contains the git clone URL for the Version Stream which is the set of versions to use for charts, images, packages etc","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.TeamSpec":{"description":"TeamSpec is the specification of an Team","type":"object","properties":{"kind":{"type":"string"},"label":{"type":"string"},"members":{"type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.TeamStatus":{"description":"TeamStatus is the status for an Team resource","type":"object","properties":{"message":{"type":"string"},"provisionStatus":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Trigger":{"description":"Trigger specifies a configuration for a single trigger.\n\nThe configuration for the trigger plugin is defined as a list of these structures.","type":"object","properties":{"ignoreOkToTest":{"description":"IgnoreOkToTest makes trigger ignore /ok-to-test comments. This is a security mitigation to only allow testing from trusted users.","type":"boolean"},"joinOrgUrl":{"description":"JoinOrgURL is a link that redirects users to a location where they should be able to read more about joining the organization in order to become trusted members. Defaults to the Github link of TrustedOrg.","type":"string"},"onlyOrgMembers":{"description":"OnlyOrgMembers requires PRs and/or /ok-to-test comments to come from org members. By default, trigger also include repo collaborators.","type":"boolean"},"trustedOrg":{"description":"TrustedOrg is the org whose members' PRs will be automatically built for PRs to the above repos. The default is the PR's org.","type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.User":{"description":"User represents a git user so we have a cache to find by email address","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails"},"user":{"description":"Deprecated, use Spec","$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserDetails":{"description":"UserDetails containers details of a user","type":"object","properties":{"accountReference":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.AccountReference"}},"avatarUrl":{"type":"string"},"creationTimestamp":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"email":{"type":"string"},"externalUser":{"type":"boolean"},"login":{"type":"string"},"name":{"type":"string"},"serviceAccount":{"type":"string"},"url":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserList":{"description":"UserList is a list of User resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.User"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.UserSpec":{"description":"UserSpec is the user details","type":"object","properties":{"imageUrl":{"type":"string"},"linkUrl":{"type":"string"},"name":{"type":"string"},"username":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Welcome":{"description":"Welcome welcome plugin config","type":"object","properties":{"message_template":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Workflow":{"description":"Workflow represents pipeline activity for a particular run of a pipeline","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowSpec"},"status":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowStatus"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowList":{"description":"WorkflowList is a list of Workflow resources","type":"object","required":["metadata","items"],"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"},"items":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.Workflow"}},"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":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowPreconditions":{"description":"WorkflowPreconditions is the trigger to start a step","type":"object","properties":{"environments":{"description":"the names of the environments which need to have promoted before this step can be triggered","type":"array","items":{"type":"string"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowSpec":{"description":"WorkflowSpec is the specification of the pipeline activity","type":"object","properties":{"pipeline":{"type":"string"},"steps":{"type":"array","items":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowStep"}}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowStatus":{"description":"WorkflowStatus is the status for an Environment resource","type":"object","properties":{"version":{"type":"string"}}},"com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowStep":{"description":"WorkflowStep represents a step in a pipeline activity","type":"object","properties":{"description":{"type":"string"},"kind":{"type":"string"},"name":{"type":"string"},"promote":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.PromoteWorkflowStep"},"trigger":{"$ref":"#/definitions/com.github.jenkins-x.jx-api.pkg.apis.jenkins_io.v1.WorkflowPreconditions"}}},"io.k8s.api.batch.v1.Job":{"description":"Job represents the configuration of a single job.","type":"object","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":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","$ref":"#/definitions/io.k8s.api.batch.v1.JobSpec"},"status":{"description":"Current status of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","$ref":"#/definitions/io.k8s.api.batch.v1.JobStatus"}}},"io.k8s.api.batch.v1.JobCondition":{"description":"JobCondition describes current state of a job.","type":"object","required":["type","status"],"properties":{"lastProbeTime":{"description":"Last time the condition was checked.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"lastTransitionTime":{"description":"Last time the condition transit from one status to another.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"message":{"description":"Human readable message indicating details about last transition.","type":"string"},"reason":{"description":"(brief) reason for the condition's last transition.","type":"string"},"status":{"description":"Status of the condition, one of True, False, Unknown.","type":"string"},"type":{"description":"Type of job condition, Complete or Failed.","type":"string"}}},"io.k8s.api.batch.v1.JobSpec":{"description":"JobSpec describes how the job execution will look like.","type":"object","required":["template"],"properties":{"activeDeadlineSeconds":{"description":"Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer","type":"integer","format":"int64"},"backoffLimit":{"description":"Specifies the number of retries before marking this job failed. Defaults to 6","type":"integer","format":"int32"},"completions":{"description":"Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"manualSelector":{"description":"manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector","type":"boolean"},"parallelism":{"description":"Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) \u003c .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"integer","format":"int32"},"selector":{"description":"A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"template":{"description":"Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","$ref":"#/definitions/io.k8s.api.core.v1.PodTemplateSpec"},"ttlSecondsAfterFinished":{"description":"ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature.","type":"integer","format":"int32"}}},"io.k8s.api.batch.v1.JobStatus":{"description":"JobStatus represents the current state of a Job.","type":"object","properties":{"active":{"description":"The number of actively running pods.","type":"integer","format":"int32"},"completionTime":{"description":"Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. The completion time is only set when the job finishes successfully.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"conditions":{"description":"The latest available observations of an object's current state. When a job fails, one of the conditions will have type == \"Failed\". More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/","type":"array","items":{"$ref":"#/definitions/io.k8s.api.batch.v1.JobCondition"},"x-kubernetes-patch-merge-key":"type","x-kubernetes-patch-strategy":"merge"},"failed":{"description":"The number of pods which reached phase Failed.","type":"integer","format":"int32"},"startTime":{"description":"Represents time when the job was acknowledged by the job controller. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"succeeded":{"description":"The number of pods which reached phase Succeeded.","type":"integer","format":"int32"}}},"io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource":{"description":"Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string"},"partition":{"description":"The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).","type":"integer","format":"int32"},"readOnly":{"description":"Specify \"true\" to force and set the ReadOnly property in VolumeMounts to \"true\". If omitted, the default is \"false\". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"boolean"},"volumeID":{"description":"Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","type":"string"}}},"io.k8s.api.core.v1.Affinity":{"description":"Affinity is a group of affinity scheduling rules.","type":"object","properties":{"nodeAffinity":{"description":"Describes node affinity scheduling rules for the pod.","$ref":"#/definitions/io.k8s.api.core.v1.NodeAffinity"},"podAffinity":{"description":"Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/definitions/io.k8s.api.core.v1.PodAffinity"},"podAntiAffinity":{"description":"Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).","$ref":"#/definitions/io.k8s.api.core.v1.PodAntiAffinity"}}},"io.k8s.api.core.v1.AzureDiskVolumeSource":{"description":"AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","type":"object","required":["diskName","diskURI"],"properties":{"cachingMode":{"description":"Host Caching mode: None, Read Only, Read Write.","type":"string"},"diskName":{"description":"The Name of the data disk in the blob storage","type":"string"},"diskURI":{"description":"The URI the data disk in the blob storage","type":"string"},"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"kind":{"description":"Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared","type":"string"},"readOnly":{"description":"Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"}}},"io.k8s.api.core.v1.AzureFileVolumeSource":{"description":"AzureFile represents an Azure File Service mount on the host and bind mount to the pod.","type":"object","required":["secretName","shareName"],"properties":{"readOnly":{"description":"Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretName":{"description":"the name of secret that contains Azure Storage Account Name and Key","type":"string"},"shareName":{"description":"Share Name","type":"string"}}},"io.k8s.api.core.v1.CSIVolumeSource":{"description":"Represents a source location of a volume to mount, managed by an external CSI driver","type":"object","required":["driver"],"properties":{"driver":{"description":"Driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.","type":"string"},"fsType":{"description":"Filesystem type to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.","type":"string"},"nodePublishSecretRef":{"description":"NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed.","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"readOnly":{"description":"Specifies a read-only configuration for the volume. Defaults to false (read/write).","type":"boolean"},"volumeAttributes":{"description":"VolumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.","type":"object","additionalProperties":{"type":"string"}}}},"io.k8s.api.core.v1.Capabilities":{"description":"Adds and removes POSIX capabilities from running containers.","type":"object","properties":{"add":{"description":"Added capabilities","type":"array","items":{"type":"string"}},"drop":{"description":"Removed capabilities","type":"array","items":{"type":"string"}}}},"io.k8s.api.core.v1.CephFSVolumeSource":{"description":"Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["monitors"],"properties":{"monitors":{"description":"Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"array","items":{"type":"string"}},"path":{"description":"Optional: Used as the mounted root, rather than the full Ceph tree, default is /","type":"string"},"readOnly":{"description":"Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"boolean"},"secretFile":{"description":"Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"},"secretRef":{"description":"Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"Optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.CinderVolumeSource":{"description":"Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string"},"readOnly":{"description":"Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"boolean"},"secretRef":{"description":"Optional: points to a secret object containing parameters used to connect to OpenStack.","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"volumeID":{"description":"volume id used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","type":"string"}}},"io.k8s.api.core.v1.ConfigMapEnvSource":{"description":"ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapKeySelector":{"description":"Selects a key from a ConfigMap.","type":"object","required":["key"],"properties":{"key":{"description":"The key to select.","type":"string"},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap or its key must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapProjection":{"description":"Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.","type":"object","properties":{"items":{"description":"If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.ConfigMapVolumeSource":{"description":"Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the ConfigMap or its keys must be defined","type":"boolean"}}},"io.k8s.api.core.v1.Container":{"description":"A single application container that you want to run within a pod.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string"}},"command":{"description":"Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string"}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images","type":"string"},"lifecycle":{"description":"Actions that the management system should take in response to container lifecycle events. Cannot be updated.","$ref":"#/definitions/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/definitions/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.","type":"string"},"ports":{"description":"List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.ContainerPort"},"x-kubernetes-list-map-keys":["containerPort","protocol"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"containerPort","x-kubernetes-patch-strategy":"merge"},"readinessProbe":{"description":"Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/definitions/io.k8s.api.core.v1.Probe"},"resources":{"description":"Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/","$ref":"#/definitions/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"Security options the pod should run with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/","$ref":"#/definitions/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","$ref":"#/definitions/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.ContainerPort":{"description":"ContainerPort represents a network port in a single container.","type":"object","required":["containerPort"],"properties":{"containerPort":{"description":"Number of port to expose on the pod's IP address. This must be a valid port number, 0 \u003c x \u003c 65536.","type":"integer","format":"int32"},"hostIP":{"description":"What host IP to bind the external port to.","type":"string"},"hostPort":{"description":"Number of port to expose on the host. If specified, this must be a valid port number, 0 \u003c x \u003c 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.","type":"integer","format":"int32"},"name":{"description":"If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.","type":"string"},"protocol":{"description":"Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".","type":"string"}}},"io.k8s.api.core.v1.DownwardAPIProjection":{"description":"Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.","type":"object","properties":{"items":{"description":"Items is a list of DownwardAPIVolume file","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.DownwardAPIVolumeFile":{"description":"DownwardAPIVolumeFile represents information to create the file containing the pod field","type":"object","required":["path"],"properties":{"fieldRef":{"description":"Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.","$ref":"#/definitions/io.k8s.api.core.v1.ObjectFieldSelector"},"mode":{"description":"Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'","type":"string"},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.","$ref":"#/definitions/io.k8s.api.core.v1.ResourceFieldSelector"}}},"io.k8s.api.core.v1.DownwardAPIVolumeSource":{"description":"DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"Items is a list of downward API volume file","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.DownwardAPIVolumeFile"}}}},"io.k8s.api.core.v1.EmptyDirVolumeSource":{"description":"Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.","type":"object","properties":{"medium":{"description":"What type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","type":"string"},"sizeLimit":{"description":"Total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir","$ref":"#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"}}},"io.k8s.api.core.v1.EnvFromSource":{"description":"EnvFromSource represents the source of a set of ConfigMaps","type":"object","properties":{"configMapRef":{"description":"The ConfigMap to select from","$ref":"#/definitions/io.k8s.api.core.v1.ConfigMapEnvSource"},"prefix":{"description":"An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.","type":"string"},"secretRef":{"description":"The Secret to select from","$ref":"#/definitions/io.k8s.api.core.v1.SecretEnvSource"}}},"io.k8s.api.core.v1.EnvVar":{"description":"EnvVar represents an environment variable present in a Container.","type":"object","required":["name"],"properties":{"name":{"description":"Name of the environment variable. Must be a C_IDENTIFIER.","type":"string"},"value":{"description":"Variable references $(VAR_NAME) are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".","type":"string"},"valueFrom":{"description":"Source for the environment variable's value. Cannot be used if value is not empty.","$ref":"#/definitions/io.k8s.api.core.v1.EnvVarSource"}}},"io.k8s.api.core.v1.EnvVarSource":{"description":"EnvVarSource represents a source for the value of an EnvVar.","type":"object","properties":{"configMapKeyRef":{"description":"Selects a key of a ConfigMap.","$ref":"#/definitions/io.k8s.api.core.v1.ConfigMapKeySelector"},"fieldRef":{"description":"Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['\u003cKEY\u003e']`, `metadata.annotations['\u003cKEY\u003e']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.","$ref":"#/definitions/io.k8s.api.core.v1.ObjectFieldSelector"},"resourceFieldRef":{"description":"Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.","$ref":"#/definitions/io.k8s.api.core.v1.ResourceFieldSelector"},"secretKeyRef":{"description":"Selects a key of a secret in the pod's namespace","$ref":"#/definitions/io.k8s.api.core.v1.SecretKeySelector"}}},"io.k8s.api.core.v1.EphemeralContainer":{"description":"An EphemeralContainer is a container that may be added temporarily to an existing pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a pod is removed or restarted. If an ephemeral container causes a pod to exceed its resource allocation, the pod may be evicted. Ephemeral containers may not be added by directly updating the pod spec. They must be added via the pod's ephemeralcontainers subresource, and they will appear in the pod spec once added. This is an alpha feature enabled by the EphemeralContainers feature flag.","type":"object","required":["name"],"properties":{"args":{"description":"Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string"}},"command":{"description":"Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell","type":"array","items":{"type":"string"}},"env":{"description":"List of environment variables to set in the container. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.EnvVar"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"envFrom":{"description":"List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.EnvFromSource"}},"image":{"description":"Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images","type":"string"},"imagePullPolicy":{"description":"Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images","type":"string"},"lifecycle":{"description":"Lifecycle is not allowed for ephemeral containers.","$ref":"#/definitions/io.k8s.api.core.v1.Lifecycle"},"livenessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/definitions/io.k8s.api.core.v1.Probe"},"name":{"description":"Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.","type":"string"},"ports":{"description":"Ports are not allowed for ephemeral containers.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.ContainerPort"}},"readinessProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/definitions/io.k8s.api.core.v1.Probe"},"resources":{"description":"Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.","$ref":"#/definitions/io.k8s.api.core.v1.ResourceRequirements"},"securityContext":{"description":"SecurityContext is not allowed for ephemeral containers.","$ref":"#/definitions/io.k8s.api.core.v1.SecurityContext"},"startupProbe":{"description":"Probes are not allowed for ephemeral containers.","$ref":"#/definitions/io.k8s.api.core.v1.Probe"},"stdin":{"description":"Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.","type":"boolean"},"stdinOnce":{"description":"Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false","type":"boolean"},"targetContainerName":{"description":"If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container is run in whatever namespaces are shared for the pod. Note that the container runtime must support this feature.","type":"string"},"terminationMessagePath":{"description":"Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.","type":"string"},"terminationMessagePolicy":{"description":"Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.","type":"string"},"tty":{"description":"Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.","type":"boolean"},"volumeDevices":{"description":"volumeDevices is the list of block devices to be used by the container.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.VolumeDevice"},"x-kubernetes-patch-merge-key":"devicePath","x-kubernetes-patch-strategy":"merge"},"volumeMounts":{"description":"Pod volumes to mount into the container's filesystem. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.VolumeMount"},"x-kubernetes-patch-merge-key":"mountPath","x-kubernetes-patch-strategy":"merge"},"workingDir":{"description":"Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.","type":"string"}}},"io.k8s.api.core.v1.EphemeralVolumeSource":{"description":"Represents an ephemeral volume that is handled by a normal storage driver.","type":"object","properties":{"readOnly":{"description":"Specifies a read-only configuration for the volume. Defaults to false (read/write).","type":"boolean"},"volumeClaimTemplate":{"description":"Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `\u003cpod name\u003e-\u003cvolume name\u003e` where `\u003cvolume name\u003e` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).\n\nAn existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.\n\nThis field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.\n\nRequired, must not be nil.","$ref":"#/definitions/io.k8s.api.core.v1.PersistentVolumeClaimTemplate"}}},"io.k8s.api.core.v1.ExecAction":{"description":"ExecAction describes a \"run in container\" action.","type":"object","properties":{"command":{"description":"Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.","type":"array","items":{"type":"string"}}}},"io.k8s.api.core.v1.FCVolumeSource":{"description":"Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.","type":"object","properties":{"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"lun":{"description":"Optional: FC target lun number","type":"integer","format":"int32"},"readOnly":{"description":"Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"targetWWNs":{"description":"Optional: FC target worldwide names (WWNs)","type":"array","items":{"type":"string"}},"wwids":{"description":"Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.","type":"array","items":{"type":"string"}}}},"io.k8s.api.core.v1.FlexVolumeSource":{"description":"FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","type":"object","required":["driver"],"properties":{"driver":{"description":"Driver is the name of the driver to use for this volume.","type":"string"},"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.","type":"string"},"options":{"description":"Optional: Extra command options if any.","type":"object","additionalProperties":{"type":"string"}},"readOnly":{"description":"Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"}}},"io.k8s.api.core.v1.FlockerVolumeSource":{"description":"Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.","type":"object","properties":{"datasetName":{"description":"Name of the dataset stored as metadata -\u003e name on the dataset for Flocker should be considered as deprecated","type":"string"},"datasetUUID":{"description":"UUID of the dataset. This is unique identifier of a Flocker dataset","type":"string"}}},"io.k8s.api.core.v1.GCEPersistentDiskVolumeSource":{"description":"Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.","type":"object","required":["pdName"],"properties":{"fsType":{"description":"Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string"},"partition":{"description":"The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"integer","format":"int32"},"pdName":{"description":"Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"string"},"readOnly":{"description":"ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","type":"boolean"}}},"io.k8s.api.core.v1.GitRepoVolumeSource":{"description":"Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.\n\nDEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","type":"object","required":["repository"],"properties":{"directory":{"description":"Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.","type":"string"},"repository":{"description":"Repository URL","type":"string"},"revision":{"description":"Commit hash for the specified revision.","type":"string"}}},"io.k8s.api.core.v1.GlusterfsVolumeSource":{"description":"Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.","type":"object","required":["endpoints","path"],"properties":{"endpoints":{"description":"EndpointsName is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string"},"path":{"description":"Path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"string"},"readOnly":{"description":"ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod","type":"boolean"}}},"io.k8s.api.core.v1.HTTPGetAction":{"description":"HTTPGetAction describes an action based on HTTP Get requests.","type":"object","required":["port"],"properties":{"host":{"description":"Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.","type":"string"},"httpHeaders":{"description":"Custom headers to set in the request. HTTP allows repeated headers.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.HTTPHeader"}},"path":{"description":"Path to access on the HTTP server.","type":"string"},"port":{"description":"Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","$ref":"#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString"},"scheme":{"description":"Scheme to use for connecting to the host. Defaults to HTTP.","type":"string"}}},"io.k8s.api.core.v1.HTTPHeader":{"description":"HTTPHeader describes a custom header to be used in HTTP probes","type":"object","required":["name","value"],"properties":{"name":{"description":"The header field name","type":"string"},"value":{"description":"The header field value","type":"string"}}},"io.k8s.api.core.v1.Handler":{"description":"Handler defines a specific action that should be taken","type":"object","properties":{"exec":{"description":"One and only one of the following should be specified. Exec specifies the action to take.","$ref":"#/definitions/io.k8s.api.core.v1.ExecAction"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/definitions/io.k8s.api.core.v1.HTTPGetAction"},"tcpSocket":{"description":"TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported","$ref":"#/definitions/io.k8s.api.core.v1.TCPSocketAction"}}},"io.k8s.api.core.v1.HostAlias":{"description":"HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.","type":"object","properties":{"hostnames":{"description":"Hostnames for the above IP address.","type":"array","items":{"type":"string"}},"ip":{"description":"IP address of the host file entry.","type":"string"}}},"io.k8s.api.core.v1.HostPathVolumeSource":{"description":"Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.","type":"object","required":["path"],"properties":{"path":{"description":"Path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string"},"type":{"description":"Type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","type":"string"}}},"io.k8s.api.core.v1.ISCSIVolumeSource":{"description":"Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.","type":"object","required":["targetPortal","iqn","lun"],"properties":{"chapAuthDiscovery":{"description":"whether support iSCSI Discovery CHAP authentication","type":"boolean"},"chapAuthSession":{"description":"whether support iSCSI Session CHAP authentication","type":"boolean"},"fsType":{"description":"Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi","type":"string"},"initiatorName":{"description":"Custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface \u003ctarget portal\u003e:\u003cvolume name\u003e will be created for the connection.","type":"string"},"iqn":{"description":"Target iSCSI Qualified Name.","type":"string"},"iscsiInterface":{"description":"iSCSI Interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).","type":"string"},"lun":{"description":"iSCSI Target Lun number.","type":"integer","format":"int32"},"portals":{"description":"iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"array","items":{"type":"string"}},"readOnly":{"description":"ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.","type":"boolean"},"secretRef":{"description":"CHAP Secret for iSCSI target and initiator authentication","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"targetPortal":{"description":"iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).","type":"string"}}},"io.k8s.api.core.v1.KeyToPath":{"description":"Maps a string key to a path within a volume.","type":"object","required":["key","path"],"properties":{"key":{"description":"The key to project.","type":"string"},"mode":{"description":"Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"path":{"description":"The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.","type":"string"}}},"io.k8s.api.core.v1.Lifecycle":{"description":"Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.","type":"object","properties":{"postStart":{"description":"PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/definitions/io.k8s.api.core.v1.Handler"},"preStop":{"description":"PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod's termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks","$ref":"#/definitions/io.k8s.api.core.v1.Handler"}}},"io.k8s.api.core.v1.LocalObjectReference":{"description":"LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"}}},"io.k8s.api.core.v1.NFSVolumeSource":{"description":"Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.","type":"object","required":["server","path"],"properties":{"path":{"description":"Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string"},"readOnly":{"description":"ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"boolean"},"server":{"description":"Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","type":"string"}}},"io.k8s.api.core.v1.NodeAffinity":{"description":"Node affinity is a group of node affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.PreferredSchedulingTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.","$ref":"#/definitions/io.k8s.api.core.v1.NodeSelector"}}},"io.k8s.api.core.v1.NodeSelector":{"description":"A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.","type":"object","required":["nodeSelectorTerms"],"properties":{"nodeSelectorTerms":{"description":"Required. A list of node selector terms. The terms are ORed.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.NodeSelectorTerm"}}}},"io.k8s.api.core.v1.NodeSelectorRequirement":{"description":"A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"The label key that the selector applies to.","type":"string"},"operator":{"description":"Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.","type":"string"},"values":{"description":"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. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.","type":"array","items":{"type":"string"}}}},"io.k8s.api.core.v1.NodeSelectorTerm":{"description":"A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.","type":"object","properties":{"matchExpressions":{"description":"A list of node selector requirements by node's labels.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.NodeSelectorRequirement"}},"matchFields":{"description":"A list of node selector requirements by node's fields.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.NodeSelectorRequirement"}}}},"io.k8s.api.core.v1.ObjectFieldSelector":{"description":"ObjectFieldSelector selects an APIVersioned field of an object.","type":"object","required":["fieldPath"],"properties":{"apiVersion":{"description":"Version of the schema the FieldPath is written in terms of, defaults to \"v1\".","type":"string"},"fieldPath":{"description":"Path of the field to select in the specified API version.","type":"string"}}},"io.k8s.api.core.v1.PersistentVolumeClaimSpec":{"description":"PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes","type":"object","properties":{"accessModes":{"description":"AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1","type":"array","items":{"type":"string"}},"dataSource":{"description":"This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot - Beta) * An existing PVC (PersistentVolumeClaim) * An existing custom resource/object that implements data population (Alpha) In order to use VolumeSnapshot object types, the appropriate feature gate must be enabled (VolumeSnapshotDataSource or AnyVolumeDataSource) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the specified data source is not supported, the volume will not be created and the failure will be reported as an event. In the future, we plan to support more data source types and the behavior of the provisioner may change.","$ref":"#/definitions/io.k8s.api.core.v1.TypedLocalObjectReference"},"resources":{"description":"Resources represents the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources","$ref":"#/definitions/io.k8s.api.core.v1.ResourceRequirements"},"selector":{"description":"A label query over volumes to consider for binding.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"storageClassName":{"description":"Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1","type":"string"},"volumeMode":{"description":"volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.","type":"string"},"volumeName":{"description":"VolumeName is the binding reference to the PersistentVolume backing this claim.","type":"string"}}},"io.k8s.api.core.v1.PersistentVolumeClaimTemplate":{"description":"PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource.","type":"object","required":["spec"],"properties":{"metadata":{"description":"May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here.","$ref":"#/definitions/io.k8s.api.core.v1.PersistentVolumeClaimSpec"}}},"io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource":{"description":"PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).","type":"object","required":["claimName"],"properties":{"claimName":{"description":"ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","type":"string"},"readOnly":{"description":"Will force the ReadOnly setting in VolumeMounts. Default false.","type":"boolean"}}},"io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource":{"description":"Represents a Photon Controller persistent disk resource.","type":"object","required":["pdID"],"properties":{"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"pdID":{"description":"ID that identifies Photon Controller persistent disk","type":"string"}}},"io.k8s.api.core.v1.PodAffinity":{"description":"Pod affinity is a group of inter pod affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodAffinityTerm":{"description":"Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key \u003ctopologyKey\u003e matches that of any node on which a pod of the set of pods is running","type":"object","required":["topologyKey"],"properties":{"labelSelector":{"description":"A label query over a set of resources, in this case pods.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"namespaces":{"description":"namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means \"this pod's namespace\"","type":"array","items":{"type":"string"}},"topologyKey":{"description":"This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.","type":"string"}}},"io.k8s.api.core.v1.PodAntiAffinity":{"description":"Pod anti affinity is a group of inter pod anti affinity scheduling rules.","type":"object","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.WeightedPodAffinityTerm"}},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.PodAffinityTerm"}}}},"io.k8s.api.core.v1.PodDNSConfig":{"description":"PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.","type":"object","properties":{"nameservers":{"description":"A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.","type":"array","items":{"type":"string"}},"options":{"description":"A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.PodDNSConfigOption"}},"searches":{"description":"A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.","type":"array","items":{"type":"string"}}}},"io.k8s.api.core.v1.PodDNSConfigOption":{"description":"PodDNSConfigOption defines DNS resolver options of a pod.","type":"object","properties":{"name":{"description":"Required.","type":"string"},"value":{"type":"string"}}},"io.k8s.api.core.v1.PodReadinessGate":{"description":"PodReadinessGate contains the reference to a pod condition","type":"object","required":["conditionType"],"properties":{"conditionType":{"description":"ConditionType refers to a condition in the pod's condition list with matching type.","type":"string"}}},"io.k8s.api.core.v1.PodSecurityContext":{"description":"PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.","type":"object","properties":{"fsGroup":{"description":"A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume.","type":"integer","format":"int64"},"fsGroupChangePolicy":{"description":"fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified defaults to \"Always\".","type":"string"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.","$ref":"#/definitions/io.k8s.api.core.v1.SELinuxOptions"},"seccompProfile":{"description":"The seccomp options to use by the containers in this pod.","$ref":"#/definitions/io.k8s.api.core.v1.SeccompProfile"},"supplementalGroups":{"description":"A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container.","type":"array","items":{"type":"integer","format":"int64"}},"sysctls":{"description":"Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.Sysctl"}},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","$ref":"#/definitions/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.PodSpec":{"description":"PodSpec is a description of a pod.","type":"object","required":["containers"],"properties":{"activeDeadlineSeconds":{"description":"Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.","type":"integer","format":"int64"},"affinity":{"description":"If specified, the pod's scheduling constraints","$ref":"#/definitions/io.k8s.api.core.v1.Affinity"},"automountServiceAccountToken":{"description":"AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.","type":"boolean"},"containers":{"description":"List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"dnsConfig":{"description":"Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.","$ref":"#/definitions/io.k8s.api.core.v1.PodDNSConfig"},"dnsPolicy":{"description":"Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.","type":"string"},"enableServiceLinks":{"description":"EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.","type":"boolean"},"ephemeralContainers":{"description":"List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. This field is alpha-level and is only honored by servers that enable the EphemeralContainers feature.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.EphemeralContainer"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"hostAliases":{"description":"HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.HostAlias"},"x-kubernetes-patch-merge-key":"ip","x-kubernetes-patch-strategy":"merge"},"hostIPC":{"description":"Use the host's ipc namespace. Optional: Default to false.","type":"boolean"},"hostNetwork":{"description":"Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.","type":"boolean"},"hostPID":{"description":"Use the host's pid namespace. Optional: Default to false.","type":"boolean"},"hostname":{"description":"Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.","type":"string"},"imagePullSecrets":{"description":"ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"initContainers":{"description":"List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.Container"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge"},"nodeName":{"description":"NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.","type":"string"},"nodeSelector":{"description":"NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/","type":"object","additionalProperties":{"type":"string"}},"overhead":{"description":"Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md This field is alpha-level as of Kubernetes v1.16, and is only honored by servers that enable the PodOverhead feature.","type":"object","additionalProperties":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"preemptionPolicy":{"description":"PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is beta-level, gated by the NonPreemptingPriority feature-gate.","type":"string"},"priority":{"description":"The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.","type":"integer","format":"int32"},"priorityClassName":{"description":"If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.","type":"string"},"readinessGates":{"description":"If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.PodReadinessGate"}},"restartPolicy":{"description":"Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy","type":"string"},"runtimeClassName":{"description":"RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md This is a beta feature as of Kubernetes v1.14.","type":"string"},"schedulerName":{"description":"If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.","type":"string"},"securityContext":{"description":"SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.","$ref":"#/definitions/io.k8s.api.core.v1.PodSecurityContext"},"serviceAccount":{"description":"DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.","type":"string"},"serviceAccountName":{"description":"ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/","type":"string"},"setHostnameAsFQDN":{"description":"If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.","type":"boolean"},"shareProcessNamespace":{"description":"Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.","type":"boolean"},"subdomain":{"description":"If specified, the fully qualified Pod hostname will be \"\u003chostname\u003e.\u003csubdomain\u003e.\u003cpod namespace\u003e.svc.\u003ccluster domain\u003e\". If not specified, the pod will not have a domainname at all.","type":"string"},"terminationGracePeriodSeconds":{"description":"Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.","type":"integer","format":"int64"},"tolerations":{"description":"If specified, the pod's tolerations.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.Toleration"}},"topologySpreadConstraints":{"description":"TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.TopologySpreadConstraint"},"x-kubernetes-list-map-keys":["topologyKey","whenUnsatisfiable"],"x-kubernetes-list-type":"map","x-kubernetes-patch-merge-key":"topologyKey","x-kubernetes-patch-strategy":"merge"},"volumes":{"description":"List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.Volume"},"x-kubernetes-patch-merge-key":"name","x-kubernetes-patch-strategy":"merge,retainKeys"}}},"io.k8s.api.core.v1.PodTemplateSpec":{"description":"PodTemplateSpec describes the data a pod should have when created from a template","type":"object","properties":{"metadata":{"description":"Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"spec":{"description":"Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status","$ref":"#/definitions/io.k8s.api.core.v1.PodSpec"}}},"io.k8s.api.core.v1.PortworxVolumeSource":{"description":"PortworxVolumeSource represents a Portworx volume resource.","type":"object","required":["volumeID"],"properties":{"fsType":{"description":"FSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"volumeID":{"description":"VolumeID uniquely identifies a Portworx volume","type":"string"}}},"io.k8s.api.core.v1.PreferredSchedulingTerm":{"description":"An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).","type":"object","required":["weight","preference"],"properties":{"preference":{"description":"A node selector term, associated with the corresponding weight.","$ref":"#/definitions/io.k8s.api.core.v1.NodeSelectorTerm"},"weight":{"description":"Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.","type":"integer","format":"int32"}}},"io.k8s.api.core.v1.Probe":{"description":"Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.","type":"object","properties":{"exec":{"description":"One and only one of the following should be specified. Exec specifies the action to take.","$ref":"#/definitions/io.k8s.api.core.v1.ExecAction"},"failureThreshold":{"description":"Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.","type":"integer","format":"int32"},"httpGet":{"description":"HTTPGet specifies the http request to perform.","$ref":"#/definitions/io.k8s.api.core.v1.HTTPGetAction"},"initialDelaySeconds":{"description":"Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"},"periodSeconds":{"description":"How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.","type":"integer","format":"int32"},"successThreshold":{"description":"Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.","type":"integer","format":"int32"},"tcpSocket":{"description":"TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported","$ref":"#/definitions/io.k8s.api.core.v1.TCPSocketAction"},"timeoutSeconds":{"description":"Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes","type":"integer","format":"int32"}}},"io.k8s.api.core.v1.ProjectedVolumeSource":{"description":"Represents a projected volume source","type":"object","properties":{"defaultMode":{"description":"Mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"sources":{"description":"list of volume projections","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.VolumeProjection"}}}},"io.k8s.api.core.v1.QuobyteVolumeSource":{"description":"Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.","type":"object","required":["registry","volume"],"properties":{"group":{"description":"Group to map volume access to Default is no group","type":"string"},"readOnly":{"description":"ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.","type":"boolean"},"registry":{"description":"Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes","type":"string"},"tenant":{"description":"Tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin","type":"string"},"user":{"description":"User to map volume access to Defaults to serivceaccount user","type":"string"},"volume":{"description":"Volume is a string that references an already created Quobyte volume by name.","type":"string"}}},"io.k8s.api.core.v1.RBDVolumeSource":{"description":"Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.","type":"object","required":["monitors","image"],"properties":{"fsType":{"description":"Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd","type":"string"},"image":{"description":"The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"keyring":{"description":"Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"monitors":{"description":"A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"array","items":{"type":"string"}},"pool":{"description":"The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"},"readOnly":{"description":"ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"boolean"},"secretRef":{"description":"SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"user":{"description":"The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it","type":"string"}}},"io.k8s.api.core.v1.ResourceFieldSelector":{"description":"ResourceFieldSelector represents container resources (cpu, memory) and their output format","type":"object","required":["resource"],"properties":{"containerName":{"description":"Container name: required for volumes, optional for env vars","type":"string"},"divisor":{"description":"Specifies the output format of the exposed resources, defaults to \"1\"","$ref":"#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"},"resource":{"description":"Required: resource to select","type":"string"}}},"io.k8s.api.core.v1.ResourceRequirements":{"description":"ResourceRequirements describes the compute resource requirements.","type":"object","properties":{"limits":{"description":"Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/","type":"object","additionalProperties":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"}},"requests":{"description":"Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/","type":"object","additionalProperties":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.api.resource.Quantity"}}}},"io.k8s.api.core.v1.SELinuxOptions":{"description":"SELinuxOptions are the labels to be applied to the container","type":"object","properties":{"level":{"description":"Level is SELinux level label that applies to the container.","type":"string"},"role":{"description":"Role is a SELinux role label that applies to the container.","type":"string"},"type":{"description":"Type is a SELinux type label that applies to the container.","type":"string"},"user":{"description":"User is a SELinux user label that applies to the container.","type":"string"}}},"io.k8s.api.core.v1.ScaleIOVolumeSource":{"description":"ScaleIOVolumeSource represents a persistent ScaleIO volume","type":"object","required":["gateway","system","secretRef"],"properties":{"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".","type":"string"},"gateway":{"description":"The host address of the ScaleIO API Gateway.","type":"string"},"protectionDomain":{"description":"The name of the ScaleIO Protection Domain for the configured storage.","type":"string"},"readOnly":{"description":"Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"sslEnabled":{"description":"Flag to enable/disable SSL communication with Gateway, default false","type":"boolean"},"storageMode":{"description":"Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.","type":"string"},"storagePool":{"description":"The ScaleIO Storage Pool associated with the protection domain.","type":"string"},"system":{"description":"The name of the storage system as configured in ScaleIO.","type":"string"},"volumeName":{"description":"The name of a volume already created in the ScaleIO system that is associated with this volume source.","type":"string"}}},"io.k8s.api.core.v1.SeccompProfile":{"description":"SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set.","type":"object","required":["type"],"properties":{"localhostProfile":{"description":"localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\".","type":"string"},"type":{"description":"type indicates which kind of seccomp profile will be applied. Valid options are:\n\nLocalhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied.","type":"string"}}},"io.k8s.api.core.v1.SecretEnvSource":{"description":"SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.","type":"object","properties":{"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretKeySelector":{"description":"SecretKeySelector selects a key of a Secret.","type":"object","required":["key"],"properties":{"key":{"description":"The key of the secret to select from. Must be a valid secret key.","type":"string"},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret or its key must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretProjection":{"description":"Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.","type":"object","properties":{"items":{"description":"If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.KeyToPath"}},"name":{"description":"Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"optional":{"description":"Specify whether the Secret or its key must be defined","type":"boolean"}}},"io.k8s.api.core.v1.SecretVolumeSource":{"description":"Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.","type":"object","properties":{"defaultMode":{"description":"Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.","type":"integer","format":"int32"},"items":{"description":"If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.","type":"array","items":{"$ref":"#/definitions/io.k8s.api.core.v1.KeyToPath"}},"optional":{"description":"Specify whether the Secret or its keys must be defined","type":"boolean"},"secretName":{"description":"Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","type":"string"}}},"io.k8s.api.core.v1.SecurityContext":{"description":"SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.","type":"object","properties":{"allowPrivilegeEscalation":{"description":"AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN","type":"boolean"},"capabilities":{"description":"The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime.","$ref":"#/definitions/io.k8s.api.core.v1.Capabilities"},"privileged":{"description":"Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false.","type":"boolean"},"procMount":{"description":"procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled.","type":"string"},"readOnlyRootFilesystem":{"description":"Whether this container has a read-only root filesystem. Default is false.","type":"boolean"},"runAsGroup":{"description":"The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"integer","format":"int64"},"runAsNonRoot":{"description":"Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"boolean"},"runAsUser":{"description":"The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"integer","format":"int64"},"seLinuxOptions":{"description":"The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","$ref":"#/definitions/io.k8s.api.core.v1.SELinuxOptions"},"seccompProfile":{"description":"The seccomp options to use by this container. If seccomp options are provided at both the pod \u0026 container level, the container options override the pod options.","$ref":"#/definitions/io.k8s.api.core.v1.SeccompProfile"},"windowsOptions":{"description":"The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","$ref":"#/definitions/io.k8s.api.core.v1.WindowsSecurityContextOptions"}}},"io.k8s.api.core.v1.ServiceAccountTokenProjection":{"description":"ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).","type":"object","required":["path"],"properties":{"audience":{"description":"Audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.","type":"string"},"expirationSeconds":{"description":"ExpirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.","type":"integer","format":"int64"},"path":{"description":"Path is the path relative to the mount point of the file to project the token into.","type":"string"}}},"io.k8s.api.core.v1.StorageOSVolumeSource":{"description":"Represents a StorageOS persistent volume resource.","type":"object","properties":{"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"readOnly":{"description":"Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.","type":"boolean"},"secretRef":{"description":"SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.","$ref":"#/definitions/io.k8s.api.core.v1.LocalObjectReference"},"volumeName":{"description":"VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.","type":"string"},"volumeNamespace":{"description":"VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.","type":"string"}}},"io.k8s.api.core.v1.Sysctl":{"description":"Sysctl defines a kernel parameter to be set","type":"object","required":["name","value"],"properties":{"name":{"description":"Name of a property to set","type":"string"},"value":{"description":"Value of a property to set","type":"string"}}},"io.k8s.api.core.v1.TCPSocketAction":{"description":"TCPSocketAction describes an action based on opening a socket","type":"object","required":["port"],"properties":{"host":{"description":"Optional: Host name to connect to, defaults to the pod IP.","type":"string"},"port":{"description":"Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.","$ref":"#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString"}}},"io.k8s.api.core.v1.Toleration":{"description":"The pod this Toleration is attached to tolerates any taint that matches the triple \u003ckey,value,effect\u003e using the matching operator \u003coperator\u003e.","type":"object","properties":{"effect":{"description":"Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.","type":"string"},"key":{"description":"Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.","type":"string"},"operator":{"description":"Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.","type":"string"},"tolerationSeconds":{"description":"TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.","type":"integer","format":"int64"},"value":{"description":"Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.","type":"string"}}},"io.k8s.api.core.v1.TopologySpreadConstraint":{"description":"TopologySpreadConstraint specifies how to spread matching pods among the given topology.","type":"object","required":["maxSkew","topologyKey","whenUnsatisfiable"],"properties":{"labelSelector":{"description":"LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector"},"maxSkew":{"description":"MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed.","type":"integer","format":"int32"},"topologyKey":{"description":"TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each \u003ckey, value\u003e as a \"bucket\", and try to put balanced number of pods into each bucket. It's a required field.","type":"string"},"whenUnsatisfiable":{"description":"WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location,\n but giving higher precedence to topologies that would help reduce the\n skew.\nA constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assigment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.","type":"string"}}},"io.k8s.api.core.v1.TypedLocalObjectReference":{"description":"TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.","type":"object","required":["kind","name"],"properties":{"apiGroup":{"description":"APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.","type":"string"},"kind":{"description":"Kind is the type of resource being referenced","type":"string"},"name":{"description":"Name is the name of resource being referenced","type":"string"}}},"io.k8s.api.core.v1.Volume":{"description":"Volume represents a named volume in a pod that may be accessed by any container in the pod.","type":"object","required":["name"],"properties":{"awsElasticBlockStore":{"description":"AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore","$ref":"#/definitions/io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource"},"azureDisk":{"description":"AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.","$ref":"#/definitions/io.k8s.api.core.v1.AzureDiskVolumeSource"},"azureFile":{"description":"AzureFile represents an Azure File Service mount on the host and bind mount to the pod.","$ref":"#/definitions/io.k8s.api.core.v1.AzureFileVolumeSource"},"cephfs":{"description":"CephFS represents a Ceph FS mount on the host that shares a pod's lifetime","$ref":"#/definitions/io.k8s.api.core.v1.CephFSVolumeSource"},"cinder":{"description":"Cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md","$ref":"#/definitions/io.k8s.api.core.v1.CinderVolumeSource"},"configMap":{"description":"ConfigMap represents a configMap that should populate this volume","$ref":"#/definitions/io.k8s.api.core.v1.ConfigMapVolumeSource"},"csi":{"description":"CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).","$ref":"#/definitions/io.k8s.api.core.v1.CSIVolumeSource"},"downwardAPI":{"description":"DownwardAPI represents downward API about the pod that should populate this volume","$ref":"#/definitions/io.k8s.api.core.v1.DownwardAPIVolumeSource"},"emptyDir":{"description":"EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir","$ref":"#/definitions/io.k8s.api.core.v1.EmptyDirVolumeSource"},"ephemeral":{"description":"Ephemeral represents a volume that is handled by a cluster storage driver (Alpha feature). The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.","$ref":"#/definitions/io.k8s.api.core.v1.EphemeralVolumeSource"},"fc":{"description":"FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.","$ref":"#/definitions/io.k8s.api.core.v1.FCVolumeSource"},"flexVolume":{"description":"FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.","$ref":"#/definitions/io.k8s.api.core.v1.FlexVolumeSource"},"flocker":{"description":"Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running","$ref":"#/definitions/io.k8s.api.core.v1.FlockerVolumeSource"},"gcePersistentDisk":{"description":"GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk","$ref":"#/definitions/io.k8s.api.core.v1.GCEPersistentDiskVolumeSource"},"gitRepo":{"description":"GitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.","$ref":"#/definitions/io.k8s.api.core.v1.GitRepoVolumeSource"},"glusterfs":{"description":"Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md","$ref":"#/definitions/io.k8s.api.core.v1.GlusterfsVolumeSource"},"hostPath":{"description":"HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath","$ref":"#/definitions/io.k8s.api.core.v1.HostPathVolumeSource"},"iscsi":{"description":"ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md","$ref":"#/definitions/io.k8s.api.core.v1.ISCSIVolumeSource"},"name":{"description":"Volume's name. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names","type":"string"},"nfs":{"description":"NFS represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs","$ref":"#/definitions/io.k8s.api.core.v1.NFSVolumeSource"},"persistentVolumeClaim":{"description":"PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims","$ref":"#/definitions/io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource"},"photonPersistentDisk":{"description":"PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine","$ref":"#/definitions/io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource"},"portworxVolume":{"description":"PortworxVolume represents a portworx volume attached and mounted on kubelets host machine","$ref":"#/definitions/io.k8s.api.core.v1.PortworxVolumeSource"},"projected":{"description":"Items for all in one resources secrets, configmaps, and downward API","$ref":"#/definitions/io.k8s.api.core.v1.ProjectedVolumeSource"},"quobyte":{"description":"Quobyte represents a Quobyte mount on the host that shares a pod's lifetime","$ref":"#/definitions/io.k8s.api.core.v1.QuobyteVolumeSource"},"rbd":{"description":"RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md","$ref":"#/definitions/io.k8s.api.core.v1.RBDVolumeSource"},"scaleIO":{"description":"ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.","$ref":"#/definitions/io.k8s.api.core.v1.ScaleIOVolumeSource"},"secret":{"description":"Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret","$ref":"#/definitions/io.k8s.api.core.v1.SecretVolumeSource"},"storageos":{"description":"StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.","$ref":"#/definitions/io.k8s.api.core.v1.StorageOSVolumeSource"},"vsphereVolume":{"description":"VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine","$ref":"#/definitions/io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource"}}},"io.k8s.api.core.v1.VolumeDevice":{"description":"volumeDevice describes a mapping of a raw block device within a container.","type":"object","required":["name","devicePath"],"properties":{"devicePath":{"description":"devicePath is the path inside of the container that the device will be mapped to.","type":"string"},"name":{"description":"name must match the name of a persistentVolumeClaim in the pod","type":"string"}}},"io.k8s.api.core.v1.VolumeMount":{"description":"VolumeMount describes a mounting of a Volume within a container.","type":"object","required":["name","mountPath"],"properties":{"mountPath":{"description":"Path within the container at which the volume should be mounted. Must not contain ':'.","type":"string"},"mountPropagation":{"description":"mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.","type":"string"},"name":{"description":"This must match the Name of a Volume.","type":"string"},"readOnly":{"description":"Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.","type":"boolean"},"subPath":{"description":"Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).","type":"string"},"subPathExpr":{"description":"Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.","type":"string"}}},"io.k8s.api.core.v1.VolumeProjection":{"description":"Projection that may be projected along with other supported volume types","type":"object","properties":{"configMap":{"description":"information about the configMap data to project","$ref":"#/definitions/io.k8s.api.core.v1.ConfigMapProjection"},"downwardAPI":{"description":"information about the downwardAPI data to project","$ref":"#/definitions/io.k8s.api.core.v1.DownwardAPIProjection"},"secret":{"description":"information about the secret data to project","$ref":"#/definitions/io.k8s.api.core.v1.SecretProjection"},"serviceAccountToken":{"description":"information about the serviceAccountToken data to project","$ref":"#/definitions/io.k8s.api.core.v1.ServiceAccountTokenProjection"}}},"io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource":{"description":"Represents a vSphere volume resource.","type":"object","required":["volumePath"],"properties":{"fsType":{"description":"Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.","type":"string"},"storagePolicyID":{"description":"Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.","type":"string"},"storagePolicyName":{"description":"Storage Policy Based Management (SPBM) profile name.","type":"string"},"volumePath":{"description":"Path that identifies vSphere volume vmdk","type":"string"}}},"io.k8s.api.core.v1.WeightedPodAffinityTerm":{"description":"The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)","type":"object","required":["weight","podAffinityTerm"],"properties":{"podAffinityTerm":{"description":"Required. A pod affinity term, associated with the corresponding weight.","$ref":"#/definitions/io.k8s.api.core.v1.PodAffinityTerm"},"weight":{"description":"weight associated with matching the corresponding podAffinityTerm, in the range 1-100.","type":"integer","format":"int32"}}},"io.k8s.api.core.v1.WindowsSecurityContextOptions":{"description":"WindowsSecurityContextOptions contain Windows-specific options and credentials.","type":"object","properties":{"gmsaCredentialSpec":{"description":"GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.","type":"string"},"gmsaCredentialSpecName":{"description":"GMSACredentialSpecName is the name of the GMSA credential spec to use.","type":"string"},"runAsUserName":{"description":"The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.","type":"string"}}},"io.k8s.api.rbac.v1.PolicyRule":{"description":"PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.","type":"object","required":["verbs"],"properties":{"apiGroups":{"description":"APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed.","type":"array","items":{"type":"string"}},"nonResourceURLs":{"description":"NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as \"pods\" or \"secrets\") or non-resource URL paths (such as \"/api\"), but not both.","type":"array","items":{"type":"string"}},"resourceNames":{"description":"ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.","type":"array","items":{"type":"string"}},"resources":{"description":"Resources is a list of resources this rule applies to. ResourceAll represents all resources.","type":"array","items":{"type":"string"}},"verbs":{"description":"Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds.","type":"array","items":{"type":"string"}}}},"io.k8s.api.rbac.v1.Role":{"description":"Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.","type":"object","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":{"description":"Standard object's metadata.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"},"rules":{"description":"Rules holds all the PolicyRules for this Role","type":"array","items":{"$ref":"#/definitions/io.k8s.api.rbac.v1.PolicyRule"}}}},"io.k8s.api.rbac.v1.RoleRef":{"description":"RoleRef contains information that points to the role being used","type":"object","required":["apiGroup","kind","name"],"properties":{"apiGroup":{"description":"APIGroup is the group for the resource being referenced","type":"string"},"kind":{"description":"Kind is the type of resource being referenced","type":"string"},"name":{"description":"Name is the name of resource being referenced","type":"string"}}},"io.k8s.api.rbac.v1.Subject":{"description":"Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names.","type":"object","required":["kind","name"],"properties":{"apiGroup":{"description":"APIGroup holds the API group of the referenced subject. Defaults to \"\" for ServiceAccount subjects. Defaults to \"rbac.authorization.k8s.io\" for User and Group subjects.","type":"string"},"kind":{"description":"Kind of object being referenced. Values defined by this API group are \"User\", \"Group\", and \"ServiceAccount\". If the Authorizer does not recognized the kind value, the Authorizer should report an error.","type":"string"},"name":{"description":"Name of the object being referenced.","type":"string"},"namespace":{"description":"Namespace of the referenced object. If the object kind is non-namespace, such as \"User\" or \"Group\", and this value is not empty the Authorizer should report an error.","type":"string"}}},"io.k8s.apimachinery.pkg.api.resource.Quantity":{"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\u003cquantity\u003e ::= \u003csignedNumber\u003e\u003csuffix\u003e\n (Note that \u003csuffix\u003e may be empty, from the \"\" case in \u003cdecimalSI\u003e.)\n\u003cdigit\u003e ::= 0 | 1 | ... | 9 \u003cdigits\u003e ::= \u003cdigit\u003e | \u003cdigit\u003e\u003cdigits\u003e \u003cnumber\u003e ::= \u003cdigits\u003e | \u003cdigits\u003e.\u003cdigits\u003e | \u003cdigits\u003e. | .\u003cdigits\u003e \u003csign\u003e ::= \"+\" | \"-\" \u003csignedNumber\u003e ::= \u003cnumber\u003e | \u003csign\u003e\u003cnumber\u003e \u003csuffix\u003e ::= \u003cbinarySI\u003e | \u003cdecimalExponent\u003e | \u003cdecimalSI\u003e \u003cbinarySI\u003e ::= Ki | Mi | Gi | Ti | Pi | Ei\n (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n\u003cdecimalSI\u003e ::= m | \"\" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\n\u003cdecimalExponent\u003e ::= \"e\" \u003csignedNumber\u003e | \"E\" \u003csignedNumber\u003e\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 a. No precision is lost\n b. No fractional digits will be emitted\n c. The exponent (or suffix) is as large as possible.\nThe sign will be omitted unless the number is negative.\n\nExamples:\n 1.5 will be serialized as \"1500m\"\n 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":"string"},"io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1":{"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:\u003cname\u003e', where \u003cname\u003e is the name of a field in a struct, or key in a map 'v:\u003cvalue\u003e', where \u003cvalue\u003e is the exact json formatted value of a list item 'i:\u003cindex\u003e', where \u003cindex\u003e is position of a item in a list 'k:\u003ckeys\u003e', where \u003ckeys\u003e 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":"object"},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector":{"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":"object","properties":{"matchExpressions":{"description":"matchExpressions is a list of label selector requirements. The requirements are ANDed.","type":"array","items":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement"}},"matchLabels":{"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":"object","additionalProperties":{"type":"string"}}}},"io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement":{"description":"A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","type":"object","required":["key","operator"],"properties":{"key":{"description":"key is the label key that the selector applies to.","type":"string","x-kubernetes-patch-merge-key":"key","x-kubernetes-patch-strategy":"merge"},"operator":{"description":"operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.","type":"string"},"values":{"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":"array","items":{"type":"string"}}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta":{"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":"object","properties":{"continue":{"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"},"remainingItemCount":{"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":"integer","format":"int64"},"resourceVersion":{"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"},"selfLink":{"description":"selfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry":{"description":"ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.","type":"object","properties":{"apiVersion":{"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"},"fieldsType":{"description":"FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: \"FieldsV1\"","type":"string"},"fieldsV1":{"description":"FieldsV1 holds the first JSON version format as described in the \"FieldsV1\" type.","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1"},"manager":{"description":"Manager is an identifier of the workflow managing these fields.","type":"string"},"operation":{"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"},"time":{"description":"Time is timestamp of when these fields were set. It should always be empty if Operation is 'Apply'","$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta":{"description":"ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.","type":"object","properties":{"annotations":{"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: http://kubernetes.io/docs/user-guide/annotations","type":"object","additionalProperties":{"type":"string"}},"clusterName":{"description":"The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.","type":"string"},"creationTimestamp":{"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":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"deletionGracePeriodSeconds":{"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":"integer","format":"int64"},"deletionTimestamp":{"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":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time"},"finalizers":{"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":"array","items":{"type":"string"},"x-kubernetes-patch-strategy":"merge"},"generateName":{"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 NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\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"},"generation":{"description":"A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.","type":"integer","format":"int64"},"labels":{"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: http://kubernetes.io/docs/user-guide/labels","type":"object","additionalProperties":{"type":"string"}},"managedFields":{"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":"array","items":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry"}},"name":{"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: http://kubernetes.io/docs/user-guide/identifiers#names","type":"string"},"namespace":{"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: http://kubernetes.io/docs/user-guide/namespaces","type":"string"},"ownerReferences":{"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":"array","items":{"$ref":"#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference"},"x-kubernetes-patch-merge-key":"uid","x-kubernetes-patch-strategy":"merge"},"resourceVersion":{"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"},"selfLink":{"description":"SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.","type":"string"},"uid":{"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: http://kubernetes.io/docs/user-guide/identifiers#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference":{"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":"object","required":["apiVersion","kind","name","uid"],"properties":{"apiVersion":{"description":"API version of the referent.","type":"string"},"blockOwnerDeletion":{"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. Defaults to false. To set this field, a user needs \"delete\" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.","type":"boolean"},"controller":{"description":"If true, this reference points to the managing controller.","type":"boolean"},"kind":{"description":"Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds","type":"string"},"name":{"description":"Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names","type":"string"},"uid":{"description":"UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids","type":"string"}}},"io.k8s.apimachinery.pkg.apis.meta.v1.Time":{"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":"string","format":"date-time"},"io.k8s.apimachinery.pkg.util.intstr.IntOrString":{"description":"IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.","type":"string","format":"int-or-string"}}} \ No newline at end of file diff --git a/docs/apidocs/openapi-spec/openapiv2.yaml b/docs/apidocs/openapi-spec/openapiv2.yaml index cc5ef6c..660be83 100644 --- a/docs/apidocs/openapi-spec/openapiv2.yaml +++ b/docs/apidocs/openapi-spec/openapiv2.yaml @@ -2854,10 +2854,12 @@ definitions: $ref: '#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.Time' description: Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented - in RFC3339 form and is in UTC. + in RFC3339 form and is in UTC. The completion time is only set when the + job finishes successfully. conditions: description: 'The latest available observations of an object''s current state. - More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/' + When a job fails, one of the conditions will have type == "Failed". More + info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/' items: $ref: '#/definitions/io.k8s.api.batch.v1.JobCondition' type: array @@ -3137,11 +3139,13 @@ definitions: The contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling. properties: defaultMode: - description: 'Optional: mode bits to use on created files by default. Must - be a value between 0 and 0777. Defaults to 0644. Directories within the - path are not affected by this setting. This might be in conflict with other - options that affect the file mode, like fsGroup, and the result can be other - mode bits set.' + description: 'Optional: mode bits used to set permissions on created files + by default. Must be an octal value between 0000 and 0777 or a decimal value + between 0 and 511. YAML accepts both octal and decimal values, JSON requires + decimal values for mode bits. Defaults to 0644. Directories within the path + are not affected by this setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result can be other mode + bits set.' format: int32 type: integer items: @@ -3264,9 +3268,8 @@ definitions: If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod''s lifecycle, when it might take a long time to load data or warm - a cache, than during steady-state operation. This cannot be updated. This - is an alpha feature enabled by the StartupProbe feature flag. More info: - https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + a cache, than during steady-state operation. This cannot be updated. More + info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' stdin: description: Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container @@ -3305,7 +3308,7 @@ definitions: type: boolean volumeDevices: description: volumeDevices is the list of block devices to be used by the - container. This is a beta feature. + container. items: $ref: '#/definitions/io.k8s.api.core.v1.VolumeDevice' type: array @@ -3375,8 +3378,10 @@ definitions: description: 'Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.' mode: - description: 'Optional: mode bits to use on this file, must be a value between - 0 and 0777. If not specified, the volume defaultMode will be used. This + description: 'Optional: mode bits used to set permissions on this file, must + be an octal value between 0000 and 0777 or a decimal value between 0 and + 511. YAML accepts both octal and decimal values, JSON requires decimal values + for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' format: int32 @@ -3400,10 +3405,13 @@ definitions: properties: defaultMode: description: 'Optional: mode bits to use on created files by default. Must - be a value between 0 and 0777. Defaults to 0644. Directories within the - path are not affected by this setting. This might be in conflict with other - options that affect the file mode, like fsGroup, and the result can be other - mode bits set.' + be a Optional: mode bits used to set permissions on created files by default. + Must be an octal value between 0000 and 0777 or a decimal value between + 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal + values for mode bits. Defaults to 0644. Directories within the path are + not affected by this setting. This might be in conflict with other options + that affect the file mode, like fsGroup, and the result can be other mode + bits set.' format: int32 type: integer items: @@ -3473,8 +3481,8 @@ definitions: fieldRef: $ref: '#/definitions/io.k8s.api.core.v1.ObjectFieldSelector' description: 'Selects a field of the pod: supports metadata.name, metadata.namespace, - metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, - status.hostIP, status.podIP.' + `metadata.labels['''']`, `metadata.annotations['''']`, spec.nodeName, + spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.' resourceFieldRef: $ref: '#/definitions/io.k8s.api.core.v1.ResourceFieldSelector' description: 'Selects a resource of the container: only resources limits and @@ -3617,7 +3625,7 @@ definitions: type: boolean volumeDevices: description: volumeDevices is the list of block devices to be used by the - container. This is a beta feature. + container. items: $ref: '#/definitions/io.k8s.api.core.v1.VolumeDevice' type: array @@ -3639,6 +3647,25 @@ definitions: required: - name type: object + io.k8s.api.core.v1.EphemeralVolumeSource: + description: Represents an ephemeral volume that is handled by a normal storage + driver. + properties: + readOnly: + description: Specifies a read-only configuration for the volume. Defaults + to false (read/write). + type: boolean + volumeClaimTemplate: + $ref: '#/definitions/io.k8s.api.core.v1.PersistentVolumeClaimTemplate' + description: |- + Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long). + + An existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster. + + This field is read-only and no changes will be made by Kubernetes to the PVC after it has been created. + + Required, must not be nil. + type: object io.k8s.api.core.v1.ExecAction: description: ExecAction describes a "run in container" action. properties: @@ -3937,8 +3964,10 @@ definitions: description: The key to project. type: string mode: - description: 'Optional: mode bits to use on this file, must be a value between - 0 and 0777. If not specified, the volume defaultMode will be used. This + description: 'Optional: mode bits used to set permissions on this file. Must + be an octal value between 0000 and 0777 or a decimal value between 0 and + 511. YAML accepts both octal and decimal values, JSON requires decimal values + for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.' format: int32 @@ -4092,6 +4121,65 @@ definitions: required: - fieldPath type: object + io.k8s.api.core.v1.PersistentVolumeClaimSpec: + description: PersistentVolumeClaimSpec describes the common attributes of storage + devices and allows a Source for provider-specific attributes + properties: + accessModes: + description: 'AccessModes contains the desired access modes the volume should + have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1' + items: + type: string + type: array + dataSource: + $ref: '#/definitions/io.k8s.api.core.v1.TypedLocalObjectReference' + description: 'This field can be used to specify either: * An existing VolumeSnapshot + object (snapshot.storage.k8s.io/VolumeSnapshot - Beta) * An existing PVC + (PersistentVolumeClaim) * An existing custom resource/object that implements + data population (Alpha) In order to use VolumeSnapshot object types, the + appropriate feature gate must be enabled (VolumeSnapshotDataSource or AnyVolumeDataSource) + If the provisioner or an external controller can support the specified data + source, it will create a new volume based on the contents of the specified + data source. If the specified data source is not supported, the volume will + not be created and the failure will be reported as an event. In the future, + we plan to support more data source types and the behavior of the provisioner + may change.' + resources: + $ref: '#/definitions/io.k8s.api.core.v1.ResourceRequirements' + description: 'Resources represents the minimum resources the volume should + have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources' + selector: + $ref: '#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector' + description: A label query over volumes to consider for binding. + storageClassName: + description: 'Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1' + type: string + volumeMode: + description: volumeMode defines what type of volume is required by the claim. + Value of Filesystem is implied when not included in claim spec. + type: string + volumeName: + description: VolumeName is the binding reference to the PersistentVolume backing + this claim. + type: string + type: object + io.k8s.api.core.v1.PersistentVolumeClaimTemplate: + description: PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim + objects as part of an EphemeralVolumeSource. + properties: + metadata: + $ref: '#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta' + description: May contain labels and annotations that will be copied into the + PVC when creating it. No other fields are allowed and will be rejected during + validation. + spec: + $ref: '#/definitions/io.k8s.api.core.v1.PersistentVolumeClaimSpec' + description: The specification for the PersistentVolumeClaim. The entire content + is copied unchanged into the PVC that gets created from this template. The + same fields as in a PersistentVolumeClaim are also valid here. + required: + - spec + type: object io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource: description: PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the @@ -4265,6 +4353,14 @@ definitions: If unset, the Kubelet will not modify the ownership and permissions of any volume. format: int64 type: integer + fsGroupChangePolicy: + description: 'fsGroupChangePolicy defines behavior of changing ownership and + permission of the volume before being exposed inside Pod. This field will + only apply to volume types which support fsGroup based ownership(and permissions). + It will have no effect on ephemeral volume types such as: secret, configmaps + and emptydir. Valid values are "OnRootMismatch" and "Always". If not specified + defaults to "Always".' + type: string runAsGroup: description: The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in @@ -4293,6 +4389,9 @@ definitions: the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container. + seccompProfile: + $ref: '#/definitions/io.k8s.api.core.v1.SeccompProfile' + description: The seccomp options to use by the containers in this pod. supplementalGroups: description: A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will @@ -4450,8 +4549,7 @@ definitions: preemptionPolicy: description: PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority - if unset. This field is alpha-level and is only honored by servers that - enable the NonPreemptingPriority feature. + if unset. This field is beta-level, gated by the NonPreemptingPriority feature-gate. type: string priority: description: The priority value. Various system components use this field @@ -4506,13 +4604,20 @@ definitions: description: 'ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/' type: string + setHostnameAsFQDN: + description: If true the pod's hostname will be configured as the pod's FQDN, + rather than the leaf name (the default). In Linux containers, this means + setting the FQDN in the hostname field of the kernel (the nodename field + of struct utsname). In Windows containers, this means setting the registry + value of hostname for the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters + to FQDN. If a pod does not have FQDN, this has no effect. Default to false. + type: boolean shareProcessNamespace: description: 'Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both - be set. Optional: Default to false. This field is beta-level and may be - disabled with the PodShareProcessNamespace feature.' + be set. Optional: Default to false.' type: boolean subdomain: description: If specified, the fully qualified Pod hostname will be ".. golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // pinned to release-branch.go1.13 golang.org/x/tools => golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 // pinned to release-branch.go1.13 - k8s.io/api => k8s.io/api v0.16.5 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.0.0-20190819143637-0dbe462fe92d - k8s.io/apimachinery => k8s.io/apimachinery v0.16.5 - k8s.io/client-go => k8s.io/client-go v0.16.5 - k8s.io/metrics => k8s.io/metrics v0.0.0-20190819143841-305e1cef1ab1 + ) diff --git a/go.sum b/go.sum index 54a6b1e..e195667 100644 --- a/go.sum +++ b/go.sum @@ -1,14 +1,29 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -19,8 +34,6 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alecthomas/jsonschema v0.0.0-20190504002508-159cbd5dba26 h1:b/CA15BzZIj8xNKnBxUwUmXt3USfJjb4Gl9eJIfMLtE= github.com/alecthomas/jsonschema v0.0.0-20190504002508-159cbd5dba26/go.mod h1:qpebaTNSsyUn5rPSJMsfqEtDw71TTggXM6stUDI16HA= -github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921 h1:T3+cD5fYvuH36h7EZq+TDpm+d8a6FSD4pQsbmuGGQ8o= -github.com/alecthomas/jsonschema v0.0.0-20200530073317-71f438968921/go.mod h1:/n6+1/DWPltRLWL/VKyUxg6tzsl5kHUCcraimt4vr60= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY= @@ -30,7 +43,11 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -39,28 +56,34 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/evanphx/json-patch v4.2.0+incompatible h1:fUDGZCv/7iAN7u0puUVhvKCcsR6vRfwrJatElLBEf0I= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= @@ -80,32 +103,52 @@ github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d h1:7XGaL1e6bYS1yIonGp9761ExpPPV1ui0SAC59Yube9k= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= @@ -115,27 +158,26 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 h1:i462o439ZjprVSFSZLZxcsoAe592sZB1rci2Z8j4wdk= -github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jenkins-x/jx-logging v0.0.8 h1:V6W3il1JFSL1BTuXio3NVefqtJWFIm3Dg/99nxGFMuU= -github.com/jenkins-x/jx-logging v0.0.8/go.mod h1:mjEejiArk2Mk+J+72/YcSKGo9bZlJ/LwKYjMgAiv+G4= github.com/jenkins-x/jx-logging v0.0.11 h1:t4T653u6oy4SJ2VYlrY5rIobr16jJS9Gf8RWlHqtJvw= github.com/jenkins-x/jx-logging v0.0.11/go.mod h1:mjEejiArk2Mk+J+72/YcSKGo9bZlJ/LwKYjMgAiv+G4= +github.com/jenkins-x/jx-logging/v3 v3.0.0 h1:Oqidp7EL+PUlZUUdPvOeWju9mMq2mzpd9/HWXdVM68E= +github.com/jenkins-x/jx-logging/v3 v3.0.0/go.mod h1:bOYlj+Cdd9v7/vDXjkwlUylxGs5sfQJvYnuYbCL0IrY= github.com/jenkins-x/logrus-stackdriver-formatter v0.2.3 h1:NuRWKUPCEX1wKlXA8ZYSG28qGKd41R7BK11YDQkPwqo= github.com/jenkins-x/logrus-stackdriver-formatter v0.2.3/go.mod h1:litPp7VZWDRCl8LvXuqGngy+65kkg/+T23TgFnDmfTk= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= @@ -170,7 +212,6 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh 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= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -182,24 +223,23 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/petergtz/pegomock v2.7.0+incompatible h1:42rJ5wIOBAg9OGdkLaPW9PlF/RtqDc5aGl6PcTCXl3o= -github.com/petergtz/pegomock v2.7.0+incompatible/go.mod h1:nuBLWZpVyv/fLo56qTwt/AUau7jgouO1h7bEvZCq82o= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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 v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -208,6 +248,7 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/rickar/props v0.0.0-20170718221555-0b06aeb2f037 h1:HFsTO5S+nnw/Xs9lRYF+UUJvH8wMSRMRal321W0hfdY= github.com/rickar/props v0.0.0-20170718221555-0b06aeb2f037/go.mod h1:F1p8BNM4IXv2UcptwSp8HJOapKurodd/PYu1D6Gtn9Y= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/satori/go.uuid v1.2.1-0.20180103174451-36e9d2ebbde5 h1:Jw7W4WMfQDxsXvfeFSaS2cHlY7bAF4MGrgnbd0+Uo78= github.com/satori/go.uuid v1.2.1-0.20180103174451-36e9d2ebbde5/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= @@ -234,13 +275,10 @@ github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgho= -github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -255,26 +293,38 @@ github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17 github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -284,17 +334,21 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 h1:rjwSpXsdiK0dV8/Naq3kAw9ymfAeJIyd0upUIElB+lI= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -303,67 +357,77 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200409092240-59c9f1ba88fa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25 h1:OKbAoGs4fGM5cPLlVQLZGYkFC8OnOfgo6tt0Smf9XhM= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 h1:PVCvyir09Xgta5zksNZDkrL+eSm/Y+gQxRG3IfqNQ3A= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200415034506-5d8e1897c761 h1:FVw4lelfGRNPqB3C8qX1m+QyeM2vzToIwlFhEZX42y8= -golang.org/x/tools v0.0.0-20200415034506-5d8e1897c761/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -375,22 +439,28 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.16.5 h1:5ceVzCX+I9LI9wIw4CASqVsepRDeUp44/J8Tgl4ki2I= -k8s.io/api v0.16.5/go.mod h1:6ijJb2BQAkGSn+8Z3173M0LXe2gBAH+i/JAJptd/rJo= -k8s.io/apimachinery v0.16.5 h1:5rnJuabGmLtgcMrdeTb48CvV0UW4TrM5vBbWWEy6OS0= -k8s.io/apimachinery v0.16.5/go.mod h1:mhhO3hoLkWO+2eCvqjPtH2Ly92l9nJDwsswzWKpkN2w= -k8s.io/client-go v0.16.5 h1:gp+ALoobYbhrm1CHo//8rAvyDuZqM6SDqnMT9nSSx1I= -k8s.io/client-go v0.16.5/go.mod h1:0Y5GaECkDkadoJg7lBQLiQQGFl67O4Gia/dHZboA7xg= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +k8s.io/api v0.19.2 h1:q+/krnHWKsL7OBZg/rxnycsl9569Pud76UJ77MvKXms= +k8s.io/api v0.19.2/go.mod h1:IQpK0zFQ1xc5iNIQPqzgoOwuFugaYHK4iCknlAQP9nI= +k8s.io/apimachinery v0.19.2 h1:5Gy9vQpAGTKHPVOh5c4plE274X8D/6cuEiTO2zve7tc= +k8s.io/apimachinery v0.19.2/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= +k8s.io/client-go v0.19.2 h1:gMJuU3xJZs86L1oQ99R4EViAADUPMHHtS9jFshasHSc= +k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA= +k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf h1:EYm5AW/UUDbnmnI+gK0TJDVK9qPLhM+sRHYanNKw0EQ= -k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20190801114015-581e00157fb1 h1:+ySTxfHnfzZb9ys375PXNlLhkJPLKgHajBU0N62BDvE= -k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= +k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488 h1:mNpvQf4lkIHNOXCoM+Veu/UXwA56Yx1J7hY1Tvcs/oM= +k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= +k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg= +k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/pkg/apis/jenkins.io/v1/types_environment.go b/pkg/apis/jenkins.io/v1/types_environment.go index fbc5bd6..2ffce33 100644 --- a/pkg/apis/jenkins.io/v1/types_environment.go +++ b/pkg/apis/jenkins.io/v1/types_environment.go @@ -4,7 +4,7 @@ import ( "encoding/json" "errors" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" batchv1 "k8s.io/api/batch/v1" rbacv1 "k8s.io/api/rbac/v1" diff --git a/pkg/apis/jenkins.io/v1/types_environment_test.go b/pkg/apis/jenkins.io/v1/types_environment_test.go index 544298d..3f22e7a 100644 --- a/pkg/apis/jenkins.io/v1/types_environment_test.go +++ b/pkg/apis/jenkins.io/v1/types_environment_test.go @@ -8,7 +8,7 @@ import ( v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/stretchr/testify/assert" ) diff --git a/pkg/apis/jenkins.io/v1/types_extensions.go b/pkg/apis/jenkins.io/v1/types_extensions.go index fbff053..0cf01a1 100644 --- a/pkg/apis/jenkins.io/v1/types_extensions.go +++ b/pkg/apis/jenkins.io/v1/types_extensions.go @@ -1,12 +1,13 @@ package v1 import ( + "context" "fmt" "io/ioutil" "path/filepath" "github.com/jenkins-x/jx-api/pkg/util" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" v1 "k8s.io/api/rbac/v1" @@ -325,14 +326,15 @@ func (extensionsConfig *ExtensionConfigList) LoadFromFile(inputFile string) (cfg } func (extensionsConfig *ExtensionConfigList) LoadFromConfigMap(configMapName string, client kubernetes.Interface, namespace string) (cfg *ExtensionConfigList, err error) { - cm, err := client.CoreV1().ConfigMaps(namespace).Get(configMapName, metav1.GetOptions{}) + ctx := context.Background() + cm, err := client.CoreV1().ConfigMaps(namespace).Get(ctx, configMapName, metav1.GetOptions{}) if err != nil { // CM doesn't exist, create it - cm, err = client.CoreV1().ConfigMaps(namespace).Create(&corev1.ConfigMap{ + cm, err = client.CoreV1().ConfigMaps(namespace).Create(ctx, &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: configMapName, }, - }) + }, metav1.CreateOptions{}) if err != nil { return nil, err } diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 67d4be2..04870d1 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -3,6 +3,8 @@ package versioned import ( + "fmt" + jenkinsv1 "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/typed/jenkins.io/v1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" @@ -35,9 +37,14 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { } // 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. func NewForConfig(c *rest.Config) (*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 diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 9ab008a..da2f822 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -13,7 +13,7 @@ import ( var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) -var parameterCodec = runtime.NewParameterCodec(scheme) + var localSchemeBuilder = runtime.SchemeBuilder{ jenkinsv1.AddToScheme, } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/app.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/app.go index 37b35ed..663389b 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/app.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/app.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type AppsGetter interface { // AppInterface has methods to work with App resources. type AppInterface interface { - Create(*v1.App) (*v1.App, error) - Update(*v1.App) (*v1.App, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.App, error) - List(opts metav1.ListOptions) (*v1.AppList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.App, err error) + Create(ctx context.Context, app *v1.App, opts metav1.CreateOptions) (*v1.App, error) + Update(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (*v1.App, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.App, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AppList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.App, err error) AppExpansion } @@ -47,20 +48,20 @@ func newApps(c *JenkinsV1Client, namespace string) *apps { } // Get takes name of the app, and returns the corresponding app object, and an error if there is any. -func (c *apps) Get(name string, options metav1.GetOptions) (result *v1.App, err error) { +func (c *apps) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.App, err error) { result = &v1.App{} err = c.client.Get(). Namespace(c.ns). Resource("apps"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Apps that match those selectors. -func (c *apps) List(opts metav1.ListOptions) (result *v1.AppList, err error) { +func (c *apps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AppList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *apps) List(opts metav1.ListOptions) (result *v1.AppList, err error) { Resource("apps"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested apps. -func (c *apps) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *apps) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *apps) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("apps"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a app and creates it. Returns the server's representation of the app, and an error, if there is any. -func (c *apps) Create(app *v1.App) (result *v1.App, err error) { +func (c *apps) Create(ctx context.Context, app *v1.App, opts metav1.CreateOptions) (result *v1.App, err error) { result = &v1.App{} err = c.client.Post(). Namespace(c.ns). Resource("apps"). + VersionedParams(&opts, scheme.ParameterCodec). Body(app). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a app and updates it. Returns the server's representation of the app, and an error, if there is any. -func (c *apps) Update(app *v1.App) (result *v1.App, err error) { +func (c *apps) Update(ctx context.Context, app *v1.App, opts metav1.UpdateOptions) (result *v1.App, err error) { result = &v1.App{} err = c.client.Put(). Namespace(c.ns). Resource("apps"). Name(app.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(app). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the app and deletes it. Returns an error if one occurs. -func (c *apps) Delete(name string, options *metav1.DeleteOptions) error { +func (c *apps) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("apps"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *apps) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *apps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("apps"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched app. -func (c *apps) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.App, err error) { +func (c *apps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.App, err error) { result = &v1.App{} err = c.client.Patch(pt). Namespace(c.ns). Resource("apps"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack.go index d1e3792..5983623 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type BuildPacksGetter interface { // BuildPackInterface has methods to work with BuildPack resources. type BuildPackInterface interface { - Create(*v1.BuildPack) (*v1.BuildPack, error) - Update(*v1.BuildPack) (*v1.BuildPack, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.BuildPack, error) - List(opts metav1.ListOptions) (*v1.BuildPackList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.BuildPack, err error) + Create(ctx context.Context, buildPack *v1.BuildPack, opts metav1.CreateOptions) (*v1.BuildPack, error) + Update(ctx context.Context, buildPack *v1.BuildPack, opts metav1.UpdateOptions) (*v1.BuildPack, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.BuildPack, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.BuildPackList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.BuildPack, err error) BuildPackExpansion } @@ -47,20 +48,20 @@ func newBuildPacks(c *JenkinsV1Client, namespace string) *buildPacks { } // Get takes name of the buildPack, and returns the corresponding buildPack object, and an error if there is any. -func (c *buildPacks) Get(name string, options metav1.GetOptions) (result *v1.BuildPack, err error) { +func (c *buildPacks) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.BuildPack, err error) { result = &v1.BuildPack{} err = c.client.Get(). Namespace(c.ns). Resource("buildpacks"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of BuildPacks that match those selectors. -func (c *buildPacks) List(opts metav1.ListOptions) (result *v1.BuildPackList, err error) { +func (c *buildPacks) List(ctx context.Context, opts metav1.ListOptions) (result *v1.BuildPackList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *buildPacks) List(opts metav1.ListOptions) (result *v1.BuildPackList, er Resource("buildpacks"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested buildPacks. -func (c *buildPacks) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *buildPacks) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *buildPacks) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("buildpacks"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a buildPack and creates it. Returns the server's representation of the buildPack, and an error, if there is any. -func (c *buildPacks) Create(buildPack *v1.BuildPack) (result *v1.BuildPack, err error) { +func (c *buildPacks) Create(ctx context.Context, buildPack *v1.BuildPack, opts metav1.CreateOptions) (result *v1.BuildPack, err error) { result = &v1.BuildPack{} err = c.client.Post(). Namespace(c.ns). Resource("buildpacks"). + VersionedParams(&opts, scheme.ParameterCodec). Body(buildPack). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a buildPack and updates it. Returns the server's representation of the buildPack, and an error, if there is any. -func (c *buildPacks) Update(buildPack *v1.BuildPack) (result *v1.BuildPack, err error) { +func (c *buildPacks) Update(ctx context.Context, buildPack *v1.BuildPack, opts metav1.UpdateOptions) (result *v1.BuildPack, err error) { result = &v1.BuildPack{} err = c.client.Put(). Namespace(c.ns). Resource("buildpacks"). Name(buildPack.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(buildPack). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the buildPack and deletes it. Returns an error if one occurs. -func (c *buildPacks) Delete(name string, options *metav1.DeleteOptions) error { +func (c *buildPacks) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("buildpacks"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *buildPacks) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *buildPacks) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("buildpacks"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched buildPack. -func (c *buildPacks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.BuildPack, err error) { +func (c *buildPacks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.BuildPack, err error) { result = &v1.BuildPack{} err = c.client.Patch(pt). Namespace(c.ns). Resource("buildpacks"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus.go index 75c5017..c206062 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type CommitStatusesGetter interface { // CommitStatusInterface has methods to work with CommitStatus resources. type CommitStatusInterface interface { - Create(*v1.CommitStatus) (*v1.CommitStatus, error) - Update(*v1.CommitStatus) (*v1.CommitStatus, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.CommitStatus, error) - List(opts metav1.ListOptions) (*v1.CommitStatusList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.CommitStatus, err error) + Create(ctx context.Context, commitStatus *v1.CommitStatus, opts metav1.CreateOptions) (*v1.CommitStatus, error) + Update(ctx context.Context, commitStatus *v1.CommitStatus, opts metav1.UpdateOptions) (*v1.CommitStatus, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CommitStatus, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.CommitStatusList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CommitStatus, err error) CommitStatusExpansion } @@ -47,20 +48,20 @@ func newCommitStatuses(c *JenkinsV1Client, namespace string) *commitStatuses { } // Get takes name of the commitStatus, and returns the corresponding commitStatus object, and an error if there is any. -func (c *commitStatuses) Get(name string, options metav1.GetOptions) (result *v1.CommitStatus, err error) { +func (c *commitStatuses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CommitStatus, err error) { result = &v1.CommitStatus{} err = c.client.Get(). Namespace(c.ns). Resource("commitstatuses"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of CommitStatuses that match those selectors. -func (c *commitStatuses) List(opts metav1.ListOptions) (result *v1.CommitStatusList, err error) { +func (c *commitStatuses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CommitStatusList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *commitStatuses) List(opts metav1.ListOptions) (result *v1.CommitStatusL Resource("commitstatuses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested commitStatuses. -func (c *commitStatuses) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *commitStatuses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *commitStatuses) Watch(opts metav1.ListOptions) (watch.Interface, error) Resource("commitstatuses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a commitStatus and creates it. Returns the server's representation of the commitStatus, and an error, if there is any. -func (c *commitStatuses) Create(commitStatus *v1.CommitStatus) (result *v1.CommitStatus, err error) { +func (c *commitStatuses) Create(ctx context.Context, commitStatus *v1.CommitStatus, opts metav1.CreateOptions) (result *v1.CommitStatus, err error) { result = &v1.CommitStatus{} err = c.client.Post(). Namespace(c.ns). Resource("commitstatuses"). + VersionedParams(&opts, scheme.ParameterCodec). Body(commitStatus). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a commitStatus and updates it. Returns the server's representation of the commitStatus, and an error, if there is any. -func (c *commitStatuses) Update(commitStatus *v1.CommitStatus) (result *v1.CommitStatus, err error) { +func (c *commitStatuses) Update(ctx context.Context, commitStatus *v1.CommitStatus, opts metav1.UpdateOptions) (result *v1.CommitStatus, err error) { result = &v1.CommitStatus{} err = c.client.Put(). Namespace(c.ns). Resource("commitstatuses"). Name(commitStatus.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(commitStatus). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the commitStatus and deletes it. Returns an error if one occurs. -func (c *commitStatuses) Delete(name string, options *metav1.DeleteOptions) error { +func (c *commitStatuses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("commitstatuses"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *commitStatuses) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *commitStatuses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("commitstatuses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched commitStatus. -func (c *commitStatuses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.CommitStatus, err error) { +func (c *commitStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CommitStatus, err error) { result = &v1.CommitStatus{} err = c.client.Patch(pt). Namespace(c.ns). Resource("commitstatuses"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment.go index cf5bf7f..19fb1de 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type EnvironmentsGetter interface { // EnvironmentInterface has methods to work with Environment resources. type EnvironmentInterface interface { - Create(*v1.Environment) (*v1.Environment, error) - Update(*v1.Environment) (*v1.Environment, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Environment, error) - List(opts metav1.ListOptions) (*v1.EnvironmentList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Environment, err error) + Create(ctx context.Context, environment *v1.Environment, opts metav1.CreateOptions) (*v1.Environment, error) + Update(ctx context.Context, environment *v1.Environment, opts metav1.UpdateOptions) (*v1.Environment, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Environment, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.EnvironmentList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Environment, err error) EnvironmentExpansion } @@ -47,20 +48,20 @@ func newEnvironments(c *JenkinsV1Client, namespace string) *environments { } // Get takes name of the environment, and returns the corresponding environment object, and an error if there is any. -func (c *environments) Get(name string, options metav1.GetOptions) (result *v1.Environment, err error) { +func (c *environments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Environment, err error) { result = &v1.Environment{} err = c.client.Get(). Namespace(c.ns). Resource("environments"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Environments that match those selectors. -func (c *environments) List(opts metav1.ListOptions) (result *v1.EnvironmentList, err error) { +func (c *environments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EnvironmentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *environments) List(opts metav1.ListOptions) (result *v1.EnvironmentList Resource("environments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested environments. -func (c *environments) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *environments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *environments) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("environments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a environment and creates it. Returns the server's representation of the environment, and an error, if there is any. -func (c *environments) Create(environment *v1.Environment) (result *v1.Environment, err error) { +func (c *environments) Create(ctx context.Context, environment *v1.Environment, opts metav1.CreateOptions) (result *v1.Environment, err error) { result = &v1.Environment{} err = c.client.Post(). Namespace(c.ns). Resource("environments"). + VersionedParams(&opts, scheme.ParameterCodec). Body(environment). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a environment and updates it. Returns the server's representation of the environment, and an error, if there is any. -func (c *environments) Update(environment *v1.Environment) (result *v1.Environment, err error) { +func (c *environments) Update(ctx context.Context, environment *v1.Environment, opts metav1.UpdateOptions) (result *v1.Environment, err error) { result = &v1.Environment{} err = c.client.Put(). Namespace(c.ns). Resource("environments"). Name(environment.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(environment). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the environment and deletes it. Returns an error if one occurs. -func (c *environments) Delete(name string, options *metav1.DeleteOptions) error { +func (c *environments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("environments"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *environments) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *environments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("environments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched environment. -func (c *environments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Environment, err error) { +func (c *environments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Environment, err error) { result = &v1.Environment{} err = c.client.Patch(pt). Namespace(c.ns). Resource("environments"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding.go index 5ddcf72..d9227ea 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type EnvironmentRoleBindingsGetter interface { // EnvironmentRoleBindingInterface has methods to work with EnvironmentRoleBinding resources. type EnvironmentRoleBindingInterface interface { - Create(*v1.EnvironmentRoleBinding) (*v1.EnvironmentRoleBinding, error) - Update(*v1.EnvironmentRoleBinding) (*v1.EnvironmentRoleBinding, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.EnvironmentRoleBinding, error) - List(opts metav1.ListOptions) (*v1.EnvironmentRoleBindingList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.EnvironmentRoleBinding, err error) + Create(ctx context.Context, environmentRoleBinding *v1.EnvironmentRoleBinding, opts metav1.CreateOptions) (*v1.EnvironmentRoleBinding, error) + Update(ctx context.Context, environmentRoleBinding *v1.EnvironmentRoleBinding, opts metav1.UpdateOptions) (*v1.EnvironmentRoleBinding, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.EnvironmentRoleBinding, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.EnvironmentRoleBindingList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EnvironmentRoleBinding, err error) EnvironmentRoleBindingExpansion } @@ -47,20 +48,20 @@ func newEnvironmentRoleBindings(c *JenkinsV1Client, namespace string) *environme } // Get takes name of the environmentRoleBinding, and returns the corresponding environmentRoleBinding object, and an error if there is any. -func (c *environmentRoleBindings) Get(name string, options metav1.GetOptions) (result *v1.EnvironmentRoleBinding, err error) { +func (c *environmentRoleBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.EnvironmentRoleBinding, err error) { result = &v1.EnvironmentRoleBinding{} err = c.client.Get(). Namespace(c.ns). Resource("environmentrolebindings"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of EnvironmentRoleBindings that match those selectors. -func (c *environmentRoleBindings) List(opts metav1.ListOptions) (result *v1.EnvironmentRoleBindingList, err error) { +func (c *environmentRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EnvironmentRoleBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *environmentRoleBindings) List(opts metav1.ListOptions) (result *v1.Envi Resource("environmentrolebindings"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested environmentRoleBindings. -func (c *environmentRoleBindings) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *environmentRoleBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *environmentRoleBindings) Watch(opts metav1.ListOptions) (watch.Interfac Resource("environmentrolebindings"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a environmentRoleBinding and creates it. Returns the server's representation of the environmentRoleBinding, and an error, if there is any. -func (c *environmentRoleBindings) Create(environmentRoleBinding *v1.EnvironmentRoleBinding) (result *v1.EnvironmentRoleBinding, err error) { +func (c *environmentRoleBindings) Create(ctx context.Context, environmentRoleBinding *v1.EnvironmentRoleBinding, opts metav1.CreateOptions) (result *v1.EnvironmentRoleBinding, err error) { result = &v1.EnvironmentRoleBinding{} err = c.client.Post(). Namespace(c.ns). Resource("environmentrolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). Body(environmentRoleBinding). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a environmentRoleBinding and updates it. Returns the server's representation of the environmentRoleBinding, and an error, if there is any. -func (c *environmentRoleBindings) Update(environmentRoleBinding *v1.EnvironmentRoleBinding) (result *v1.EnvironmentRoleBinding, err error) { +func (c *environmentRoleBindings) Update(ctx context.Context, environmentRoleBinding *v1.EnvironmentRoleBinding, opts metav1.UpdateOptions) (result *v1.EnvironmentRoleBinding, err error) { result = &v1.EnvironmentRoleBinding{} err = c.client.Put(). Namespace(c.ns). Resource("environmentrolebindings"). Name(environmentRoleBinding.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(environmentRoleBinding). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the environmentRoleBinding and deletes it. Returns an error if one occurs. -func (c *environmentRoleBindings) Delete(name string, options *metav1.DeleteOptions) error { +func (c *environmentRoleBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("environmentrolebindings"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *environmentRoleBindings) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *environmentRoleBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("environmentrolebindings"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched environmentRoleBinding. -func (c *environmentRoleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.EnvironmentRoleBinding, err error) { +func (c *environmentRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EnvironmentRoleBinding, err error) { result = &v1.EnvironmentRoleBinding{} err = c.client.Patch(pt). Namespace(c.ns). Resource("environmentrolebindings"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension.go index bcbba43..08a262e 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type ExtensionsGetter interface { // ExtensionInterface has methods to work with Extension resources. type ExtensionInterface interface { - Create(*v1.Extension) (*v1.Extension, error) - Update(*v1.Extension) (*v1.Extension, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Extension, error) - List(opts metav1.ListOptions) (*v1.ExtensionList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Extension, err error) + Create(ctx context.Context, extension *v1.Extension, opts metav1.CreateOptions) (*v1.Extension, error) + Update(ctx context.Context, extension *v1.Extension, opts metav1.UpdateOptions) (*v1.Extension, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Extension, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ExtensionList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Extension, err error) ExtensionExpansion } @@ -47,20 +48,20 @@ func newExtensions(c *JenkinsV1Client, namespace string) *extensions { } // Get takes name of the extension, and returns the corresponding extension object, and an error if there is any. -func (c *extensions) Get(name string, options metav1.GetOptions) (result *v1.Extension, err error) { +func (c *extensions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Extension, err error) { result = &v1.Extension{} err = c.client.Get(). Namespace(c.ns). Resource("extensions"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Extensions that match those selectors. -func (c *extensions) List(opts metav1.ListOptions) (result *v1.ExtensionList, err error) { +func (c *extensions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ExtensionList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *extensions) List(opts metav1.ListOptions) (result *v1.ExtensionList, er Resource("extensions"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested extensions. -func (c *extensions) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *extensions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *extensions) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("extensions"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a extension and creates it. Returns the server's representation of the extension, and an error, if there is any. -func (c *extensions) Create(extension *v1.Extension) (result *v1.Extension, err error) { +func (c *extensions) Create(ctx context.Context, extension *v1.Extension, opts metav1.CreateOptions) (result *v1.Extension, err error) { result = &v1.Extension{} err = c.client.Post(). Namespace(c.ns). Resource("extensions"). + VersionedParams(&opts, scheme.ParameterCodec). Body(extension). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a extension and updates it. Returns the server's representation of the extension, and an error, if there is any. -func (c *extensions) Update(extension *v1.Extension) (result *v1.Extension, err error) { +func (c *extensions) Update(ctx context.Context, extension *v1.Extension, opts metav1.UpdateOptions) (result *v1.Extension, err error) { result = &v1.Extension{} err = c.client.Put(). Namespace(c.ns). Resource("extensions"). Name(extension.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(extension). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the extension and deletes it. Returns an error if one occurs. -func (c *extensions) Delete(name string, options *metav1.DeleteOptions) error { +func (c *extensions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("extensions"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *extensions) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *extensions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("extensions"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched extension. -func (c *extensions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Extension, err error) { +func (c *extensions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Extension, err error) { result = &v1.Extension{} err = c.client.Patch(pt). Namespace(c.ns). Resource("extensions"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go index 2f1a549..1af6143 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type FactsGetter interface { // FactInterface has methods to work with Fact resources. type FactInterface interface { - Create(*v1.Fact) (*v1.Fact, error) - Update(*v1.Fact) (*v1.Fact, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Fact, error) - List(opts metav1.ListOptions) (*v1.FactList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Fact, err error) + Create(ctx context.Context, fact *v1.Fact, opts metav1.CreateOptions) (*v1.Fact, error) + Update(ctx context.Context, fact *v1.Fact, opts metav1.UpdateOptions) (*v1.Fact, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Fact, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.FactList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Fact, err error) FactExpansion } @@ -47,20 +48,20 @@ func newFacts(c *JenkinsV1Client, namespace string) *facts { } // Get takes name of the fact, and returns the corresponding fact object, and an error if there is any. -func (c *facts) Get(name string, options metav1.GetOptions) (result *v1.Fact, err error) { +func (c *facts) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Fact, err error) { result = &v1.Fact{} err = c.client.Get(). Namespace(c.ns). Resource("facts"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Facts that match those selectors. -func (c *facts) List(opts metav1.ListOptions) (result *v1.FactList, err error) { +func (c *facts) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FactList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *facts) List(opts metav1.ListOptions) (result *v1.FactList, err error) { Resource("facts"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested facts. -func (c *facts) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *facts) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *facts) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("facts"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a fact and creates it. Returns the server's representation of the fact, and an error, if there is any. -func (c *facts) Create(fact *v1.Fact) (result *v1.Fact, err error) { +func (c *facts) Create(ctx context.Context, fact *v1.Fact, opts metav1.CreateOptions) (result *v1.Fact, err error) { result = &v1.Fact{} err = c.client.Post(). Namespace(c.ns). Resource("facts"). + VersionedParams(&opts, scheme.ParameterCodec). Body(fact). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a fact and updates it. Returns the server's representation of the fact, and an error, if there is any. -func (c *facts) Update(fact *v1.Fact) (result *v1.Fact, err error) { +func (c *facts) Update(ctx context.Context, fact *v1.Fact, opts metav1.UpdateOptions) (result *v1.Fact, err error) { result = &v1.Fact{} err = c.client.Put(). Namespace(c.ns). Resource("facts"). Name(fact.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(fact). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the fact and deletes it. Returns an error if one occurs. -func (c *facts) Delete(name string, options *metav1.DeleteOptions) error { +func (c *facts) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("facts"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *facts) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *facts) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("facts"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched fact. -func (c *facts) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Fact, err error) { +func (c *facts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Fact, err error) { result = &v1.Fact{} err = c.client.Patch(pt). Namespace(c.ns). Resource("facts"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app.go index 477cd4d..0e1c939 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var appsResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v1 var appsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "App"} // Get takes name of the app, and returns the corresponding app object, and an error if there is any. -func (c *FakeApps) Get(name string, options v1.GetOptions) (result *jenkinsiov1.App, err error) { +func (c *FakeApps) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.App, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(appsResource, c.ns, name), &jenkinsiov1.App{}) @@ -34,7 +36,7 @@ func (c *FakeApps) Get(name string, options v1.GetOptions) (result *jenkinsiov1. } // List takes label and field selectors, and returns the list of Apps that match those selectors. -func (c *FakeApps) List(opts v1.ListOptions) (result *jenkinsiov1.AppList, err error) { +func (c *FakeApps) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.AppList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(appsResource, appsKind, c.ns, opts), &jenkinsiov1.AppList{}) @@ -56,14 +58,14 @@ func (c *FakeApps) List(opts v1.ListOptions) (result *jenkinsiov1.AppList, err e } // Watch returns a watch.Interface that watches the requested apps. -func (c *FakeApps) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeApps) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(appsResource, c.ns, opts)) } // Create takes the representation of a app and creates it. Returns the server's representation of the app, and an error, if there is any. -func (c *FakeApps) Create(app *jenkinsiov1.App) (result *jenkinsiov1.App, err error) { +func (c *FakeApps) Create(ctx context.Context, app *jenkinsiov1.App, opts v1.CreateOptions) (result *jenkinsiov1.App, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(appsResource, c.ns, app), &jenkinsiov1.App{}) @@ -74,7 +76,7 @@ func (c *FakeApps) Create(app *jenkinsiov1.App) (result *jenkinsiov1.App, err er } // Update takes the representation of a app and updates it. Returns the server's representation of the app, and an error, if there is any. -func (c *FakeApps) Update(app *jenkinsiov1.App) (result *jenkinsiov1.App, err error) { +func (c *FakeApps) Update(ctx context.Context, app *jenkinsiov1.App, opts v1.UpdateOptions) (result *jenkinsiov1.App, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(appsResource, c.ns, app), &jenkinsiov1.App{}) @@ -85,7 +87,7 @@ func (c *FakeApps) Update(app *jenkinsiov1.App) (result *jenkinsiov1.App, err er } // Delete takes name of the app and deletes it. Returns an error if one occurs. -func (c *FakeApps) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeApps) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(appsResource, c.ns, name), &jenkinsiov1.App{}) @@ -93,15 +95,15 @@ func (c *FakeApps) Delete(name string, options *v1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *FakeApps) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(appsResource, c.ns, listOptions) +func (c *FakeApps) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(appsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.AppList{}) return err } // Patch applies the patch and returns the patched app. -func (c *FakeApps) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.App, err error) { +func (c *FakeApps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.App, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(appsResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.App{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack.go index 49f2532..dbf8e05 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var buildpacksResource = schema.GroupVersionResource{Group: "jenkins.io", Versio var buildpacksKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "BuildPack"} // Get takes name of the buildPack, and returns the corresponding buildPack object, and an error if there is any. -func (c *FakeBuildPacks) Get(name string, options v1.GetOptions) (result *jenkinsiov1.BuildPack, err error) { +func (c *FakeBuildPacks) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.BuildPack, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(buildpacksResource, c.ns, name), &jenkinsiov1.BuildPack{}) @@ -34,7 +36,7 @@ func (c *FakeBuildPacks) Get(name string, options v1.GetOptions) (result *jenkin } // List takes label and field selectors, and returns the list of BuildPacks that match those selectors. -func (c *FakeBuildPacks) List(opts v1.ListOptions) (result *jenkinsiov1.BuildPackList, err error) { +func (c *FakeBuildPacks) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.BuildPackList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(buildpacksResource, buildpacksKind, c.ns, opts), &jenkinsiov1.BuildPackList{}) @@ -56,14 +58,14 @@ func (c *FakeBuildPacks) List(opts v1.ListOptions) (result *jenkinsiov1.BuildPac } // Watch returns a watch.Interface that watches the requested buildPacks. -func (c *FakeBuildPacks) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeBuildPacks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(buildpacksResource, c.ns, opts)) } // Create takes the representation of a buildPack and creates it. Returns the server's representation of the buildPack, and an error, if there is any. -func (c *FakeBuildPacks) Create(buildPack *jenkinsiov1.BuildPack) (result *jenkinsiov1.BuildPack, err error) { +func (c *FakeBuildPacks) Create(ctx context.Context, buildPack *jenkinsiov1.BuildPack, opts v1.CreateOptions) (result *jenkinsiov1.BuildPack, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(buildpacksResource, c.ns, buildPack), &jenkinsiov1.BuildPack{}) @@ -74,7 +76,7 @@ func (c *FakeBuildPacks) Create(buildPack *jenkinsiov1.BuildPack) (result *jenki } // Update takes the representation of a buildPack and updates it. Returns the server's representation of the buildPack, and an error, if there is any. -func (c *FakeBuildPacks) Update(buildPack *jenkinsiov1.BuildPack) (result *jenkinsiov1.BuildPack, err error) { +func (c *FakeBuildPacks) Update(ctx context.Context, buildPack *jenkinsiov1.BuildPack, opts v1.UpdateOptions) (result *jenkinsiov1.BuildPack, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(buildpacksResource, c.ns, buildPack), &jenkinsiov1.BuildPack{}) @@ -85,7 +87,7 @@ func (c *FakeBuildPacks) Update(buildPack *jenkinsiov1.BuildPack) (result *jenki } // Delete takes name of the buildPack and deletes it. Returns an error if one occurs. -func (c *FakeBuildPacks) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeBuildPacks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(buildpacksResource, c.ns, name), &jenkinsiov1.BuildPack{}) @@ -93,15 +95,15 @@ func (c *FakeBuildPacks) Delete(name string, options *v1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *FakeBuildPacks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(buildpacksResource, c.ns, listOptions) +func (c *FakeBuildPacks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(buildpacksResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.BuildPackList{}) return err } // Patch applies the patch and returns the patched buildPack. -func (c *FakeBuildPacks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.BuildPack, err error) { +func (c *FakeBuildPacks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.BuildPack, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(buildpacksResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.BuildPack{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus.go index 26d604a..99e5e0b 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var commitstatusesResource = schema.GroupVersionResource{Group: "jenkins.io", Ve var commitstatusesKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "CommitStatus"} // Get takes name of the commitStatus, and returns the corresponding commitStatus object, and an error if there is any. -func (c *FakeCommitStatuses) Get(name string, options v1.GetOptions) (result *jenkinsiov1.CommitStatus, err error) { +func (c *FakeCommitStatuses) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.CommitStatus, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(commitstatusesResource, c.ns, name), &jenkinsiov1.CommitStatus{}) @@ -34,7 +36,7 @@ func (c *FakeCommitStatuses) Get(name string, options v1.GetOptions) (result *je } // List takes label and field selectors, and returns the list of CommitStatuses that match those selectors. -func (c *FakeCommitStatuses) List(opts v1.ListOptions) (result *jenkinsiov1.CommitStatusList, err error) { +func (c *FakeCommitStatuses) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.CommitStatusList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(commitstatusesResource, commitstatusesKind, c.ns, opts), &jenkinsiov1.CommitStatusList{}) @@ -56,14 +58,14 @@ func (c *FakeCommitStatuses) List(opts v1.ListOptions) (result *jenkinsiov1.Comm } // Watch returns a watch.Interface that watches the requested commitStatuses. -func (c *FakeCommitStatuses) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeCommitStatuses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(commitstatusesResource, c.ns, opts)) } // Create takes the representation of a commitStatus and creates it. Returns the server's representation of the commitStatus, and an error, if there is any. -func (c *FakeCommitStatuses) Create(commitStatus *jenkinsiov1.CommitStatus) (result *jenkinsiov1.CommitStatus, err error) { +func (c *FakeCommitStatuses) Create(ctx context.Context, commitStatus *jenkinsiov1.CommitStatus, opts v1.CreateOptions) (result *jenkinsiov1.CommitStatus, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(commitstatusesResource, c.ns, commitStatus), &jenkinsiov1.CommitStatus{}) @@ -74,7 +76,7 @@ func (c *FakeCommitStatuses) Create(commitStatus *jenkinsiov1.CommitStatus) (res } // Update takes the representation of a commitStatus and updates it. Returns the server's representation of the commitStatus, and an error, if there is any. -func (c *FakeCommitStatuses) Update(commitStatus *jenkinsiov1.CommitStatus) (result *jenkinsiov1.CommitStatus, err error) { +func (c *FakeCommitStatuses) Update(ctx context.Context, commitStatus *jenkinsiov1.CommitStatus, opts v1.UpdateOptions) (result *jenkinsiov1.CommitStatus, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(commitstatusesResource, c.ns, commitStatus), &jenkinsiov1.CommitStatus{}) @@ -85,7 +87,7 @@ func (c *FakeCommitStatuses) Update(commitStatus *jenkinsiov1.CommitStatus) (res } // Delete takes name of the commitStatus and deletes it. Returns an error if one occurs. -func (c *FakeCommitStatuses) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeCommitStatuses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(commitstatusesResource, c.ns, name), &jenkinsiov1.CommitStatus{}) @@ -93,15 +95,15 @@ func (c *FakeCommitStatuses) Delete(name string, options *v1.DeleteOptions) erro } // DeleteCollection deletes a collection of objects. -func (c *FakeCommitStatuses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(commitstatusesResource, c.ns, listOptions) +func (c *FakeCommitStatuses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(commitstatusesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.CommitStatusList{}) return err } // Patch applies the patch and returns the patched commitStatus. -func (c *FakeCommitStatuses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.CommitStatus, err error) { +func (c *FakeCommitStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.CommitStatus, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(commitstatusesResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.CommitStatus{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment.go index 9313c02..75a322f 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var environmentsResource = schema.GroupVersionResource{Group: "jenkins.io", Vers var environmentsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "Environment"} // Get takes name of the environment, and returns the corresponding environment object, and an error if there is any. -func (c *FakeEnvironments) Get(name string, options v1.GetOptions) (result *jenkinsiov1.Environment, err error) { +func (c *FakeEnvironments) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.Environment, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(environmentsResource, c.ns, name), &jenkinsiov1.Environment{}) @@ -34,7 +36,7 @@ func (c *FakeEnvironments) Get(name string, options v1.GetOptions) (result *jenk } // List takes label and field selectors, and returns the list of Environments that match those selectors. -func (c *FakeEnvironments) List(opts v1.ListOptions) (result *jenkinsiov1.EnvironmentList, err error) { +func (c *FakeEnvironments) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.EnvironmentList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(environmentsResource, environmentsKind, c.ns, opts), &jenkinsiov1.EnvironmentList{}) @@ -56,14 +58,14 @@ func (c *FakeEnvironments) List(opts v1.ListOptions) (result *jenkinsiov1.Enviro } // Watch returns a watch.Interface that watches the requested environments. -func (c *FakeEnvironments) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeEnvironments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(environmentsResource, c.ns, opts)) } // Create takes the representation of a environment and creates it. Returns the server's representation of the environment, and an error, if there is any. -func (c *FakeEnvironments) Create(environment *jenkinsiov1.Environment) (result *jenkinsiov1.Environment, err error) { +func (c *FakeEnvironments) Create(ctx context.Context, environment *jenkinsiov1.Environment, opts v1.CreateOptions) (result *jenkinsiov1.Environment, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(environmentsResource, c.ns, environment), &jenkinsiov1.Environment{}) @@ -74,7 +76,7 @@ func (c *FakeEnvironments) Create(environment *jenkinsiov1.Environment) (result } // Update takes the representation of a environment and updates it. Returns the server's representation of the environment, and an error, if there is any. -func (c *FakeEnvironments) Update(environment *jenkinsiov1.Environment) (result *jenkinsiov1.Environment, err error) { +func (c *FakeEnvironments) Update(ctx context.Context, environment *jenkinsiov1.Environment, opts v1.UpdateOptions) (result *jenkinsiov1.Environment, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(environmentsResource, c.ns, environment), &jenkinsiov1.Environment{}) @@ -85,7 +87,7 @@ func (c *FakeEnvironments) Update(environment *jenkinsiov1.Environment) (result } // Delete takes name of the environment and deletes it. Returns an error if one occurs. -func (c *FakeEnvironments) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeEnvironments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(environmentsResource, c.ns, name), &jenkinsiov1.Environment{}) @@ -93,15 +95,15 @@ func (c *FakeEnvironments) Delete(name string, options *v1.DeleteOptions) error } // DeleteCollection deletes a collection of objects. -func (c *FakeEnvironments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(environmentsResource, c.ns, listOptions) +func (c *FakeEnvironments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(environmentsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.EnvironmentList{}) return err } // Patch applies the patch and returns the patched environment. -func (c *FakeEnvironments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.Environment, err error) { +func (c *FakeEnvironments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.Environment, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(environmentsResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.Environment{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding.go index f7a3f0a..f4b8140 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var environmentrolebindingsResource = schema.GroupVersionResource{Group: "jenkin var environmentrolebindingsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "EnvironmentRoleBinding"} // Get takes name of the environmentRoleBinding, and returns the corresponding environmentRoleBinding object, and an error if there is any. -func (c *FakeEnvironmentRoleBindings) Get(name string, options v1.GetOptions) (result *jenkinsiov1.EnvironmentRoleBinding, err error) { +func (c *FakeEnvironmentRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.EnvironmentRoleBinding, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(environmentrolebindingsResource, c.ns, name), &jenkinsiov1.EnvironmentRoleBinding{}) @@ -34,7 +36,7 @@ func (c *FakeEnvironmentRoleBindings) Get(name string, options v1.GetOptions) (r } // List takes label and field selectors, and returns the list of EnvironmentRoleBindings that match those selectors. -func (c *FakeEnvironmentRoleBindings) List(opts v1.ListOptions) (result *jenkinsiov1.EnvironmentRoleBindingList, err error) { +func (c *FakeEnvironmentRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.EnvironmentRoleBindingList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(environmentrolebindingsResource, environmentrolebindingsKind, c.ns, opts), &jenkinsiov1.EnvironmentRoleBindingList{}) @@ -56,14 +58,14 @@ func (c *FakeEnvironmentRoleBindings) List(opts v1.ListOptions) (result *jenkins } // Watch returns a watch.Interface that watches the requested environmentRoleBindings. -func (c *FakeEnvironmentRoleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeEnvironmentRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(environmentrolebindingsResource, c.ns, opts)) } // Create takes the representation of a environmentRoleBinding and creates it. Returns the server's representation of the environmentRoleBinding, and an error, if there is any. -func (c *FakeEnvironmentRoleBindings) Create(environmentRoleBinding *jenkinsiov1.EnvironmentRoleBinding) (result *jenkinsiov1.EnvironmentRoleBinding, err error) { +func (c *FakeEnvironmentRoleBindings) Create(ctx context.Context, environmentRoleBinding *jenkinsiov1.EnvironmentRoleBinding, opts v1.CreateOptions) (result *jenkinsiov1.EnvironmentRoleBinding, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(environmentrolebindingsResource, c.ns, environmentRoleBinding), &jenkinsiov1.EnvironmentRoleBinding{}) @@ -74,7 +76,7 @@ func (c *FakeEnvironmentRoleBindings) Create(environmentRoleBinding *jenkinsiov1 } // Update takes the representation of a environmentRoleBinding and updates it. Returns the server's representation of the environmentRoleBinding, and an error, if there is any. -func (c *FakeEnvironmentRoleBindings) Update(environmentRoleBinding *jenkinsiov1.EnvironmentRoleBinding) (result *jenkinsiov1.EnvironmentRoleBinding, err error) { +func (c *FakeEnvironmentRoleBindings) Update(ctx context.Context, environmentRoleBinding *jenkinsiov1.EnvironmentRoleBinding, opts v1.UpdateOptions) (result *jenkinsiov1.EnvironmentRoleBinding, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(environmentrolebindingsResource, c.ns, environmentRoleBinding), &jenkinsiov1.EnvironmentRoleBinding{}) @@ -85,7 +87,7 @@ func (c *FakeEnvironmentRoleBindings) Update(environmentRoleBinding *jenkinsiov1 } // Delete takes name of the environmentRoleBinding and deletes it. Returns an error if one occurs. -func (c *FakeEnvironmentRoleBindings) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeEnvironmentRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(environmentrolebindingsResource, c.ns, name), &jenkinsiov1.EnvironmentRoleBinding{}) @@ -93,15 +95,15 @@ func (c *FakeEnvironmentRoleBindings) Delete(name string, options *v1.DeleteOpti } // DeleteCollection deletes a collection of objects. -func (c *FakeEnvironmentRoleBindings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(environmentrolebindingsResource, c.ns, listOptions) +func (c *FakeEnvironmentRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(environmentrolebindingsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.EnvironmentRoleBindingList{}) return err } // Patch applies the patch and returns the patched environmentRoleBinding. -func (c *FakeEnvironmentRoleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.EnvironmentRoleBinding, err error) { +func (c *FakeEnvironmentRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.EnvironmentRoleBinding, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(environmentrolebindingsResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.EnvironmentRoleBinding{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension.go index f1decdc..4373762 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var extensionsResource = schema.GroupVersionResource{Group: "jenkins.io", Versio var extensionsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "Extension"} // Get takes name of the extension, and returns the corresponding extension object, and an error if there is any. -func (c *FakeExtensions) Get(name string, options v1.GetOptions) (result *jenkinsiov1.Extension, err error) { +func (c *FakeExtensions) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.Extension, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(extensionsResource, c.ns, name), &jenkinsiov1.Extension{}) @@ -34,7 +36,7 @@ func (c *FakeExtensions) Get(name string, options v1.GetOptions) (result *jenkin } // List takes label and field selectors, and returns the list of Extensions that match those selectors. -func (c *FakeExtensions) List(opts v1.ListOptions) (result *jenkinsiov1.ExtensionList, err error) { +func (c *FakeExtensions) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.ExtensionList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(extensionsResource, extensionsKind, c.ns, opts), &jenkinsiov1.ExtensionList{}) @@ -56,14 +58,14 @@ func (c *FakeExtensions) List(opts v1.ListOptions) (result *jenkinsiov1.Extensio } // Watch returns a watch.Interface that watches the requested extensions. -func (c *FakeExtensions) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeExtensions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(extensionsResource, c.ns, opts)) } // Create takes the representation of a extension and creates it. Returns the server's representation of the extension, and an error, if there is any. -func (c *FakeExtensions) Create(extension *jenkinsiov1.Extension) (result *jenkinsiov1.Extension, err error) { +func (c *FakeExtensions) Create(ctx context.Context, extension *jenkinsiov1.Extension, opts v1.CreateOptions) (result *jenkinsiov1.Extension, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(extensionsResource, c.ns, extension), &jenkinsiov1.Extension{}) @@ -74,7 +76,7 @@ func (c *FakeExtensions) Create(extension *jenkinsiov1.Extension) (result *jenki } // Update takes the representation of a extension and updates it. Returns the server's representation of the extension, and an error, if there is any. -func (c *FakeExtensions) Update(extension *jenkinsiov1.Extension) (result *jenkinsiov1.Extension, err error) { +func (c *FakeExtensions) Update(ctx context.Context, extension *jenkinsiov1.Extension, opts v1.UpdateOptions) (result *jenkinsiov1.Extension, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(extensionsResource, c.ns, extension), &jenkinsiov1.Extension{}) @@ -85,7 +87,7 @@ func (c *FakeExtensions) Update(extension *jenkinsiov1.Extension) (result *jenki } // Delete takes name of the extension and deletes it. Returns an error if one occurs. -func (c *FakeExtensions) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeExtensions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(extensionsResource, c.ns, name), &jenkinsiov1.Extension{}) @@ -93,15 +95,15 @@ func (c *FakeExtensions) Delete(name string, options *v1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *FakeExtensions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(extensionsResource, c.ns, listOptions) +func (c *FakeExtensions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(extensionsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.ExtensionList{}) return err } // Patch applies the patch and returns the patched extension. -func (c *FakeExtensions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.Extension, err error) { +func (c *FakeExtensions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.Extension, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(extensionsResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.Extension{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go index 982b027..3e78b22 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var factsResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v var factsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "Fact"} // Get takes name of the fact, and returns the corresponding fact object, and an error if there is any. -func (c *FakeFacts) Get(name string, options v1.GetOptions) (result *jenkinsiov1.Fact, err error) { +func (c *FakeFacts) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.Fact, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(factsResource, c.ns, name), &jenkinsiov1.Fact{}) @@ -34,7 +36,7 @@ func (c *FakeFacts) Get(name string, options v1.GetOptions) (result *jenkinsiov1 } // List takes label and field selectors, and returns the list of Facts that match those selectors. -func (c *FakeFacts) List(opts v1.ListOptions) (result *jenkinsiov1.FactList, err error) { +func (c *FakeFacts) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.FactList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(factsResource, factsKind, c.ns, opts), &jenkinsiov1.FactList{}) @@ -56,14 +58,14 @@ func (c *FakeFacts) List(opts v1.ListOptions) (result *jenkinsiov1.FactList, err } // Watch returns a watch.Interface that watches the requested facts. -func (c *FakeFacts) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeFacts) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(factsResource, c.ns, opts)) } // Create takes the representation of a fact and creates it. Returns the server's representation of the fact, and an error, if there is any. -func (c *FakeFacts) Create(fact *jenkinsiov1.Fact) (result *jenkinsiov1.Fact, err error) { +func (c *FakeFacts) Create(ctx context.Context, fact *jenkinsiov1.Fact, opts v1.CreateOptions) (result *jenkinsiov1.Fact, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(factsResource, c.ns, fact), &jenkinsiov1.Fact{}) @@ -74,7 +76,7 @@ func (c *FakeFacts) Create(fact *jenkinsiov1.Fact) (result *jenkinsiov1.Fact, er } // Update takes the representation of a fact and updates it. Returns the server's representation of the fact, and an error, if there is any. -func (c *FakeFacts) Update(fact *jenkinsiov1.Fact) (result *jenkinsiov1.Fact, err error) { +func (c *FakeFacts) Update(ctx context.Context, fact *jenkinsiov1.Fact, opts v1.UpdateOptions) (result *jenkinsiov1.Fact, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(factsResource, c.ns, fact), &jenkinsiov1.Fact{}) @@ -85,7 +87,7 @@ func (c *FakeFacts) Update(fact *jenkinsiov1.Fact) (result *jenkinsiov1.Fact, er } // Delete takes name of the fact and deletes it. Returns an error if one occurs. -func (c *FakeFacts) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeFacts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(factsResource, c.ns, name), &jenkinsiov1.Fact{}) @@ -93,15 +95,15 @@ func (c *FakeFacts) Delete(name string, options *v1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *FakeFacts) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(factsResource, c.ns, listOptions) +func (c *FakeFacts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(factsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.FactList{}) return err } // Patch applies the patch and returns the patched fact. -func (c *FakeFacts) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.Fact, err error) { +func (c *FakeFacts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.Fact, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(factsResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.Fact{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice.go index 0d1f880..e2ad762 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var gitservicesResource = schema.GroupVersionResource{Group: "jenkins.io", Versi var gitservicesKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "GitService"} // Get takes name of the gitService, and returns the corresponding gitService object, and an error if there is any. -func (c *FakeGitServices) Get(name string, options v1.GetOptions) (result *jenkinsiov1.GitService, err error) { +func (c *FakeGitServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.GitService, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(gitservicesResource, c.ns, name), &jenkinsiov1.GitService{}) @@ -34,7 +36,7 @@ func (c *FakeGitServices) Get(name string, options v1.GetOptions) (result *jenki } // List takes label and field selectors, and returns the list of GitServices that match those selectors. -func (c *FakeGitServices) List(opts v1.ListOptions) (result *jenkinsiov1.GitServiceList, err error) { +func (c *FakeGitServices) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.GitServiceList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(gitservicesResource, gitservicesKind, c.ns, opts), &jenkinsiov1.GitServiceList{}) @@ -56,14 +58,14 @@ func (c *FakeGitServices) List(opts v1.ListOptions) (result *jenkinsiov1.GitServ } // Watch returns a watch.Interface that watches the requested gitServices. -func (c *FakeGitServices) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeGitServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(gitservicesResource, c.ns, opts)) } // Create takes the representation of a gitService and creates it. Returns the server's representation of the gitService, and an error, if there is any. -func (c *FakeGitServices) Create(gitService *jenkinsiov1.GitService) (result *jenkinsiov1.GitService, err error) { +func (c *FakeGitServices) Create(ctx context.Context, gitService *jenkinsiov1.GitService, opts v1.CreateOptions) (result *jenkinsiov1.GitService, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(gitservicesResource, c.ns, gitService), &jenkinsiov1.GitService{}) @@ -74,7 +76,7 @@ func (c *FakeGitServices) Create(gitService *jenkinsiov1.GitService) (result *je } // Update takes the representation of a gitService and updates it. Returns the server's representation of the gitService, and an error, if there is any. -func (c *FakeGitServices) Update(gitService *jenkinsiov1.GitService) (result *jenkinsiov1.GitService, err error) { +func (c *FakeGitServices) Update(ctx context.Context, gitService *jenkinsiov1.GitService, opts v1.UpdateOptions) (result *jenkinsiov1.GitService, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(gitservicesResource, c.ns, gitService), &jenkinsiov1.GitService{}) @@ -85,7 +87,7 @@ func (c *FakeGitServices) Update(gitService *jenkinsiov1.GitService) (result *je } // Delete takes name of the gitService and deletes it. Returns an error if one occurs. -func (c *FakeGitServices) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeGitServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(gitservicesResource, c.ns, name), &jenkinsiov1.GitService{}) @@ -93,15 +95,15 @@ func (c *FakeGitServices) Delete(name string, options *v1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *FakeGitServices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(gitservicesResource, c.ns, listOptions) +func (c *FakeGitServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(gitservicesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.GitServiceList{}) return err } // Patch applies the patch and returns the patched gitService. -func (c *FakeGitServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.GitService, err error) { +func (c *FakeGitServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.GitService, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(gitservicesResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.GitService{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity.go index a28f162..2f56fff 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var pipelineactivitiesResource = schema.GroupVersionResource{Group: "jenkins.io" var pipelineactivitiesKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "PipelineActivity"} // Get takes name of the pipelineActivity, and returns the corresponding pipelineActivity object, and an error if there is any. -func (c *FakePipelineActivities) Get(name string, options v1.GetOptions) (result *jenkinsiov1.PipelineActivity, err error) { +func (c *FakePipelineActivities) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.PipelineActivity, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(pipelineactivitiesResource, c.ns, name), &jenkinsiov1.PipelineActivity{}) @@ -34,7 +36,7 @@ func (c *FakePipelineActivities) Get(name string, options v1.GetOptions) (result } // List takes label and field selectors, and returns the list of PipelineActivities that match those selectors. -func (c *FakePipelineActivities) List(opts v1.ListOptions) (result *jenkinsiov1.PipelineActivityList, err error) { +func (c *FakePipelineActivities) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.PipelineActivityList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(pipelineactivitiesResource, pipelineactivitiesKind, c.ns, opts), &jenkinsiov1.PipelineActivityList{}) @@ -56,14 +58,14 @@ func (c *FakePipelineActivities) List(opts v1.ListOptions) (result *jenkinsiov1. } // Watch returns a watch.Interface that watches the requested pipelineActivities. -func (c *FakePipelineActivities) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakePipelineActivities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(pipelineactivitiesResource, c.ns, opts)) } // Create takes the representation of a pipelineActivity and creates it. Returns the server's representation of the pipelineActivity, and an error, if there is any. -func (c *FakePipelineActivities) Create(pipelineActivity *jenkinsiov1.PipelineActivity) (result *jenkinsiov1.PipelineActivity, err error) { +func (c *FakePipelineActivities) Create(ctx context.Context, pipelineActivity *jenkinsiov1.PipelineActivity, opts v1.CreateOptions) (result *jenkinsiov1.PipelineActivity, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(pipelineactivitiesResource, c.ns, pipelineActivity), &jenkinsiov1.PipelineActivity{}) @@ -74,7 +76,7 @@ func (c *FakePipelineActivities) Create(pipelineActivity *jenkinsiov1.PipelineAc } // Update takes the representation of a pipelineActivity and updates it. Returns the server's representation of the pipelineActivity, and an error, if there is any. -func (c *FakePipelineActivities) Update(pipelineActivity *jenkinsiov1.PipelineActivity) (result *jenkinsiov1.PipelineActivity, err error) { +func (c *FakePipelineActivities) Update(ctx context.Context, pipelineActivity *jenkinsiov1.PipelineActivity, opts v1.UpdateOptions) (result *jenkinsiov1.PipelineActivity, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(pipelineactivitiesResource, c.ns, pipelineActivity), &jenkinsiov1.PipelineActivity{}) @@ -85,7 +87,7 @@ func (c *FakePipelineActivities) Update(pipelineActivity *jenkinsiov1.PipelineAc } // Delete takes name of the pipelineActivity and deletes it. Returns an error if one occurs. -func (c *FakePipelineActivities) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakePipelineActivities) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(pipelineactivitiesResource, c.ns, name), &jenkinsiov1.PipelineActivity{}) @@ -93,15 +95,15 @@ func (c *FakePipelineActivities) Delete(name string, options *v1.DeleteOptions) } // DeleteCollection deletes a collection of objects. -func (c *FakePipelineActivities) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(pipelineactivitiesResource, c.ns, listOptions) +func (c *FakePipelineActivities) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(pipelineactivitiesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.PipelineActivityList{}) return err } // Patch applies the patch and returns the patched pipelineActivity. -func (c *FakePipelineActivities) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.PipelineActivity, err error) { +func (c *FakePipelineActivities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.PipelineActivity, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(pipelineactivitiesResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.PipelineActivity{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go index b2c9483..49ef9bf 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var pipelinestructuresResource = schema.GroupVersionResource{Group: "jenkins.io" var pipelinestructuresKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "PipelineStructure"} // Get takes name of the pipelineStructure, and returns the corresponding pipelineStructure object, and an error if there is any. -func (c *FakePipelineStructures) Get(name string, options v1.GetOptions) (result *jenkinsiov1.PipelineStructure, err error) { +func (c *FakePipelineStructures) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.PipelineStructure, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(pipelinestructuresResource, c.ns, name), &jenkinsiov1.PipelineStructure{}) @@ -34,7 +36,7 @@ func (c *FakePipelineStructures) Get(name string, options v1.GetOptions) (result } // List takes label and field selectors, and returns the list of PipelineStructures that match those selectors. -func (c *FakePipelineStructures) List(opts v1.ListOptions) (result *jenkinsiov1.PipelineStructureList, err error) { +func (c *FakePipelineStructures) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.PipelineStructureList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(pipelinestructuresResource, pipelinestructuresKind, c.ns, opts), &jenkinsiov1.PipelineStructureList{}) @@ -56,14 +58,14 @@ func (c *FakePipelineStructures) List(opts v1.ListOptions) (result *jenkinsiov1. } // Watch returns a watch.Interface that watches the requested pipelineStructures. -func (c *FakePipelineStructures) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakePipelineStructures) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(pipelinestructuresResource, c.ns, opts)) } // Create takes the representation of a pipelineStructure and creates it. Returns the server's representation of the pipelineStructure, and an error, if there is any. -func (c *FakePipelineStructures) Create(pipelineStructure *jenkinsiov1.PipelineStructure) (result *jenkinsiov1.PipelineStructure, err error) { +func (c *FakePipelineStructures) Create(ctx context.Context, pipelineStructure *jenkinsiov1.PipelineStructure, opts v1.CreateOptions) (result *jenkinsiov1.PipelineStructure, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(pipelinestructuresResource, c.ns, pipelineStructure), &jenkinsiov1.PipelineStructure{}) @@ -74,7 +76,7 @@ func (c *FakePipelineStructures) Create(pipelineStructure *jenkinsiov1.PipelineS } // Update takes the representation of a pipelineStructure and updates it. Returns the server's representation of the pipelineStructure, and an error, if there is any. -func (c *FakePipelineStructures) Update(pipelineStructure *jenkinsiov1.PipelineStructure) (result *jenkinsiov1.PipelineStructure, err error) { +func (c *FakePipelineStructures) Update(ctx context.Context, pipelineStructure *jenkinsiov1.PipelineStructure, opts v1.UpdateOptions) (result *jenkinsiov1.PipelineStructure, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(pipelinestructuresResource, c.ns, pipelineStructure), &jenkinsiov1.PipelineStructure{}) @@ -85,7 +87,7 @@ func (c *FakePipelineStructures) Update(pipelineStructure *jenkinsiov1.PipelineS } // Delete takes name of the pipelineStructure and deletes it. Returns an error if one occurs. -func (c *FakePipelineStructures) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakePipelineStructures) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(pipelinestructuresResource, c.ns, name), &jenkinsiov1.PipelineStructure{}) @@ -93,15 +95,15 @@ func (c *FakePipelineStructures) Delete(name string, options *v1.DeleteOptions) } // DeleteCollection deletes a collection of objects. -func (c *FakePipelineStructures) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(pipelinestructuresResource, c.ns, listOptions) +func (c *FakePipelineStructures) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(pipelinestructuresResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.PipelineStructureList{}) return err } // Patch applies the patch and returns the patched pipelineStructure. -func (c *FakePipelineStructures) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.PipelineStructure, err error) { +func (c *FakePipelineStructures) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.PipelineStructure, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(pipelinestructuresResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.PipelineStructure{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin.go index b07d290..a0a31db 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var pluginsResource = schema.GroupVersionResource{Group: "jenkins.io", Version: var pluginsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "Plugin"} // Get takes name of the plugin, and returns the corresponding plugin object, and an error if there is any. -func (c *FakePlugins) Get(name string, options v1.GetOptions) (result *jenkinsiov1.Plugin, err error) { +func (c *FakePlugins) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.Plugin, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(pluginsResource, c.ns, name), &jenkinsiov1.Plugin{}) @@ -34,7 +36,7 @@ func (c *FakePlugins) Get(name string, options v1.GetOptions) (result *jenkinsio } // List takes label and field selectors, and returns the list of Plugins that match those selectors. -func (c *FakePlugins) List(opts v1.ListOptions) (result *jenkinsiov1.PluginList, err error) { +func (c *FakePlugins) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.PluginList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(pluginsResource, pluginsKind, c.ns, opts), &jenkinsiov1.PluginList{}) @@ -56,14 +58,14 @@ func (c *FakePlugins) List(opts v1.ListOptions) (result *jenkinsiov1.PluginList, } // Watch returns a watch.Interface that watches the requested plugins. -func (c *FakePlugins) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakePlugins) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(pluginsResource, c.ns, opts)) } // Create takes the representation of a plugin and creates it. Returns the server's representation of the plugin, and an error, if there is any. -func (c *FakePlugins) Create(plugin *jenkinsiov1.Plugin) (result *jenkinsiov1.Plugin, err error) { +func (c *FakePlugins) Create(ctx context.Context, plugin *jenkinsiov1.Plugin, opts v1.CreateOptions) (result *jenkinsiov1.Plugin, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(pluginsResource, c.ns, plugin), &jenkinsiov1.Plugin{}) @@ -74,7 +76,7 @@ func (c *FakePlugins) Create(plugin *jenkinsiov1.Plugin) (result *jenkinsiov1.Pl } // Update takes the representation of a plugin and updates it. Returns the server's representation of the plugin, and an error, if there is any. -func (c *FakePlugins) Update(plugin *jenkinsiov1.Plugin) (result *jenkinsiov1.Plugin, err error) { +func (c *FakePlugins) Update(ctx context.Context, plugin *jenkinsiov1.Plugin, opts v1.UpdateOptions) (result *jenkinsiov1.Plugin, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(pluginsResource, c.ns, plugin), &jenkinsiov1.Plugin{}) @@ -85,7 +87,7 @@ func (c *FakePlugins) Update(plugin *jenkinsiov1.Plugin) (result *jenkinsiov1.Pl } // Delete takes name of the plugin and deletes it. Returns an error if one occurs. -func (c *FakePlugins) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakePlugins) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(pluginsResource, c.ns, name), &jenkinsiov1.Plugin{}) @@ -93,15 +95,15 @@ func (c *FakePlugins) Delete(name string, options *v1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *FakePlugins) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(pluginsResource, c.ns, listOptions) +func (c *FakePlugins) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(pluginsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.PluginList{}) return err } // Patch applies the patch and returns the patched plugin. -func (c *FakePlugins) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.Plugin, err error) { +func (c *FakePlugins) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.Plugin, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(pluginsResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.Plugin{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release.go index d134f87..535fddf 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var releasesResource = schema.GroupVersionResource{Group: "jenkins.io", Version: var releasesKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "Release"} // Get takes name of the release, and returns the corresponding release object, and an error if there is any. -func (c *FakeReleases) Get(name string, options v1.GetOptions) (result *jenkinsiov1.Release, err error) { +func (c *FakeReleases) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.Release, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(releasesResource, c.ns, name), &jenkinsiov1.Release{}) @@ -34,7 +36,7 @@ func (c *FakeReleases) Get(name string, options v1.GetOptions) (result *jenkinsi } // List takes label and field selectors, and returns the list of Releases that match those selectors. -func (c *FakeReleases) List(opts v1.ListOptions) (result *jenkinsiov1.ReleaseList, err error) { +func (c *FakeReleases) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.ReleaseList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(releasesResource, releasesKind, c.ns, opts), &jenkinsiov1.ReleaseList{}) @@ -56,14 +58,14 @@ func (c *FakeReleases) List(opts v1.ListOptions) (result *jenkinsiov1.ReleaseLis } // Watch returns a watch.Interface that watches the requested releases. -func (c *FakeReleases) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeReleases) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(releasesResource, c.ns, opts)) } // Create takes the representation of a release and creates it. Returns the server's representation of the release, and an error, if there is any. -func (c *FakeReleases) Create(release *jenkinsiov1.Release) (result *jenkinsiov1.Release, err error) { +func (c *FakeReleases) Create(ctx context.Context, release *jenkinsiov1.Release, opts v1.CreateOptions) (result *jenkinsiov1.Release, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(releasesResource, c.ns, release), &jenkinsiov1.Release{}) @@ -74,7 +76,7 @@ func (c *FakeReleases) Create(release *jenkinsiov1.Release) (result *jenkinsiov1 } // Update takes the representation of a release and updates it. Returns the server's representation of the release, and an error, if there is any. -func (c *FakeReleases) Update(release *jenkinsiov1.Release) (result *jenkinsiov1.Release, err error) { +func (c *FakeReleases) Update(ctx context.Context, release *jenkinsiov1.Release, opts v1.UpdateOptions) (result *jenkinsiov1.Release, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(releasesResource, c.ns, release), &jenkinsiov1.Release{}) @@ -85,7 +87,7 @@ func (c *FakeReleases) Update(release *jenkinsiov1.Release) (result *jenkinsiov1 } // Delete takes name of the release and deletes it. Returns an error if one occurs. -func (c *FakeReleases) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeReleases) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(releasesResource, c.ns, name), &jenkinsiov1.Release{}) @@ -93,15 +95,15 @@ func (c *FakeReleases) Delete(name string, options *v1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *FakeReleases) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(releasesResource, c.ns, listOptions) +func (c *FakeReleases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(releasesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.ReleaseList{}) return err } // Patch applies the patch and returns the patched release. -func (c *FakeReleases) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.Release, err error) { +func (c *FakeReleases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.Release, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(releasesResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.Release{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go index 09209bc..908d3e7 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var schedulersResource = schema.GroupVersionResource{Group: "jenkins.io", Versio var schedulersKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "Scheduler"} // Get takes name of the scheduler, and returns the corresponding scheduler object, and an error if there is any. -func (c *FakeSchedulers) Get(name string, options v1.GetOptions) (result *jenkinsiov1.Scheduler, err error) { +func (c *FakeSchedulers) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.Scheduler, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(schedulersResource, c.ns, name), &jenkinsiov1.Scheduler{}) @@ -34,7 +36,7 @@ func (c *FakeSchedulers) Get(name string, options v1.GetOptions) (result *jenkin } // List takes label and field selectors, and returns the list of Schedulers that match those selectors. -func (c *FakeSchedulers) List(opts v1.ListOptions) (result *jenkinsiov1.SchedulerList, err error) { +func (c *FakeSchedulers) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.SchedulerList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(schedulersResource, schedulersKind, c.ns, opts), &jenkinsiov1.SchedulerList{}) @@ -56,14 +58,14 @@ func (c *FakeSchedulers) List(opts v1.ListOptions) (result *jenkinsiov1.Schedule } // Watch returns a watch.Interface that watches the requested schedulers. -func (c *FakeSchedulers) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeSchedulers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(schedulersResource, c.ns, opts)) } // Create takes the representation of a scheduler and creates it. Returns the server's representation of the scheduler, and an error, if there is any. -func (c *FakeSchedulers) Create(scheduler *jenkinsiov1.Scheduler) (result *jenkinsiov1.Scheduler, err error) { +func (c *FakeSchedulers) Create(ctx context.Context, scheduler *jenkinsiov1.Scheduler, opts v1.CreateOptions) (result *jenkinsiov1.Scheduler, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(schedulersResource, c.ns, scheduler), &jenkinsiov1.Scheduler{}) @@ -74,7 +76,7 @@ func (c *FakeSchedulers) Create(scheduler *jenkinsiov1.Scheduler) (result *jenki } // Update takes the representation of a scheduler and updates it. Returns the server's representation of the scheduler, and an error, if there is any. -func (c *FakeSchedulers) Update(scheduler *jenkinsiov1.Scheduler) (result *jenkinsiov1.Scheduler, err error) { +func (c *FakeSchedulers) Update(ctx context.Context, scheduler *jenkinsiov1.Scheduler, opts v1.UpdateOptions) (result *jenkinsiov1.Scheduler, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(schedulersResource, c.ns, scheduler), &jenkinsiov1.Scheduler{}) @@ -85,7 +87,7 @@ func (c *FakeSchedulers) Update(scheduler *jenkinsiov1.Scheduler) (result *jenki } // Delete takes name of the scheduler and deletes it. Returns an error if one occurs. -func (c *FakeSchedulers) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeSchedulers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(schedulersResource, c.ns, name), &jenkinsiov1.Scheduler{}) @@ -93,15 +95,15 @@ func (c *FakeSchedulers) Delete(name string, options *v1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *FakeSchedulers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(schedulersResource, c.ns, listOptions) +func (c *FakeSchedulers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(schedulersResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.SchedulerList{}) return err } // Patch applies the patch and returns the patched scheduler. -func (c *FakeSchedulers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.Scheduler, err error) { +func (c *FakeSchedulers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.Scheduler, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(schedulersResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.Scheduler{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository.go index dd5b08d..697d55b 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var sourcerepositoriesResource = schema.GroupVersionResource{Group: "jenkins.io" var sourcerepositoriesKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "SourceRepository"} // Get takes name of the sourceRepository, and returns the corresponding sourceRepository object, and an error if there is any. -func (c *FakeSourceRepositories) Get(name string, options v1.GetOptions) (result *jenkinsiov1.SourceRepository, err error) { +func (c *FakeSourceRepositories) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.SourceRepository, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(sourcerepositoriesResource, c.ns, name), &jenkinsiov1.SourceRepository{}) @@ -34,7 +36,7 @@ func (c *FakeSourceRepositories) Get(name string, options v1.GetOptions) (result } // List takes label and field selectors, and returns the list of SourceRepositories that match those selectors. -func (c *FakeSourceRepositories) List(opts v1.ListOptions) (result *jenkinsiov1.SourceRepositoryList, err error) { +func (c *FakeSourceRepositories) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.SourceRepositoryList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(sourcerepositoriesResource, sourcerepositoriesKind, c.ns, opts), &jenkinsiov1.SourceRepositoryList{}) @@ -56,14 +58,14 @@ func (c *FakeSourceRepositories) List(opts v1.ListOptions) (result *jenkinsiov1. } // Watch returns a watch.Interface that watches the requested sourceRepositories. -func (c *FakeSourceRepositories) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeSourceRepositories) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(sourcerepositoriesResource, c.ns, opts)) } // Create takes the representation of a sourceRepository and creates it. Returns the server's representation of the sourceRepository, and an error, if there is any. -func (c *FakeSourceRepositories) Create(sourceRepository *jenkinsiov1.SourceRepository) (result *jenkinsiov1.SourceRepository, err error) { +func (c *FakeSourceRepositories) Create(ctx context.Context, sourceRepository *jenkinsiov1.SourceRepository, opts v1.CreateOptions) (result *jenkinsiov1.SourceRepository, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(sourcerepositoriesResource, c.ns, sourceRepository), &jenkinsiov1.SourceRepository{}) @@ -74,7 +76,7 @@ func (c *FakeSourceRepositories) Create(sourceRepository *jenkinsiov1.SourceRepo } // Update takes the representation of a sourceRepository and updates it. Returns the server's representation of the sourceRepository, and an error, if there is any. -func (c *FakeSourceRepositories) Update(sourceRepository *jenkinsiov1.SourceRepository) (result *jenkinsiov1.SourceRepository, err error) { +func (c *FakeSourceRepositories) Update(ctx context.Context, sourceRepository *jenkinsiov1.SourceRepository, opts v1.UpdateOptions) (result *jenkinsiov1.SourceRepository, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(sourcerepositoriesResource, c.ns, sourceRepository), &jenkinsiov1.SourceRepository{}) @@ -85,7 +87,7 @@ func (c *FakeSourceRepositories) Update(sourceRepository *jenkinsiov1.SourceRepo } // Delete takes name of the sourceRepository and deletes it. Returns an error if one occurs. -func (c *FakeSourceRepositories) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeSourceRepositories) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(sourcerepositoriesResource, c.ns, name), &jenkinsiov1.SourceRepository{}) @@ -93,15 +95,15 @@ func (c *FakeSourceRepositories) Delete(name string, options *v1.DeleteOptions) } // DeleteCollection deletes a collection of objects. -func (c *FakeSourceRepositories) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(sourcerepositoriesResource, c.ns, listOptions) +func (c *FakeSourceRepositories) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sourcerepositoriesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.SourceRepositoryList{}) return err } // Patch applies the patch and returns the patched sourceRepository. -func (c *FakeSourceRepositories) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.SourceRepository, err error) { +func (c *FakeSourceRepositories) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.SourceRepository, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(sourcerepositoriesResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.SourceRepository{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepositorygroup.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepositorygroup.go index adff4f8..73f6cf6 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepositorygroup.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepositorygroup.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var sourcerepositorygroupsResource = schema.GroupVersionResource{Group: "jenkins var sourcerepositorygroupsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "SourceRepositoryGroup"} // Get takes name of the sourceRepositoryGroup, and returns the corresponding sourceRepositoryGroup object, and an error if there is any. -func (c *FakeSourceRepositoryGroups) Get(name string, options v1.GetOptions) (result *jenkinsiov1.SourceRepositoryGroup, err error) { +func (c *FakeSourceRepositoryGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.SourceRepositoryGroup, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(sourcerepositorygroupsResource, c.ns, name), &jenkinsiov1.SourceRepositoryGroup{}) @@ -34,7 +36,7 @@ func (c *FakeSourceRepositoryGroups) Get(name string, options v1.GetOptions) (re } // List takes label and field selectors, and returns the list of SourceRepositoryGroups that match those selectors. -func (c *FakeSourceRepositoryGroups) List(opts v1.ListOptions) (result *jenkinsiov1.SourceRepositoryGroupList, err error) { +func (c *FakeSourceRepositoryGroups) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.SourceRepositoryGroupList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(sourcerepositorygroupsResource, sourcerepositorygroupsKind, c.ns, opts), &jenkinsiov1.SourceRepositoryGroupList{}) @@ -56,14 +58,14 @@ func (c *FakeSourceRepositoryGroups) List(opts v1.ListOptions) (result *jenkinsi } // Watch returns a watch.Interface that watches the requested sourceRepositoryGroups. -func (c *FakeSourceRepositoryGroups) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeSourceRepositoryGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(sourcerepositorygroupsResource, c.ns, opts)) } // Create takes the representation of a sourceRepositoryGroup and creates it. Returns the server's representation of the sourceRepositoryGroup, and an error, if there is any. -func (c *FakeSourceRepositoryGroups) Create(sourceRepositoryGroup *jenkinsiov1.SourceRepositoryGroup) (result *jenkinsiov1.SourceRepositoryGroup, err error) { +func (c *FakeSourceRepositoryGroups) Create(ctx context.Context, sourceRepositoryGroup *jenkinsiov1.SourceRepositoryGroup, opts v1.CreateOptions) (result *jenkinsiov1.SourceRepositoryGroup, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(sourcerepositorygroupsResource, c.ns, sourceRepositoryGroup), &jenkinsiov1.SourceRepositoryGroup{}) @@ -74,7 +76,7 @@ func (c *FakeSourceRepositoryGroups) Create(sourceRepositoryGroup *jenkinsiov1.S } // Update takes the representation of a sourceRepositoryGroup and updates it. Returns the server's representation of the sourceRepositoryGroup, and an error, if there is any. -func (c *FakeSourceRepositoryGroups) Update(sourceRepositoryGroup *jenkinsiov1.SourceRepositoryGroup) (result *jenkinsiov1.SourceRepositoryGroup, err error) { +func (c *FakeSourceRepositoryGroups) Update(ctx context.Context, sourceRepositoryGroup *jenkinsiov1.SourceRepositoryGroup, opts v1.UpdateOptions) (result *jenkinsiov1.SourceRepositoryGroup, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(sourcerepositorygroupsResource, c.ns, sourceRepositoryGroup), &jenkinsiov1.SourceRepositoryGroup{}) @@ -85,7 +87,7 @@ func (c *FakeSourceRepositoryGroups) Update(sourceRepositoryGroup *jenkinsiov1.S } // Delete takes name of the sourceRepositoryGroup and deletes it. Returns an error if one occurs. -func (c *FakeSourceRepositoryGroups) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeSourceRepositoryGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(sourcerepositorygroupsResource, c.ns, name), &jenkinsiov1.SourceRepositoryGroup{}) @@ -93,15 +95,15 @@ func (c *FakeSourceRepositoryGroups) Delete(name string, options *v1.DeleteOptio } // DeleteCollection deletes a collection of objects. -func (c *FakeSourceRepositoryGroups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(sourcerepositorygroupsResource, c.ns, listOptions) +func (c *FakeSourceRepositoryGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sourcerepositorygroupsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.SourceRepositoryGroupList{}) return err } // Patch applies the patch and returns the patched sourceRepositoryGroup. -func (c *FakeSourceRepositoryGroups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.SourceRepositoryGroup, err error) { +func (c *FakeSourceRepositoryGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.SourceRepositoryGroup, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(sourcerepositorygroupsResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.SourceRepositoryGroup{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team.go index 7016863..5556034 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var teamsResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v var teamsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "Team"} // Get takes name of the team, and returns the corresponding team object, and an error if there is any. -func (c *FakeTeams) Get(name string, options v1.GetOptions) (result *jenkinsiov1.Team, err error) { +func (c *FakeTeams) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.Team, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(teamsResource, c.ns, name), &jenkinsiov1.Team{}) @@ -34,7 +36,7 @@ func (c *FakeTeams) Get(name string, options v1.GetOptions) (result *jenkinsiov1 } // List takes label and field selectors, and returns the list of Teams that match those selectors. -func (c *FakeTeams) List(opts v1.ListOptions) (result *jenkinsiov1.TeamList, err error) { +func (c *FakeTeams) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.TeamList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(teamsResource, teamsKind, c.ns, opts), &jenkinsiov1.TeamList{}) @@ -56,14 +58,14 @@ func (c *FakeTeams) List(opts v1.ListOptions) (result *jenkinsiov1.TeamList, err } // Watch returns a watch.Interface that watches the requested teams. -func (c *FakeTeams) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeTeams) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(teamsResource, c.ns, opts)) } // Create takes the representation of a team and creates it. Returns the server's representation of the team, and an error, if there is any. -func (c *FakeTeams) Create(team *jenkinsiov1.Team) (result *jenkinsiov1.Team, err error) { +func (c *FakeTeams) Create(ctx context.Context, team *jenkinsiov1.Team, opts v1.CreateOptions) (result *jenkinsiov1.Team, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(teamsResource, c.ns, team), &jenkinsiov1.Team{}) @@ -74,7 +76,7 @@ func (c *FakeTeams) Create(team *jenkinsiov1.Team) (result *jenkinsiov1.Team, er } // Update takes the representation of a team and updates it. Returns the server's representation of the team, and an error, if there is any. -func (c *FakeTeams) Update(team *jenkinsiov1.Team) (result *jenkinsiov1.Team, err error) { +func (c *FakeTeams) Update(ctx context.Context, team *jenkinsiov1.Team, opts v1.UpdateOptions) (result *jenkinsiov1.Team, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(teamsResource, c.ns, team), &jenkinsiov1.Team{}) @@ -85,7 +87,7 @@ func (c *FakeTeams) Update(team *jenkinsiov1.Team) (result *jenkinsiov1.Team, er } // Delete takes name of the team and deletes it. Returns an error if one occurs. -func (c *FakeTeams) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeTeams) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(teamsResource, c.ns, name), &jenkinsiov1.Team{}) @@ -93,15 +95,15 @@ func (c *FakeTeams) Delete(name string, options *v1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *FakeTeams) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(teamsResource, c.ns, listOptions) +func (c *FakeTeams) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(teamsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.TeamList{}) return err } // Patch applies the patch and returns the patched team. -func (c *FakeTeams) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.Team, err error) { +func (c *FakeTeams) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.Team, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(teamsResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.Team{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user.go index b4ea0db..dc0be52 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var usersResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v var usersKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "User"} // Get takes name of the user, and returns the corresponding user object, and an error if there is any. -func (c *FakeUsers) Get(name string, options v1.GetOptions) (result *jenkinsiov1.User, err error) { +func (c *FakeUsers) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.User, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(usersResource, c.ns, name), &jenkinsiov1.User{}) @@ -34,7 +36,7 @@ func (c *FakeUsers) Get(name string, options v1.GetOptions) (result *jenkinsiov1 } // List takes label and field selectors, and returns the list of Users that match those selectors. -func (c *FakeUsers) List(opts v1.ListOptions) (result *jenkinsiov1.UserList, err error) { +func (c *FakeUsers) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.UserList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(usersResource, usersKind, c.ns, opts), &jenkinsiov1.UserList{}) @@ -56,14 +58,14 @@ func (c *FakeUsers) List(opts v1.ListOptions) (result *jenkinsiov1.UserList, err } // Watch returns a watch.Interface that watches the requested users. -func (c *FakeUsers) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeUsers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(usersResource, c.ns, opts)) } // Create takes the representation of a user and creates it. Returns the server's representation of the user, and an error, if there is any. -func (c *FakeUsers) Create(user *jenkinsiov1.User) (result *jenkinsiov1.User, err error) { +func (c *FakeUsers) Create(ctx context.Context, user *jenkinsiov1.User, opts v1.CreateOptions) (result *jenkinsiov1.User, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(usersResource, c.ns, user), &jenkinsiov1.User{}) @@ -74,7 +76,7 @@ func (c *FakeUsers) Create(user *jenkinsiov1.User) (result *jenkinsiov1.User, er } // Update takes the representation of a user and updates it. Returns the server's representation of the user, and an error, if there is any. -func (c *FakeUsers) Update(user *jenkinsiov1.User) (result *jenkinsiov1.User, err error) { +func (c *FakeUsers) Update(ctx context.Context, user *jenkinsiov1.User, opts v1.UpdateOptions) (result *jenkinsiov1.User, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(usersResource, c.ns, user), &jenkinsiov1.User{}) @@ -85,7 +87,7 @@ func (c *FakeUsers) Update(user *jenkinsiov1.User) (result *jenkinsiov1.User, er } // Delete takes name of the user and deletes it. Returns an error if one occurs. -func (c *FakeUsers) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeUsers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(usersResource, c.ns, name), &jenkinsiov1.User{}) @@ -93,15 +95,15 @@ func (c *FakeUsers) Delete(name string, options *v1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *FakeUsers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(usersResource, c.ns, listOptions) +func (c *FakeUsers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(usersResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.UserList{}) return err } // Patch applies the patch and returns the patched user. -func (c *FakeUsers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.User, err error) { +func (c *FakeUsers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.User, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(usersResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.User{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go index e6ea218..c3f360b 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go @@ -3,6 +3,8 @@ package fake import ( + "context" + jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -23,7 +25,7 @@ var workflowsResource = schema.GroupVersionResource{Group: "jenkins.io", Version var workflowsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "Workflow"} // Get takes name of the workflow, and returns the corresponding workflow object, and an error if there is any. -func (c *FakeWorkflows) Get(name string, options v1.GetOptions) (result *jenkinsiov1.Workflow, err error) { +func (c *FakeWorkflows) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.Workflow, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(workflowsResource, c.ns, name), &jenkinsiov1.Workflow{}) @@ -34,7 +36,7 @@ func (c *FakeWorkflows) Get(name string, options v1.GetOptions) (result *jenkins } // List takes label and field selectors, and returns the list of Workflows that match those selectors. -func (c *FakeWorkflows) List(opts v1.ListOptions) (result *jenkinsiov1.WorkflowList, err error) { +func (c *FakeWorkflows) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.WorkflowList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(workflowsResource, workflowsKind, c.ns, opts), &jenkinsiov1.WorkflowList{}) @@ -56,14 +58,14 @@ func (c *FakeWorkflows) List(opts v1.ListOptions) (result *jenkinsiov1.WorkflowL } // Watch returns a watch.Interface that watches the requested workflows. -func (c *FakeWorkflows) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeWorkflows) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(workflowsResource, c.ns, opts)) } // Create takes the representation of a workflow and creates it. Returns the server's representation of the workflow, and an error, if there is any. -func (c *FakeWorkflows) Create(workflow *jenkinsiov1.Workflow) (result *jenkinsiov1.Workflow, err error) { +func (c *FakeWorkflows) Create(ctx context.Context, workflow *jenkinsiov1.Workflow, opts v1.CreateOptions) (result *jenkinsiov1.Workflow, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(workflowsResource, c.ns, workflow), &jenkinsiov1.Workflow{}) @@ -74,7 +76,7 @@ func (c *FakeWorkflows) Create(workflow *jenkinsiov1.Workflow) (result *jenkinsi } // Update takes the representation of a workflow and updates it. Returns the server's representation of the workflow, and an error, if there is any. -func (c *FakeWorkflows) Update(workflow *jenkinsiov1.Workflow) (result *jenkinsiov1.Workflow, err error) { +func (c *FakeWorkflows) Update(ctx context.Context, workflow *jenkinsiov1.Workflow, opts v1.UpdateOptions) (result *jenkinsiov1.Workflow, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(workflowsResource, c.ns, workflow), &jenkinsiov1.Workflow{}) @@ -85,7 +87,7 @@ func (c *FakeWorkflows) Update(workflow *jenkinsiov1.Workflow) (result *jenkinsi } // Delete takes name of the workflow and deletes it. Returns an error if one occurs. -func (c *FakeWorkflows) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeWorkflows) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(workflowsResource, c.ns, name), &jenkinsiov1.Workflow{}) @@ -93,15 +95,15 @@ func (c *FakeWorkflows) Delete(name string, options *v1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *FakeWorkflows) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(workflowsResource, c.ns, listOptions) +func (c *FakeWorkflows) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(workflowsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &jenkinsiov1.WorkflowList{}) return err } // Patch applies the patch and returns the patched workflow. -func (c *FakeWorkflows) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *jenkinsiov1.Workflow, err error) { +func (c *FakeWorkflows) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.Workflow, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(workflowsResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.Workflow{}) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice.go index 1774a83..74b623d 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type GitServicesGetter interface { // GitServiceInterface has methods to work with GitService resources. type GitServiceInterface interface { - Create(*v1.GitService) (*v1.GitService, error) - Update(*v1.GitService) (*v1.GitService, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.GitService, error) - List(opts metav1.ListOptions) (*v1.GitServiceList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.GitService, err error) + Create(ctx context.Context, gitService *v1.GitService, opts metav1.CreateOptions) (*v1.GitService, error) + Update(ctx context.Context, gitService *v1.GitService, opts metav1.UpdateOptions) (*v1.GitService, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.GitService, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.GitServiceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GitService, err error) GitServiceExpansion } @@ -47,20 +48,20 @@ func newGitServices(c *JenkinsV1Client, namespace string) *gitServices { } // Get takes name of the gitService, and returns the corresponding gitService object, and an error if there is any. -func (c *gitServices) Get(name string, options metav1.GetOptions) (result *v1.GitService, err error) { +func (c *gitServices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.GitService, err error) { result = &v1.GitService{} err = c.client.Get(). Namespace(c.ns). Resource("gitservices"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of GitServices that match those selectors. -func (c *gitServices) List(opts metav1.ListOptions) (result *v1.GitServiceList, err error) { +func (c *gitServices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.GitServiceList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *gitServices) List(opts metav1.ListOptions) (result *v1.GitServiceList, Resource("gitservices"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested gitServices. -func (c *gitServices) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *gitServices) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *gitServices) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("gitservices"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a gitService and creates it. Returns the server's representation of the gitService, and an error, if there is any. -func (c *gitServices) Create(gitService *v1.GitService) (result *v1.GitService, err error) { +func (c *gitServices) Create(ctx context.Context, gitService *v1.GitService, opts metav1.CreateOptions) (result *v1.GitService, err error) { result = &v1.GitService{} err = c.client.Post(). Namespace(c.ns). Resource("gitservices"). + VersionedParams(&opts, scheme.ParameterCodec). Body(gitService). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a gitService and updates it. Returns the server's representation of the gitService, and an error, if there is any. -func (c *gitServices) Update(gitService *v1.GitService) (result *v1.GitService, err error) { +func (c *gitServices) Update(ctx context.Context, gitService *v1.GitService, opts metav1.UpdateOptions) (result *v1.GitService, err error) { result = &v1.GitService{} err = c.client.Put(). Namespace(c.ns). Resource("gitservices"). Name(gitService.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(gitService). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the gitService and deletes it. Returns an error if one occurs. -func (c *gitServices) Delete(name string, options *metav1.DeleteOptions) error { +func (c *gitServices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("gitservices"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *gitServices) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *gitServices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("gitservices"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched gitService. -func (c *gitServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.GitService, err error) { +func (c *gitServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.GitService, err error) { result = &v1.GitService{} err = c.client.Patch(pt). Namespace(c.ns). Resource("gitservices"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity.go index a142ede..4e6f523 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type PipelineActivitiesGetter interface { // PipelineActivityInterface has methods to work with PipelineActivity resources. type PipelineActivityInterface interface { - Create(*v1.PipelineActivity) (*v1.PipelineActivity, error) - Update(*v1.PipelineActivity) (*v1.PipelineActivity, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.PipelineActivity, error) - List(opts metav1.ListOptions) (*v1.PipelineActivityList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PipelineActivity, err error) + Create(ctx context.Context, pipelineActivity *v1.PipelineActivity, opts metav1.CreateOptions) (*v1.PipelineActivity, error) + Update(ctx context.Context, pipelineActivity *v1.PipelineActivity, opts metav1.UpdateOptions) (*v1.PipelineActivity, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PipelineActivity, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PipelineActivityList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PipelineActivity, err error) PipelineActivityExpansion } @@ -47,20 +48,20 @@ func newPipelineActivities(c *JenkinsV1Client, namespace string) *pipelineActivi } // Get takes name of the pipelineActivity, and returns the corresponding pipelineActivity object, and an error if there is any. -func (c *pipelineActivities) Get(name string, options metav1.GetOptions) (result *v1.PipelineActivity, err error) { +func (c *pipelineActivities) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PipelineActivity, err error) { result = &v1.PipelineActivity{} err = c.client.Get(). Namespace(c.ns). Resource("pipelineactivities"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PipelineActivities that match those selectors. -func (c *pipelineActivities) List(opts metav1.ListOptions) (result *v1.PipelineActivityList, err error) { +func (c *pipelineActivities) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PipelineActivityList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *pipelineActivities) List(opts metav1.ListOptions) (result *v1.PipelineA Resource("pipelineactivities"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested pipelineActivities. -func (c *pipelineActivities) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *pipelineActivities) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *pipelineActivities) Watch(opts metav1.ListOptions) (watch.Interface, er Resource("pipelineactivities"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a pipelineActivity and creates it. Returns the server's representation of the pipelineActivity, and an error, if there is any. -func (c *pipelineActivities) Create(pipelineActivity *v1.PipelineActivity) (result *v1.PipelineActivity, err error) { +func (c *pipelineActivities) Create(ctx context.Context, pipelineActivity *v1.PipelineActivity, opts metav1.CreateOptions) (result *v1.PipelineActivity, err error) { result = &v1.PipelineActivity{} err = c.client.Post(). Namespace(c.ns). Resource("pipelineactivities"). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipelineActivity). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a pipelineActivity and updates it. Returns the server's representation of the pipelineActivity, and an error, if there is any. -func (c *pipelineActivities) Update(pipelineActivity *v1.PipelineActivity) (result *v1.PipelineActivity, err error) { +func (c *pipelineActivities) Update(ctx context.Context, pipelineActivity *v1.PipelineActivity, opts metav1.UpdateOptions) (result *v1.PipelineActivity, err error) { result = &v1.PipelineActivity{} err = c.client.Put(). Namespace(c.ns). Resource("pipelineactivities"). Name(pipelineActivity.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipelineActivity). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the pipelineActivity and deletes it. Returns an error if one occurs. -func (c *pipelineActivities) Delete(name string, options *metav1.DeleteOptions) error { +func (c *pipelineActivities) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("pipelineactivities"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *pipelineActivities) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *pipelineActivities) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("pipelineactivities"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched pipelineActivity. -func (c *pipelineActivities) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PipelineActivity, err error) { +func (c *pipelineActivities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PipelineActivity, err error) { result = &v1.PipelineActivity{} err = c.client.Patch(pt). Namespace(c.ns). Resource("pipelineactivities"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go index 91302e3..d4061b9 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type PipelineStructuresGetter interface { // PipelineStructureInterface has methods to work with PipelineStructure resources. type PipelineStructureInterface interface { - Create(*v1.PipelineStructure) (*v1.PipelineStructure, error) - Update(*v1.PipelineStructure) (*v1.PipelineStructure, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.PipelineStructure, error) - List(opts metav1.ListOptions) (*v1.PipelineStructureList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PipelineStructure, err error) + Create(ctx context.Context, pipelineStructure *v1.PipelineStructure, opts metav1.CreateOptions) (*v1.PipelineStructure, error) + Update(ctx context.Context, pipelineStructure *v1.PipelineStructure, opts metav1.UpdateOptions) (*v1.PipelineStructure, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PipelineStructure, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PipelineStructureList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PipelineStructure, err error) PipelineStructureExpansion } @@ -47,20 +48,20 @@ func newPipelineStructures(c *JenkinsV1Client, namespace string) *pipelineStruct } // Get takes name of the pipelineStructure, and returns the corresponding pipelineStructure object, and an error if there is any. -func (c *pipelineStructures) Get(name string, options metav1.GetOptions) (result *v1.PipelineStructure, err error) { +func (c *pipelineStructures) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PipelineStructure, err error) { result = &v1.PipelineStructure{} err = c.client.Get(). Namespace(c.ns). Resource("pipelinestructures"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PipelineStructures that match those selectors. -func (c *pipelineStructures) List(opts metav1.ListOptions) (result *v1.PipelineStructureList, err error) { +func (c *pipelineStructures) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PipelineStructureList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *pipelineStructures) List(opts metav1.ListOptions) (result *v1.PipelineS Resource("pipelinestructures"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested pipelineStructures. -func (c *pipelineStructures) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *pipelineStructures) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *pipelineStructures) Watch(opts metav1.ListOptions) (watch.Interface, er Resource("pipelinestructures"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a pipelineStructure and creates it. Returns the server's representation of the pipelineStructure, and an error, if there is any. -func (c *pipelineStructures) Create(pipelineStructure *v1.PipelineStructure) (result *v1.PipelineStructure, err error) { +func (c *pipelineStructures) Create(ctx context.Context, pipelineStructure *v1.PipelineStructure, opts metav1.CreateOptions) (result *v1.PipelineStructure, err error) { result = &v1.PipelineStructure{} err = c.client.Post(). Namespace(c.ns). Resource("pipelinestructures"). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipelineStructure). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a pipelineStructure and updates it. Returns the server's representation of the pipelineStructure, and an error, if there is any. -func (c *pipelineStructures) Update(pipelineStructure *v1.PipelineStructure) (result *v1.PipelineStructure, err error) { +func (c *pipelineStructures) Update(ctx context.Context, pipelineStructure *v1.PipelineStructure, opts metav1.UpdateOptions) (result *v1.PipelineStructure, err error) { result = &v1.PipelineStructure{} err = c.client.Put(). Namespace(c.ns). Resource("pipelinestructures"). Name(pipelineStructure.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipelineStructure). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the pipelineStructure and deletes it. Returns an error if one occurs. -func (c *pipelineStructures) Delete(name string, options *metav1.DeleteOptions) error { +func (c *pipelineStructures) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("pipelinestructures"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *pipelineStructures) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *pipelineStructures) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("pipelinestructures"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched pipelineStructure. -func (c *pipelineStructures) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PipelineStructure, err error) { +func (c *pipelineStructures) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PipelineStructure, err error) { result = &v1.PipelineStructure{} err = c.client.Patch(pt). Namespace(c.ns). Resource("pipelinestructures"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin.go index 6831605..ebef9e1 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type PluginsGetter interface { // PluginInterface has methods to work with Plugin resources. type PluginInterface interface { - Create(*v1.Plugin) (*v1.Plugin, error) - Update(*v1.Plugin) (*v1.Plugin, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Plugin, error) - List(opts metav1.ListOptions) (*v1.PluginList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Plugin, err error) + Create(ctx context.Context, plugin *v1.Plugin, opts metav1.CreateOptions) (*v1.Plugin, error) + Update(ctx context.Context, plugin *v1.Plugin, opts metav1.UpdateOptions) (*v1.Plugin, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Plugin, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PluginList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Plugin, err error) PluginExpansion } @@ -47,20 +48,20 @@ func newPlugins(c *JenkinsV1Client, namespace string) *plugins { } // Get takes name of the plugin, and returns the corresponding plugin object, and an error if there is any. -func (c *plugins) Get(name string, options metav1.GetOptions) (result *v1.Plugin, err error) { +func (c *plugins) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Plugin, err error) { result = &v1.Plugin{} err = c.client.Get(). Namespace(c.ns). Resource("plugins"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Plugins that match those selectors. -func (c *plugins) List(opts metav1.ListOptions) (result *v1.PluginList, err error) { +func (c *plugins) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PluginList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *plugins) List(opts metav1.ListOptions) (result *v1.PluginList, err erro Resource("plugins"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested plugins. -func (c *plugins) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *plugins) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *plugins) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("plugins"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a plugin and creates it. Returns the server's representation of the plugin, and an error, if there is any. -func (c *plugins) Create(plugin *v1.Plugin) (result *v1.Plugin, err error) { +func (c *plugins) Create(ctx context.Context, plugin *v1.Plugin, opts metav1.CreateOptions) (result *v1.Plugin, err error) { result = &v1.Plugin{} err = c.client.Post(). Namespace(c.ns). Resource("plugins"). + VersionedParams(&opts, scheme.ParameterCodec). Body(plugin). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a plugin and updates it. Returns the server's representation of the plugin, and an error, if there is any. -func (c *plugins) Update(plugin *v1.Plugin) (result *v1.Plugin, err error) { +func (c *plugins) Update(ctx context.Context, plugin *v1.Plugin, opts metav1.UpdateOptions) (result *v1.Plugin, err error) { result = &v1.Plugin{} err = c.client.Put(). Namespace(c.ns). Resource("plugins"). Name(plugin.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(plugin). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the plugin and deletes it. Returns an error if one occurs. -func (c *plugins) Delete(name string, options *metav1.DeleteOptions) error { +func (c *plugins) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("plugins"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *plugins) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *plugins) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("plugins"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched plugin. -func (c *plugins) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Plugin, err error) { +func (c *plugins) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Plugin, err error) { result = &v1.Plugin{} err = c.client.Patch(pt). Namespace(c.ns). Resource("plugins"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/release.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/release.go index b200ce9..edeb5f2 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/release.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/release.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type ReleasesGetter interface { // ReleaseInterface has methods to work with Release resources. type ReleaseInterface interface { - Create(*v1.Release) (*v1.Release, error) - Update(*v1.Release) (*v1.Release, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Release, error) - List(opts metav1.ListOptions) (*v1.ReleaseList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Release, err error) + Create(ctx context.Context, release *v1.Release, opts metav1.CreateOptions) (*v1.Release, error) + Update(ctx context.Context, release *v1.Release, opts metav1.UpdateOptions) (*v1.Release, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Release, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ReleaseList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Release, err error) ReleaseExpansion } @@ -47,20 +48,20 @@ func newReleases(c *JenkinsV1Client, namespace string) *releases { } // Get takes name of the release, and returns the corresponding release object, and an error if there is any. -func (c *releases) Get(name string, options metav1.GetOptions) (result *v1.Release, err error) { +func (c *releases) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Release, err error) { result = &v1.Release{} err = c.client.Get(). Namespace(c.ns). Resource("releases"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Releases that match those selectors. -func (c *releases) List(opts metav1.ListOptions) (result *v1.ReleaseList, err error) { +func (c *releases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReleaseList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *releases) List(opts metav1.ListOptions) (result *v1.ReleaseList, err er Resource("releases"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested releases. -func (c *releases) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *releases) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *releases) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("releases"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a release and creates it. Returns the server's representation of the release, and an error, if there is any. -func (c *releases) Create(release *v1.Release) (result *v1.Release, err error) { +func (c *releases) Create(ctx context.Context, release *v1.Release, opts metav1.CreateOptions) (result *v1.Release, err error) { result = &v1.Release{} err = c.client.Post(). Namespace(c.ns). Resource("releases"). + VersionedParams(&opts, scheme.ParameterCodec). Body(release). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a release and updates it. Returns the server's representation of the release, and an error, if there is any. -func (c *releases) Update(release *v1.Release) (result *v1.Release, err error) { +func (c *releases) Update(ctx context.Context, release *v1.Release, opts metav1.UpdateOptions) (result *v1.Release, err error) { result = &v1.Release{} err = c.client.Put(). Namespace(c.ns). Resource("releases"). Name(release.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(release). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the release and deletes it. Returns an error if one occurs. -func (c *releases) Delete(name string, options *metav1.DeleteOptions) error { +func (c *releases) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("releases"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *releases) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *releases) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("releases"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched release. -func (c *releases) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Release, err error) { +func (c *releases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Release, err error) { result = &v1.Release{} err = c.client.Patch(pt). Namespace(c.ns). Resource("releases"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go index a706c44..8b0cc2b 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type SchedulersGetter interface { // SchedulerInterface has methods to work with Scheduler resources. type SchedulerInterface interface { - Create(*v1.Scheduler) (*v1.Scheduler, error) - Update(*v1.Scheduler) (*v1.Scheduler, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Scheduler, error) - List(opts metav1.ListOptions) (*v1.SchedulerList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Scheduler, err error) + Create(ctx context.Context, scheduler *v1.Scheduler, opts metav1.CreateOptions) (*v1.Scheduler, error) + Update(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (*v1.Scheduler, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Scheduler, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SchedulerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Scheduler, err error) SchedulerExpansion } @@ -47,20 +48,20 @@ func newSchedulers(c *JenkinsV1Client, namespace string) *schedulers { } // Get takes name of the scheduler, and returns the corresponding scheduler object, and an error if there is any. -func (c *schedulers) Get(name string, options metav1.GetOptions) (result *v1.Scheduler, err error) { +func (c *schedulers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Scheduler, err error) { result = &v1.Scheduler{} err = c.client.Get(). Namespace(c.ns). Resource("schedulers"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Schedulers that match those selectors. -func (c *schedulers) List(opts metav1.ListOptions) (result *v1.SchedulerList, err error) { +func (c *schedulers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SchedulerList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *schedulers) List(opts metav1.ListOptions) (result *v1.SchedulerList, er Resource("schedulers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested schedulers. -func (c *schedulers) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *schedulers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *schedulers) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("schedulers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a scheduler and creates it. Returns the server's representation of the scheduler, and an error, if there is any. -func (c *schedulers) Create(scheduler *v1.Scheduler) (result *v1.Scheduler, err error) { +func (c *schedulers) Create(ctx context.Context, scheduler *v1.Scheduler, opts metav1.CreateOptions) (result *v1.Scheduler, err error) { result = &v1.Scheduler{} err = c.client.Post(). Namespace(c.ns). Resource("schedulers"). + VersionedParams(&opts, scheme.ParameterCodec). Body(scheduler). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a scheduler and updates it. Returns the server's representation of the scheduler, and an error, if there is any. -func (c *schedulers) Update(scheduler *v1.Scheduler) (result *v1.Scheduler, err error) { +func (c *schedulers) Update(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (result *v1.Scheduler, err error) { result = &v1.Scheduler{} err = c.client.Put(). Namespace(c.ns). Resource("schedulers"). Name(scheduler.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(scheduler). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the scheduler and deletes it. Returns an error if one occurs. -func (c *schedulers) Delete(name string, options *metav1.DeleteOptions) error { +func (c *schedulers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("schedulers"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *schedulers) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *schedulers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("schedulers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched scheduler. -func (c *schedulers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Scheduler, err error) { +func (c *schedulers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Scheduler, err error) { result = &v1.Scheduler{} err = c.client.Patch(pt). Namespace(c.ns). Resource("schedulers"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository.go index c1d1aa9..0c63ca2 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type SourceRepositoriesGetter interface { // SourceRepositoryInterface has methods to work with SourceRepository resources. type SourceRepositoryInterface interface { - Create(*v1.SourceRepository) (*v1.SourceRepository, error) - Update(*v1.SourceRepository) (*v1.SourceRepository, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.SourceRepository, error) - List(opts metav1.ListOptions) (*v1.SourceRepositoryList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.SourceRepository, err error) + Create(ctx context.Context, sourceRepository *v1.SourceRepository, opts metav1.CreateOptions) (*v1.SourceRepository, error) + Update(ctx context.Context, sourceRepository *v1.SourceRepository, opts metav1.UpdateOptions) (*v1.SourceRepository, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SourceRepository, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SourceRepositoryList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SourceRepository, err error) SourceRepositoryExpansion } @@ -47,20 +48,20 @@ func newSourceRepositories(c *JenkinsV1Client, namespace string) *sourceReposito } // Get takes name of the sourceRepository, and returns the corresponding sourceRepository object, and an error if there is any. -func (c *sourceRepositories) Get(name string, options metav1.GetOptions) (result *v1.SourceRepository, err error) { +func (c *sourceRepositories) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SourceRepository, err error) { result = &v1.SourceRepository{} err = c.client.Get(). Namespace(c.ns). Resource("sourcerepositories"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of SourceRepositories that match those selectors. -func (c *sourceRepositories) List(opts metav1.ListOptions) (result *v1.SourceRepositoryList, err error) { +func (c *sourceRepositories) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SourceRepositoryList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *sourceRepositories) List(opts metav1.ListOptions) (result *v1.SourceRep Resource("sourcerepositories"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested sourceRepositories. -func (c *sourceRepositories) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *sourceRepositories) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *sourceRepositories) Watch(opts metav1.ListOptions) (watch.Interface, er Resource("sourcerepositories"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a sourceRepository and creates it. Returns the server's representation of the sourceRepository, and an error, if there is any. -func (c *sourceRepositories) Create(sourceRepository *v1.SourceRepository) (result *v1.SourceRepository, err error) { +func (c *sourceRepositories) Create(ctx context.Context, sourceRepository *v1.SourceRepository, opts metav1.CreateOptions) (result *v1.SourceRepository, err error) { result = &v1.SourceRepository{} err = c.client.Post(). Namespace(c.ns). Resource("sourcerepositories"). + VersionedParams(&opts, scheme.ParameterCodec). Body(sourceRepository). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a sourceRepository and updates it. Returns the server's representation of the sourceRepository, and an error, if there is any. -func (c *sourceRepositories) Update(sourceRepository *v1.SourceRepository) (result *v1.SourceRepository, err error) { +func (c *sourceRepositories) Update(ctx context.Context, sourceRepository *v1.SourceRepository, opts metav1.UpdateOptions) (result *v1.SourceRepository, err error) { result = &v1.SourceRepository{} err = c.client.Put(). Namespace(c.ns). Resource("sourcerepositories"). Name(sourceRepository.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(sourceRepository). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the sourceRepository and deletes it. Returns an error if one occurs. -func (c *sourceRepositories) Delete(name string, options *metav1.DeleteOptions) error { +func (c *sourceRepositories) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("sourcerepositories"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *sourceRepositories) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *sourceRepositories) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("sourcerepositories"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched sourceRepository. -func (c *sourceRepositories) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.SourceRepository, err error) { +func (c *sourceRepositories) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SourceRepository, err error) { result = &v1.SourceRepository{} err = c.client.Patch(pt). Namespace(c.ns). Resource("sourcerepositories"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepositorygroup.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepositorygroup.go index a1d3ea9..2236052 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepositorygroup.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepositorygroup.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type SourceRepositoryGroupsGetter interface { // SourceRepositoryGroupInterface has methods to work with SourceRepositoryGroup resources. type SourceRepositoryGroupInterface interface { - Create(*v1.SourceRepositoryGroup) (*v1.SourceRepositoryGroup, error) - Update(*v1.SourceRepositoryGroup) (*v1.SourceRepositoryGroup, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.SourceRepositoryGroup, error) - List(opts metav1.ListOptions) (*v1.SourceRepositoryGroupList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.SourceRepositoryGroup, err error) + Create(ctx context.Context, sourceRepositoryGroup *v1.SourceRepositoryGroup, opts metav1.CreateOptions) (*v1.SourceRepositoryGroup, error) + Update(ctx context.Context, sourceRepositoryGroup *v1.SourceRepositoryGroup, opts metav1.UpdateOptions) (*v1.SourceRepositoryGroup, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.SourceRepositoryGroup, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SourceRepositoryGroupList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SourceRepositoryGroup, err error) SourceRepositoryGroupExpansion } @@ -47,20 +48,20 @@ func newSourceRepositoryGroups(c *JenkinsV1Client, namespace string) *sourceRepo } // Get takes name of the sourceRepositoryGroup, and returns the corresponding sourceRepositoryGroup object, and an error if there is any. -func (c *sourceRepositoryGroups) Get(name string, options metav1.GetOptions) (result *v1.SourceRepositoryGroup, err error) { +func (c *sourceRepositoryGroups) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.SourceRepositoryGroup, err error) { result = &v1.SourceRepositoryGroup{} err = c.client.Get(). Namespace(c.ns). Resource("sourcerepositorygroups"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of SourceRepositoryGroups that match those selectors. -func (c *sourceRepositoryGroups) List(opts metav1.ListOptions) (result *v1.SourceRepositoryGroupList, err error) { +func (c *sourceRepositoryGroups) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SourceRepositoryGroupList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *sourceRepositoryGroups) List(opts metav1.ListOptions) (result *v1.Sourc Resource("sourcerepositorygroups"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested sourceRepositoryGroups. -func (c *sourceRepositoryGroups) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *sourceRepositoryGroups) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *sourceRepositoryGroups) Watch(opts metav1.ListOptions) (watch.Interface Resource("sourcerepositorygroups"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a sourceRepositoryGroup and creates it. Returns the server's representation of the sourceRepositoryGroup, and an error, if there is any. -func (c *sourceRepositoryGroups) Create(sourceRepositoryGroup *v1.SourceRepositoryGroup) (result *v1.SourceRepositoryGroup, err error) { +func (c *sourceRepositoryGroups) Create(ctx context.Context, sourceRepositoryGroup *v1.SourceRepositoryGroup, opts metav1.CreateOptions) (result *v1.SourceRepositoryGroup, err error) { result = &v1.SourceRepositoryGroup{} err = c.client.Post(). Namespace(c.ns). Resource("sourcerepositorygroups"). + VersionedParams(&opts, scheme.ParameterCodec). Body(sourceRepositoryGroup). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a sourceRepositoryGroup and updates it. Returns the server's representation of the sourceRepositoryGroup, and an error, if there is any. -func (c *sourceRepositoryGroups) Update(sourceRepositoryGroup *v1.SourceRepositoryGroup) (result *v1.SourceRepositoryGroup, err error) { +func (c *sourceRepositoryGroups) Update(ctx context.Context, sourceRepositoryGroup *v1.SourceRepositoryGroup, opts metav1.UpdateOptions) (result *v1.SourceRepositoryGroup, err error) { result = &v1.SourceRepositoryGroup{} err = c.client.Put(). Namespace(c.ns). Resource("sourcerepositorygroups"). Name(sourceRepositoryGroup.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(sourceRepositoryGroup). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the sourceRepositoryGroup and deletes it. Returns an error if one occurs. -func (c *sourceRepositoryGroups) Delete(name string, options *metav1.DeleteOptions) error { +func (c *sourceRepositoryGroups) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("sourcerepositorygroups"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *sourceRepositoryGroups) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *sourceRepositoryGroups) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("sourcerepositorygroups"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched sourceRepositoryGroup. -func (c *sourceRepositoryGroups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.SourceRepositoryGroup, err error) { +func (c *sourceRepositoryGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.SourceRepositoryGroup, err error) { result = &v1.SourceRepositoryGroup{} err = c.client.Patch(pt). Namespace(c.ns). Resource("sourcerepositorygroups"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/team.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/team.go index aa34387..d528997 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/team.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/team.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type TeamsGetter interface { // TeamInterface has methods to work with Team resources. type TeamInterface interface { - Create(*v1.Team) (*v1.Team, error) - Update(*v1.Team) (*v1.Team, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Team, error) - List(opts metav1.ListOptions) (*v1.TeamList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Team, err error) + Create(ctx context.Context, team *v1.Team, opts metav1.CreateOptions) (*v1.Team, error) + Update(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (*v1.Team, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Team, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TeamList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Team, err error) TeamExpansion } @@ -47,20 +48,20 @@ func newTeams(c *JenkinsV1Client, namespace string) *teams { } // Get takes name of the team, and returns the corresponding team object, and an error if there is any. -func (c *teams) Get(name string, options metav1.GetOptions) (result *v1.Team, err error) { +func (c *teams) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Team, err error) { result = &v1.Team{} err = c.client.Get(). Namespace(c.ns). Resource("teams"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Teams that match those selectors. -func (c *teams) List(opts metav1.ListOptions) (result *v1.TeamList, err error) { +func (c *teams) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TeamList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *teams) List(opts metav1.ListOptions) (result *v1.TeamList, err error) { Resource("teams"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested teams. -func (c *teams) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *teams) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *teams) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("teams"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a team and creates it. Returns the server's representation of the team, and an error, if there is any. -func (c *teams) Create(team *v1.Team) (result *v1.Team, err error) { +func (c *teams) Create(ctx context.Context, team *v1.Team, opts metav1.CreateOptions) (result *v1.Team, err error) { result = &v1.Team{} err = c.client.Post(). Namespace(c.ns). Resource("teams"). + VersionedParams(&opts, scheme.ParameterCodec). Body(team). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a team and updates it. Returns the server's representation of the team, and an error, if there is any. -func (c *teams) Update(team *v1.Team) (result *v1.Team, err error) { +func (c *teams) Update(ctx context.Context, team *v1.Team, opts metav1.UpdateOptions) (result *v1.Team, err error) { result = &v1.Team{} err = c.client.Put(). Namespace(c.ns). Resource("teams"). Name(team.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(team). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the team and deletes it. Returns an error if one occurs. -func (c *teams) Delete(name string, options *metav1.DeleteOptions) error { +func (c *teams) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("teams"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *teams) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *teams) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("teams"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched team. -func (c *teams) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Team, err error) { +func (c *teams) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Team, err error) { result = &v1.Team{} err = c.client.Patch(pt). Namespace(c.ns). Resource("teams"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/user.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/user.go index c982fb3..cd2491b 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/user.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/user.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type UsersGetter interface { // UserInterface has methods to work with User resources. type UserInterface interface { - Create(*v1.User) (*v1.User, error) - Update(*v1.User) (*v1.User, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.User, error) - List(opts metav1.ListOptions) (*v1.UserList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.User, err error) + Create(ctx context.Context, user *v1.User, opts metav1.CreateOptions) (*v1.User, error) + Update(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (*v1.User, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.User, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.UserList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.User, err error) UserExpansion } @@ -47,20 +48,20 @@ func newUsers(c *JenkinsV1Client, namespace string) *users { } // Get takes name of the user, and returns the corresponding user object, and an error if there is any. -func (c *users) Get(name string, options metav1.GetOptions) (result *v1.User, err error) { +func (c *users) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.User, err error) { result = &v1.User{} err = c.client.Get(). Namespace(c.ns). Resource("users"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Users that match those selectors. -func (c *users) List(opts metav1.ListOptions) (result *v1.UserList, err error) { +func (c *users) List(ctx context.Context, opts metav1.ListOptions) (result *v1.UserList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *users) List(opts metav1.ListOptions) (result *v1.UserList, err error) { Resource("users"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested users. -func (c *users) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *users) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *users) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("users"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a user and creates it. Returns the server's representation of the user, and an error, if there is any. -func (c *users) Create(user *v1.User) (result *v1.User, err error) { +func (c *users) Create(ctx context.Context, user *v1.User, opts metav1.CreateOptions) (result *v1.User, err error) { result = &v1.User{} err = c.client.Post(). Namespace(c.ns). Resource("users"). + VersionedParams(&opts, scheme.ParameterCodec). Body(user). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a user and updates it. Returns the server's representation of the user, and an error, if there is any. -func (c *users) Update(user *v1.User) (result *v1.User, err error) { +func (c *users) Update(ctx context.Context, user *v1.User, opts metav1.UpdateOptions) (result *v1.User, err error) { result = &v1.User{} err = c.client.Put(). Namespace(c.ns). Resource("users"). Name(user.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(user). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the user and deletes it. Returns an error if one occurs. -func (c *users) Delete(name string, options *metav1.DeleteOptions) error { +func (c *users) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("users"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *users) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *users) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("users"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched user. -func (c *users) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.User, err error) { +func (c *users) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.User, err error) { result = &v1.User{} err = c.client.Patch(pt). Namespace(c.ns). Resource("users"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go index 279b62f..ecb772c 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go @@ -3,6 +3,7 @@ package v1 import ( + "context" "time" v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -21,14 +22,14 @@ type WorkflowsGetter interface { // WorkflowInterface has methods to work with Workflow resources. type WorkflowInterface interface { - Create(*v1.Workflow) (*v1.Workflow, error) - Update(*v1.Workflow) (*v1.Workflow, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Workflow, error) - List(opts metav1.ListOptions) (*v1.WorkflowList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Workflow, err error) + Create(ctx context.Context, workflow *v1.Workflow, opts metav1.CreateOptions) (*v1.Workflow, error) + Update(ctx context.Context, workflow *v1.Workflow, opts metav1.UpdateOptions) (*v1.Workflow, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Workflow, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.WorkflowList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Workflow, err error) WorkflowExpansion } @@ -47,20 +48,20 @@ func newWorkflows(c *JenkinsV1Client, namespace string) *workflows { } // Get takes name of the workflow, and returns the corresponding workflow object, and an error if there is any. -func (c *workflows) Get(name string, options metav1.GetOptions) (result *v1.Workflow, err error) { +func (c *workflows) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Workflow, err error) { result = &v1.Workflow{} err = c.client.Get(). Namespace(c.ns). Resource("workflows"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Workflows that match those selectors. -func (c *workflows) List(opts metav1.ListOptions) (result *v1.WorkflowList, err error) { +func (c *workflows) List(ctx context.Context, opts metav1.ListOptions) (result *v1.WorkflowList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -71,13 +72,13 @@ func (c *workflows) List(opts metav1.ListOptions) (result *v1.WorkflowList, err Resource("workflows"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested workflows. -func (c *workflows) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *workflows) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,71 +89,74 @@ func (c *workflows) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("workflows"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a workflow and creates it. Returns the server's representation of the workflow, and an error, if there is any. -func (c *workflows) Create(workflow *v1.Workflow) (result *v1.Workflow, err error) { +func (c *workflows) Create(ctx context.Context, workflow *v1.Workflow, opts metav1.CreateOptions) (result *v1.Workflow, err error) { result = &v1.Workflow{} err = c.client.Post(). Namespace(c.ns). Resource("workflows"). + VersionedParams(&opts, scheme.ParameterCodec). Body(workflow). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a workflow and updates it. Returns the server's representation of the workflow, and an error, if there is any. -func (c *workflows) Update(workflow *v1.Workflow) (result *v1.Workflow, err error) { +func (c *workflows) Update(ctx context.Context, workflow *v1.Workflow, opts metav1.UpdateOptions) (result *v1.Workflow, err error) { result = &v1.Workflow{} err = c.client.Put(). Namespace(c.ns). Resource("workflows"). Name(workflow.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(workflow). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the workflow and deletes it. Returns an error if one occurs. -func (c *workflows) Delete(name string, options *metav1.DeleteOptions) error { +func (c *workflows) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("workflows"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *workflows) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *workflows) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("workflows"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched workflow. -func (c *workflows) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Workflow, err error) { +func (c *workflows) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Workflow, err error) { result = &v1.Workflow{} err = c.client.Patch(pt). Namespace(c.ns). Resource("workflows"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/app.go b/pkg/client/informers/externalversions/jenkins.io/v1/app.go index b1971a5..bc36a64 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/app.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/app.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredAppInformer(client versioned.Interface, namespace string, resync if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Apps(namespace).List(options) + return client.JenkinsV1().Apps(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Apps(namespace).Watch(options) + return client.JenkinsV1().Apps(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.App{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/buildpack.go b/pkg/client/informers/externalversions/jenkins.io/v1/buildpack.go index 7d6106a..acf6420 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/buildpack.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/buildpack.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredBuildPackInformer(client versioned.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().BuildPacks(namespace).List(options) + return client.JenkinsV1().BuildPacks(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().BuildPacks(namespace).Watch(options) + return client.JenkinsV1().BuildPacks(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.BuildPack{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/commitstatus.go b/pkg/client/informers/externalversions/jenkins.io/v1/commitstatus.go index 9f00050..2cbb313 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/commitstatus.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/commitstatus.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredCommitStatusInformer(client versioned.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().CommitStatuses(namespace).List(options) + return client.JenkinsV1().CommitStatuses(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().CommitStatuses(namespace).Watch(options) + return client.JenkinsV1().CommitStatuses(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.CommitStatus{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/environment.go b/pkg/client/informers/externalversions/jenkins.io/v1/environment.go index 50c5f78..0b1dd18 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/environment.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/environment.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredEnvironmentInformer(client versioned.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Environments(namespace).List(options) + return client.JenkinsV1().Environments(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Environments(namespace).Watch(options) + return client.JenkinsV1().Environments(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.Environment{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/environmentrolebinding.go b/pkg/client/informers/externalversions/jenkins.io/v1/environmentrolebinding.go index 8283893..6c3c531 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/environmentrolebinding.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/environmentrolebinding.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredEnvironmentRoleBindingInformer(client versioned.Interface, names if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().EnvironmentRoleBindings(namespace).List(options) + return client.JenkinsV1().EnvironmentRoleBindings(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().EnvironmentRoleBindings(namespace).Watch(options) + return client.JenkinsV1().EnvironmentRoleBindings(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.EnvironmentRoleBinding{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/extension.go b/pkg/client/informers/externalversions/jenkins.io/v1/extension.go index 4ace84d..551d541 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/extension.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/extension.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredExtensionInformer(client versioned.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Extensions(namespace).List(options) + return client.JenkinsV1().Extensions(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Extensions(namespace).Watch(options) + return client.JenkinsV1().Extensions(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.Extension{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/fact.go b/pkg/client/informers/externalversions/jenkins.io/v1/fact.go index f3c1c90..c889475 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/fact.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/fact.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredFactInformer(client versioned.Interface, namespace string, resyn if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Facts(namespace).List(options) + return client.JenkinsV1().Facts(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Facts(namespace).Watch(options) + return client.JenkinsV1().Facts(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.Fact{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/gitservice.go b/pkg/client/informers/externalversions/jenkins.io/v1/gitservice.go index 28e8c96..10a7e51 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/gitservice.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/gitservice.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredGitServiceInformer(client versioned.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().GitServices(namespace).List(options) + return client.JenkinsV1().GitServices(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().GitServices(namespace).Watch(options) + return client.JenkinsV1().GitServices(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.GitService{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/pipelineactivity.go b/pkg/client/informers/externalversions/jenkins.io/v1/pipelineactivity.go index 826171b..42fc2da 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/pipelineactivity.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/pipelineactivity.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredPipelineActivityInformer(client versioned.Interface, namespace s if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().PipelineActivities(namespace).List(options) + return client.JenkinsV1().PipelineActivities(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().PipelineActivities(namespace).Watch(options) + return client.JenkinsV1().PipelineActivities(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.PipelineActivity{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go b/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go index ed6aed0..be66fa7 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredPipelineStructureInformer(client versioned.Interface, namespace if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().PipelineStructures(namespace).List(options) + return client.JenkinsV1().PipelineStructures(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().PipelineStructures(namespace).Watch(options) + return client.JenkinsV1().PipelineStructures(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.PipelineStructure{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/plugin.go b/pkg/client/informers/externalversions/jenkins.io/v1/plugin.go index a6c195d..cfcb2f6 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/plugin.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/plugin.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredPluginInformer(client versioned.Interface, namespace string, res if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Plugins(namespace).List(options) + return client.JenkinsV1().Plugins(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Plugins(namespace).Watch(options) + return client.JenkinsV1().Plugins(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.Plugin{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/release.go b/pkg/client/informers/externalversions/jenkins.io/v1/release.go index 2ea4083..8d99e5f 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/release.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/release.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredReleaseInformer(client versioned.Interface, namespace string, re if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Releases(namespace).List(options) + return client.JenkinsV1().Releases(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Releases(namespace).Watch(options) + return client.JenkinsV1().Releases(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.Release{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go b/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go index 8919e5c..33dca80 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredSchedulerInformer(client versioned.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Schedulers(namespace).List(options) + return client.JenkinsV1().Schedulers(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Schedulers(namespace).Watch(options) + return client.JenkinsV1().Schedulers(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.Scheduler{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepository.go b/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepository.go index b0ff685..bb508da 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepository.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepository.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredSourceRepositoryInformer(client versioned.Interface, namespace s if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().SourceRepositories(namespace).List(options) + return client.JenkinsV1().SourceRepositories(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().SourceRepositories(namespace).Watch(options) + return client.JenkinsV1().SourceRepositories(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.SourceRepository{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepositorygroup.go b/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepositorygroup.go index 394619f..f73db20 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepositorygroup.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepositorygroup.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredSourceRepositoryGroupInformer(client versioned.Interface, namesp if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().SourceRepositoryGroups(namespace).List(options) + return client.JenkinsV1().SourceRepositoryGroups(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().SourceRepositoryGroups(namespace).Watch(options) + return client.JenkinsV1().SourceRepositoryGroups(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.SourceRepositoryGroup{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/team.go b/pkg/client/informers/externalversions/jenkins.io/v1/team.go index f59a214..66224d8 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/team.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/team.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredTeamInformer(client versioned.Interface, namespace string, resyn if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Teams(namespace).List(options) + return client.JenkinsV1().Teams(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Teams(namespace).Watch(options) + return client.JenkinsV1().Teams(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.Team{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/user.go b/pkg/client/informers/externalversions/jenkins.io/v1/user.go index 6557f25..ecd7d46 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/user.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/user.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredUserInformer(client versioned.Interface, namespace string, resyn if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Users(namespace).List(options) + return client.JenkinsV1().Users(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Users(namespace).Watch(options) + return client.JenkinsV1().Users(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.User{}, diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go b/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go index c529a8b..3275e9c 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go @@ -3,6 +3,7 @@ package v1 import ( + "context" time "time" jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" @@ -45,13 +46,13 @@ func NewFilteredWorkflowInformer(client versioned.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Workflows(namespace).List(options) + return client.JenkinsV1().Workflows(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.JenkinsV1().Workflows(namespace).Watch(options) + return client.JenkinsV1().Workflows(namespace).Watch(context.TODO(), options) }, }, &jenkinsiov1.Workflow{}, diff --git a/pkg/client/listers/jenkins.io/v1/app.go b/pkg/client/listers/jenkins.io/v1/app.go index 7a7de71..7bc1ef7 100644 --- a/pkg/client/listers/jenkins.io/v1/app.go +++ b/pkg/client/listers/jenkins.io/v1/app.go @@ -10,8 +10,10 @@ import ( ) // AppLister helps list Apps. +// All objects returned here must be treated as read-only. type AppLister interface { // List lists all Apps in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.App, err error) // Apps returns an object that can list and get Apps. Apps(namespace string) AppNamespaceLister @@ -42,10 +44,13 @@ func (s *appLister) Apps(namespace string) AppNamespaceLister { } // AppNamespaceLister helps list and get Apps. +// All objects returned here must be treated as read-only. type AppNamespaceLister interface { // List lists all Apps in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.App, err error) // Get retrieves the App from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.App, error) AppNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/buildpack.go b/pkg/client/listers/jenkins.io/v1/buildpack.go index c6c93a6..1fe6372 100644 --- a/pkg/client/listers/jenkins.io/v1/buildpack.go +++ b/pkg/client/listers/jenkins.io/v1/buildpack.go @@ -10,8 +10,10 @@ import ( ) // BuildPackLister helps list BuildPacks. +// All objects returned here must be treated as read-only. type BuildPackLister interface { // List lists all BuildPacks in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.BuildPack, err error) // BuildPacks returns an object that can list and get BuildPacks. BuildPacks(namespace string) BuildPackNamespaceLister @@ -42,10 +44,13 @@ func (s *buildPackLister) BuildPacks(namespace string) BuildPackNamespaceLister } // BuildPackNamespaceLister helps list and get BuildPacks. +// All objects returned here must be treated as read-only. type BuildPackNamespaceLister interface { // List lists all BuildPacks in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.BuildPack, err error) // Get retrieves the BuildPack from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.BuildPack, error) BuildPackNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/commitstatus.go b/pkg/client/listers/jenkins.io/v1/commitstatus.go index 8a7f09e..bb69518 100644 --- a/pkg/client/listers/jenkins.io/v1/commitstatus.go +++ b/pkg/client/listers/jenkins.io/v1/commitstatus.go @@ -10,8 +10,10 @@ import ( ) // CommitStatusLister helps list CommitStatuses. +// All objects returned here must be treated as read-only. type CommitStatusLister interface { // List lists all CommitStatuses in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.CommitStatus, err error) // CommitStatuses returns an object that can list and get CommitStatuses. CommitStatuses(namespace string) CommitStatusNamespaceLister @@ -42,10 +44,13 @@ func (s *commitStatusLister) CommitStatuses(namespace string) CommitStatusNamesp } // CommitStatusNamespaceLister helps list and get CommitStatuses. +// All objects returned here must be treated as read-only. type CommitStatusNamespaceLister interface { // List lists all CommitStatuses in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.CommitStatus, err error) // Get retrieves the CommitStatus from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.CommitStatus, error) CommitStatusNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/environment.go b/pkg/client/listers/jenkins.io/v1/environment.go index c94c03f..d9c2413 100644 --- a/pkg/client/listers/jenkins.io/v1/environment.go +++ b/pkg/client/listers/jenkins.io/v1/environment.go @@ -10,8 +10,10 @@ import ( ) // EnvironmentLister helps list Environments. +// All objects returned here must be treated as read-only. type EnvironmentLister interface { // List lists all Environments in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Environment, err error) // Environments returns an object that can list and get Environments. Environments(namespace string) EnvironmentNamespaceLister @@ -42,10 +44,13 @@ func (s *environmentLister) Environments(namespace string) EnvironmentNamespaceL } // EnvironmentNamespaceLister helps list and get Environments. +// All objects returned here must be treated as read-only. type EnvironmentNamespaceLister interface { // List lists all Environments in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Environment, err error) // Get retrieves the Environment from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.Environment, error) EnvironmentNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/environmentrolebinding.go b/pkg/client/listers/jenkins.io/v1/environmentrolebinding.go index eed1067..ffd8ab6 100644 --- a/pkg/client/listers/jenkins.io/v1/environmentrolebinding.go +++ b/pkg/client/listers/jenkins.io/v1/environmentrolebinding.go @@ -10,8 +10,10 @@ import ( ) // EnvironmentRoleBindingLister helps list EnvironmentRoleBindings. +// All objects returned here must be treated as read-only. type EnvironmentRoleBindingLister interface { // List lists all EnvironmentRoleBindings in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.EnvironmentRoleBinding, err error) // EnvironmentRoleBindings returns an object that can list and get EnvironmentRoleBindings. EnvironmentRoleBindings(namespace string) EnvironmentRoleBindingNamespaceLister @@ -42,10 +44,13 @@ func (s *environmentRoleBindingLister) EnvironmentRoleBindings(namespace string) } // EnvironmentRoleBindingNamespaceLister helps list and get EnvironmentRoleBindings. +// All objects returned here must be treated as read-only. type EnvironmentRoleBindingNamespaceLister interface { // List lists all EnvironmentRoleBindings in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.EnvironmentRoleBinding, err error) // Get retrieves the EnvironmentRoleBinding from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.EnvironmentRoleBinding, error) EnvironmentRoleBindingNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/extension.go b/pkg/client/listers/jenkins.io/v1/extension.go index 11a8d50..210faf7 100644 --- a/pkg/client/listers/jenkins.io/v1/extension.go +++ b/pkg/client/listers/jenkins.io/v1/extension.go @@ -10,8 +10,10 @@ import ( ) // ExtensionLister helps list Extensions. +// All objects returned here must be treated as read-only. type ExtensionLister interface { // List lists all Extensions in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Extension, err error) // Extensions returns an object that can list and get Extensions. Extensions(namespace string) ExtensionNamespaceLister @@ -42,10 +44,13 @@ func (s *extensionLister) Extensions(namespace string) ExtensionNamespaceLister } // ExtensionNamespaceLister helps list and get Extensions. +// All objects returned here must be treated as read-only. type ExtensionNamespaceLister interface { // List lists all Extensions in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Extension, err error) // Get retrieves the Extension from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.Extension, error) ExtensionNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/fact.go b/pkg/client/listers/jenkins.io/v1/fact.go index 0f82ed6..dcfb3e3 100644 --- a/pkg/client/listers/jenkins.io/v1/fact.go +++ b/pkg/client/listers/jenkins.io/v1/fact.go @@ -10,8 +10,10 @@ import ( ) // FactLister helps list Facts. +// All objects returned here must be treated as read-only. type FactLister interface { // List lists all Facts in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Fact, err error) // Facts returns an object that can list and get Facts. Facts(namespace string) FactNamespaceLister @@ -42,10 +44,13 @@ func (s *factLister) Facts(namespace string) FactNamespaceLister { } // FactNamespaceLister helps list and get Facts. +// All objects returned here must be treated as read-only. type FactNamespaceLister interface { // List lists all Facts in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Fact, err error) // Get retrieves the Fact from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.Fact, error) FactNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/gitservice.go b/pkg/client/listers/jenkins.io/v1/gitservice.go index 07db01e..151ed11 100644 --- a/pkg/client/listers/jenkins.io/v1/gitservice.go +++ b/pkg/client/listers/jenkins.io/v1/gitservice.go @@ -10,8 +10,10 @@ import ( ) // GitServiceLister helps list GitServices. +// All objects returned here must be treated as read-only. type GitServiceLister interface { // List lists all GitServices in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.GitService, err error) // GitServices returns an object that can list and get GitServices. GitServices(namespace string) GitServiceNamespaceLister @@ -42,10 +44,13 @@ func (s *gitServiceLister) GitServices(namespace string) GitServiceNamespaceList } // GitServiceNamespaceLister helps list and get GitServices. +// All objects returned here must be treated as read-only. type GitServiceNamespaceLister interface { // List lists all GitServices in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.GitService, err error) // Get retrieves the GitService from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.GitService, error) GitServiceNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/pipelineactivity.go b/pkg/client/listers/jenkins.io/v1/pipelineactivity.go index 090d255..acf868f 100644 --- a/pkg/client/listers/jenkins.io/v1/pipelineactivity.go +++ b/pkg/client/listers/jenkins.io/v1/pipelineactivity.go @@ -10,8 +10,10 @@ import ( ) // PipelineActivityLister helps list PipelineActivities. +// All objects returned here must be treated as read-only. type PipelineActivityLister interface { // List lists all PipelineActivities in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.PipelineActivity, err error) // PipelineActivities returns an object that can list and get PipelineActivities. PipelineActivities(namespace string) PipelineActivityNamespaceLister @@ -42,10 +44,13 @@ func (s *pipelineActivityLister) PipelineActivities(namespace string) PipelineAc } // PipelineActivityNamespaceLister helps list and get PipelineActivities. +// All objects returned here must be treated as read-only. type PipelineActivityNamespaceLister interface { // List lists all PipelineActivities in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.PipelineActivity, err error) // Get retrieves the PipelineActivity from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.PipelineActivity, error) PipelineActivityNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/pipelinestructure.go b/pkg/client/listers/jenkins.io/v1/pipelinestructure.go index 0f1e9cf..73671d4 100644 --- a/pkg/client/listers/jenkins.io/v1/pipelinestructure.go +++ b/pkg/client/listers/jenkins.io/v1/pipelinestructure.go @@ -10,8 +10,10 @@ import ( ) // PipelineStructureLister helps list PipelineStructures. +// All objects returned here must be treated as read-only. type PipelineStructureLister interface { // List lists all PipelineStructures in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.PipelineStructure, err error) // PipelineStructures returns an object that can list and get PipelineStructures. PipelineStructures(namespace string) PipelineStructureNamespaceLister @@ -42,10 +44,13 @@ func (s *pipelineStructureLister) PipelineStructures(namespace string) PipelineS } // PipelineStructureNamespaceLister helps list and get PipelineStructures. +// All objects returned here must be treated as read-only. type PipelineStructureNamespaceLister interface { // List lists all PipelineStructures in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.PipelineStructure, err error) // Get retrieves the PipelineStructure from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.PipelineStructure, error) PipelineStructureNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/plugin.go b/pkg/client/listers/jenkins.io/v1/plugin.go index 2197ca3..e325df8 100644 --- a/pkg/client/listers/jenkins.io/v1/plugin.go +++ b/pkg/client/listers/jenkins.io/v1/plugin.go @@ -10,8 +10,10 @@ import ( ) // PluginLister helps list Plugins. +// All objects returned here must be treated as read-only. type PluginLister interface { // List lists all Plugins in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Plugin, err error) // Plugins returns an object that can list and get Plugins. Plugins(namespace string) PluginNamespaceLister @@ -42,10 +44,13 @@ func (s *pluginLister) Plugins(namespace string) PluginNamespaceLister { } // PluginNamespaceLister helps list and get Plugins. +// All objects returned here must be treated as read-only. type PluginNamespaceLister interface { // List lists all Plugins in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Plugin, err error) // Get retrieves the Plugin from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.Plugin, error) PluginNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/release.go b/pkg/client/listers/jenkins.io/v1/release.go index 9b251de..3187145 100644 --- a/pkg/client/listers/jenkins.io/v1/release.go +++ b/pkg/client/listers/jenkins.io/v1/release.go @@ -10,8 +10,10 @@ import ( ) // ReleaseLister helps list Releases. +// All objects returned here must be treated as read-only. type ReleaseLister interface { // List lists all Releases in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Release, err error) // Releases returns an object that can list and get Releases. Releases(namespace string) ReleaseNamespaceLister @@ -42,10 +44,13 @@ func (s *releaseLister) Releases(namespace string) ReleaseNamespaceLister { } // ReleaseNamespaceLister helps list and get Releases. +// All objects returned here must be treated as read-only. type ReleaseNamespaceLister interface { // List lists all Releases in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Release, err error) // Get retrieves the Release from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.Release, error) ReleaseNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/scheduler.go b/pkg/client/listers/jenkins.io/v1/scheduler.go index f77c685..810dc5c 100644 --- a/pkg/client/listers/jenkins.io/v1/scheduler.go +++ b/pkg/client/listers/jenkins.io/v1/scheduler.go @@ -10,8 +10,10 @@ import ( ) // SchedulerLister helps list Schedulers. +// All objects returned here must be treated as read-only. type SchedulerLister interface { // List lists all Schedulers in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Scheduler, err error) // Schedulers returns an object that can list and get Schedulers. Schedulers(namespace string) SchedulerNamespaceLister @@ -42,10 +44,13 @@ func (s *schedulerLister) Schedulers(namespace string) SchedulerNamespaceLister } // SchedulerNamespaceLister helps list and get Schedulers. +// All objects returned here must be treated as read-only. type SchedulerNamespaceLister interface { // List lists all Schedulers in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Scheduler, err error) // Get retrieves the Scheduler from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.Scheduler, error) SchedulerNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/sourcerepository.go b/pkg/client/listers/jenkins.io/v1/sourcerepository.go index 44cd971..c595d9d 100644 --- a/pkg/client/listers/jenkins.io/v1/sourcerepository.go +++ b/pkg/client/listers/jenkins.io/v1/sourcerepository.go @@ -10,8 +10,10 @@ import ( ) // SourceRepositoryLister helps list SourceRepositories. +// All objects returned here must be treated as read-only. type SourceRepositoryLister interface { // List lists all SourceRepositories in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.SourceRepository, err error) // SourceRepositories returns an object that can list and get SourceRepositories. SourceRepositories(namespace string) SourceRepositoryNamespaceLister @@ -42,10 +44,13 @@ func (s *sourceRepositoryLister) SourceRepositories(namespace string) SourceRepo } // SourceRepositoryNamespaceLister helps list and get SourceRepositories. +// All objects returned here must be treated as read-only. type SourceRepositoryNamespaceLister interface { // List lists all SourceRepositories in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.SourceRepository, err error) // Get retrieves the SourceRepository from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.SourceRepository, error) SourceRepositoryNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/sourcerepositorygroup.go b/pkg/client/listers/jenkins.io/v1/sourcerepositorygroup.go index 592dd66..98d3060 100644 --- a/pkg/client/listers/jenkins.io/v1/sourcerepositorygroup.go +++ b/pkg/client/listers/jenkins.io/v1/sourcerepositorygroup.go @@ -10,8 +10,10 @@ import ( ) // SourceRepositoryGroupLister helps list SourceRepositoryGroups. +// All objects returned here must be treated as read-only. type SourceRepositoryGroupLister interface { // List lists all SourceRepositoryGroups in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.SourceRepositoryGroup, err error) // SourceRepositoryGroups returns an object that can list and get SourceRepositoryGroups. SourceRepositoryGroups(namespace string) SourceRepositoryGroupNamespaceLister @@ -42,10 +44,13 @@ func (s *sourceRepositoryGroupLister) SourceRepositoryGroups(namespace string) S } // SourceRepositoryGroupNamespaceLister helps list and get SourceRepositoryGroups. +// All objects returned here must be treated as read-only. type SourceRepositoryGroupNamespaceLister interface { // List lists all SourceRepositoryGroups in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.SourceRepositoryGroup, err error) // Get retrieves the SourceRepositoryGroup from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.SourceRepositoryGroup, error) SourceRepositoryGroupNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/team.go b/pkg/client/listers/jenkins.io/v1/team.go index c22a0b4..0b6c6b0 100644 --- a/pkg/client/listers/jenkins.io/v1/team.go +++ b/pkg/client/listers/jenkins.io/v1/team.go @@ -10,8 +10,10 @@ import ( ) // TeamLister helps list Teams. +// All objects returned here must be treated as read-only. type TeamLister interface { // List lists all Teams in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Team, err error) // Teams returns an object that can list and get Teams. Teams(namespace string) TeamNamespaceLister @@ -42,10 +44,13 @@ func (s *teamLister) Teams(namespace string) TeamNamespaceLister { } // TeamNamespaceLister helps list and get Teams. +// All objects returned here must be treated as read-only. type TeamNamespaceLister interface { // List lists all Teams in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Team, err error) // Get retrieves the Team from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.Team, error) TeamNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/user.go b/pkg/client/listers/jenkins.io/v1/user.go index a9b708b..c3859fa 100644 --- a/pkg/client/listers/jenkins.io/v1/user.go +++ b/pkg/client/listers/jenkins.io/v1/user.go @@ -10,8 +10,10 @@ import ( ) // UserLister helps list Users. +// All objects returned here must be treated as read-only. type UserLister interface { // List lists all Users in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.User, err error) // Users returns an object that can list and get Users. Users(namespace string) UserNamespaceLister @@ -42,10 +44,13 @@ func (s *userLister) Users(namespace string) UserNamespaceLister { } // UserNamespaceLister helps list and get Users. +// All objects returned here must be treated as read-only. type UserNamespaceLister interface { // List lists all Users in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.User, err error) // Get retrieves the User from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.User, error) UserNamespaceListerExpansion } diff --git a/pkg/client/listers/jenkins.io/v1/workflow.go b/pkg/client/listers/jenkins.io/v1/workflow.go index 0520954..391bdec 100644 --- a/pkg/client/listers/jenkins.io/v1/workflow.go +++ b/pkg/client/listers/jenkins.io/v1/workflow.go @@ -10,8 +10,10 @@ import ( ) // WorkflowLister helps list Workflows. +// All objects returned here must be treated as read-only. type WorkflowLister interface { // List lists all Workflows in the indexer. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Workflow, err error) // Workflows returns an object that can list and get Workflows. Workflows(namespace string) WorkflowNamespaceLister @@ -42,10 +44,13 @@ func (s *workflowLister) Workflows(namespace string) WorkflowNamespaceLister { } // WorkflowNamespaceLister helps list and get Workflows. +// All objects returned here must be treated as read-only. type WorkflowNamespaceLister interface { // List lists all Workflows in the indexer for a given namespace. + // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*v1.Workflow, err error) // Get retrieves the Workflow from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. Get(name string) (*v1.Workflow, error) WorkflowNamespaceListerExpansion } diff --git a/pkg/client/openapi/k8s_io_api_batch_v1/openapi_generated.go b/pkg/client/openapi/k8s_io_api_batch_v1/openapi_generated.go index 453f86d..f3c2db8 100644 --- a/pkg/client/openapi/k8s_io_api_batch_v1/openapi_generated.go +++ b/pkg/client/openapi/k8s_io_api_batch_v1/openapi_generated.go @@ -258,7 +258,7 @@ func schema_k8sio_api_batch_v1_JobStatus(ref common.ReferenceCallback) common.Op }, }, SchemaProps: spec.SchemaProps{ - Description: "The latest available observations of an object's current state. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", + Description: "The latest available observations of an object's current state. When a job fails, one of the conditions will have type == \"Failed\". More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -277,7 +277,7 @@ func schema_k8sio_api_batch_v1_JobStatus(ref common.ReferenceCallback) common.Op }, "completionTime": { SchemaProps: spec.SchemaProps{ - Description: "Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.", + Description: "Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. The completion time is only set when the job finishes successfully.", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, diff --git a/pkg/client/openapi/k8s_io_api_core_v1/openapi_generated.go b/pkg/client/openapi/k8s_io_api_core_v1/openapi_generated.go index 2502576..108f133 100644 --- a/pkg/client/openapi/k8s_io_api_core_v1/openapi_generated.go +++ b/pkg/client/openapi/k8s_io_api_core_v1/openapi_generated.go @@ -63,6 +63,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.EphemeralContainer": schema_k8sio_api_core_v1_EphemeralContainer(ref), "k8s.io/api/core/v1.EphemeralContainerCommon": schema_k8sio_api_core_v1_EphemeralContainerCommon(ref), "k8s.io/api/core/v1.EphemeralContainers": schema_k8sio_api_core_v1_EphemeralContainers(ref), + "k8s.io/api/core/v1.EphemeralVolumeSource": schema_k8sio_api_core_v1_EphemeralVolumeSource(ref), "k8s.io/api/core/v1.Event": schema_k8sio_api_core_v1_Event(ref), "k8s.io/api/core/v1.EventList": schema_k8sio_api_core_v1_EventList(ref), "k8s.io/api/core/v1.EventSeries": schema_k8sio_api_core_v1_EventSeries(ref), @@ -124,6 +125,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.PersistentVolumeClaimList": schema_k8sio_api_core_v1_PersistentVolumeClaimList(ref), "k8s.io/api/core/v1.PersistentVolumeClaimSpec": schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref), "k8s.io/api/core/v1.PersistentVolumeClaimStatus": schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref), + "k8s.io/api/core/v1.PersistentVolumeClaimTemplate": schema_k8sio_api_core_v1_PersistentVolumeClaimTemplate(ref), "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource": schema_k8sio_api_core_v1_PersistentVolumeClaimVolumeSource(ref), "k8s.io/api/core/v1.PersistentVolumeList": schema_k8sio_api_core_v1_PersistentVolumeList(ref), "k8s.io/api/core/v1.PersistentVolumeSource": schema_k8sio_api_core_v1_PersistentVolumeSource(ref), @@ -178,6 +180,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.ScaleIOVolumeSource": schema_k8sio_api_core_v1_ScaleIOVolumeSource(ref), "k8s.io/api/core/v1.ScopeSelector": schema_k8sio_api_core_v1_ScopeSelector(ref), "k8s.io/api/core/v1.ScopedResourceSelectorRequirement": schema_k8sio_api_core_v1_ScopedResourceSelectorRequirement(ref), + "k8s.io/api/core/v1.SeccompProfile": schema_k8sio_api_core_v1_SeccompProfile(ref), "k8s.io/api/core/v1.Secret": schema_k8sio_api_core_v1_Secret(ref), "k8s.io/api/core/v1.SecretEnvSource": schema_k8sio_api_core_v1_SecretEnvSource(ref), "k8s.io/api/core/v1.SecretKeySelector": schema_k8sio_api_core_v1_SecretKeySelector(ref), @@ -993,7 +996,7 @@ func schema_k8sio_api_core_v1_ComponentStatus(ref common.ReferenceCallback) comm return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ComponentStatus (and ComponentStatusList) holds the cluster validation info.", + Description: "ComponentStatus (and ComponentStatusList) holds the cluster validation info. Deprecated: This API is deprecated in v1.19+", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -1047,7 +1050,7 @@ func schema_k8sio_api_core_v1_ComponentStatusList(ref common.ReferenceCallback) return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "Status of all the conditions for the component as a list of ComponentStatus objects.", + Description: "Status of all the conditions for the component as a list of ComponentStatus objects. Deprecated: This API is deprecated in v1.19+", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -1119,6 +1122,13 @@ func schema_k8sio_api_core_v1_ConfigMap(ref common.ReferenceCallback) common.Ope Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, + "immutable": { + SchemaProps: spec.SchemaProps{ + Description: "Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is a beta field enabled by ImmutableEphemeralVolumes feature gate.", + Type: []string{"boolean"}, + Format: "", + }, + }, "data": { SchemaProps: spec.SchemaProps{ Description: "Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process.", @@ -1389,7 +1399,7 @@ func schema_k8sio_api_core_v1_ConfigMapVolumeSource(ref common.ReferenceCallback }, "defaultMode": { SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", + Description: "Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", Type: []string{"integer"}, Format: "int32", }, @@ -1554,7 +1564,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope }, }, SchemaProps: spec.SchemaProps{ - Description: "volumeDevices is the list of block devices to be used by the container. This is a beta feature.", + Description: "volumeDevices is the list of block devices to be used by the container.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -1579,7 +1589,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope }, "startupProbe": { SchemaProps: spec.SchemaProps{ - Description: "StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. This is an alpha feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", + Description: "StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", Ref: ref("k8s.io/api/core/v1.Probe"), }, }, @@ -2032,7 +2042,7 @@ func schema_k8sio_api_core_v1_DownwardAPIVolumeFile(ref common.ReferenceCallback }, "mode": { SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", + Description: "Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", Type: []string{"integer"}, Format: "int32", }, @@ -2068,7 +2078,7 @@ func schema_k8sio_api_core_v1_DownwardAPIVolumeSource(ref common.ReferenceCallba }, "defaultMode": { SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", + Description: "Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", Type: []string{"integer"}, Format: "int32", }, @@ -2180,6 +2190,13 @@ func schema_k8sio_api_core_v1_EndpointPort(ref common.ReferenceCallback) common. Format: "", }, }, + "appProtocol": { + SchemaProps: spec.SchemaProps{ + Description: "The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol. This is a beta field that is guarded by the ServiceAppProtocol feature gate and enabled by default.", + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"port"}, }, @@ -2418,7 +2435,7 @@ func schema_k8sio_api_core_v1_EnvVarSource(ref common.ReferenceCallback) common. Properties: map[string]spec.Schema{ "fieldRef": { SchemaProps: spec.SchemaProps{ - Description: "Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP.", + Description: "Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.", Ref: ref("k8s.io/api/core/v1.ObjectFieldSelector"), }, }, @@ -2582,7 +2599,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c }, }, SchemaProps: spec.SchemaProps{ - Description: "volumeDevices is the list of block devices to be used by the container. This is a beta feature.", + Description: "volumeDevices is the list of block devices to be used by the container.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -2815,7 +2832,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb }, }, SchemaProps: spec.SchemaProps{ - Description: "volumeDevices is the list of block devices to be used by the container. This is a beta feature.", + Description: "volumeDevices is the list of block devices to be used by the container.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -2961,6 +2978,34 @@ func schema_k8sio_api_core_v1_EphemeralContainers(ref common.ReferenceCallback) } } +func schema_k8sio_api_core_v1_EphemeralVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Represents an ephemeral volume that is handled by a normal storage driver.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "volumeClaimTemplate": { + SchemaProps: spec.SchemaProps{ + Description: "Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).\n\nAn existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.\n\nThis field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.\n\nRequired, must not be nil.", + Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimTemplate"), + }, + }, + "readOnly": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies a read-only configuration for the volume. Defaults to false (read/write).", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.PersistentVolumeClaimTemplate"}, + } +} + func schema_k8sio_api_core_v1_Event(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -3157,13 +3202,6 @@ func schema_k8sio_api_core_v1_EventSeries(ref common.ReferenceCallback) common.O Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"), }, }, - "state": { - SchemaProps: spec.SchemaProps{ - Description: "State of this Series: Ongoing or Finished Deprecated. Planned removal for 1.18", - Type: []string{"string"}, - Format: "", - }, - }, }, }, }, @@ -3994,7 +4032,7 @@ func schema_k8sio_api_core_v1_KeyToPath(ref common.ReferenceCallback) common.Ope }, "mode": { SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", + Description: "Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", Type: []string{"integer"}, Format: "int32", }, @@ -4155,6 +4193,7 @@ func schema_k8sio_api_core_v1_LimitRangeItem(ref common.ReferenceCallback) commo }, }, }, + Required: []string{"type"}, }, }, Dependencies: []string{ @@ -4979,7 +5018,7 @@ func schema_k8sio_api_core_v1_NodeResources(ref common.ReferenceCallback) common return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "NodeResources is an object for conveying resource information about a node. see http://releases.k8s.io/HEAD/docs/design/resources.md for more details.", + Description: "NodeResources is an object for conveying resource information about a node. see https://kubernetes.io/docs/concepts/architecture/nodes/#capacity for more details.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "Capacity": { @@ -5358,7 +5397,7 @@ func schema_k8sio_api_core_v1_NodeSystemInfo(ref common.ReferenceCallback) commo }, "systemUUID": { SchemaProps: spec.SchemaProps{ - Description: "SystemUUID reported by the node. For unique machine identification MachineID is preferred. This field is specific to Red Hat hosts https://access.redhat.com/documentation/en-US/Red_Hat_Subscription_Management/1/html/RHSM/getting-system-uuid.html", + Description: "SystemUUID reported by the node. For unique machine identification MachineID is preferred. This field is specific to Red Hat hosts https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/rhsm/uuid", Type: []string{"string"}, Format: "", }, @@ -5765,14 +5804,14 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall }, "volumeMode": { SchemaProps: spec.SchemaProps{ - Description: "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec. This is a beta feature.", + Description: "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.", Type: []string{"string"}, Format: "", }, }, "dataSource": { SchemaProps: spec.SchemaProps{ - Description: "This field requires the VolumeSnapshotDataSource alpha feature gate to be enabled and currently VolumeSnapshot is the only supported data source. If the provisioner can support VolumeSnapshot data source, it will create a new volume and data will be restored to the volume at the same time. If the provisioner does not support VolumeSnapshot data source, volume will not be created and the failure will be reported as an event. In the future, we plan to support more data source types and the behavior of the provisioner may change.", + Description: "This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot - Beta) * An existing PVC (PersistentVolumeClaim) * An existing custom resource/object that implements data population (Alpha) In order to use VolumeSnapshot object types, the appropriate feature gate must be enabled (VolumeSnapshotDataSource or AnyVolumeDataSource) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the specified data source is not supported, the volume will not be created and the failure will be reported as an event. In the future, we plan to support more data source types and the behavior of the provisioner may change.", Ref: ref("k8s.io/api/core/v1.TypedLocalObjectReference"), }, }, @@ -5852,6 +5891,34 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa } } +func schema_k8sio_api_core_v1_PersistentVolumeClaimTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here.", + Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimSpec"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + func schema_k8sio_api_core_v1_PersistentVolumeClaimVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -6279,7 +6346,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) }, "volumeMode": { SchemaProps: spec.SchemaProps{ - Description: "volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec. This is a beta feature.", + Description: "volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec.", Type: []string{"string"}, Format: "", }, @@ -6960,6 +7027,13 @@ func schema_k8sio_api_core_v1_PodLogOptions(ref common.ReferenceCallback) common Format: "int64", }, }, + "insecureSkipTLSVerifyBackend": { + SchemaProps: spec.SchemaProps{ + Description: "insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real kubelet. If the kubelet is configured to verify the apiserver's TLS credentials, it does not mean the connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept the actual log data coming from the real kubelet).", + Type: []string{"boolean"}, + Format: "", + }, + }, }, }, }, @@ -7141,11 +7215,24 @@ func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) c }, }, }, + "fsGroupChangePolicy": { + SchemaProps: spec.SchemaProps{ + Description: "fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified defaults to \"Always\".", + Type: []string{"string"}, + Format: "", + }, + }, + "seccompProfile": { + SchemaProps: spec.SchemaProps{ + Description: "The seccomp options to use by the containers in this pod.", + Ref: ref("k8s.io/api/core/v1.SeccompProfile"), + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.SELinuxOptions", "k8s.io/api/core/v1.Sysctl", "k8s.io/api/core/v1.WindowsSecurityContextOptions"}, + "k8s.io/api/core/v1.SELinuxOptions", "k8s.io/api/core/v1.SeccompProfile", "k8s.io/api/core/v1.Sysctl", "k8s.io/api/core/v1.WindowsSecurityContextOptions"}, } } @@ -7346,7 +7433,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "shareProcessNamespace": { SchemaProps: spec.SchemaProps{ - Description: "Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false. This field is beta-level and may be disabled with the PodShareProcessNamespace feature.", + Description: "Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.", Type: []string{"boolean"}, Format: "", }, @@ -7484,7 +7571,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "preemptionPolicy": { SchemaProps: spec.SchemaProps{ - Description: "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature.", + Description: "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is beta-level, gated by the NonPreemptingPriority feature-gate.", Type: []string{"string"}, Format: "", }, @@ -7515,7 +7602,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, }, SchemaProps: spec.SchemaProps{ - Description: "TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. This field is alpha-level and is only honored by clusters that enables the EvenPodsSpread feature. All topologySpreadConstraints are ANDed.", + Description: "TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -7526,6 +7613,13 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, }, }, + "setHostnameAsFQDN": { + SchemaProps: spec.SchemaProps{ + Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", + Type: []string{"boolean"}, + Format: "", + }, + }, }, Required: []string{"containers"}, }, @@ -8037,13 +8131,12 @@ func schema_k8sio_api_core_v1_ProjectedVolumeSource(ref common.ReferenceCallback }, "defaultMode": { SchemaProps: spec.SchemaProps{ - Description: "Mode bits to use on created files by default. Must be a value between 0 and 0777. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", + Description: "Mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", Type: []string{"integer"}, Format: "int32", }, }, }, - Required: []string{"sources"}, }, }, Dependencies: []string{ @@ -9124,6 +9217,35 @@ func schema_k8sio_api_core_v1_ScopedResourceSelectorRequirement(ref common.Refer } } +func schema_k8sio_api_core_v1_SeccompProfile(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type indicates which kind of seccomp profile will be applied. Valid options are:\n\nLocalhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied.", + Type: []string{"string"}, + Format: "", + }, + }, + "localhostProfile": { + SchemaProps: spec.SchemaProps{ + Description: "localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\".", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"type"}, + }, + }, + Dependencies: []string{}, + } +} + func schema_k8sio_api_core_v1_Secret(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -9151,6 +9273,13 @@ func schema_k8sio_api_core_v1_Secret(ref common.ReferenceCallback) common.OpenAP Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, + "immutable": { + SchemaProps: spec.SchemaProps{ + Description: "Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is a beta field enabled by ImmutableEphemeralVolumes feature gate.", + Type: []string{"boolean"}, + Format: "", + }, + }, "data": { SchemaProps: spec.SchemaProps{ Description: "Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4", @@ -9406,7 +9535,7 @@ func schema_k8sio_api_core_v1_SecretVolumeSource(ref common.ReferenceCallback) c }, "defaultMode": { SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", + Description: "Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", Type: []string{"integer"}, Format: "int32", }, @@ -9500,11 +9629,17 @@ func schema_k8sio_api_core_v1_SecurityContext(ref common.ReferenceCallback) comm Format: "", }, }, + "seccompProfile": { + SchemaProps: spec.SchemaProps{ + Description: "The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options.", + Ref: ref("k8s.io/api/core/v1.SeccompProfile"), + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.Capabilities", "k8s.io/api/core/v1.SELinuxOptions", "k8s.io/api/core/v1.WindowsSecurityContextOptions"}, + "k8s.io/api/core/v1.Capabilities", "k8s.io/api/core/v1.SELinuxOptions", "k8s.io/api/core/v1.SeccompProfile", "k8s.io/api/core/v1.WindowsSecurityContextOptions"}, } } @@ -9819,6 +9954,13 @@ func schema_k8sio_api_core_v1_ServicePort(ref common.ReferenceCallback) common.O Format: "", }, }, + "appProtocol": { + SchemaProps: spec.SchemaProps{ + Description: "The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol. This is a beta field that is guarded by the ServiceAppProtocol feature gate and enabled by default.", + Type: []string{"string"}, + Format: "", + }, + }, "port": { SchemaProps: spec.SchemaProps{ Description: "The port that will be exposed by this service.", @@ -9986,7 +10128,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, "externalName": { SchemaProps: spec.SchemaProps{ - Description: "externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) and requires Type to be ExternalName.", + Description: "externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) and requires Type to be ExternalName.", Type: []string{"string"}, Format: "", }, @@ -10007,7 +10149,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, "publishNotReadyAddresses": { SchemaProps: spec.SchemaProps{ - Description: "publishNotReadyAddresses, when set to true, indicates that DNS implementations must publish the notReadyAddresses of subsets for the Endpoints associated with the Service. The default value is false. The primary use case for setting this field is to use a StatefulSet's Headless Service to propagate SRV records for its Pods without respect to their readiness for purpose of peer discovery.", + Description: "publishNotReadyAddresses indicates that any agent which deals with endpoints for this Service should disregard any indications of ready/not-ready. The primary use case for setting this field is for a StatefulSet's Headless Service to propagate SRV DNS records for its Pods for the purpose of peer discovery. The Kubernetes controllers that generate Endpoints and EndpointSlice resources for Services interpret this to mean that all endpoints are considered \"ready\" even if the Pods themselves are not. Agents which consume only Kubernetes generated endpoints through the Endpoints or EndpointSlice resources can safely assume this behavior.", Type: []string{"boolean"}, Format: "", }, @@ -10020,11 +10162,25 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, "ipFamily": { SchemaProps: spec.SchemaProps{ - Description: "ipFamily specifies whether this Service has a preference for a particular IP family (e.g. IPv4 vs. IPv6). If a specific IP family is requested, the clusterIP field will be allocated from that family, if it is available in the cluster. If no IP family is requested, the cluster's primary IP family will be used. Other IP fields (loadBalancerIP, loadBalancerSourceRanges, externalIPs) and controllers which allocate external load-balancers should use the same IP family. Endpoints for this Service will be of this family. This field is immutable after creation. Assigning a ServiceIPFamily not available in the cluster (e.g. IPv6 in IPv4 only cluster) is an error condition and will fail during clusterIP assignment.", + Description: "ipFamily specifies whether this Service has a preference for a particular IP family (e.g. IPv4 vs. IPv6) when the IPv6DualStack feature gate is enabled. In a dual-stack cluster, you can specify ipFamily when creating a ClusterIP Service to determine whether the controller will allocate an IPv4 or IPv6 IP for it, and you can specify ipFamily when creating a headless Service to determine whether it will have IPv4 or IPv6 Endpoints. In either case, if you do not specify an ipFamily explicitly, it will default to the cluster's primary IP family. This field is part of an alpha feature, and you should not make any assumptions about its semantics other than those described above. In particular, you should not assume that it can (or cannot) be changed after creation time; that it can only have the values \"IPv4\" and \"IPv6\"; or that its current value on a given Service correctly reflects the current state of that Service. (For ClusterIP Services, look at clusterIP to see if the Service is IPv4 or IPv6. For headless Services, look at the endpoints, which may be dual-stack in the future. For ExternalName Services, ipFamily has no meaning, but it may be set to an irrelevant value anyway.)", Type: []string{"string"}, Format: "", }, }, + "topologyKeys": { + SchemaProps: spec.SchemaProps{ + Description: "topologyKeys is a preference-order list of topology keys which implementations of services should use to preferentially sort endpoints when accessing this Service, it can not be used at the same time as externalTrafficPolicy=Local. Topology keys must be valid label keys and at most 16 keys may be specified. Endpoints are chosen based on the first topology key with available backends. If this field is specified and all entries have no backends that match the topology of the client, the service has no backends for that client and connections should fail. The special value \"*\" may be used to mean \"any topology\". This catch-all value, if used, only makes sense as the last value in the list. If this is not specified or empty, no topology constraints will be applied.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, }, }, }, @@ -10247,7 +10403,7 @@ func schema_k8sio_api_core_v1_Taint(ref common.ReferenceCallback) common.OpenAPI }, "value": { SchemaProps: spec.SchemaProps{ - Description: "Required. The taint value corresponding to the taint key.", + Description: "The taint value corresponding to the taint key.", Type: []string{"string"}, Format: "", }, @@ -10396,7 +10552,7 @@ func schema_k8sio_api_core_v1_TopologySpreadConstraint(ref common.ReferenceCallb Properties: map[string]spec.Schema{ "maxSkew": { SchemaProps: spec.SchemaProps{ - Description: "MaxSkew describes the degree to which pods may be unevenly distributed. It's the maximum permitted difference between the number of matching pods in any two topology domains of a given topology type. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. It's a required field. Default value is 1 and 0 is not allowed.", + Description: "MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed.", Type: []string{"integer"}, Format: "int32", }, @@ -10410,7 +10566,7 @@ func schema_k8sio_api_core_v1_TopologySpreadConstraint(ref common.ReferenceCallb }, "whenUnsatisfiable": { SchemaProps: spec.SchemaProps{ - Description: "WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it - ScheduleAnyway tells the scheduler to still schedule it It's considered as \"Unsatisfiable\" if and only if placing incoming pod on any topology violates \"MaxSkew\". For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.", + Description: "WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location,\n but giving higher precedence to topologies that would help reduce the\n skew.\nA constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assigment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.", Type: []string{"string"}, Format: "", }, @@ -10644,16 +10800,22 @@ func schema_k8sio_api_core_v1_Volume(ref common.ReferenceCallback) common.OpenAP }, "csi": { SchemaProps: spec.SchemaProps{ - Description: "CSI (Container Storage Interface) represents storage that is handled by an external CSI driver (Alpha feature).", + Description: "CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).", Ref: ref("k8s.io/api/core/v1.CSIVolumeSource"), }, }, + "ephemeral": { + SchemaProps: spec.SchemaProps{ + Description: "Ephemeral represents a volume that is handled by a cluster storage driver (Alpha feature). The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.", + Ref: ref("k8s.io/api/core/v1.EphemeralVolumeSource"), + }, + }, }, Required: []string{"name"}, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, + "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.EphemeralVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, } } @@ -10730,7 +10892,7 @@ func schema_k8sio_api_core_v1_VolumeMount(ref common.ReferenceCallback) common.O }, "subPathExpr": { SchemaProps: spec.SchemaProps{ - Description: "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive. This field is beta in 1.15.", + Description: "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.", Type: []string{"string"}, Format: "", }, @@ -10974,15 +11136,21 @@ func schema_k8sio_api_core_v1_VolumeSource(ref common.ReferenceCallback) common. }, "csi": { SchemaProps: spec.SchemaProps{ - Description: "CSI (Container Storage Interface) represents storage that is handled by an external CSI driver (Alpha feature).", + Description: "CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).", Ref: ref("k8s.io/api/core/v1.CSIVolumeSource"), }, }, + "ephemeral": { + SchemaProps: spec.SchemaProps{ + Description: "Ephemeral represents a volume that is handled by a cluster storage driver (Alpha feature). The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.", + Ref: ref("k8s.io/api/core/v1.EphemeralVolumeSource"), + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, + "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.EphemeralVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, } } @@ -11067,21 +11235,21 @@ func schema_k8sio_api_core_v1_WindowsSecurityContextOptions(ref common.Reference Properties: map[string]spec.Schema{ "gmsaCredentialSpecName": { SchemaProps: spec.SchemaProps{ - Description: "GMSACredentialSpecName is the name of the GMSA credential spec to use. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.", + Description: "GMSACredentialSpecName is the name of the GMSA credential spec to use.", Type: []string{"string"}, Format: "", }, }, "gmsaCredentialSpec": { SchemaProps: spec.SchemaProps{ - Description: "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.", + Description: "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.", Type: []string{"string"}, Format: "", }, }, "runAsUserName": { SchemaProps: spec.SchemaProps{ - Description: "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. This field is alpha-level and it is only honored by servers that enable the WindowsRunAsUserName feature flag.", + Description: "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", Type: []string{"string"}, Format: "", }, diff --git a/pkg/client/openapi/k8s_io_apimachinery_meta_v1/openapi_generated.go b/pkg/client/openapi/k8s_io_apimachinery_meta_v1/openapi_generated.go index 12556d9..16cb6ea 100644 --- a/pkg/client/openapi/k8s_io_apimachinery_meta_v1/openapi_generated.go +++ b/pkg/client/openapi/k8s_io_apimachinery_meta_v1/openapi_generated.go @@ -19,6 +19,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Condition": schema_pkg_apis_meta_v1_Condition(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), @@ -389,6 +390,63 @@ func schema_pkg_apis_meta_v1_APIVersions(ref common.ReferenceCallback) common.Op } } +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.", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status of the condition, one of True, False, Unknown.", + 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("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "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.", + 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.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"type", "status", "lastTransitionTime", "reason", "message"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + func schema_pkg_apis_meta_v1_CreateOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -599,7 +657,7 @@ func schema_pkg_apis_meta_v1_GetOptions(ref common.ReferenceCallback) common.Ope }, "resourceVersion": { SchemaProps: spec.SchemaProps{ - Description: "When specified: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", + 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: "", }, @@ -1041,14 +1099,21 @@ func schema_pkg_apis_meta_v1_ListOptions(ref common.ReferenceCallback) common.Op }, "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. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.\n\nThis field is beta.", + 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. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.", Type: []string{"boolean"}, Format: "", }, }, "resourceVersion": { SchemaProps: spec.SchemaProps{ - Description: "When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.", + 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: "", }, @@ -1171,7 +1236,7 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope }, "namespace": { SchemaProps: spec.SchemaProps{ - Description: "Namespace defines the space within 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: http://kubernetes.io/docs/user-guide/namespaces", + 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: http://kubernetes.io/docs/user-guide/namespaces", Type: []string{"string"}, Format: "", }, @@ -1277,7 +1342,7 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope }, }, 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.", + 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{ diff --git a/pkg/config/install_requirements.go b/pkg/config/install_requirements.go index 0f01273..920292d 100644 --- a/pkg/config/install_requirements.go +++ b/pkg/config/install_requirements.go @@ -6,7 +6,7 @@ import ( "github.com/jenkins-x/jx-api/pkg/cloud" "github.com/jenkins-x/jx-api/pkg/util" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" "io/ioutil" "os" diff --git a/pkg/config/install_requirements_test.go b/pkg/config/install_requirements_test.go index 2178c89..6faee83 100644 --- a/pkg/config/install_requirements_test.go +++ b/pkg/config/install_requirements_test.go @@ -14,7 +14,7 @@ import ( "github.com/jenkins-x/jx-api/pkg/cloud" "github.com/jenkins-x/jx-api/pkg/config" "github.com/jenkins-x/jx-api/pkg/util" - "github.com/jenkins-x/jx-logging/pkg/log" + "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/stretchr/testify/assert" ) From d49c121142d2b4762141c53af158b1736f8cf3f1 Mon Sep 17 00:00:00 2001 From: James Rawlings Date: Wed, 30 Sep 2020 20:40:44 +0100 Subject: [PATCH 2/9] refactor: switch to upstream code-generator --- cmd/codegen/app/generate_clientset.go | 136 - cmd/codegen/app/generate_docs.go | 117 - cmd/codegen/app/generate_openapi.go | 182 - cmd/codegen/app/generate_options.go | 77 - cmd/codegen/app/root.go | 50 - cmd/codegen/codegen.go | 14 - cmd/codegen/generator/client_set.go | 230 - cmd/codegen/generator/common.go | 68 - cmd/codegen/generator/docs.go | 147 - cmd/codegen/generator/open_api.go | 595 - cmd/codegen/util/cli.go | 58 - cmd/codegen/util/commands.go | 244 - cmd/codegen/util/files.go | 267 - cmd/codegen/util/go.go | 314 - cmd/codegen/util/go_test.go | 125 - cmd/codegen/util/strings.go | 13 - go.mod | 11 +- go.sum | 105 +- hack/custom-boilerplate.go.txt | 15 + hack/tools.go | 32 + hack/update-codegen.sh | 33 + jenkins-x.yml | 6 +- .../jenkins.io/v1/zz_generated.deepcopy.go | 15 + pkg/client/clientset/versioned/clientset.go | 15 + pkg/client/clientset/versioned/doc.go | 15 + .../versioned/fake/clientset_generated.go | 15 + pkg/client/clientset/versioned/fake/doc.go | 15 + .../clientset/versioned/fake/register.go | 15 + pkg/client/clientset/versioned/scheme/doc.go | 15 + .../clientset/versioned/scheme/register.go | 15 + .../versioned/typed/jenkins.io/v1/app.go | 15 + .../typed/jenkins.io/v1/app_expansion.go | 42 - .../typed/jenkins.io/v1/buildpack.go | 15 + .../jenkins.io/v1/buildpack_expansion.go | 42 - .../jenkins.io/v1/buildpack_expansion_test.go | 128 - .../typed/jenkins.io/v1/commitstatus.go | 15 + .../jenkins.io/v1/commitstatus_expansion.go | 42 - .../v1/commitstatus_expansion_test.go | 135 - .../versioned/typed/jenkins.io/v1/doc.go | 15 + .../typed/jenkins.io/v1/environment.go | 15 + .../jenkins.io/v1/environment_expansion.go | 42 - .../v1/environment_expansion_test.go | 127 - .../jenkins.io/v1/environmentrolebinding.go | 15 + .../v1/environmentrolebinding_expansion.go | 42 - .../environmentrolebinding_expansion_test.go | 136 - .../typed/jenkins.io/v1/extension.go | 15 + .../jenkins.io/v1/extension_expansion.go | 42 - .../jenkins.io/v1/extension_expansion_test.go | 129 - .../versioned/typed/jenkins.io/v1/fact.go | 15 + .../typed/jenkins.io/v1/fact_expansion.go | 42 - .../jenkins.io/v1/fact_expansion_test.go | 125 - .../versioned/typed/jenkins.io/v1/fake/doc.go | 15 + .../typed/jenkins.io/v1/fake/fake_app.go | 15 + .../jenkins.io/v1/fake/fake_app_expansion.go | 9 - .../jenkins.io/v1/fake/fake_buildpack.go | 15 + .../v1/fake/fake_buildpack_expansion.go | 9 - .../jenkins.io/v1/fake/fake_commitstatus.go | 15 + .../v1/fake/fake_commitstatus_expansion.go | 9 - .../jenkins.io/v1/fake/fake_environment.go | 15 + .../v1/fake/fake_environment_expansion.go | 9 - .../v1/fake/fake_environmentrolebinding.go | 15 + .../fake_environmentrolebinding_expansion.go | 9 - .../jenkins.io/v1/fake/fake_extension.go | 15 + .../v1/fake/fake_extension_expansion.go | 9 - .../typed/jenkins.io/v1/fake/fake_fact.go | 15 + .../jenkins.io/v1/fake/fake_fact_expansion.go | 9 - .../jenkins.io/v1/fake/fake_gitservice.go | 15 + .../v1/fake/fake_gitservice_expansion.go | 9 - .../v1/fake/fake_jenkins.io_client.go | 15 + .../v1/fake/fake_pipelineactivity.go | 15 + .../fake/fake_pipelineactivity_expansion.go | 9 - .../v1/fake/fake_pipelinestructure.go | 15 + .../fake/fake_pipelinestructure_expansion.go | 9 - .../typed/jenkins.io/v1/fake/fake_plugin.go | 15 + .../v1/fake/fake_plugin_expansion.go | 9 - .../typed/jenkins.io/v1/fake/fake_release.go | 15 + .../v1/fake/fake_release_expansion.go | 9 - .../jenkins.io/v1/fake/fake_scheduler.go | 15 + .../v1/fake/fake_sourcerepository.go | 15 + .../fake/fake_sourcerepository_expansion.go | 9 - .../v1/fake/fake_sourcerepositorygroup.go | 15 + .../typed/jenkins.io/v1/fake/fake_team.go | 15 + .../jenkins.io/v1/fake/fake_team_expansion.go | 9 - .../typed/jenkins.io/v1/fake/fake_user.go | 15 + .../jenkins.io/v1/fake/fake_user_expansion.go | 9 - .../typed/jenkins.io/v1/fake/fake_workflow.go | 15 + .../v1/fake/fake_workflow_expansion.go | 9 - .../jenkins.io/v1/generated_expansion.go | 47 + .../typed/jenkins.io/v1/gitservice.go | 15 + .../jenkins.io/v1/gitservice_expansion.go | 42 - .../v1/gitservice_expansion_test.go | 127 - .../typed/jenkins.io/v1/jenkins.io_client.go | 15 + .../typed/jenkins.io/v1/pipelineactivity.go | 15 + .../v1/pipelineactivity_expansion.go | 43 - .../v1/pipelineactivity_expansion_test.go | 127 - .../typed/jenkins.io/v1/pipelinestructure.go | 15 + .../v1/pipelinestructure_expansion.go | 42 - .../v1/pipelinestructure_expansion_test.go | 126 - .../versioned/typed/jenkins.io/v1/plugin.go | 15 + .../typed/jenkins.io/v1/plugin_expansion.go | 42 - .../jenkins.io/v1/plugin_expansion_test.go | 124 - .../versioned/typed/jenkins.io/v1/release.go | 15 + .../typed/jenkins.io/v1/release_expansion.go | 42 - .../jenkins.io/v1/release_expansion_test.go | 126 - .../typed/jenkins.io/v1/scheduler.go | 15 + .../typed/jenkins.io/v1/sourcerepository.go | 15 + .../v1/sourcerepository_expansion.go | 42 - .../v1/sourcerepository_expansion_test.go | 127 - .../jenkins.io/v1/sourcerepositorygroup.go | 15 + .../versioned/typed/jenkins.io/v1/team.go | 15 + .../typed/jenkins.io/v1/team_expansion.go | 42 - .../jenkins.io/v1/team_expansion_test.go | 127 - .../versioned/typed/jenkins.io/v1/testutil.go | 82 - .../versioned/typed/jenkins.io/v1/user.go | 15 + .../typed/jenkins.io/v1/user_expansion.go | 42 - .../jenkins.io/v1/user_expansion_test.go | 126 - .../versioned/typed/jenkins.io/v1/workflow.go | 15 + .../typed/jenkins.io/v1/workflow_expansion.go | 42 - .../jenkins.io/v1/workflow_expansion_test.go | 127 - .../informers/externalversions/factory.go | 15 + .../informers/externalversions/generic.go | 15 + .../internalinterfaces/factory_interfaces.go | 15 + .../externalversions/jenkins.io/interface.go | 15 + .../externalversions/jenkins.io/v1/app.go | 15 + .../jenkins.io/v1/buildpack.go | 15 + .../jenkins.io/v1/commitstatus.go | 15 + .../jenkins.io/v1/environment.go | 15 + .../jenkins.io/v1/environmentrolebinding.go | 15 + .../jenkins.io/v1/extension.go | 15 + .../externalversions/jenkins.io/v1/fact.go | 15 + .../jenkins.io/v1/gitservice.go | 15 + .../jenkins.io/v1/interface.go | 15 + .../jenkins.io/v1/pipelineactivity.go | 15 + .../jenkins.io/v1/pipelinestructure.go | 15 + .../externalversions/jenkins.io/v1/plugin.go | 15 + .../externalversions/jenkins.io/v1/release.go | 15 + .../jenkins.io/v1/scheduler.go | 15 + .../jenkins.io/v1/sourcerepository.go | 15 + .../jenkins.io/v1/sourcerepositorygroup.go | 15 + .../externalversions/jenkins.io/v1/team.go | 15 + .../externalversions/jenkins.io/v1/user.go | 15 + .../jenkins.io/v1/workflow.go | 15 + pkg/client/listers/jenkins.io/v1/app.go | 15 + pkg/client/listers/jenkins.io/v1/buildpack.go | 15 + .../listers/jenkins.io/v1/commitstatus.go | 15 + .../listers/jenkins.io/v1/environment.go | 15 + .../jenkins.io/v1/environmentrolebinding.go | 15 + .../jenkins.io/v1/expansion_generated.go | 15 + pkg/client/listers/jenkins.io/v1/extension.go | 15 + pkg/client/listers/jenkins.io/v1/fact.go | 15 + .../listers/jenkins.io/v1/gitservice.go | 15 + .../listers/jenkins.io/v1/pipelineactivity.go | 15 + .../jenkins.io/v1/pipelinestructure.go | 15 + pkg/client/listers/jenkins.io/v1/plugin.go | 15 + pkg/client/listers/jenkins.io/v1/release.go | 15 + pkg/client/listers/jenkins.io/v1/scheduler.go | 15 + .../listers/jenkins.io/v1/sourcerepository.go | 15 + .../jenkins.io/v1/sourcerepositorygroup.go | 15 + pkg/client/listers/jenkins.io/v1/team.go | 15 + pkg/client/listers/jenkins.io/v1/user.go | 15 + pkg/client/listers/jenkins.io/v1/workflow.go | 15 + pkg/client/openapi/all/openapi_generated.go | 65 - pkg/client/openapi/core/openapi_generated.go | 6861 ---------- .../k8s_io_api_batch_v1/openapi_generated.go | 311 - .../k8s_io_api_core_v1/openapi_generated.go | 11262 ---------------- .../k8s_io_api_rbac_v1/openapi_generated.go | 629 - .../openapi_generated.go | 31 - .../openapi_generated.go | 2231 --- .../openapi_generated.go | 59 - pkg/client/openapi/schema_writer_generated.go | 42 - 170 files changed, 1501 insertions(+), 27042 deletions(-) delete mode 100644 cmd/codegen/app/generate_clientset.go delete mode 100644 cmd/codegen/app/generate_docs.go delete mode 100644 cmd/codegen/app/generate_openapi.go delete mode 100644 cmd/codegen/app/generate_options.go delete mode 100644 cmd/codegen/app/root.go delete mode 100644 cmd/codegen/codegen.go delete mode 100644 cmd/codegen/generator/client_set.go delete mode 100644 cmd/codegen/generator/common.go delete mode 100644 cmd/codegen/generator/docs.go delete mode 100644 cmd/codegen/generator/open_api.go delete mode 100644 cmd/codegen/util/cli.go delete mode 100644 cmd/codegen/util/commands.go delete mode 100644 cmd/codegen/util/files.go delete mode 100644 cmd/codegen/util/go.go delete mode 100644 cmd/codegen/util/go_test.go delete mode 100644 cmd/codegen/util/strings.go create mode 100644 hack/custom-boilerplate.go.txt create mode 100644 hack/tools.go create mode 100755 hack/update-codegen.sh delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/app_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack_expansion_test.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus_expansion_test.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/environment_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/environment_expansion_test.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding_expansion_test.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/extension_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/extension_expansion_test.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fact_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fact_expansion_test.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice_expansion_test.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity_expansion_test.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure_expansion_test.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin_expansion_test.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/release_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/release_expansion_test.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository_expansion_test.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/team_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/team_expansion_test.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/testutil.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/user_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/user_expansion_test.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow_expansion.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow_expansion_test.go delete mode 100644 pkg/client/openapi/all/openapi_generated.go delete mode 100644 pkg/client/openapi/core/openapi_generated.go delete mode 100644 pkg/client/openapi/k8s_io_api_batch_v1/openapi_generated.go delete mode 100644 pkg/client/openapi/k8s_io_api_core_v1/openapi_generated.go delete mode 100644 pkg/client/openapi/k8s_io_api_rbac_v1/openapi_generated.go delete mode 100644 pkg/client/openapi/k8s_io_apimachinery_intstr_unversioned/openapi_generated.go delete mode 100644 pkg/client/openapi/k8s_io_apimachinery_meta_v1/openapi_generated.go delete mode 100644 pkg/client/openapi/k8s_io_apimachinery_resource_unversioned/openapi_generated.go delete mode 100644 pkg/client/openapi/schema_writer_generated.go diff --git a/cmd/codegen/app/generate_clientset.go b/cmd/codegen/app/generate_clientset.go deleted file mode 100644 index 0d2daa3..0000000 --- a/cmd/codegen/app/generate_clientset.go +++ /dev/null @@ -1,136 +0,0 @@ -package app - -import ( - "go/build" - "os" - "path/filepath" - - "github.com/jenkins-x/jx-logging/v3/pkg/log" - - "github.com/jenkins-x/jx-api/cmd/codegen/generator" - "github.com/jenkins-x/jx-api/cmd/codegen/util" - - "github.com/pkg/errors" - - "github.com/spf13/cobra" -) - -// ClientSetGenerationOptions contain the options for the clientset generation. -type ClientSetGenerationOptions struct { - GenerateOptions - Generators []string -} - -var ( - createClientGoLong = `This command code generates clients for the specified custom resources.` - - createClientGoExample = ` -# lets generate a client -codegen clientset - --output-package=github.com/jenkins-x/jx-api/pkg/client \ - --input-package=github.com/jenkins-x/pkg-apis \ - --group-with-version=jenkins.io:v1 - -# You will normally want to add a target to your Makefile that looks like -generate-clients: - codegen clientset - --output-package=github.com/jenkins-x/jx-api/pkg/client \ - --input-package=github.com/jenkins-x/jx-api/pkg/apis \ - --group-with-version=jenkins.io:v1 - -# and then call -make generate-client -` -) - -// NewGenerateClientSetCmd creates the command -func NewGenerateClientSetCmd(genOpts GenerateOptions) *cobra.Command { - o := &ClientSetGenerationOptions{ - GenerateOptions: genOpts, - } - - cobraCmd := &cobra.Command{ - Use: "clientset", - Short: "Creates Go client for Custom Resources", - Long: createClientGoLong, - Example: createClientGoExample, - - Run: func(c *cobra.Command, args []string) { - o.Cmd = c - o.Args = args - err := o.Run() - util.CheckErr(err) - }, - } - - availableGenerators := []string{ - "deepcopy", - "clientset", - "listers", - "informers", - } - - wd, err := os.Getwd() - if err != nil { - log.Logger().Warnf("Error getting working directory for %v\n", err) - } - - cobraCmd.Flags().StringArrayVarP(&o.Generators, "generator", "", availableGenerators, "Enable a generator") - cobraCmd.Flags().StringVarP(&o.OutputBase, "output-base", "", wd, "Output base directory, "+ - "by the current working directory") - cobraCmd.Flags().StringVarP(&o.BoilerplateFile, optionBoilerplateFile, "", "custom-boilerplate.go.txt", - "Custom boilerplate to add to all files if the file is missing it will be ignored") - cobraCmd.Flags().StringArrayVarP(&o.GroupsWithVersions, optionGroupWithVersion, "g", make([]string, 0), - "group name:version (e.g. jenkins.io:v1) to generate, must specify at least once") - cobraCmd.Flags().StringVarP(&o.InputPackage, optionInputPackage, "i", "", "Input package, must specify") - cobraCmd.Flags().StringVarP(&o.OutputPackage, optionOutputPackage, "o", "", "Output package, must specify") - cobraCmd.Flags().StringVarP(&o.InputBase, optionInputBase, "", wd, "Input base, defaults working directory") - cobraCmd.Flags().BoolVarP(&o.Global, global, "", false, "use the users GOPATH") - cobraCmd.Flags().StringVarP(&o.SemVer, optionSemVer, "", "", "semantic version to use in packages") - return cobraCmd -} - -// Run executes this command. -func (o *ClientSetGenerationOptions) Run() error { - var err error - o.BoilerplateFile, err = generator.GetBoilerplateFile(o.BoilerplateFile) - if err != nil { - return errors.Wrapf(err, "reading file %s specified by %s", o.BoilerplateFile, optionBoilerplateFile) - } - if len(o.GroupsWithVersions) < 1 { - return util.InvalidOptionf(optionGroupWithVersion, o.GroupsWithVersions, "must specify at least once") - } - if o.InputPackage == "" { - return util.MissingOption(optionInputPackage) - } - if o.OutputPackage == "" { - return util.MissingOption(optionOutputPackage) - } - - err = o.configure() - if err != nil { - return errors.Wrapf(err, "ensure GOPATH is set correctly") - } - - cleanupFunc := func() {} - gopath := util.GoPath() - if !o.Global { - gopath, err = util.IsolatedGoPath() - if err != nil { - return errors.Wrapf(err, "getting isolated gopath") - } - cleanupFunc, err = util.BackupGoModAndGoSum() - if err != nil { - return errors.Wrapf(err, "backing up go.mod and go.sum") - } - } - defer cleanupFunc() - - err = generator.InstallCodeGenerators(o.GeneratorVersion, gopath) - if err != nil { - return errors.Wrapf(err, "installing kubernetes code generator tools") - } - log.Logger().Infof("generating Go code to %s in package %s from package %s\n", o.OutputBase, o.GoPathOutputPackage, o.GoPathInputPackage) - return generator.GenerateClient(o.Generators, o.GroupsWithVersions, o.GoPathInputPackage, o.GoPathOutputPackage, o.OutputPackage, - filepath.Join(build.Default.GOPATH, "src"), o.BoilerplateFile, gopath, o.SemVer) -} diff --git a/cmd/codegen/app/generate_docs.go b/cmd/codegen/app/generate_docs.go deleted file mode 100644 index daefe37..0000000 --- a/cmd/codegen/app/generate_docs.go +++ /dev/null @@ -1,117 +0,0 @@ -package app - -import ( - "os" - "path/filepath" - - "github.com/jenkins-x/jx-logging/v3/pkg/log" - - "github.com/jenkins-x/jx-api/cmd/codegen/generator" - "github.com/jenkins-x/jx-api/cmd/codegen/util" - "github.com/pkg/errors" - - "github.com/spf13/cobra" -) - -// GenerateDocsOptions contains the options for the create client docs command -type GenerateDocsOptions struct { - GenerateOptions - ReferenceDocsVersion string -} - -var ( - createClientDocsLong = `This command code generates clients docs (Swagger,OpenAPI and HTML) for - the specified custom resources. - -` - - createClientDocsExample = ` -# lets generate client docs -codegen docs - -# You will normally want to add a target to your Makefile that looks like -generate-clients-docs: - codegen docs - -# and then call -make generate-clients-docs -` -) - -// NewCreateDocsCmd creates apidocs for CRDs -func NewCreateDocsCmd(genOpts GenerateOptions) *cobra.Command { - o := &GenerateDocsOptions{ - GenerateOptions: genOpts, - } - - cobraCmd := &cobra.Command{ - Use: "docs", - Short: "Creates client docs for Custom Resources", - Long: createClientDocsLong, - Example: createClientDocsExample, - - Run: func(c *cobra.Command, args []string) { - o.Cmd = c - o.Args = args - err := run(o) - util.CheckErr(err) - }, - } - - wd, err := os.Getwd() - if err != nil { - log.Logger().Warnf("error getting working directory for %v\n", err) - } - - cobraCmd.Flags().StringVarP(&o.InputBase, optionInputBase, "", wd, - "Input base (root of module), by default the current working directory") - cobraCmd.Flags().StringVarP(&o.OutputBase, optionOutputBase, "o", filepath.Join(wd, "docs/apidocs"), - "output base directory, by default the /docs/apidocs") - cobraCmd.Flags().BoolVarP(&o.Global, global, "", false, "use the users GOPATH") - return cobraCmd -} - -func run(o *GenerateDocsOptions) error { - var err error - if o.OutputBase == "" { - return util.MissingOption(optionOutputBase) - } - log.Logger().Infof("generating docs to %s\n", o.OutputBase) - - cleanupFunc := func() {} - gopath := util.GoPath() - if !o.Global { - gopath, err = util.IsolatedGoPath() - if err != nil { - return errors.Wrapf(err, "getting isolated gopath") - } - cleanupFunc, err = util.BackupGoModAndGoSum() - if err != nil { - return errors.Wrapf(err, "backing up go.mod and go.sum") - } - } - defer cleanupFunc() - err = generator.InstallGenAPIDocs(o.GeneratorVersion, gopath) - if err != nil { - return err - } - - referenceDocsRepo, err := generator.DetermineSourceLocation(o.InputBase, gopath) - if err != nil { - return err - } - - err = generator.GenerateAPIDocs(o.OutputBase, gopath) - if err != nil { - return err - } - err = generator.AssembleAPIDocsStatic(referenceDocsRepo, o.OutputBase) - if err != nil { - return err - } - err = generator.AssembleAPIDocs(o.OutputBase, filepath.Join(o.OutputBase, "site")) - if err != nil { - return err - } - return nil -} diff --git a/cmd/codegen/app/generate_openapi.go b/cmd/codegen/app/generate_openapi.go deleted file mode 100644 index 08c95e6..0000000 --- a/cmd/codegen/app/generate_openapi.go +++ /dev/null @@ -1,182 +0,0 @@ -package app - -import ( - "go/build" - "os" - "path/filepath" - "strings" - - "github.com/jenkins-x/jx-logging/v3/pkg/log" - - "github.com/jenkins-x/jx-api/cmd/codegen/generator" - "github.com/jenkins-x/jx-api/cmd/codegen/util" - - "github.com/pkg/errors" - - "github.com/spf13/cobra" -) - -// CreateClientOpenAPIOptions the options for the create client openapi command -type CreateClientOpenAPIOptions struct { - GenerateOptions - Title string - Version string - ReferenceDocsVersion string - OpenAPIDependencies []string - OpenAPIOutputDir string - ModuleName string -} - -var ( - createClientOpenAPILong = `This command code generates OpenAPI specs for -the specified custom resources. -` - - createClientOpenAPIExample = ` -# lets generate client docs -codegen openapi - --output-package=github.com/jenkins-x/jx-api/pkg/client \ - --input-package=github.com/jenkins-x/jx-api/pkg-apis \ - --group-with-version=jenkins.io:v1 - --version=1.2.3 - --title=Jenkins X - -# You will normally want to add a target to your Makefile that looks like -generate-openapi: - codegen openapi - --output-package=github.com/jenkins-x/jx-api/pkg/client \ - --input-package=github.com/jenkins-x/jx-api/pkg/apis \ - --group-with-version=jenkins.io:v1 - --version=${VERSION} - --title=${TITLE} - -# and then call -make generate-openapi -` -) - -// NewCmdCreateClientOpenAPI creates the command -func NewCmdCreateClientOpenAPI(genOpts GenerateOptions) *cobra.Command { - o := &CreateClientOpenAPIOptions{ - GenerateOptions: genOpts, - } - - cobraCmd := &cobra.Command{ - Use: "openapi", - Short: "Creates OpenAPI specs for Custom Resources", - Long: createClientOpenAPILong, - Example: createClientOpenAPIExample, - - Run: func(c *cobra.Command, args []string) { - o.Cmd = c - o.Args = args - err := o.Run() - util.CheckErr(err) - }, - } - - wd, err := os.Getwd() - if err != nil { - log.Logger().Warnf("Error getting working directory for %v\n", err) - } - - openAPIDependencies := []string{ - "k8s.io/apimachinery?modules:pkg/apis:meta:v1", - "k8s.io/apimachinery?modules:pkg/api:resource:", - "k8s.io/apimachinery?modules:pkg/util:intstr:", - "k8s.io/api?modules::batch:v1", - "k8s.io/api?modules::core:v1", - "k8s.io/api?modules::rbac:v1", - } - - moduleName := strings.TrimPrefix(strings.TrimPrefix(wd, filepath.Join(build.Default.GOPATH, "src")), "/") - - cobraCmd.Flags().StringVarP(&o.OutputBase, "output-base", "", wd, - "Output base directory, by default the current working directory") - cobraCmd.Flags().StringVarP(&o.BoilerplateFile, optionBoilerplateFile, "", "custom-boilerplate.go.txt", - "Custom boilerplate to add to all files if the file is missing it will be ignored") - cobraCmd.Flags().StringVarP(&o.InputBase, optionInputBase, "", wd, - "Input base (the root of module the OpenAPI is being generated for), by default the current working directory") - cobraCmd.Flags().StringVarP(&o.InputPackage, optionInputPackage, "i", "", "Input package (relative to input base), "+ - "must specify") - cobraCmd.Flags().StringVarP(&o.OutputPackage, optionOutputPackage, "o", "", "Output package, must specify") - cobraCmd.Flags().StringVarP(&o.Title, "title", "", "Jenkins X", "Title for OpenAPI, JSON Schema and HTML docs") - cobraCmd.Flags().StringVarP(&o.Version, "version", "", "", "Version for OpenAPI, JSON Schema and HTML docs") - cobraCmd.Flags().StringArrayVarP(&o.OpenAPIDependencies, "open-api-dependency", "", openAPIDependencies, - "Add dependencies for OpenAPI generation") - cobraCmd.Flags().StringVarP(&o.OpenAPIOutputDir, "openapi-output-directory", "", - "docs/apidocs", "Output directory for the OpenAPI specs, "+ - "relative to the output-base unless absolute. "+ - "OpenAPI spec JSON and YAML files are placed in openapi-spec sub directory.") - cobraCmd.Flags().StringArrayVarP(&o.GroupsWithVersions, optionGroupWithVersion, "g", make([]string, 0), - "group name:version (e.g. jenkins.io:v1) to generate, must specify at least once") - cobraCmd.Flags().StringVarP(&o.ModuleName, optionModuleName, "", moduleName, - "module name (e.g. github.com/jenkins-x/jx)") - cobraCmd.Flags().BoolVarP(&o.Global, global, "", false, "use the users GOPATH") - cobraCmd.Flags().StringVarP(&o.SemVer, optionSemVer, "", "", "semantic version to use in packages") - return cobraCmd -} - -// Run implements this command -func (o *CreateClientOpenAPIOptions) Run() error { - var err error - o.BoilerplateFile, err = generator.GetBoilerplateFile(o.BoilerplateFile) - if err != nil { - return errors.Wrapf(err, "reading file %s specified by %s", o.BoilerplateFile, optionBoilerplateFile) - } - if o.InputPackage == "" { - return util.MissingOption(optionInputPackage) - } - if o.OutputPackage == "" { - return util.MissingOption(optionOutputPackage) - } - - err = o.configure() - if err != nil { - return errors.Wrapf(err, "ensuring GOPATH is set correctly") - } - - if len(o.GroupsWithVersions) < 1 { - return util.InvalidOptionf(optionGroupWithVersion, o.GroupsWithVersions, "must specify at least once") - } - - cleanupFunc := func() {} - - gopath := util.GoPath() - if !o.Global { - gopath, err = util.IsolatedGoPath() - if err != nil { - return errors.Wrapf(err, "getting isolated gopath") - } - cleanupFunc, err = util.BackupGoModAndGoSum() - if err != nil { - return errors.Wrapf(err, "backing up go.mod and go.sum") - } - } - - defer cleanupFunc() - - err = generator.InstallOpenApiGen(o.GeneratorVersion, gopath) - if err != nil { - return errors.Wrapf(err, "error installing kubernetes openapi tools") - } - - if !filepath.IsAbs(o.OpenAPIOutputDir) { - o.OpenAPIOutputDir = filepath.Join(o.OutputBase, o.OpenAPIOutputDir) - } - - log.Logger().Infof("generating Go code to %s in package %s from package %s\n", o.OutputBase, o.GoPathOutputPackage, o.InputPackage) - err = generator.GenerateOpenApi(o.GroupsWithVersions, o.InputPackage, o.GoPathOutputPackage, o.OutputPackage, - filepath.Join(build.Default.GOPATH, "src"), o.OpenAPIDependencies, o.InputBase, o.ModuleName, o.BoilerplateFile, gopath, o.SemVer) - if err != nil { - return errors.Wrapf(err, "generating openapi structs to %s", o.GoPathOutputPackage) - } - - log.Logger().Infof("generating OpenAPI spec files to %s from package %s\n", o.OpenAPIOutputDir, filepath.Join(o.InputBase, - o.InputPackage)) - err = generator.GenerateSchema(o.OpenAPIOutputDir, o.OutputPackage, o.InputBase, o.Title, o.Version, gopath) - if err != nil { - return errors.Wrapf(err, "generating schema to %s", o.OpenAPIOutputDir) - } - return nil -} diff --git a/cmd/codegen/app/generate_options.go b/cmd/codegen/app/generate_options.go deleted file mode 100644 index 3bcf8be..0000000 --- a/cmd/codegen/app/generate_options.go +++ /dev/null @@ -1,77 +0,0 @@ -package app - -import ( - "fmt" - "go/build" - "path/filepath" - "strings" - - "github.com/pkg/errors" - "github.com/spf13/cobra" - - "github.com/jenkins-x/jx-api/cmd/codegen/util" -) - -const ( - optionGroupWithVersion = "group-with-version" - optionInputPackage = "input-package" - optionOutputPackage = "output-package" - - optionInputBase = "input-base" - optionOutputBase = "output-base" - optionBoilerplateFile = "boilerplate-file" - optionModuleName = "module-name" - global = "global" - optionSemVer = "semver" -) - -// CommonOptions contains the common options -type CommonOptions struct { - Args []string - Cmd *cobra.Command - LogLevel string - GeneratorVersion string -} - -// GenerateOptions contain common code generation options -type GenerateOptions struct { - *CommonOptions - OutputBase string - BoilerplateFile string - GroupsWithVersions []string - InputPackage string - GoPathInputPackage string - GoPathOutputPackage string - GoPathOutputBase string - OutputPackage string - InputBase string - Global bool - SemVer string -} - -func (o *GenerateOptions) configure() error { - err := util.EnsureGoPath() - if err != nil { - return err - } - - inputPath := filepath.Join(o.InputBase, o.InputPackage) - outputPath := filepath.Join(o.OutputBase, o.OutputPackage) - - if !strings.HasPrefix(inputPath, build.Default.GOPATH) { - return errors.Errorf("input %s is not in GOPATH (%s)", inputPath, build.Default.GOPATH) - } - - if !strings.HasPrefix(outputPath, build.Default.GOPATH) { - return errors.Errorf("output %s is not in GOPATH (%s)", outputPath, build.Default.GOPATH) - } - - // Work out the InputPackage relative to GOROOT - o.GoPathInputPackage = strings.TrimPrefix(inputPath, - fmt.Sprintf("%s/", filepath.Join(build.Default.GOPATH, "src"))) - - // Work out the OutputPackage relative to GOROOT - o.GoPathOutputPackage = strings.TrimPrefix(outputPath, - fmt.Sprintf("%s/", filepath.Join(build.Default.GOPATH, "src"))) - return nil -} diff --git a/cmd/codegen/app/root.go b/cmd/codegen/app/root.go deleted file mode 100644 index 8072abb..0000000 --- a/cmd/codegen/app/root.go +++ /dev/null @@ -1,50 +0,0 @@ -package app - -import ( - "github.com/spf13/cobra" -) - -var ( - longHelp = `Generates Go clientsets, OpenAPI spec and API docs for custom resources. - -Custom resources are defined using Go structs. - -Available generators include: - -* openapi - generates OpenAPI specs, required to generate API docs and clients other than Go -* docs - generates API docs from the OpenAPI specs -* clientset - generates a Go CRUD client directly from custom resources - -` -) - -// Run executes the Cobra root command. -func Run() error { - rootCommand := &cobra.Command{ - Use: "codegen", - Short: "Uses Golang code-generators to generate various application resources and documentation.", - Long: longHelp, - Run: runHelp, - } - - commonOpts := &CommonOptions{ - Cmd: rootCommand, - } - - genOpts := GenerateOptions{ - CommonOptions: commonOpts, - } - - rootCommand.PersistentFlags().StringVarP(&commonOpts.GeneratorVersion, "generator-version", "", "master", - "Version (really a commit-ish) of the generator tool to use. Allows to pin version using Go modules. Default is master.") - - rootCommand.AddCommand(NewGenerateClientSetCmd(genOpts)) - rootCommand.AddCommand(NewCmdCreateClientOpenAPI(genOpts)) - rootCommand.AddCommand(NewCreateDocsCmd(genOpts)) - - return rootCommand.Execute() -} - -func runHelp(cmd *cobra.Command, _args []string) { - cmd.Help() //nolint:errcheck -} diff --git a/cmd/codegen/codegen.go b/cmd/codegen/codegen.go deleted file mode 100644 index c63b88e..0000000 --- a/cmd/codegen/codegen.go +++ /dev/null @@ -1,14 +0,0 @@ -package main - -import ( - "os" - - "github.com/jenkins-x/jx-api/cmd/codegen/app" -) - -func main() { - if err := app.Run(); err != nil { - os.Exit(1) - } - os.Exit(0) -} diff --git a/cmd/codegen/generator/client_set.go b/cmd/codegen/generator/client_set.go deleted file mode 100644 index 6ea4ecd..0000000 --- a/cmd/codegen/generator/client_set.go +++ /dev/null @@ -1,230 +0,0 @@ -package generator - -import ( - "bytes" - "fmt" - "go/ast" - "go/format" - "go/parser" - "go/token" - "io/ioutil" - "os" - "path/filepath" - "strings" - - "github.com/jenkins-x/jx-logging/v3/pkg/log" - - "github.com/jenkins-x/jx-api/cmd/codegen/util" - "github.com/pkg/errors" - "golang.org/x/tools/go/ast/astutil" -) - -const ( - basePath = "k8s.io/code-generator/cmd" - defaultVersion = "kubernetes-1.11.3" -) - -var ( - // AllGenerators is a list of all the generators provide by kubernetes code-generator - allGenerators = map[string]string{ - "clientset": "client-gen", - "defaulter": "defaulter-gen", - "listers": "lister-gen", - "informers": "informer-gen", - "deepcopy": "deepcopy-gen", - } -) - -// InstallCodeGenerators installs client-gen from the kubernetes-incubator/reference-docs repository. -func InstallCodeGenerators(version string, gopath string) error { - if version == "" { - version = defaultVersion - } - path := fmt.Sprintf("%s/...", basePath) - log.Logger().Infof("installing %s version %s into %s", path, version, gopath) - err := util.GoGet(path, version, gopath, true, false, false) - if err != nil { - return err - } - - return nil -} - -// GenerateClient runs the generators specified. It looks at the specified groupsWithVersions in inputPackage and generates to outputPackage ( -//// relative to the module outputBase). A boilerplateFile is written to the top of any generated files. -func GenerateClient(generators []string, groupsWithVersions []string, inputPackage string, outputPackage string, - relativePackage string, outputBase string, boilerplateFile string, gopath string, semVer string) error { - for _, generatorName := range generators { - if generator, ok := allGenerators[generatorName]; ok { - switch generatorName { - case "clientset": - err := generateWithOutputPackage(generator, - generatorName, - groupsWithVersions, - inputPackage, - outputPackage, - outputBase, - boilerplateFile, - gopath, - "--clientset-name", - "versioned") - if err != nil { - return err - } - if semVer != "" { - oldPkg := filepath.Join(outputPackage, generatorName) - csDir := filepath.Join(outputBase, oldPkg) - svPkg := strings.ReplaceAll(oldPkg, fmt.Sprintf("/%s", relativePackage), fmt.Sprintf("/%s/%s", semVer, relativePackage)) - err = fixClientImportsForSemVer(csDir, oldPkg, svPkg) - if err != nil { - return errors.Wrapf(err, "updating clientset imports for semver") - } - } - case "deepcopy": - err := defaultGenerate(generator, - generatorName, - groupsWithVersions, - inputPackage, - outputPackage, - outputBase, - boilerplateFile, - gopath, - "-O", - "zz_generated.deepcopy", - "--bounding-dirs", - inputPackage) - if err != nil { - return err - } - // If we have a semver, copy the semver's pkg directory contents to the normal pkg and delete the semver directory - if semVer != "" { - wd, err := os.Getwd() - if err != nil { - return errors.Wrapf(err, "getting working directory") - } - pkgs, err := packagesForGroupsWithVersions(inputPackage, groupsWithVersions) - if err != nil { - return err - } - for _, p := range pkgs { - svFile := filepath.Join(outputBase, inputPackage, p, "zz_generated.deepcopy.go") - pkgFile := strings.ReplaceAll(svFile, fmt.Sprintf("/%s/", semVer), "/") - exists, err := util.FileExists(svFile) - if err != nil { - return errors.Wrapf(err, "checking if file %s exists", svFile) - } - if exists { - err = util.CopyFile(svFile, pkgFile) - if err != nil { - return errors.Wrapf(err, "copying %s to %s", svFile, pkgFile) - } - } - } - err = os.RemoveAll(filepath.Join(wd, semVer)) - if err != nil { - return err - } - } - case "informers": - basePkg := outputPackage - if semVer != "" { - basePkg = strings.ReplaceAll(basePkg, fmt.Sprintf("/%s", relativePackage), fmt.Sprintf("/%s/%s", semVer, relativePackage)) - } - err := generateWithOutputPackage(generator, - generatorName, - groupsWithVersions, - inputPackage, - outputPackage, - outputBase, - boilerplateFile, - gopath, - "--versioned-clientset-package", - fmt.Sprintf("%s/clientset/versioned", basePkg), - "--listers-package", - fmt.Sprintf("%s/listers", basePkg)) - if err != nil { - return err - } - if semVer != "" { - oldPkg := filepath.Join(outputPackage, generatorName) - infDir := filepath.Join(outputBase, oldPkg) - svPkg := strings.ReplaceAll(oldPkg, fmt.Sprintf("/%s", relativePackage), fmt.Sprintf("/%s/%s", semVer, relativePackage)) - err = fixClientImportsForSemVer(infDir, oldPkg, svPkg) - if err != nil { - return errors.Wrapf(err, "updating informer imports for semver") - } - } - default: - err := generateWithOutputPackage(generator, generatorName, groupsWithVersions, inputPackage, - outputPackage, outputBase, boilerplateFile, gopath) - if err != nil { - return err - } - } - } else { - return errors.Errorf("no generator %s available", generatorName) - } - } - return nil -} - -// GetBoilerplateFile is responsible for canonicalizing the name of the boilerplate file -func GetBoilerplateFile(fileName string) (string, error) { - if fileName != "" { - if _, err := os.Stat(fileName); err != nil && !os.IsNotExist(err) { - return "", errors.Wrapf(err, "error reading boilerplate file %s", fileName) - } else if err == nil { - abs, err := filepath.Abs(fileName) - if err == nil { - fileName = abs - } else { - log.Logger().Errorf("error converting %s to absolute path so leaving as is %v", fileName, err) - } - } - } - return fileName, nil -} - -func generateWithOutputPackage(generator string, name string, groupsWithVersions []string, - inputPackage string, outputPackage string, outputBase string, boilerplateFile string, gopath string, args ...string) error { - args = append(args, "--output-package", fmt.Sprintf("%s/%s", outputPackage, name)) - return defaultGenerate(generator, name, groupsWithVersions, inputPackage, outputPackage, outputBase, - boilerplateFile, gopath, args...) -} - -func fixClientImportsForSemVer(clientDir string, oldPackage string, semVerPackage string) error { - return filepath.Walk(clientDir, func(path string, info os.FileInfo, err error) error { - if strings.HasSuffix(path, ".go") { - fs := token.NewFileSet() - f, err := parser.ParseFile(fs, path, nil, parser.ParseComments) - if err != nil { - return errors.Wrapf(err, "parsing %s", path) - } - importsToReplace := make(map[string]string) - - for _, imp := range f.Imports { - existingImp := strings.Replace(imp.Path.Value, `"`, ``, 2) - if strings.HasPrefix(existingImp, oldPackage) { - importsToReplace[existingImp] = strings.ReplaceAll(existingImp, oldPackage, semVerPackage) - } - } - if len(importsToReplace) > 0 { - for oldPkg, newPkg := range importsToReplace { - astutil.RewriteImport(fs, f, oldPkg, newPkg) - } - // Sort the imports - ast.SortImports(fs, f) - var buf bytes.Buffer - err = format.Node(&buf, fs, f) - if err != nil { - return errors.Wrapf(err, "convert AST to []byte for %s", path) - } - err = ioutil.WriteFile(path, buf.Bytes(), 0600) - if err != nil { - return errors.Wrapf(err, "writing %s", path) - } - } - } - return nil - }) -} diff --git a/cmd/codegen/generator/common.go b/cmd/codegen/generator/common.go deleted file mode 100644 index 580d721..0000000 --- a/cmd/codegen/generator/common.go +++ /dev/null @@ -1,68 +0,0 @@ -package generator - -import ( - "fmt" - "path/filepath" - "strings" - - "github.com/jenkins-x/jx-logging/v3/pkg/log" - - "github.com/jenkins-x/jx-api/cmd/codegen/util" - "github.com/pkg/errors" -) - -func defaultGenerate(generator string, name string, groupsWithVersions []string, inputPackage string, - outputPackage string, outputBase string, boilerplateFile string, gopath string, args ...string) error { - log.Logger().Infof("generating %s structs for %s at %s\n", name, groupsWithVersions, outputPackage) - - generateCommand := util.Command{ - Name: filepath.Join(util.GoPathBin(gopath), generator), - Args: []string{ - "--output-base", - outputBase, - "--go-header-file", - boilerplateFile, - }, - Env: map[string]string{ - "GO111MODULE": "on", - }, - } - if name == "clientset" { - inputDirs := make([]string, 0) - for _, gv := range groupsWithVersions { - groupVersion := strings.Split(gv, ":") - if len(groupVersion) != 2 { - return errors.Errorf("argument %s must be like cheese:v1", gv) - } - inputDirs = append(inputDirs, fmt.Sprintf("%s/%s", groupVersion[0], groupVersion[1])) - } - inputDirsStr := strings.Join(inputDirs, ",") - generateCommand.Args = append(generateCommand.Args, "--input", inputDirsStr, "--input-base", inputPackage) - } else { - inputDirs, err := packagesForGroupsWithVersions(inputPackage, groupsWithVersions) - if err != nil { - return err - } - inputDirsStr := strings.Join(inputDirs, ",") - generateCommand.Args = append(generateCommand.Args, "--input-dirs", inputDirsStr) - } - generateCommand.Args = append(generateCommand.Args, args...) - - out, err := generateCommand.RunWithoutRetry() - if err != nil { - return errors.Wrapf(err, "running %s, output %s", generateCommand.String(), out) - } - return nil -} - -func packagesForGroupsWithVersions(inputPackage string, groupsWithVersions []string) ([]string, error) { - inputDirs := make([]string, 0) - for _, gv := range groupsWithVersions { - groupVersion := strings.Split(gv, ":") - if len(groupVersion) != 2 { - return nil, errors.Errorf("argument %s must be like cheese:v1", gv) - } - inputDirs = append(inputDirs, fmt.Sprintf("%s/%s/%s", inputPackage, groupVersion[0], groupVersion[1])) - } - return inputDirs, nil -} diff --git a/cmd/codegen/generator/docs.go b/cmd/codegen/generator/docs.go deleted file mode 100644 index e4c8edd..0000000 --- a/cmd/codegen/generator/docs.go +++ /dev/null @@ -1,147 +0,0 @@ -package generator - -import ( - "os" - "path/filepath" - - "github.com/jenkins-x/jx-logging/v3/pkg/log" - - "github.com/jenkins-x/jx-api/cmd/codegen/util" - "github.com/pkg/errors" -) - -const ( - genAPIDocsRepo = "github.com/kubernetes-incubator/reference-docs" - genAPIDocsBin = genAPIDocsRepo + "/gen-apidocs" -) - -// InstallGenAPIDocs installs the gen-apidocs tool from the kubernetes-incubator/reference-docs repository. -func InstallGenAPIDocs(version string, gopath string) error { - log.Logger().Infof("installing %s in version %s via 'go get'", genAPIDocsRepo, version) - err := util.GoGet(genAPIDocsRepo, version, gopath, true, false, true) - if err != nil { - return err - } - log.Logger().Infof("installing %s in version %s via 'go get'", genAPIDocsBin, version) - err = util.GoGet(genAPIDocsBin, version, gopath, true, false, true) - if err != nil { - return err - } - - return nil -} - -// DetermineSourceLocation determines the source location for the installed kubernetes-incubator/reference-docs/ -// The location is based on GOPATH/pkd/mod and the current version. -func DetermineSourceLocation(moduleDir string, gopath string) (string, error) { - moduleDir, err := util.GetModuleDir(moduleDir, genAPIDocsRepo, gopath) - if err != nil { - return "", errors.Wrapf(err, "Unable to determine source directory for %s", genAPIDocsRepo) - } - return moduleDir, nil -} - -// GenerateAPIDocs runs the apidocs-gen tool against configDirectory which includes the openapi-spec dir, -// the config.yaml file, static content and the static_includes -func GenerateAPIDocs(configDir string, gopath string) error { - includesDir := filepath.Join(configDir, "includes") - err := util.DeleteDirContents(includesDir) - if err != nil { - return errors.Wrapf(err, "deleting contents of %s", includesDir) - } - buildDir := filepath.Join(configDir, "build") - err = util.DeleteDirContents(buildDir) - if err != nil { - return errors.Wrapf(err, "deleting contents of %s", buildDir) - } - cmd := util.Command{ - Dir: configDir, - Name: filepath.Join(util.GoPathBin(gopath), "gen-apidocs"), - Args: []string{ - "--config-dir", - configDir, - "--munge-groups", - "false", - }, - } - out, err := cmd.RunWithoutRetry() - if err != nil { - return errors.Wrapf(err, "running %s, output %s", cmd.String(), out) - } - log.Logger().Debugf("running %s\n", cmd.String()) - log.Logger().Debug(out) - return nil -} - -// AssembleAPIDocsStatic copies the static files from the referenceDocsRepo to the outputDir. -// It also downloads from CDN jquery and bootstrap js -func AssembleAPIDocsStatic(referenceDocsRepo string, outputDir string) error { - srcDir := filepath.Join(referenceDocsRepo, "gen-apidocs", "generators", "static") - outDir := filepath.Join(outputDir, "static") - log.Logger().Infof("copying static files from %s to %s\n", srcDir, outDir) - err := util.CopyDirPreserve(srcDir, outDir) - if err != nil { - return errors.Wrapf(err, "copying %s to %s", srcDir, outDir) - } - err = util.DownloadFile(filepath.Join(outDir, bootstrapJsFileName), bootstrapJsUrl) - if err != nil { - return err - } - err = util.DownloadFile(filepath.Join(outDir, jqueryFileName), jqueryUrl) - if err != nil { - return err - } - return nil -} - -// AssembleAPIDocs copies the generated html files and the static files from srcDir into outputDir -func AssembleAPIDocs(srcDir string, outputDir string) error { - // Clean the dir - err := util.DeleteDirContents(outputDir) - if err != nil { - return errors.Wrapf(err, "deleting contents of %s", outputDir) - } - // Copy the fonts over - err = copyStaticFiles(filepath.Join(srcDir, "static"), filepath.Join(outputDir, "fonts"), fonts) - if err != nil { - return err - } - // Copy the css over - err = copyStaticFiles(filepath.Join(srcDir, "static"), filepath.Join(outputDir, "css"), css) - if err != nil { - return err - } - // Copy the static jsroot over - err = copyStaticFiles(filepath.Join(srcDir, "static"), filepath.Join(outputDir, ""), jsroot) - if err != nil { - return err - } - - // Copy the static js over - err = copyStaticFiles(filepath.Join(srcDir, "static"), filepath.Join(outputDir, "js"), js) - if err != nil { - return err - } - // Copy the generated files over - err = copyStaticFiles(filepath.Join(srcDir, "build"), filepath.Join(outputDir, ""), build) - if err != nil { - return err - } - return nil -} - -func copyStaticFiles(srcDir string, outputDir string, resources []string) error { - err := os.MkdirAll(outputDir, 0700) - if err != nil { - return errors.Wrapf(err, "making %s", outputDir) - } - for _, resource := range resources { - srcPath := filepath.Join(srcDir, resource) - dstPath := filepath.Join(outputDir, resource) - err := util.CopyFile(srcPath, dstPath) - if err != nil { - return errors.Wrapf(err, "copying %s to %s", srcPath, dstPath) - } - } - return nil -} diff --git a/cmd/codegen/generator/open_api.go b/cmd/codegen/generator/open_api.go deleted file mode 100644 index 29fc8e6..0000000 --- a/cmd/codegen/generator/open_api.go +++ /dev/null @@ -1,595 +0,0 @@ -package generator - -import ( - "bytes" - "encoding/json" - "fmt" - "go/ast" - "go/format" - "go/parser" - "go/token" - "html/template" - "io/ioutil" - "os" - "path/filepath" - "strconv" - "strings" - - "github.com/jenkins-x/jx-logging/v3/pkg/log" - - "github.com/jenkins-x/jx-api/cmd/codegen/util" - - "github.com/ghodss/yaml" - - "k8s.io/kube-openapi/pkg/builder" - - "k8s.io/kube-openapi/pkg/common" - - "github.com/go-openapi/spec" - "github.com/pkg/errors" -) - -const ( - openapiTemplateSrc = `// +build !ignore_autogenerated - -// Code generated by jx create client. DO NOT EDIT. -package openapi - -import ( - openapicore "{{ $.Path }}" - {{ range $i, $path := $.Dependents }} - openapi{{ $i }} "{{ $path }}" - {{ end }} - "k8s.io/kube-openapi/pkg/common" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - result := make(map[string]common.OpenAPIDefinition) - // This is our core openapi definitions (the ones for this module) - for k, v := range openapicore.GetOpenAPIDefinitions(ref) { - result[k] = v - } - // These are the ones we depend on - {{ range $i, $path := $.Dependents }} - for k, v := range openapi{{ $i}}.GetOpenAPIDefinitions(ref) { - result[k] = v - } - {{ end }} - return result -} - -func GetNames(ref common.ReferenceCallback) []string { - result := make([]string, 0) - for k, _ := range openapicore.GetOpenAPIDefinitions(ref) { - result = append(result, k) - } - return result -} -` - - schemaWriterTemplateSrc = `package main - -import ( - "flag" - "os" - "strings" - - openapi "{{ $.AllImportPath }}" - - "github.com/go-openapi/spec" - - "github.com/pkg/errors" - - "github.com/jenkins-x/jx-api/cmd/codegen/generator" -) - -func main() { - var outputDir, namesStr, title, version string - flag.StringVar(&outputDir, "output-directory", "", "directory to write generated files to") - flag.StringVar(&namesStr, "names", "", "comma separated list of resources to generate schema for, "+ - "if empty all resources will be generated") - flag.StringVar(&title, "title", "", "title for OpenAPI and HTML generated docs") - flag.StringVar(&version, "version", "", "version for OpenAPI and HTML generated docs") - flag.Parse() - if outputDir == "" { - panic(errors.New("--output-directory cannot be empty")) - } - var names []string - if namesStr != "" { - names = strings.Split(namesStr, ",") - } else { - refCallback := func(path string) spec.Ref { - return spec.Ref{} - } - names = openapi.GetNames(refCallback) - } - err := generator.WriteSchemaToDisk(outputDir, title, version, openapi.GetOpenAPIDefinitions, names) - if err != nil { - panic(errors.Wrapf(err, "writing schema to %s", outputDir)) - } - os.Exit(0) -} -` - OpenApiDir = "openapi" - SchemaWriterSrcFileName = "schema_writer_generated.go" - OpenApiV2JSON = "openapiv2.json" - OpenApiV2YAML = "openapiv2.yaml" - openApiGenerator = "openapi-gen" - - bootstrapJsUrl = "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" - bootstrapJsFileName = "bootstrap-3.3.7.min.js" - jqueryUrl = "https://code.jquery.com/jquery-3.2.1.min.js" - jqueryFileName = "jquery-3.2.1.min.js" - - openApiGen = "k8s.io/kube-openapi/cmd/openapi-gen" -) - -var ( - fonts = []string{ - "FontAwesome.otf", - "fontawesome-webfont.eot", - "fontawesome-webfont.svg", - "fontawesome-webfont.ttf", - "fontawesome-webfont.woff", - "fontawesome-webfont.woff2", - } - - css = []string{ - "stylesheet.css", - "bootstrap.min.css", - "font-awesome.min.css", - } - - js = []string{ - "jquery-3.2.1.min.js", - "bootstrap-3.3.7.min.js", - } - - jsroot = []string{ - "scroll.js", - "jquery.scrollTo.min.js", - } - - build = []string{ - "index.html", - "navData.js", - } -) - -type openapiTemplateData struct { - Dependents []string - Path string -} - -type schemaWriterTemplateData struct { - AllImportPath string -} - -// InstallOpenApiGen installs the openapi-gen tool from the github.com/kubernetes/kube-openapi repository. -func InstallOpenApiGen(version string, gopath string) error { - log.Logger().Infof("installing %s with version %s via 'go get' to %s", openApiGen, version, gopath) - err := util.GoGet(openApiGen, version, gopath, true, false, false) - if err != nil { - return err - } - - return nil -} - -// GenerateOpenApi generates the OpenAPI structs and schema files. -// It looks at the specified groupsWithVersions in inputPackage and generates to outputPackage ( -// relative to the module outputBase). Any openApiDependencies also have OpenAPI structs generated. -// A boilerplateFile is written to the top of any generated files. -// The gitter client is used to ensure the correct versions of dependencies are loaded. -func GenerateOpenApi(groupsWithVersions []string, inputPackage string, outputPackage string, relativePackage string, - outputBase string, openApiDependencies []string, moduleDir string, moduleName string, boilerplateFile string, gopath string, semVer string) error { - basePkg := fmt.Sprintf("%s/openapi", outputPackage) - corePkg := fmt.Sprintf("%s/core", basePkg) - allPkg := fmt.Sprintf("%s/all", basePkg) - - // Generate the dependent openapi structs as these are missing from the k8s client - dependentPackages, err := generateOpenApiDependenciesStruct(outputPackage, relativePackage, outputBase, - openApiDependencies, moduleDir, moduleName, boilerplateFile, gopath) - if err != nil { - return err - } - // Generate the main openapi struct - err = defaultGenerate(openApiGenerator, "openapi", groupsWithVersions, inputPackage, - corePkg, outputBase, boilerplateFile, gopath, "--output-package", corePkg) - if err != nil { - return err - } - _, err = writeOpenApiAll(outputBase, allPkg, corePkg, dependentPackages, semVer) - if err != nil { - return err - } - _, err = writeSchemaWriterToDisk(outputBase, basePkg, allPkg, semVer) - if err != nil { - return err - } - return nil -} - -// writeOpenApiAll code generates a file in openapi/all that reads in all the generated openapi structs and puts them -// in a single map, allowing them to be used by the schema writer and the CRD registration. -// baseDir is the root of the module, outputPackage is the base path of the output package, -// path is the path to the core openapi package (those that are generated for module the generator is run against), -// and dependents is the paths to the dependent openapi packages -func writeOpenApiAll(baseDir string, outputPackage string, path string, dependents []string, semVer string) (string, - error) { - tmpl, err := template.New("openapi").Parse(openapiTemplateSrc) - if err != nil { - return "", errors.Wrapf(err, "parsing template for openapi_generated.go") - } - outputDir := filepath.Join(baseDir, outputPackage) - err = os.MkdirAll(outputDir, 0700) - if err != nil { - return "", errors.Wrapf(err, "creating directory %s", outputDir) - } - outFilePath := filepath.Join(outputDir, "openapi_generated.go") - outFile, err := os.Create(outFilePath) - if err != nil { - return "", errors.Wrapf(err, "creating file %s", outFilePath) - } - data := &openapiTemplateData{ - Path: path, - Dependents: dependents, - } - if semVer != "" { - data.Path = strings.ReplaceAll(path, "/pkg/", fmt.Sprintf("/%s/pkg/", semVer)) - data.Dependents = []string{} - for _, d := range dependents { - data.Dependents = append(data.Dependents, strings.ReplaceAll(d, "/pkg/", fmt.Sprintf("/%s/pkg/", semVer))) - } - } - err = tmpl.Execute(outFile, data) - defer func() { - err := outFile.Close() - if err != nil { - log.Logger().Errorf("error closing %s %v\n", outFilePath, err) - } - }() - if err != nil { - return "", errors.Wrapf(err, "templating %s", outFilePath) - } - return outputPackage, nil -} - -// writeSchemaWriterToDisk code generates a simple main function that can be called to write the contents of all the -// OpenAPI structs out to JSON and YAML. It's implemented like this to allow us to automatically call the schema -// writer without requiring the user to write a command themselves. baseDir is the path to the module, -// outputPackage is the path to the outputPacakge for the code generator, -// and allImportPath is the path to the package where the generated map of all the structs is -func writeSchemaWriterToDisk(baseDir string, outputPackage string, allImportPath string, semVer string) (string, error) { - tmpl, err := template.New("schema_writer").Parse(schemaWriterTemplateSrc) - if err != nil { - return "", errors.Wrapf(err, "parsing template for %s", SchemaWriterSrcFileName) - } - outputDir := filepath.Join(baseDir, outputPackage) - err = os.MkdirAll(outputDir, 0700) - if err != nil { - return "", errors.Wrapf(err, "creating directory %s", outputDir) - } - outFilePath := filepath.Join(outputDir, SchemaWriterSrcFileName) - outFile, err := os.Create(outFilePath) - if err != nil { - return "", errors.Wrapf(err, "creating file %s", outFilePath) - } - data := &schemaWriterTemplateData{ - AllImportPath: allImportPath, - } - if semVer != "" { - data.AllImportPath = strings.ReplaceAll(allImportPath, "/pkg/", fmt.Sprintf("/%s/pkg/", semVer)) - } - err = tmpl.Execute(outFile, data) - defer func() { - err := outFile.Close() - if err != nil { - log.Logger().Errorf("error closing %s %v\n", outFilePath, err) - } - }() - if err != nil { - return "", errors.Wrapf(err, "templating %s", outFilePath) - } - return outputPackage, nil -} - -// WriteSchemaToDisk is called by the code generated main function to marshal the contents of the OpenAPI structs and -// write them to disk. outputDir is the dir to write the json and yaml files to, -// you can also provide the title and version for the OpenAPI spec. -// definitions is the function that returns all the openapi definitions. -// WriteSchemaToDisk will rewrite the definitions to a dot-separated notation, reversing the initial domain name -func WriteSchemaToDisk(outputDir string, title string, version string, definitions common.GetOpenAPIDefinitions, - names []string) error { - err := os.MkdirAll(outputDir, 0700) - if err != nil { - return errors.Wrapf(err, "creating --output-directory %s", outputDir) - } - config := common.Config{ - Info: &spec.Info{ - InfoProps: spec.InfoProps{ - Version: version, - Title: title, - }, - }, - GetDefinitions: definitions, - GetDefinitionName: func(name string) (string, spec.Extensions) { - // For example "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.AppSpec" - parts := strings.Split(name, "/") - if len(parts) < 3 { - // Can't do anything with it, return raw - return name, nil - } - var result []string - for i, part := range parts { - // handle the domain at the start of the package - if i == 0 { - subparts := strings.Split(part, ".") - for j := len(subparts) - 1; j >= 0; j-- { - result = append(result, subparts[j]) - } - } else if i < len(parts)-1 { - // The docs generator can't handle a dot in the group name, so we remove it - result = append(result, strings.Replace(part, ".", "_", -1)) - } else { - result = append(result, part) - } - } - return strings.Join(result, "."), nil - }, - } - - spec, err := builder.BuildOpenAPIDefinitionsForResources(&config, names...) - if err != nil { - return errors.Wrapf(err, "building openapi definitions for %s", names) - } - bytes, err := json.Marshal(spec) - if err != nil { - return errors.Wrapf(err, "marshaling openapi definitions to json for %s", names) - } - outFile := filepath.Join(outputDir, OpenApiV2JSON) - err = ioutil.WriteFile(outFile, bytes, 0600) - if err != nil { - return errors.Wrapf(err, "writing openapi definitions for %s to %s", names, outFile) - } - return nil -} - -func packageToDirName(pkg string) string { - str := strings.Join(strings.Split(pkg, "/"), "_") - str = strings.Join(strings.Split(str, "."), "_") - return str -} - -// GenerateSchema calls the generated schema writer and then loads the output and also writes out a yaml version. The -// outputDir is the base directory for writing the schemas to (they get put in the openapi-spec subdir), -// inputPackage is the package in which generated code lives, inputBase is the path to the module, -// title and version are used in the OpenAPI spec files. -func GenerateSchema(outputDir string, inputPackage string, inputBase string, title string, version string, gopath string) error { - schemaWriterSrc := filepath.Join(inputPackage, OpenApiDir, SchemaWriterSrcFileName) - schemaWriterBinary, err := ioutil.TempFile("", "") - outputDir = filepath.Join(outputDir, "openapi-spec") - defer func() { - err := util.DeleteFile(schemaWriterBinary.Name()) - if err != nil { - log.Logger().Warnf("error cleaning up tempfile %s created to compile %s to %v", - schemaWriterBinary.Name(), SchemaWriterSrcFileName, err) - } - }() - if err != nil { - return errors.Wrapf(err, "creating tempfile to compile %s to %v", SchemaWriterSrcFileName, err) - } - cmd := util.Command{ - Dir: inputBase, - Name: "go", - Args: []string{ - "build", - "-o", - schemaWriterBinary.Name(), - schemaWriterSrc, - }, - Env: map[string]string{ - "GO111MODULE": "on", - "GOPATH": gopath, - }, - } - out, err := cmd.RunWithoutRetry() - if err != nil { - return errors.Wrapf(err, "running %s, output %s", cmd.String(), out) - } - fileJSON := filepath.Join(outputDir, OpenApiV2JSON) - fileYAML := filepath.Join(outputDir, OpenApiV2YAML) - cmd = util.Command{ - Name: schemaWriterBinary.Name(), - Args: []string{ - "--output-directory", - outputDir, - "--title", - title, - "--version", - version, - }, - } - out, err = cmd.RunWithoutRetry() - if err != nil { - return errors.Wrapf(err, "running %s, output %s", cmd.String(), out) - } - // Convert to YAML as well - bytes, err := ioutil.ReadFile(fileJSON) - if err != nil { - return errors.Wrapf(err, "reading %s", fileJSON) - } - yamlBytes, err := yaml.JSONToYAML(bytes) - if err != nil { - return errors.Wrapf(err, "converting %s to yaml", fileJSON) - } - err = ioutil.WriteFile(fileYAML, yamlBytes, 0600) - if err != nil { - return errors.Wrapf(err, "writing %s", fileYAML) - } - return nil -} - -func getOutputPackageForOpenApi(pkg string, groupWithVersion []string, outputPackage string) (string, error) { - if len(groupWithVersion) != 2 { - return "", errors.Errorf("groupWithVersion must be of length 2 but is %s", groupWithVersion) - } - version := groupWithVersion[1] - if version == "" { - version = "unversioned" - } - return filepath.Join(outputPackage, "openapi", fmt.Sprintf("%s_%s_%s", toValidPackageName(packageToDirName(pkg)), - toValidPackageName(groupWithVersion[0]), - toValidPackageName(version))), nil -} - -func toValidPackageName(pkg string) string { - return strings.Replace(strings.Replace(pkg, "-", "_", -1), ".", "_", -1) -} - -func generateOpenApiDependenciesStruct(outputPackage string, relativePackage string, outputBase string, - openApiDependencies []string, moduleDir string, moduleName string, boilerplateFile string, gopath string) ([]string, error) { - paths := make([]string, 0) - modulesRequirements, err := util.GetModuleRequirements(moduleDir, gopath) - if err != nil { - return nil, errors.Wrapf(err, "getting module requirements for %s", moduleDir) - } - for _, d := range openApiDependencies { - outputPackage, err := generate(d, outputPackage, relativePackage, outputBase, moduleName, boilerplateFile, gopath, modulesRequirements) - if err != nil { - return nil, errors.Wrapf(err, "generating open api dependency %s", d) - } - paths = append(paths, outputPackage) - } - return paths, nil -} - -func generate(d string, outputPackage string, relativePackage string, outputBase string, moduleName string, boilerplateFile string, gopath string, modulesRequirements map[string]map[string]string) (string, error) { - // First, make sure we have the right files in our .jx GOPATH - // Use go mod to find out the dependencyVersion for our main tree - ds := strings.Split(d, ":") - if len(ds) != 4 { - return "", errors.Errorf("--open-api-dependency %s must be of the format path:package:group"+ - ":apiVersion", d) - } - path := ds[0] - pkg := ds[1] - group := ds[2] - version := ds[3] - groupsWithVersions := []string{ - fmt.Sprintf("%s:%s", group, version), - } - modules := false - if strings.Contains(path, "?modules") { - path = strings.TrimSuffix(path, "?modules") - modules = true - } - - dependencyVersion := "master" - if moduleRequirement, ok := modulesRequirements[moduleName]; !ok { - log.Logger().Warnf("unable to find module requirement for %s, please add it to your go.mod, "+ - "for now using HEAD of the master branch", moduleName) - } else { - if requirementVersion, ok := moduleRequirement[path]; !ok { - log.Logger().Warnf("unable to find module requirement version for %s (module %s), "+ - "please add it to your go.mod, "+ - "for now using HEAD of the master branch", path, moduleName) - } else { - dependencyVersion = requirementVersion - } - } - - if strings.HasPrefix(dependencyVersion, "v0.0.0-") { - parts := strings.Split(dependencyVersion, "-") - if len(parts) != 3 { - return "", errors.Errorf("unable to parse dependencyVersion %s", dependencyVersion) - } - // this is the sha - dependencyVersion = parts[2] - } - err := util.GoGet(path, dependencyVersion, gopath, modules, true, true) - if err != nil { - return "", errors.WithStack(err) - } - // Now we can run the generator against it - generator := openApiGenerator - modifiedOutputPackage, err := getOutputPackageForOpenApi(path, []string{group, version}, outputPackage) - if err != nil { - return "", errors.Wrapf(err, "getting filename for openapi structs for %s", d) - } - err = defaultGenerate(generator, - "openapi", - groupsWithVersions, - filepath.Join(path, pkg), - modifiedOutputPackage, - outputBase, - boilerplateFile, - gopath, - "--output-package", - modifiedOutputPackage) - if err != nil { - return "", errors.WithStack(err) - } - relativeOutputPackage, err := getOutputPackageForOpenApi(path, []string{group, version}, relativePackage) - if err != nil { - return "", errors.Wrapf(err, "getting filename for openapi structs for %s", d) - } - // the generator forgets to add the spec import in some cases - generatedFile := filepath.Join(relativeOutputPackage, "openapi_generated.go") - fs := token.NewFileSet() - f, err := parser.ParseFile(fs, generatedFile, nil, parser.ParseComments) - if err != nil { - return "", errors.Wrapf(err, "parsing %s", generatedFile) - } - found := false - for _, imp := range f.Imports { - if strings.Trim(imp.Path.Value, "\"") == "github.com/go-openapi/spec" { - found = true - break - } - } - if !found { - // Add the imports - for i := 0; i < len(f.Decls); i++ { - d := f.Decls[i] - - switch d.(type) { - case *ast.FuncDecl: - // No action - case *ast.GenDecl: - dd := d.(*ast.GenDecl) - - // IMPORT Declarations - if dd.Tok == token.IMPORT { - // Add the new import - iSpec := &ast.ImportSpec{Path: &ast.BasicLit{Value: strconv.Quote("github.com/go-openapi/spec")}} - dd.Specs = append(dd.Specs, iSpec) - } - } - } - - // Sort the imports - ast.SortImports(fs, f) - var buf bytes.Buffer - err = format.Node(&buf, fs, f) - if err != nil { - return "", errors.Wrapf(err, "convert AST to []byte for %s", generatedFile) - } - // Manually add new lines after build tags - lines := strings.Split(string(buf.Bytes()), "\n") - buf.Reset() - for _, line := range lines { - buf.WriteString(line) - buf.WriteString("\r\n") - if strings.HasPrefix(line, "// +") { - buf.WriteString("\r\n") - } - } - - err = ioutil.WriteFile(generatedFile, buf.Bytes(), 0600) - if err != nil { - return "", errors.Wrapf(err, "writing %s", generatedFile) - } - } - return modifiedOutputPackage, nil -} diff --git a/cmd/codegen/util/cli.go b/cmd/codegen/util/cli.go deleted file mode 100644 index 52c2ef7..0000000 --- a/cmd/codegen/util/cli.go +++ /dev/null @@ -1,58 +0,0 @@ -package util - -import ( - "fmt" - "os" - "strings" -) - -const ( - // DefaultErrorExitCode is the default exit code in case of an error - DefaultErrorExitCode = 1 -) - -var ( - fatalErrHandler = fatal - // ErrExit can be used to exit with a non 0 exit code without any error message - ErrExit = fmt.Errorf("exit") -) - -// InvalidOptionf returns an error that shows the invalid option. -func InvalidOptionf(option string, value interface{}, message string, a ...interface{}) error { - text := fmt.Sprintf(message, a...) - return fmt.Errorf("invalid option: --%s %v\n%s", option, value, text) -} - -// MissingOption reports a missing command line option using the full name expression. -func MissingOption(name string) error { - return fmt.Errorf("missing option: --%s", name) -} - -// CheckErr prints a user friendly error to STDERR and exits with a non-zero exit code. -func CheckErr(err error) { - checkErr(err, fatalErrHandler) -} - -// checkErr formats a given error as a string and calls the passed handleErr func. -func checkErr(err error, handleErr func(string, int)) { - switch { - case err == nil: - return - case err == ErrExit: - handleErr("", DefaultErrorExitCode) - return - default: - handleErr(err.Error(), DefaultErrorExitCode) - } -} - -func fatal(msg string, code int) { - if len(msg) > 0 { - // add newline if needed - if !strings.HasSuffix(msg, "\n") { - msg += "\n" - } - fmt.Fprint(os.Stderr, msg) - } - os.Exit(code) -} diff --git a/cmd/codegen/util/commands.go b/cmd/codegen/util/commands.go deleted file mode 100644 index 79fa826..0000000 --- a/cmd/codegen/util/commands.go +++ /dev/null @@ -1,244 +0,0 @@ -package util - -import ( - "fmt" - "io" - "os" - "os/exec" - "strings" - "time" - - "github.com/jenkins-x/jx-logging/v3/pkg/log" - - "github.com/cenkalti/backoff" -) - -// Command is a struct containing the details of an external command to be executed -type Command struct { - attempts int - Errors []error - Dir string - Name string - Args []string - ExponentialBackOff *backoff.ExponentialBackOff - Timeout time.Duration - Out io.Writer - Err io.Writer - Env map[string]string -} - -// CommandError is the error object encapsulating an error from a Command -type CommandError struct { - Command Command - Output string - cause error -} - -func (c CommandError) Error() string { - // sanitise any password arguments before printing the error string. The actual sensitive argument is still present - // in the Command object - sanitisedArgs := make([]string, len(c.Command.Args)) - copy(sanitisedArgs, c.Command.Args) - for i, arg := range sanitisedArgs { - if strings.Contains(strings.ToLower(arg), "password") && i < len(sanitisedArgs)-1 { - // sanitise the subsequent argument to any 'password' fields - sanitisedArgs[i+1] = "*****" - } - } - - return fmt.Sprintf("failed to run '%s %s' command in directory '%s', output: '%s'", - c.Command.Name, strings.Join(sanitisedArgs, " "), c.Command.Dir, c.Output) -} - -// SetName Setter method for Name to enable use of interface instead of Command struct -func (c *Command) SetName(name string) { - c.Name = name -} - -// CurrentName returns the current name of the command -func (c *Command) CurrentName() string { - return c.Name -} - -// SetDir Setter method for Dir to enable use of interface instead of Command struct -func (c *Command) SetDir(dir string) { - c.Dir = dir -} - -// CurrentDir returns the current Dir -func (c *Command) CurrentDir() string { - return c.Dir -} - -// SetArgs Setter method for Args to enable use of interface instead of Command struct -func (c *Command) SetArgs(args []string) { - c.Args = args -} - -// CurrentArgs returns the current command arguments -func (c *Command) CurrentArgs() []string { - return c.Args -} - -// SetTimeout Setter method for Timeout to enable use of interface instead of Command struct -func (c *Command) SetTimeout(timeout time.Duration) { - c.Timeout = timeout -} - -// SetExponentialBackOff Setter method for ExponentialBackOff to enable use of interface instead of Command struct -func (c *Command) SetExponentialBackOff(backoff *backoff.ExponentialBackOff) { - c.ExponentialBackOff = backoff -} - -// SetEnv Setter method for Env to enable use of interface instead of Command struct -func (c *Command) SetEnv(env map[string]string) { - c.Env = env -} - -// CurrentEnv returns the current environment variables -func (c *Command) CurrentEnv() map[string]string { - return c.Env -} - -// SetEnvVariable sets an environment variable into the environment -func (c *Command) SetEnvVariable(name string, value string) { - if c.Env == nil { - c.Env = map[string]string{} - } - c.Env[name] = value -} - -// Attempts The number of times the command has been executed -func (c *Command) Attempts() int { - return c.attempts -} - -// DidError returns a boolean if any error occurred in any execution of the command -func (c *Command) DidError() bool { - return len(c.Errors) > 0 -} - -// DidFail returns a boolean if the command could not complete (errored on every attempt) -func (c *Command) DidFail() bool { - return len(c.Errors) == c.attempts -} - -// Error returns the last error -func (c *Command) Error() error { - if len(c.Errors) > 0 { - return c.Errors[len(c.Errors)-1] - } - return nil -} - -// Run Execute the command and block waiting for return values -func (c *Command) Run() (string, error) { - var r string - var e error - - f := func() error { - r, e = c.run() - c.attempts++ - if e != nil { - c.Errors = append(c.Errors, e) - return e - } - return nil - } - - c.ExponentialBackOff = backoff.NewExponentialBackOff() - if c.Timeout == 0 { - c.Timeout = 3 * time.Minute - } - c.ExponentialBackOff.MaxElapsedTime = c.Timeout - c.ExponentialBackOff.Reset() - err := backoff.Retry(f, c.ExponentialBackOff) - if err != nil { - return "", err - } - return r, nil -} - -// RunWithoutRetry Execute the command without retrying on failure and block waiting for return values -func (c *Command) RunWithoutRetry() (string, error) { - var r string - var e error - - log.Logger().Debugf("Running %s %s %s", JoinMap(c.Env, " ", "="), c.Name, strings.Join(c.Args, " ")) - - r, e = c.run() - c.attempts++ - if e != nil { - c.Errors = append(c.Errors, e) - } - return r, e -} - -func (c *Command) String() string { - var builder strings.Builder - builder.WriteString(c.Name) - for _, arg := range c.Args { - builder.WriteString(" ") - builder.WriteString(arg) - } - return builder.String() -} - -func (c *Command) run() (string, error) { - e := exec.Command(c.Name, c.Args...) // #nosec - if c.Dir != "" { - e.Dir = c.Dir - } - if len(c.Env) > 0 { - m := map[string]string{} - environ := os.Environ() - for _, kv := range environ { - paths := strings.SplitN(kv, "=", 2) - if len(paths) == 2 { - m[paths[0]] = paths[1] - } - } - for k, v := range c.Env { - m[k] = v - } - envVars := []string{} - for k, v := range m { - envVars = append(envVars, k+"="+v) - } - e.Env = envVars - } - - if c.Out != nil { - e.Stdout = c.Out - } - - if c.Err != nil { - e.Stderr = c.Err - } - - var text string - var err error - - if c.Out != nil { - err := e.Run() - if err != nil { - return text, CommandError{ - Command: *c, - cause: err, - } - } - } else { - data, err := e.CombinedOutput() - output := string(data) - text = strings.TrimSpace(output) - if err != nil { - return text, CommandError{ - Command: *c, - Output: text, - cause: err, - } - } - } - - return text, err -} diff --git a/cmd/codegen/util/files.go b/cmd/codegen/util/files.go deleted file mode 100644 index b8688c1..0000000 --- a/cmd/codegen/util/files.go +++ /dev/null @@ -1,267 +0,0 @@ -package util - -import ( - "fmt" - "io" - "io/ioutil" - "net/http" - "os" - "path/filepath" - "time" - - "github.com/jenkins-x/jx-logging/v3/pkg/log" - - "github.com/pkg/errors" -) - -// BackupGoModAndGoSum creates backup copies of go.mod and go.sum and returns a function to run at the end of execution -// to revert the go.mod and go.sum in the repo to the backups. -func BackupGoModAndGoSum() (func(), error) { - defaultCleanupFunc := func() {} - wd, err := os.Getwd() - if err != nil { - return defaultCleanupFunc, errors.Wrapf(err, "getting current directory") - } - origMod := filepath.Join(wd, "go.mod") - origSum := filepath.Join(wd, "go.sum") - modExists, err := FileExists(origMod) - if err != nil { - return defaultCleanupFunc, errors.Wrapf(err, "checking if %s exists", origMod) - } - sumExists, err := FileExists(origSum) - if err != nil { - return defaultCleanupFunc, errors.Wrapf(err, "checking if %s exists", origSum) - } - if modExists && sumExists { - tmpDir, err := ioutil.TempDir("", "go-mod-backup-") - if err != nil { - return defaultCleanupFunc, errors.Wrapf(err, "creating go mod backup directory") - } - tmpMod := filepath.Join(tmpDir, "go.mod") - tmpSum := filepath.Join(tmpDir, "go.sum") - err = CopyFile(origMod, tmpMod) - if err != nil { - return defaultCleanupFunc, errors.Wrapf(err, "copying %s to %s", origMod, tmpMod) - } - err = CopyFile(origSum, tmpSum) - if err != nil { - return defaultCleanupFunc, errors.Wrapf(err, "copying %s to %s", origSum, tmpSum) - } - - return func() { - err := CopyFile(tmpMod, origMod) - if err != nil { - log.Logger().WithError(err).Errorf("restoring backup go.mod from %s", tmpMod) - } - err = CopyFile(tmpSum, origSum) - if err != nil { - log.Logger().WithError(err).Errorf("restoring backup go.sum from %s", tmpSum) - } - err = os.RemoveAll(tmpDir) - if err != nil { - log.Logger().WithError(err).Errorf("removing go mod backup directory %s", tmpDir) - } - }, nil - } - return defaultCleanupFunc, nil -} - -// DeleteDirContents removes all the contents of the given directory -func DeleteDirContents(dir string) error { - files, err := filepath.Glob(filepath.Join(dir, "*")) - if err != nil { - return err - } - for _, file := range files { - // lets ignore the top level dir - if dir != file { - err = os.RemoveAll(file) - if err != nil { - return err - } - } - } - return nil -} - -// FileExists returns true if the specified path exist, false otherwise. An error is returned if and file system -// operation fails. -func FileExists(path string) (bool, error) { - _, err := os.Stat(path) - if err == nil { - return true, nil - } - if os.IsNotExist(err) { - return false, nil - } - return true, errors.Wrapf(err, "failed to check if file exists %s", path) -} - -// DirExists checks if path exists and is a directory -func DirExists(path string) (bool, error) { - info, err := os.Stat(path) - if err == nil { - return info.IsDir(), nil - } else if os.IsNotExist(err) { - return false, nil - } - return false, err -} - -// DeleteFile deletes a file from the operating system. This should NOT be used to delete any sensitive information -// because it can easily be recovered. Use DestroyFile to delete sensitive information -func DeleteFile(fileName string) (err error) { - if fileName != "" { - exists, err := FileExists(fileName) - if err != nil { - return fmt.Errorf("could not check if file exists %s due to %s", fileName, err) - } - - if exists { - err = os.Remove(fileName) - if err != nil { - return errors.Wrapf(err, "could not remove file due to %s", fileName) - } - } - } else { - return fmt.Errorf("filename is not valid") - } - return nil -} - -// CopyFile copies a file from the specified source src to dst. -// credit https://gist.github.com/r0l1/92462b38df26839a3ca324697c8cba04 -func CopyFile(src, dst string) (err error) { - in, err := os.Open(src) - if err != nil { - return - } - defer in.Close() //nolint:errcheck - - out, err := os.Create(dst) - if err != nil { - return - } - defer func() { - if e := out.Close(); e != nil { - err = e - } - }() - - _, err = io.Copy(out, in) - if err != nil { - return - } - - err = out.Sync() - if err != nil { - return - } - - si, err := os.Stat(src) - if err != nil { - return - } - err = os.Chmod(dst, si.Mode()) - if err != nil { - return - } - - return nil -} - -// CopyDirPreserve copies from the src dir to the dst dir if the file does NOT already exist in dst -func CopyDirPreserve(src string, dst string) error { - src = filepath.Clean(src) - dst = filepath.Clean(dst) - - si, err := os.Stat(src) - if err != nil { - return errors.Wrapf(err, "checking %s exists", src) - } - if !si.IsDir() { - return fmt.Errorf("source is not a directory") - } - - _, err = os.Stat(dst) - if err != nil && !os.IsNotExist(err) { - return errors.Wrapf(err, "checking %s exists", dst) - } - - err = os.MkdirAll(dst, si.Mode()) - if err != nil { - return errors.Wrapf(err, "creating %s", dst) - } - - entries, err := ioutil.ReadDir(src) - if err != nil { - return errors.Wrapf(err, "reading files in %s", src) - } - - for _, entry := range entries { - srcPath := filepath.Join(src, entry.Name()) - dstPath := filepath.Join(dst, entry.Name()) - - if entry.IsDir() { - err = CopyDirPreserve(srcPath, dstPath) - if err != nil { - return errors.Wrapf(err, "recursively copying %s", entry.Name()) - } - } else { - // Skip symlinks. - if entry.Mode()&os.ModeSymlink != 0 { - continue - } - if _, err := os.Stat(dstPath); os.IsNotExist(err) { - err = CopyFile(srcPath, dstPath) - if err != nil { - return errors.Wrapf(err, "copying %s to %s", srcPath, dstPath) - } - } else if err != nil { - return errors.Wrapf(err, "checking if %s exists", dstPath) - } - } - } - return nil -} - -// DownloadFile downloads a file from the given URL -func DownloadFile(filepath string, url string) (err error) { - // Create the file - out, err := os.Create(filepath) - if err != nil { - return err - } - defer out.Close() //nolint:errcheck - - // Get the data - resp, err := GetClientWithTimeout(time.Hour * 2).Get(url) - if err != nil { - return err - } - defer resp.Body.Close() //nolint:errcheck - - if resp.StatusCode != http.StatusOK { - err := fmt.Errorf("download of %s failed with return code %d", url, resp.StatusCode) - return err - } - - // Writer the body to file - _, err = io.Copy(out, resp.Body) - if err != nil { - return err - } - - // make it executable - err = os.Chmod(filepath, 0755) - if err != nil { - return err - } - return nil -} - -// GetClientWithTimeout returns a client with JX default transport and user specified timeout -func GetClientWithTimeout(duration time.Duration) *http.Client { - client := http.Client{} - return &client -} diff --git a/cmd/codegen/util/go.go b/cmd/codegen/util/go.go deleted file mode 100644 index 45f005c..0000000 --- a/cmd/codegen/util/go.go +++ /dev/null @@ -1,314 +0,0 @@ -package util - -import ( - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/jenkins-x/jx-logging/v3/pkg/log" - - uuid "github.com/satori/go.uuid" - - "github.com/pkg/errors" -) - -const ( - gopath = "GOPATH" - defaultWritePermissions = 0760 -) - -// GoPath returns the first element of the GOPATH. -// The empty string is returned if GOPATH is not set. -func GoPath() string { - goPath := os.Getenv(gopath) - - // GOPATH can have multiple elements, we take the first which is consistent with what 'go get' does - pathElements := strings.Split(goPath, string(os.PathListSeparator)) - path := pathElements[0] - return path -} - -// GoPathSrc returns the src directory of the first GOPATH element. -func GoPathSrc(gopath string) string { - return filepath.Join(gopath, "src") -} - -// GoPathBin returns the bin directory of the first GOPATH element. -func GoPathBin(gopath string) string { - return filepath.Join(gopath, "bin") -} - -// GoPathMod returns the modules directory of the first GOPATH element. -func GoPathMod(gopath string) string { - return filepath.Join(gopath, "pkg", "mod") -} - -// EnsureGoPath ensures the GOPATH environment variable is set and points to a valid directory. -func EnsureGoPath() error { - goPath := os.Getenv(gopath) - if goPath == "" { - return errors.New("GOPATH needs to be set") - } - - // GOPATH can have multiple elements, if so take the first - pathElements := strings.Split(goPath, string(os.PathListSeparator)) - path := pathElements[0] - if len(pathElements) > 1 { - log.Logger().Debugf("GOPATH contains more than one element using %s", path) - } - - if _, err := os.Stat(path); err == nil { - return nil - } else if os.IsNotExist(err) { - return errors.New(fmt.Sprintf("the GOPATH directory %s does not exist", path)) - } else { - return err - } -} - -// GoGet runs go get to install the specified binary. -func GoGet(path string, version string, gopath string, goModules bool, sourceOnly bool, update bool) error { - modulesMode := "off" - if goModules { - modulesMode = "on" - } - - fullPath := path - if version != "" { - if goModules { - fullPath = fmt.Sprintf("%s@%s", path, version) - } else { - fullPath = fmt.Sprintf("%s/...", path) - } - - } - args := []string{ - "get", - } - if update { - args = append(args, "-u") - } - if sourceOnly || !goModules { - args = append(args, "-d") - } - args = append(args, fullPath) - goGetCmd := Command{ - Name: "go", - Args: args, - Env: map[string]string{ - "GO111MODULE": modulesMode, - "GOPATH": gopath, - }, - } - out, err := goGetCmd.RunWithoutRetry() - if err != nil { - return errors.Wrapf(err, "error running %s, output %s", goGetCmd.String(), out) - } - parts := []string{ - GoPathSrc(gopath), - } - parts = append(parts, strings.Split(path, "/")...) - dir := filepath.Join(parts...) - if !goModules && version != "" { - - branchNameUUID, err := uuid.NewV4() - if err != nil { - return errors.WithStack(err) - } - branchName := branchNameUUID.String() - oldBranchName, err := branch(dir) - if err != nil { - return errors.Wrapf(err, "getting current branch name") - } - err = createBranchFrom(dir, branchName, version) - if err != nil { - return errors.Wrapf(err, "creating branch from %s", version) - } - err = checkout(dir, branchName) - defer func() { - err := checkout(dir, oldBranchName) - if err != nil { - log.Logger().Errorf("Error checking out original branch %s: %v", oldBranchName, err) - } - }() - if err != nil { - return errors.Wrapf(err, "checking out branch from %s", branchName) - } - - } - if !sourceOnly && !goModules { - cmd := Command{ - Dir: dir, - Name: "go", - Args: []string{ - "install", - }, - Env: map[string]string{ - "GO111MODULE": modulesMode, - "GOPATH": gopath, - }, - } - out, err = cmd.RunWithoutRetry() - if err != nil { - return errors.Wrapf(err, "error running %s, output %s", goGetCmd.String(), out) - } - } - return nil -} - -func checkout(dir string, branch string) error { - return gitCmd(dir, "checkout", branch) -} - -// branch returns the current branch of the repository located at the given directory -func branch(dir string) (string, error) { - return gitCmdWithOutput(dir, "rev-parse", "--abbrev-ref", "HEAD") -} - -// createBranchFrom creates a new branch called branchName from startPoint -func createBranchFrom(dir string, branchName string, startPoint string) error { - return gitCmd(dir, "branch", branchName, startPoint) -} - -func gitCmd(dir string, args ...string) error { - cmd := Command{ - Dir: dir, - Name: "git", - Args: args, - } - - output, err := cmd.RunWithoutRetry() - return errors.Wrapf(err, "git output: %s", output) -} - -func gitCmdWithOutput(dir string, args ...string) (string, error) { - cmd := Command{ - Dir: dir, - Name: "git", - Args: args, - } - return cmd.RunWithoutRetry() -} - -// GetModuleDir determines the directory on disk of the specified module dependency. -// Returns the empty string if the target requirement is not part of the module graph. -func GetModuleDir(moduleDir string, targetRequirement string, gopath string) (string, error) { - out, err := getModGraph(moduleDir, gopath) - if err != nil { - return "", err - } - - for _, line := range strings.Split(out, "\n") { - parts := strings.Split(line, " ") - if len(parts) != 2 { - return "", errors.Errorf("line of go mod graph should be like ' ' but was %s", - line) - } - requirement := parts[1] - if strings.HasPrefix(requirement, targetRequirement) { - return filepath.Join(GoPathMod(gopath), requirement), nil - } - } - return "", nil -} - -// GetModuleRequirements returns the requirements for the GO module rooted in dir -// It returns a map[]map[] -func GetModuleRequirements(dir string, gopath string) (map[string]map[string]string, error) { - out, err := getModGraph(dir, gopath) - if err != nil { - return nil, err - } - - answer := make(map[string]map[string]string) - for _, line := range strings.Split(out, "\n") { - if strings.HasPrefix(line, "go: ") { - // lines that start with go: are things like module download messages - continue - } - parts := strings.Split(line, " ") - if len(parts) != 2 { - return nil, errors.Errorf("line of go mod graph should be like ' ' but was %s", - line) - } - moduleName := parts[0] - requirement := parts[1] - parts1 := strings.Split(requirement, "@") - if len(parts1) != 2 { - return nil, errors.Errorf("go mod graph line should be like ' @' but was %s", line) - } - requirementName := parts1[0] - requirementVersion := parts1[1] - if _, ok := answer[moduleName]; !ok { - answer[moduleName] = make(map[string]string) - } - answer[moduleName][requirementName] = requirementVersion - } - return answer, nil -} - -func getModGraph(dir string, gopath string) (string, error) { - cmd := Command{ - Dir: dir, - Name: "go", - Args: []string{ - "mod", - "graph", - }, - Env: map[string]string{ - "GO111MODULE": "on", - "GOPATH": gopath, - }, - } - out, err := cmd.RunWithoutRetry() - if err != nil { - return "", errors.Wrapf(err, "unable to retrieve module graph: %s", out) - } - - // deal with windows - out = strings.Replace(out, "\r\n", "\n", -1) - - return out, nil -} - -// IsolatedGoPath returns the isolated go path for codegen -func IsolatedGoPath() (string, error) { - configDir, err := ConfigDir() - if err != nil { - return "", errors.Wrapf(err, "getting JX_HOME") - } - path := filepath.Join(configDir, "codegen", "go") - err = os.MkdirAll(path, defaultWritePermissions) - if err != nil { - return "", errors.Wrapf(err, "making %s", path) - } - return path, nil -} - -// HomeDir returns the users home directory -func HomeDir() string { - if h := os.Getenv("HOME"); h != "" { - return h - } - h := os.Getenv("USERPROFILE") // windows - if h == "" { - h = "." - } - return h -} - -// ConfigDir returns the JX_HOME directory, creating it if missing -func ConfigDir() (string, error) { - path := os.Getenv("JX_HOME") - if path != "" { - return path, nil - } - h := HomeDir() - path = filepath.Join(h, ".jx") - err := os.MkdirAll(path, defaultWritePermissions) - if err != nil { - return "", err - } - return path, nil -} diff --git a/cmd/codegen/util/go_test.go b/cmd/codegen/util/go_test.go deleted file mode 100644 index ce9b788..0000000 --- a/cmd/codegen/util/go_test.go +++ /dev/null @@ -1,125 +0,0 @@ -package util_test - -import ( - "fmt" - - "github.com/jenkins-x/jx-api/cmd/codegen/util" - - "io/ioutil" - "os" - "path/filepath" - "testing" - - "github.com/stretchr/testify/assert" -) - -const ( - gopath = "GOPATH" -) - -func Test_ensure_gopath_set(t *testing.T) { - tmpGoDir, err := ioutil.TempDir("", "jx-codegen-tests") - if err != nil { - assert.Fail(t, "unable to create test directory") - } - defer os.RemoveAll(tmpGoDir) - err = os.Setenv(gopath, tmpGoDir) - if err != nil { - assert.Fail(t, "unable to set env variable") - } - - err = util.EnsureGoPath() - assert.NoError(t, err, "GOPATH should be set") -} - -func Test_ensure_gopath_unset(t *testing.T) { - err := os.Setenv(gopath, "") - if err != nil { - assert.Fail(t, "unable to set env variable") - } - - err = util.EnsureGoPath() - assert.Error(t, err, "GOPATH should not be set") - assert.Equal(t, "GOPATH needs to be set", err.Error()) -} - -func Test_ensure_gopath_does_not_exist(t *testing.T) { - err := os.Setenv(gopath, "snafu") - if err != nil { - assert.Fail(t, "unable to set env variable") - } - - err = util.EnsureGoPath() - assert.Error(t, err, "GOPATH should not be set") - assert.Equal(t, "the GOPATH directory snafu does not exist", err.Error()) -} - -func Test_get_gopath(t *testing.T) { - tmpGoDir, err := ioutil.TempDir("", "jx-codegen-tests") - if err != nil { - assert.Fail(t, "unable to create test directory") - } - defer os.RemoveAll(tmpGoDir) - err = os.Setenv(gopath, tmpGoDir) - if err != nil { - assert.Fail(t, "unable to set env variable") - } - - goPath := util.GoPath() - assert.Equal(t, tmpGoDir, goPath) -} - -func Test_get_gopath_unset_env(t *testing.T) { - err := os.Setenv(gopath, "") - if err != nil { - assert.Fail(t, "unable to set env variable") - } - - goPath := util.GoPath() - assert.Equal(t, "", goPath) -} - -func Test_get_gopath_multiple_elements(t *testing.T) { - tmpGoDir, err := ioutil.TempDir("", "jx-codegen-tests") - if err != nil { - assert.Fail(t, "unable to create test directory") - } - defer os.RemoveAll(tmpGoDir) - err = os.Setenv(gopath, fmt.Sprintf("%s%sfoo", tmpGoDir, string(os.PathListSeparator))) - if err != nil { - assert.Fail(t, "unable to set env variable") - } - - goPath := util.GoPath() - assert.Equal(t, tmpGoDir, goPath) -} - -func Test_get_gopath_src(t *testing.T) { - tmpGoDir, err := ioutil.TempDir("", "jx-codegen-tests") - if err != nil { - assert.Fail(t, "unable to create test directory") - } - defer os.RemoveAll(tmpGoDir) - err = os.Setenv(gopath, tmpGoDir) - if err != nil { - assert.Fail(t, "unable to set env variable") - } - - goPathSrc := util.GoPathSrc(tmpGoDir) - assert.Equal(t, filepath.Join(tmpGoDir, "src"), goPathSrc) -} - -func Test_get_gopath_bin(t *testing.T) { - tmpGoDir, err := ioutil.TempDir("", "jx-codegen-tests") - if err != nil { - assert.Fail(t, "unable to create test directory") - } - defer os.RemoveAll(tmpGoDir) - err = os.Setenv(gopath, tmpGoDir) - if err != nil { - assert.Fail(t, "unable to set env variable") - } - - goPathBin := util.GoPathBin(tmpGoDir) - assert.Equal(t, filepath.Join(tmpGoDir, "bin"), goPathBin) -} diff --git a/cmd/codegen/util/strings.go b/cmd/codegen/util/strings.go deleted file mode 100644 index e3d0629..0000000 --- a/cmd/codegen/util/strings.go +++ /dev/null @@ -1,13 +0,0 @@ -package util - -import ( - "fmt" -) - -func JoinMap(m map[string]string, pairSep string, keyValueSep string) string { - answer := "" - for k, v := range m { - answer = fmt.Sprintf("%s%s%s%s%s", answer, k, keyValueSep, v, pairSep) - } - return answer -} diff --git a/go.mod b/go.mod index 4ee79e8..bd3917d 100644 --- a/go.mod +++ b/go.mod @@ -1,28 +1,25 @@ module github.com/jenkins-x/jx-api -go 1.13 +go 1.15 require ( github.com/alecthomas/jsonschema v0.0.0-20190504002508-159cbd5dba26 - github.com/cenkalti/backoff v2.2.1+incompatible github.com/ghodss/yaml v1.0.0 - github.com/go-openapi/spec v0.19.7 + github.com/go-openapi/spec v0.19.7 // indirect github.com/imdario/mergo v0.3.9 github.com/jenkins-x/jx-logging/v3 v3.0.0 github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a github.com/pkg/errors v0.9.1 - github.com/satori/go.uuid v1.2.1-0.20180103174451-36e9d2ebbde5 - github.com/spf13/cobra v1.0.0 github.com/stoewer/go-strcase v1.2.0 github.com/stretchr/testify v1.6.1 github.com/vrischmann/envconfig v1.2.0 github.com/xeipuuv/gojsonschema v1.2.0 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect - golang.org/x/tools v0.0.0-20200415034506-5d8e1897c761 k8s.io/api v0.19.2 k8s.io/apimachinery v0.19.2 k8s.io/client-go v0.19.2 - k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488 + k8s.io/code-generator v0.19.2 + k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488 // indirect ) replace ( diff --git a/go.sum b/go.sum index e195667..c27ef19 100644 --- a/go.sum +++ b/go.sum @@ -25,7 +25,6 @@ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbt github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -34,38 +33,23 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alecthomas/jsonschema v0.0.0-20190504002508-159cbd5dba26 h1:b/CA15BzZIj8xNKnBxUwUmXt3USfJjb4Gl9eJIfMLtE= github.com/alecthomas/jsonschema v0.0.0-20190504002508-159cbd5dba26/go.mod h1:qpebaTNSsyUn5rPSJMsfqEtDw71TTggXM6stUDI16HA= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= -github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= @@ -79,9 +63,6 @@ github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2H github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= @@ -92,7 +73,10 @@ github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34 github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/spec v0.19.7 h1:0xWSeMd35y5avQAThZR2PkEuqSosoS5t6gDH4L8n11M= github.com/go-openapi/spec v0.19.7/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= @@ -101,12 +85,9 @@ github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tF github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -149,56 +130,45 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jenkins-x/jx-logging v0.0.11 h1:t4T653u6oy4SJ2VYlrY5rIobr16jJS9Gf8RWlHqtJvw= -github.com/jenkins-x/jx-logging v0.0.11/go.mod h1:mjEejiArk2Mk+J+72/YcSKGo9bZlJ/LwKYjMgAiv+G4= github.com/jenkins-x/jx-logging/v3 v3.0.0 h1:Oqidp7EL+PUlZUUdPvOeWju9mMq2mzpd9/HWXdVM68E= github.com/jenkins-x/jx-logging/v3 v3.0.0/go.mod h1:bOYlj+Cdd9v7/vDXjkwlUylxGs5sfQJvYnuYbCL0IrY= github.com/jenkins-x/logrus-stackdriver-formatter v0.2.3 h1:NuRWKUPCEX1wKlXA8ZYSG28qGKd41R7BK11YDQkPwqo= github.com/jenkins-x/logrus-stackdriver-formatter v0.2.3/go.mod h1:litPp7VZWDRCl8LvXuqGngy+65kkg/+T23TgFnDmfTk= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= +github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a h1:+J2gw7Bw77w/fbK7wnNJJDKmw1IbWft2Ul5BzrG1Qm8= github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a/go.mod h1:M1qoD/MqPgTZIk0EWKB38wE28ACRfVcn+cU08jyArI0= github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= @@ -206,9 +176,6 @@ github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 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= @@ -216,11 +183,9 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= @@ -228,61 +193,32 @@ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rickar/props v0.0.0-20170718221555-0b06aeb2f037 h1:HFsTO5S+nnw/Xs9lRYF+UUJvH8wMSRMRal321W0hfdY= github.com/rickar/props v0.0.0-20170718221555-0b06aeb2f037/go.mod h1:F1p8BNM4IXv2UcptwSp8HJOapKurodd/PYu1D6Gtn9Y= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/satori/go.uuid v1.2.1-0.20180103174451-36e9d2ebbde5 h1:Jw7W4WMfQDxsXvfeFSaS2cHlY7bAF4MGrgnbd0+Uo78= -github.com/satori/go.uuid v1.2.1-0.20180103174451-36e9d2ebbde5/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/vrischmann/envconfig v1.2.0 h1:5/u4fI34/g3m0SdTQj/6f3r640jv9E5+yTXIZOWsxk0= github.com/vrischmann/envconfig v1.2.0/go.mod h1:c5DuUlkzfsnspy1g7qiqryPCsW+NjsrLsYq4zhwsoHo= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= @@ -291,19 +227,14 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -325,18 +256,16 @@ golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -373,6 +302,7 @@ golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 h1:PVCvyir09Xgta5zksNZDkrL+eSm/Y+gQxRG3IfqNQ3A= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -399,7 +329,6 @@ google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -414,8 +343,6 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -426,10 +353,8 @@ gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -448,7 +373,11 @@ k8s.io/apimachinery v0.19.2 h1:5Gy9vQpAGTKHPVOh5c4plE274X8D/6cuEiTO2zve7tc= k8s.io/apimachinery v0.19.2/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= k8s.io/client-go v0.19.2 h1:gMJuU3xJZs86L1oQ99R4EViAADUPMHHtS9jFshasHSc= k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA= +k8s.io/code-generator v0.19.2 h1:7uaWJll6fyCPj2j3sfNN1AiY2gZU1VFN2dFR2uoxGWI= +k8s.io/code-generator v0.19.2/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14 h1:t4L10Qfx/p7ASH3gXCdIUtPbbIuegCoUJf3TMSFekjw= +k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= diff --git a/hack/custom-boilerplate.go.txt b/hack/custom-boilerplate.go.txt new file mode 100644 index 0000000..ba49735 --- /dev/null +++ b/hack/custom-boilerplate.go.txt @@ -0,0 +1,15 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ \ No newline at end of file diff --git a/hack/tools.go b/hack/tools.go new file mode 100644 index 0000000..57f2561 --- /dev/null +++ b/hack/tools.go @@ -0,0 +1,32 @@ +// +build tools + +/* + Copyright 2019 The Kubernetes Authors. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +// This package contains code generation utilities +// This package imports things required by build scripts, to force `go mod` to see them as dependencies +package tools + +import ( + _ "k8s.io/code-generator/cmd/client-gen" + _ "k8s.io/code-generator/cmd/conversion-gen" + _ "k8s.io/code-generator/cmd/deepcopy-gen" + _ "k8s.io/code-generator/cmd/defaulter-gen" + _ "k8s.io/code-generator/cmd/go-to-protobuf" + _ "k8s.io/code-generator/cmd/import-boss" + _ "k8s.io/code-generator/cmd/informer-gen" + _ "k8s.io/code-generator/cmd/lister-gen" + _ "k8s.io/code-generator/cmd/openapi-gen" + _ "k8s.io/code-generator/cmd/register-gen" + _ "k8s.io/code-generator/cmd/set-gen" +) diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh new file mode 100755 index 0000000..6bb7b06 --- /dev/null +++ b/hack/update-codegen.sh @@ -0,0 +1,33 @@ + +#!/usr/bin/env bash + +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} + +# generate the code with: +# --output-base because this script should also be able to run inside the vendor dir of +# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir +# instead of the $GOPATH directly. For normal projects this can be dropped. +bash "${CODEGEN_PKG}"/generate-groups.sh all \ + github.com/jenkins-x/jx-api/pkg/client github.com/jenkins-x/jx-api/pkg/apis \ + jenkins.io:v1 \ + --output-base "$(dirname "${BASH_SOURCE[0]}")/../../../.." \ + --go-header-file "${SCRIPT_ROOT}"/hack/custom-boilerplate.go.txt \ No newline at end of file diff --git a/jenkins-x.yml b/jenkins-x.yml index 6e9937f..3461538 100644 --- a/jenkins-x.yml +++ b/jenkins-x.yml @@ -17,13 +17,13 @@ pipelineConfig: steps: - name: test command: make - image: golang:1.13.10 + image: golang:1.15 args: - test dir: /workspace/source - name: lint command: ./hack/linter.sh - image: golang:1.13.10 + image: golang:1.15 - name: mk-jxapi-project-dir image: bash command: mkdir @@ -40,7 +40,7 @@ pipelineConfig: dir: /workspace/source - name: verify-codegen command: ./hack/generate.sh - image: golang:1.13.10 + image: golang:1.15 dir: /workspace/go/src/github.com/jenkins-x/jx-api release: pipeline: diff --git a/pkg/apis/jenkins.io/v1/zz_generated.deepcopy.go b/pkg/apis/jenkins.io/v1/zz_generated.deepcopy.go index 02899a6..90a0b33 100644 --- a/pkg/apis/jenkins.io/v1/zz_generated.deepcopy.go +++ b/pkg/apis/jenkins.io/v1/zz_generated.deepcopy.go @@ -1,5 +1,20 @@ // +build !ignore_autogenerated +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by deepcopy-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 04870d1..10c96df 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package versioned diff --git a/pkg/client/clientset/versioned/doc.go b/pkg/client/clientset/versioned/doc.go index 0e0c2a8..0909114 100644 --- a/pkg/client/clientset/versioned/doc.go +++ b/pkg/client/clientset/versioned/doc.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated clientset. diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index ba42ce6..a61a876 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/fake/doc.go b/pkg/client/clientset/versioned/fake/doc.go index 3630ed1..d4f2c58 100644 --- a/pkg/client/clientset/versioned/fake/doc.go +++ b/pkg/client/clientset/versioned/fake/doc.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated fake clientset. diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index da2f822..6b7ef57 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/scheme/doc.go b/pkg/client/clientset/versioned/scheme/doc.go index 14db57a..b6039d5 100644 --- a/pkg/client/clientset/versioned/scheme/doc.go +++ b/pkg/client/clientset/versioned/scheme/doc.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. // This package contains the scheme of the automatically generated clientset. diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 72000b7..c6cbfc4 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package scheme diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/app.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/app.go index 663389b..2a81dbb 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/app.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/app.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/app_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/app_expansion.go deleted file mode 100644 index ed465c5..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/app_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// AppExpansion expands the default CRUD interface for App. -type AppExpansion interface { - PatchUpdate(app *v1.App) (result *v1.App, err error) -} - -// PatchUpdate takes the representation of an app and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the app, and an error, if there is any. -func (c *apps) PatchUpdate(app *v1.App) (*v1.App, error) { - resourceName := app.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, app) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patchedApp, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patchedApp, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack.go index 5983623..e707fae 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack_expansion.go deleted file mode 100644 index 793eb9d..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// BuildPackExpansion expands the default CRUD interface for BuildPack. -type BuildPackExpansion interface { - PatchUpdate(buildPack *v1.BuildPack) (result *v1.BuildPack, err error) -} - -// PatchUpdate takes the representation of a buildPack and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the buildPack, and an error, if there is any. -func (c *buildPacks) PatchUpdate(buildPack *v1.BuildPack) (*v1.BuildPack, error) { - resourceName := buildPack.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, buildPack) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack_expansion_test.go deleted file mode 100644 index c31f0de..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack_expansion_test.go +++ /dev/null @@ -1,128 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testBuildPack = &v1.BuildPack{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: v1.BuildPackSpec{}, - } -) - -func TestPatchUpdateBuildPackNoModification(t *testing.T) { - json, err := json.Marshal(testBuildPack) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - buildPacks := buildPacks{ - client: fakeClient, - ns: "default", - } - - updated, err := buildPacks.PatchUpdate(testBuildPack) - assert.NoError(t, err) - assert.Equal(t, testBuildPack, updated) -} - -func TestPatchUpdateBuildPackWithChange(t *testing.T) { - url := "git@github.com:jenkins-x/jx.git" - clonedBuildPack := testBuildPack.DeepCopy() - clonedBuildPack.Spec.GitURL = url - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testBuildPack) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedBuildPack) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - buildPacks := buildPacks{ - client: fakeClient, - ns: "default", - } - - updated, err := buildPacks.PatchUpdate(clonedBuildPack) - assert.NoError(t, err) - assert.NotEqual(t, testBuildPack, updated) - assert.Equal(t, url, updated.Spec.GitURL) -} - -func TestPatchUpdateBuildPackWithErrorInGet(t *testing.T) { - - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringGETMessage) - } - - fakeClient := newClientForTest(get, nil) - - buildPacks := buildPacks{ - client: fakeClient, - ns: "default", - } - - updated, err := buildPacks.PatchUpdate(testBuildPack) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringGETMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdateBuildPackWithErrorInPatch(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testBuildPack) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringPATCHMessage) - } - - fakeClient := newClientForTest(get, patch) - - buildPacks := buildPacks{ - client: fakeClient, - ns: "default", - } - url := "git@github.com:jenkins-x/jx.git" - clonedBuildPack := testBuildPack.DeepCopy() - clonedBuildPack.Spec.GitURL = url - updated, err := buildPacks.PatchUpdate(clonedBuildPack) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringPATCHMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus.go index c206062..008b1b4 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus_expansion.go deleted file mode 100644 index 65f10d6..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// CommitStatusExpansion expands the default CRUD interface for CommitStatus. -type CommitStatusExpansion interface { - PatchUpdate(commitStatus *v1.CommitStatus) (result *v1.CommitStatus, err error) -} - -// PatchUpdate takes the representation of a commitStatus and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the commitStatus, and an error, if there is any. -func (c *commitStatuses) PatchUpdate(commitStatus *v1.CommitStatus) (*v1.CommitStatus, error) { - resourceName := commitStatus.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, commitStatus) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus_expansion_test.go deleted file mode 100644 index 71cb290..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus_expansion_test.go +++ /dev/null @@ -1,135 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testCommitStatus = &v1.CommitStatus{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: v1.CommitStatusSpec{}, - } -) - -func TestPatchUpdateCommitStatusNoModification(t *testing.T) { - json, err := json.Marshal(testCommitStatus) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - commitStatuses := commitStatuses{ - client: fakeClient, - ns: "default", - } - - updated, err := commitStatuses.PatchUpdate(testCommitStatus) - assert.NoError(t, err) - assert.Equal(t, testCommitStatus, updated) -} - -func TestPatchUpdateCommitStatusWithChange(t *testing.T) { - context := "foo" - clonedCommitStatus := testCommitStatus.DeepCopy() - clonedCommitStatus.Spec.Items = []v1.CommitStatusDetails{ - { - Context: context, - }, - } - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testCommitStatus) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedCommitStatus) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - commitStatuses := commitStatuses{ - client: fakeClient, - ns: "default", - } - - updated, err := commitStatuses.PatchUpdate(clonedCommitStatus) - assert.NoError(t, err) - assert.NotEqual(t, testCommitStatus, updated) - assert.Equal(t, context, updated.Spec.Items[0].Context) -} - -func TestPatchUpdateCommitStatusWithErrorInGet(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringGETMessage) - } - - fakeClient := newClientForTest(get, nil) - - commitStatuses := commitStatuses{ - client: fakeClient, - ns: "default", - } - - updated, err := commitStatuses.PatchUpdate(testCommitStatus) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringGETMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdateCommitStatusWithErrorInPatch(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testCommitStatus) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringPATCHMessage) - } - - fakeClient := newClientForTest(get, patch) - - commitStatuses := commitStatuses{ - client: fakeClient, - ns: "default", - } - context := "foo" - clonedCommitStatus := testCommitStatus.DeepCopy() - clonedCommitStatus.Spec.Items = []v1.CommitStatusDetails{ - { - Context: context, - }, - } - updated, err := commitStatuses.PatchUpdate(clonedCommitStatus) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringPATCHMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/doc.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/doc.go index 225e6b2..90866c5 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/doc.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/doc.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment.go index 19fb1de..b4d111d 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment_expansion.go deleted file mode 100644 index b28c79f..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// EnvironmentExpansion expands the default CRUD interface for Environment. -type EnvironmentExpansion interface { - PatchUpdate(environment *v1.Environment) (result *v1.Environment, err error) -} - -// PatchUpdate takes the representation of an environment and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the environment, and an error, if there is any. -func (c *environments) PatchUpdate(environment *v1.Environment) (*v1.Environment, error) { - resourceName := environment.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, environment) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment_expansion_test.go deleted file mode 100644 index 5d9feda..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment_expansion_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testEnvironment = &v1.Environment{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: v1.EnvironmentSpec{}, - } -) - -func TestPatchUpdateEnvironmentNoModification(t *testing.T) { - json, err := json.Marshal(testEnvironment) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - environments := environments{ - client: fakeClient, - ns: "default", - } - - updated, err := environments.PatchUpdate(testEnvironment) - assert.NoError(t, err) - assert.Equal(t, testEnvironment, updated) -} - -func TestPatchUpdateEnvironmentWithChange(t *testing.T) { - namespace := "jx" - clonedEnvironment := testEnvironment.DeepCopy() - clonedEnvironment.Spec.Namespace = namespace - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testEnvironment) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedEnvironment) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - environments := environments{ - client: fakeClient, - ns: "default", - } - - updated, err := environments.PatchUpdate(clonedEnvironment) - assert.NoError(t, err) - assert.NotEqual(t, testEnvironment, updated) - assert.Equal(t, namespace, updated.Spec.Namespace) -} - -func TestPatchUpdateEnvironmentWithErrorInGet(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringGETMessage) - } - - fakeClient := newClientForTest(get, nil) - - environments := environments{ - client: fakeClient, - ns: "default", - } - - updated, err := environments.PatchUpdate(testEnvironment) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringGETMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdateEnvironmentWithErrorInPatch(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testEnvironment) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringPATCHMessage) - } - - fakeClient := newClientForTest(get, patch) - - environments := environments{ - client: fakeClient, - ns: "default", - } - namespace := "jx" - clonedEnvironment := testEnvironment.DeepCopy() - clonedEnvironment.Spec.Namespace = namespace - updated, err := environments.PatchUpdate(clonedEnvironment) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringPATCHMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding.go index d9227ea..219f86a 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding_expansion.go deleted file mode 100644 index 50130ad..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// EnvironmentRoleBindingExpansion expands the default CRUD interface for EnvironmentRoleBinding. -type EnvironmentRoleBindingExpansion interface { - PatchUpdate(environmentRoleBinding *v1.EnvironmentRoleBinding) (result *v1.EnvironmentRoleBinding, err error) -} - -// PatchUpdate takes the representation of a environmentRoleBinding and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the environmentRoleBinding, and an error, if there is any. -func (c *environmentRoleBindings) PatchUpdate(environmentRoleBinding *v1.EnvironmentRoleBinding) (*v1.EnvironmentRoleBinding, error) { - resourceName := environmentRoleBinding.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, environmentRoleBinding) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding_expansion_test.go deleted file mode 100644 index d1f8293..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding_expansion_test.go +++ /dev/null @@ -1,136 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - rbacv1 "k8s.io/api/rbac/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testEnvironmentRoleBinding = &v1.EnvironmentRoleBinding{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: v1.EnvironmentRoleBindingSpec{}, - } -) - -func TestPatchUpdateEnvironmentRoleBindingNoModification(t *testing.T) { - json, err := json.Marshal(testEnvironmentRoleBinding) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - environmentRoleBindings := environmentRoleBindings{ - client: fakeClient, - ns: "default", - } - - updated, err := environmentRoleBindings.PatchUpdate(testEnvironmentRoleBinding) - assert.NoError(t, err) - assert.Equal(t, testEnvironmentRoleBinding, updated) -} - -func TestPatchUpdateEnvironmentRoleBindingWithChange(t *testing.T) { - subject := "snafu" - clonedEnvironmentRoleBinding := testEnvironmentRoleBinding.DeepCopy() - clonedEnvironmentRoleBinding.Spec.Subjects = []rbacv1.Subject{ - { - Name: subject, - }, - } - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testEnvironmentRoleBinding) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedEnvironmentRoleBinding) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - environmentRoleBindings := environmentRoleBindings{ - client: fakeClient, - ns: "default", - } - - updated, err := environmentRoleBindings.PatchUpdate(clonedEnvironmentRoleBinding) - assert.NoError(t, err) - assert.NotEqual(t, testEnvironmentRoleBinding, updated) - assert.Equal(t, subject, updated.Spec.Subjects[0].Name) -} - -func TestPatchUpdateEnvironmentRoleBindingWithErrorInGet(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringGETMessage) - } - - fakeClient := newClientForTest(get, nil) - - environmentRoleBindings := environmentRoleBindings{ - client: fakeClient, - ns: "default", - } - - updated, err := environmentRoleBindings.PatchUpdate(testEnvironmentRoleBinding) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringGETMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdateEnvironmentRoleBindingWithErrorInPatch(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testEnvironmentRoleBinding) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringPATCHMessage) - } - - fakeClient := newClientForTest(get, patch) - - environmentRoleBindings := environmentRoleBindings{ - client: fakeClient, - ns: "default", - } - subject := "snafu" - clonedEnvironmentRoleBinding := testEnvironmentRoleBinding.DeepCopy() - clonedEnvironmentRoleBinding.Spec.Subjects = []rbacv1.Subject{ - { - Name: subject, - }, - } - updated, err := environmentRoleBindings.PatchUpdate(clonedEnvironmentRoleBinding) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringPATCHMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension.go index 08a262e..064f745 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension_expansion.go deleted file mode 100644 index 7425f4a..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// ExtensionExpansion expands the default CRUD interface for Extension. -type ExtensionExpansion interface { - PatchUpdate(extension *v1.Extension) (result *v1.Extension, err error) -} - -// PatchUpdate takes the representation of an extension and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the extension, and an error, if there is any. -func (c *extensions) PatchUpdate(extension *v1.Extension) (*v1.Extension, error) { - resourceName := extension.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, extension) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension_expansion_test.go deleted file mode 100644 index 27b2288..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension_expansion_test.go +++ /dev/null @@ -1,129 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testExtension = &v1.Extension{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: v1.ExtensionSpec{}, - } -) - -func TestPatchUpdateExtensionNoModification(t *testing.T) { - json, err := json.Marshal(testExtension) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - extensions := extensions{ - client: fakeClient, - ns: "default", - } - - updated, err := extensions.PatchUpdate(testExtension) - assert.NoError(t, err) - assert.Equal(t, testExtension, updated) -} - -func TestPatchUpdateExtensionWithChange(t *testing.T) { - name := "fubu" - clonedExtension := testExtension.DeepCopy() - clonedExtension.Spec.Name = name - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testExtension) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedExtension) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - extensions := extensions{ - client: fakeClient, - ns: "default", - } - - updated, err := extensions.PatchUpdate(clonedExtension) - assert.NoError(t, err) - assert.NotEqual(t, testExtension, updated) - assert.Equal(t, name, updated.Spec.Name) -} - -func TestPatchUpdateExtensionWithErrorInGet(t *testing.T) { - errorMessage := "error during GET" - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorMessage) - } - - fakeClient := newClientForTest(get, nil) - - extensions := extensions{ - client: fakeClient, - ns: "default", - } - - updated, err := extensions.PatchUpdate(testExtension) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdateExtensionWithErrorInPatch(t *testing.T) { - errorMessage := "error during PATCH" - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testExtension) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorMessage) - } - - fakeClient := newClientForTest(get, patch) - - extensions := extensions{ - client: fakeClient, - ns: "default", - } - name := "fubu" - clonedExtension := testExtension.DeepCopy() - clonedExtension.Spec.Name = name - updated, err := extensions.PatchUpdate(clonedExtension) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go index 1af6143..8b218c5 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact_expansion.go deleted file mode 100644 index 88bacf5..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// FactExpansion expands the default CRUD interface for Fact. -type FactExpansion interface { - PatchUpdate(fact *v1.Fact) (result *v1.Fact, err error) -} - -// PatchUpdate takes the representation of a fact and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the fact, and an error, if there is any. -func (c *facts) PatchUpdate(fact *v1.Fact) (*v1.Fact, error) { - resourceName := fact.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, fact) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact_expansion_test.go deleted file mode 100644 index 443dd83..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact_expansion_test.go +++ /dev/null @@ -1,125 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testFact = &v1.Fact{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: v1.FactSpec{}, - } -) - -func TestPatchUpdateFactNoModification(t *testing.T) { - json, err := json.Marshal(testFact) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - facts := facts{ - client: fakeClient, - ns: "default", - } - - updated, err := facts.PatchUpdate(testFact) - assert.NoError(t, err) - assert.Equal(t, testFact, updated) -} - -func TestPatchUpdateFactWithChange(t *testing.T) { - clonedFact := testFact.DeepCopy() - clonedFact.Spec.Name = FactNameUpdate - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testFact) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedFact) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - facts := facts{ - client: fakeClient, - ns: "default", - } - - updated, err := facts.PatchUpdate(clonedFact) - assert.NoError(t, err) - assert.NotEqual(t, testFact, updated) - assert.Equal(t, FactNameUpdate, updated.Spec.Name) -} - -func TestPatchUpdateFactWithErrorInGet(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringGETMessage) - } - - fakeClient := newClientForTest(get, nil) - - facts := facts{ - client: fakeClient, - ns: "default", - } - - updated, err := facts.PatchUpdate(testFact) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringGETMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdateFactWithErrorInPatch(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testFact) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringPATCHMessage) - } - - fakeClient := newClientForTest(get, patch) - - facts := facts{ - client: fakeClient, - ns: "default", - } - clonedFact := testFact.DeepCopy() - clonedFact.Spec.Name = FactNameUpdate - updated, err := facts.PatchUpdate(clonedFact) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringPATCHMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/doc.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/doc.go index 2b5ba4c..a1d44d2 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/doc.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/doc.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app.go index 0e1c939..b0e07a2 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app_expansion.go deleted file mode 100644 index 1329aad..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of an app and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the app, and an error, if there is any. -func (c *FakeApps) PatchUpdate(app *v1.App) (*v1.App, error) { - return c.Update(app) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack.go index dbf8e05..44e0c42 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack_expansion.go deleted file mode 100644 index 2731302..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of a buildPack and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the buildPack, and an error, if there is any. -func (c *FakeBuildPacks) PatchUpdate(buildPack *v1.BuildPack) (*v1.BuildPack, error) { - return c.Update(buildPack) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus.go index 99e5e0b..334b40e 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus_expansion.go deleted file mode 100644 index d79f1c1..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of a commitStatus and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the commitStatus, and an error, if there is any -func (c *FakeCommitStatuses) PatchUpdate(app *v1.CommitStatus) (*v1.CommitStatus, error) { - return c.Update(app) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment.go index 75a322f..f815bbb 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment_expansion.go deleted file mode 100644 index 7d23cab..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of an environment and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the environment, and an error, if there is any. -func (c *FakeEnvironments) PatchUpdate(app *v1.Environment) (*v1.Environment, error) { - return c.Update(app) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding.go index f4b8140..61c16e6 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding_expansion.go deleted file mode 100644 index b8de86e..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of a environmentRoleBinding and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the environmentRoleBinding, and an error, if there is any. -func (c *FakeEnvironmentRoleBindings) PatchUpdate(app *v1.EnvironmentRoleBinding) (*v1.EnvironmentRoleBinding, error) { - return c.Update(app) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension.go index 4373762..66485cb 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension_expansion.go deleted file mode 100644 index f5dacf0..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of an extension and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the extension, and an error, if there is any. -func (c *FakeExtensions) PatchUpdate(app *v1.Extension) (*v1.Extension, error) { - return c.Update(app) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go index 3e78b22..888c595 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact_expansion.go deleted file mode 100644 index b8c8d96..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of a fact and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the fact, and an error, if there is any. -func (c *FakeFacts) PatchUpdate(app *v1.Fact) (*v1.Fact, error) { - return c.Update(app) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice.go index e2ad762..a5f1393 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice_expansion.go deleted file mode 100644 index 3635c12..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of a gitService and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the gitService, and an error, if there is any. -func (c *FakeGitServices) PatchUpdate(app *v1.GitService) (*v1.GitService, error) { - return c.Update(app) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_jenkins.io_client.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_jenkins.io_client.go index a481670..da3ac9c 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_jenkins.io_client.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_jenkins.io_client.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity.go index 2f56fff..edbec78 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity_expansion.go deleted file mode 100644 index 2935010..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of a pipelineActivity and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the pipelineActivity, and an error, if there is any. -func (c *FakePipelineActivities) PatchUpdate(activity *v1.PipelineActivity) (*v1.PipelineActivity, error) { - return c.Update(activity) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go index 49ef9bf..c4b3f6b 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure_expansion.go deleted file mode 100644 index 5b82341..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of a pipelineStructure and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the pipelineStructure, and an error, if there is any. -func (c *FakePipelineStructures) PatchUpdate(app *v1.PipelineStructure) (*v1.PipelineStructure, error) { - return c.Update(app) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin.go index a0a31db..93c11f3 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin_expansion.go deleted file mode 100644 index 579b500..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of a plugin and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the plugin, and an error, if there is any. -func (c *FakePlugins) PatchUpdate(app *v1.Plugin) (*v1.Plugin, error) { - return c.Update(app) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release.go index 535fddf..9c53373 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release_expansion.go deleted file mode 100644 index 42235f5..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of a release and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the release, and an error, if there is any. -func (c *FakeReleases) PatchUpdate(app *v1.Release) (*v1.Release, error) { - return c.Update(app) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go index 908d3e7..5441a9e 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository.go index 697d55b..4cf1ee8 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository_expansion.go deleted file mode 100644 index 47670fc..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of a sourceRepository and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the sourceRepository, and an error, if there is any. -func (c *FakeSourceRepositories) PatchUpdate(app *v1.SourceRepository) (*v1.SourceRepository, error) { - return c.Update(app) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepositorygroup.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepositorygroup.go index 73f6cf6..eb3eed5 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepositorygroup.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepositorygroup.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team.go index 5556034..3d5b3a3 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team_expansion.go deleted file mode 100644 index 824a9f0..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of a team and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the team, and an error, if there is any. -func (c *FakeTeams) PatchUpdate(app *v1.Team) (*v1.Team, error) { - return c.Update(app) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user.go index dc0be52..7add6c5 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user_expansion.go deleted file mode 100644 index dc793bb..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of a user and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the user, and an error, if there is any. -func (c *FakeUsers) PatchUpdate(app *v1.User) (*v1.User, error) { - return c.Update(app) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go index c3f360b..54bce72 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow_expansion.go deleted file mode 100644 index 414a7e5..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow_expansion.go +++ /dev/null @@ -1,9 +0,0 @@ -package fake - -import v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - -// PatchUpdate takes the representation of a workflow and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the workflow, and an error, if there is any. -func (c *FakeWorkflows) PatchUpdate(app *v1.Workflow) (*v1.Workflow, error) { - return c.Update(app) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/generated_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/generated_expansion.go index 20ce623..1cde34e 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/generated_expansion.go @@ -1,7 +1,54 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 +type AppExpansion interface{} + +type BuildPackExpansion interface{} + +type CommitStatusExpansion interface{} + +type EnvironmentExpansion interface{} + +type EnvironmentRoleBindingExpansion interface{} + +type ExtensionExpansion interface{} + +type FactExpansion interface{} + +type GitServiceExpansion interface{} + +type PipelineActivityExpansion interface{} + +type PipelineStructureExpansion interface{} + +type PluginExpansion interface{} + +type ReleaseExpansion interface{} + type SchedulerExpansion interface{} +type SourceRepositoryExpansion interface{} + type SourceRepositoryGroupExpansion interface{} + +type TeamExpansion interface{} + +type UserExpansion interface{} + +type WorkflowExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice.go index 74b623d..b15a47c 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice_expansion.go deleted file mode 100644 index f592d5a..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// GitServiceExpansion expands the default CRUD interface for GitService. -type GitServiceExpansion interface { - PatchUpdate(gitService *v1.GitService) (result *v1.GitService, err error) -} - -// PatchUpdate takes the representation of a gitService and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the gitService, and an error, if there is any. -func (c *gitServices) PatchUpdate(gitService *v1.GitService) (*v1.GitService, error) { - resourceName := gitService.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, gitService) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice_expansion_test.go deleted file mode 100644 index 213a799..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice_expansion_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testGitService = &v1.GitService{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: v1.GitServiceSpec{}, - } -) - -func TestPatchUpdateGitServiceNoModification(t *testing.T) { - json, err := json.Marshal(testGitService) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - gitServices := gitServices{ - client: fakeClient, - ns: "default", - } - - updated, err := gitServices.PatchUpdate(testGitService) - assert.NoError(t, err) - assert.Equal(t, testGitService, updated) -} - -func TestPatchUpdateGitServiceWithChange(t *testing.T) { - clonedGitService := testGitService.DeepCopy() - clonedGitService.Spec.Name = FactNameUpdate - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testGitService) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedGitService) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - gitServices := gitServices{ - client: fakeClient, - ns: "default", - } - - updated, err := gitServices.PatchUpdate(clonedGitService) - assert.NoError(t, err) - assert.NotEqual(t, testGitService, updated) - assert.Equal(t, FactNameUpdate, updated.Spec.Name) -} - -func TestPatchUpdateGitServiceWithErrorInGet(t *testing.T) { - errorMessage := "error during GET" - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorMessage) - } - - fakeClient := newClientForTest(get, nil) - - gitServices := gitServices{ - client: fakeClient, - ns: "default", - } - - updated, err := gitServices.PatchUpdate(testGitService) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdateGitServiceWithErrorInPatch(t *testing.T) { - errorMessage := "error during PATCH" - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testGitService) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorMessage) - } - - fakeClient := newClientForTest(get, patch) - - gitServices := gitServices{ - client: fakeClient, - ns: "default", - } - clonedGitService := testGitService.DeepCopy() - clonedGitService.Spec.Name = FactNameUpdate - updated, err := gitServices.PatchUpdate(clonedGitService) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/jenkins.io_client.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/jenkins.io_client.go index 520bedd..f42565f 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/jenkins.io_client.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/jenkins.io_client.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity.go index 4e6f523..4fc7e38 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity_expansion.go deleted file mode 100644 index e9d636d..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity_expansion.go +++ /dev/null @@ -1,43 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// PipelineActivityExpansion expands the default CRUD interface for PipelineActivity. -type PipelineActivityExpansion interface { - PatchUpdate(pipelineActivity *v1.PipelineActivity) (result *v1.PipelineActivity, err error) -} - -// PatchUpdate takes the representation of a pipelineActivity and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the pipelineActivity, and an error, if there is any. -func (c *pipelineActivities) PatchUpdate(pipelineActivity *v1.PipelineActivity) (*v1.PipelineActivity, error) { - resourceName := pipelineActivity.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, pipelineActivity) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity_expansion_test.go deleted file mode 100644 index 19de682..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity_expansion_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testPipelineActivity = &v1.PipelineActivity{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: v1.PipelineActivitySpec{}, - } -) - -func TestPatchUpdatePipelineActivityNoModification(t *testing.T) { - json, err := json.Marshal(testPipelineActivity) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - pipelineActivities := pipelineActivities{ - client: fakeClient, - ns: "default", - } - - updated, err := pipelineActivities.PatchUpdate(testPipelineActivity) - assert.NoError(t, err) - assert.Equal(t, testPipelineActivity, updated) -} - -func TestPatchUpdatePipelineActivityWithChange(t *testing.T) { - name := "test" - clonedPipelineActivity := testPipelineActivity.DeepCopy() - clonedPipelineActivity.Spec.Pipeline = name - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testPipelineActivity) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedPipelineActivity) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - pipelineActivities := pipelineActivities{ - client: fakeClient, - ns: "default", - } - - updated, err := pipelineActivities.PatchUpdate(clonedPipelineActivity) - assert.NoError(t, err) - assert.NotEqual(t, testPipelineActivity, updated) - assert.Equal(t, name, updated.Spec.Pipeline) -} - -func TestPatchUpdatePipelineActivityWithErrorInGet(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringGETMessage) - } - - fakeClient := newClientForTest(get, nil) - - pipelineActivities := pipelineActivities{ - client: fakeClient, - ns: "default", - } - - updated, err := pipelineActivities.PatchUpdate(testPipelineActivity) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringGETMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdatePipelineActivityWithErrorInPatch(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testPipelineActivity) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringPATCHMessage) - } - - fakeClient := newClientForTest(get, patch) - - pipelineActivities := pipelineActivities{ - client: fakeClient, - ns: "default", - } - name := "test" - clonedPipelineActivity := testPipelineActivity.DeepCopy() - clonedPipelineActivity.Spec.Pipeline = name - updated, err := pipelineActivities.PatchUpdate(clonedPipelineActivity) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringPATCHMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go index d4061b9..d87f2da 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure_expansion.go deleted file mode 100644 index e9551ed..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// PipelineStructureExpansion expands the default CRUD interface for PipelineStructure. -type PipelineStructureExpansion interface { - PatchUpdate(pipelineStructure *v1.PipelineStructure) (result *v1.PipelineStructure, err error) -} - -// PatchUpdate takes the representation of a pipelineStructure and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the pipelineStructure, and an error, if there is any. -func (c *pipelineStructures) PatchUpdate(pipelineStructure *v1.PipelineStructure) (*v1.PipelineStructure, error) { - resourceName := pipelineStructure.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, pipelineStructure) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure_expansion_test.go deleted file mode 100644 index 1fc25d3..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure_expansion_test.go +++ /dev/null @@ -1,126 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testPipelineStructure = &v1.PipelineStructure{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - } -) - -func TestPatchUpdatePipelineStructureNoModification(t *testing.T) { - json, err := json.Marshal(testPipelineStructure) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - pipelineStructures := pipelineStructures{ - client: fakeClient, - ns: "default", - } - - updated, err := pipelineStructures.PatchUpdate(testPipelineStructure) - assert.NoError(t, err) - assert.Equal(t, testPipelineStructure, updated) -} - -func TestPatchUpdatePipelineStructureWithChange(t *testing.T) { - ref := FactNameUpdate - clonedPipelineStructure := testPipelineStructure.DeepCopy() - clonedPipelineStructure.PipelineRef = &ref - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testPipelineStructure) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedPipelineStructure) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - pipelineStructures := pipelineStructures{ - client: fakeClient, - ns: "default", - } - - updated, err := pipelineStructures.PatchUpdate(clonedPipelineStructure) - assert.NoError(t, err) - assert.NotEqual(t, testPipelineStructure, updated) - assert.Equal(t, &ref, updated.PipelineRef) -} - -func TestPatchUpdatePipelineStructureWithErrorInGet(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringGETMessage) - } - - fakeClient := newClientForTest(get, nil) - - pipelineStructures := pipelineStructures{ - client: fakeClient, - ns: "default", - } - - updated, err := pipelineStructures.PatchUpdate(testPipelineStructure) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringGETMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdatePipelineStructureWithErrorInPatch(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testPipelineStructure) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringPATCHMessage) - } - - fakeClient := newClientForTest(get, patch) - - pipelineStructures := pipelineStructures{ - client: fakeClient, - ns: "default", - } - ref := FactNameUpdate - clonedPipelineStructure := testPipelineStructure.DeepCopy() - clonedPipelineStructure.PipelineRef = &ref - updated, err := pipelineStructures.PatchUpdate(clonedPipelineStructure) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringPATCHMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin.go index ebef9e1..70e0a8b 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin_expansion.go deleted file mode 100644 index 713a411..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// PluginExpansion expands the default CRUD interface for Plugin. -type PluginExpansion interface { - PatchUpdate(plugin *v1.Plugin) (result *v1.Plugin, err error) -} - -// PatchUpdate takes the representation of a plugin and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the plugin, and an error, if there is any. -func (c *plugins) PatchUpdate(plugin *v1.Plugin) (*v1.Plugin, error) { - resourceName := plugin.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, plugin) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin_expansion_test.go deleted file mode 100644 index 265f9b6..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin_expansion_test.go +++ /dev/null @@ -1,124 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testPlugin = &v1.Plugin{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: v1.PluginSpec{}, - } -) - -func TestPatchUpdatePluginNoModification(t *testing.T) { - json, err := json.Marshal(testPlugin) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - plugins := plugins{ - client: fakeClient, - ns: "default", - } - - updated, err := plugins.PatchUpdate(testPlugin) - assert.NoError(t, err) - assert.Equal(t, testPlugin, updated) -} - -func TestPatchUpdatePluginWithChange(t *testing.T) { - clonedPlugin := testPlugin.DeepCopy() - clonedPlugin.Spec.Name = FactNameUpdate - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testPlugin) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedPlugin) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - plugins := plugins{ - client: fakeClient, - ns: "default", - } - - updated, err := plugins.PatchUpdate(clonedPlugin) - assert.NoError(t, err) - assert.NotEqual(t, testPlugin, updated) - assert.Equal(t, FactNameUpdate, updated.Spec.Name) -} - -func TestPatchUpdatePluginWithErrorInGet(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringGETMessage) - } - - fakeClient := newClientForTest(get, nil) - - plugins := plugins{ - client: fakeClient, - ns: "default", - } - updated, err := plugins.PatchUpdate(testPlugin) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringGETMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdatePluginWithErrorInPatch(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testPlugin) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringPATCHMessage) - } - - fakeClient := newClientForTest(get, patch) - - plugins := plugins{ - client: fakeClient, - ns: "default", - } - clonedPlugin := testPlugin.DeepCopy() - clonedPlugin.Spec.Name = FactNameUpdate - updated, err := plugins.PatchUpdate(clonedPlugin) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringPATCHMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/release.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/release.go index edeb5f2..559135d 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/release.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/release.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/release_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/release_expansion.go deleted file mode 100644 index 40070a3..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/release_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// ReleaseExpansion expands the default CRUD interface for Release. -type ReleaseExpansion interface { - PatchUpdate(release *v1.Release) (result *v1.Release, err error) -} - -// PatchUpdate takes the representation of a release and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the release, and an error, if there is any. -func (c *releases) PatchUpdate(release *v1.Release) (*v1.Release, error) { - resourceName := release.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, release) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/release_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/release_expansion_test.go deleted file mode 100644 index 7758995..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/release_expansion_test.go +++ /dev/null @@ -1,126 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testRelease = &v1.Release{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: v1.ReleaseSpec{}, - } -) - -func TestPatchUpdateReleaseNoModification(t *testing.T) { - json, err := json.Marshal(testRelease) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - releases := releases{ - client: fakeClient, - ns: "default", - } - - updated, err := releases.PatchUpdate(testRelease) - assert.NoError(t, err) - assert.Equal(t, testRelease, updated) -} - -func TestPatchUpdateReleaseWithChange(t *testing.T) { - clonedRelease := testRelease.DeepCopy() - clonedRelease.Spec.Name = FactNameUpdate - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testRelease) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedRelease) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - releases := releases{ - client: fakeClient, - ns: "default", - } - - updated, err := releases.PatchUpdate(clonedRelease) - assert.NoError(t, err) - assert.NotEqual(t, testRelease, updated) - assert.Equal(t, FactNameUpdate, updated.Spec.Name) -} - -func TestPatchUpdateReleaseWithErrorInGet(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringGETMessage) - } - - fakeClient := newClientForTest(get, nil) - - releases := releases{ - client: fakeClient, - ns: "default", - } - - updated, err := releases.PatchUpdate(testRelease) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringGETMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdateReleaseWithErrorInPatch(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testRelease) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringPATCHMessage) - } - - fakeClient := newClientForTest(get, patch) - - releases := releases{ - client: fakeClient, - ns: "default", - } - name := "susfu" - clonedRelease := testRelease.DeepCopy() - clonedRelease.Spec.Name = name - updated, err := releases.PatchUpdate(clonedRelease) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringPATCHMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go index 8b0cc2b..db56690 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository.go index 0c63ca2..7a72df9 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository_expansion.go deleted file mode 100644 index 4b2c54e..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// SourceRepositoryExpansion expands the default CRUD interface for SourceRepository. -type SourceRepositoryExpansion interface { - PatchUpdate(sourceRepository *v1.SourceRepository) (result *v1.SourceRepository, err error) -} - -// PatchUpdate takes the representation of a sourceRepository and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the sourceRepository, and an error, if there is any. -func (c *sourceRepositories) PatchUpdate(sourceRepository *v1.SourceRepository) (*v1.SourceRepository, error) { - resourceName := sourceRepository.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, sourceRepository) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository_expansion_test.go deleted file mode 100644 index 0c8d3dd..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository_expansion_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testSourceRepository = &v1.SourceRepository{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: v1.SourceRepositorySpec{}, - } -) - -func TestPatchUpdateSourceRepositoryNoModification(t *testing.T) { - json, err := json.Marshal(testSourceRepository) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - sourceRepositories := sourceRepositories{ - client: fakeClient, - ns: "default", - } - - updated, err := sourceRepositories.PatchUpdate(testSourceRepository) - assert.NoError(t, err) - assert.Equal(t, testSourceRepository, updated) -} - -func TestPatchUpdateSourceRepositoryWithChange(t *testing.T) { - description := "my repo" - clonedSourceRepository := testSourceRepository.DeepCopy() - clonedSourceRepository.Spec.Description = description - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testSourceRepository) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedSourceRepository) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - sourceRepositories := sourceRepositories{ - client: fakeClient, - ns: "default", - } - - updated, err := sourceRepositories.PatchUpdate(clonedSourceRepository) - assert.NoError(t, err) - assert.NotEqual(t, testSourceRepository, updated) - assert.Equal(t, description, updated.Spec.Description) -} - -func TestPatchUpdateSourceRepositoryWithErrorInGet(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringGETMessage) - } - - fakeClient := newClientForTest(get, nil) - - sourceRepositories := sourceRepositories{ - client: fakeClient, - ns: "default", - } - - updated, err := sourceRepositories.PatchUpdate(testSourceRepository) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringGETMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdateSourceRepositoryWithErrorInPatch(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testSourceRepository) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringPATCHMessage) - } - - fakeClient := newClientForTest(get, patch) - - sourceRepositories := sourceRepositories{ - client: fakeClient, - ns: "default", - } - description := "my repo" - clonedSourceRepository := testSourceRepository.DeepCopy() - clonedSourceRepository.Spec.Description = description - updated, err := sourceRepositories.PatchUpdate(clonedSourceRepository) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringPATCHMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepositorygroup.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepositorygroup.go index 2236052..7e59c04 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepositorygroup.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepositorygroup.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/team.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/team.go index d528997..a81aa71 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/team.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/team.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/team_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/team_expansion.go deleted file mode 100644 index 8652938..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/team_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// TeamExpansion expands the default CRUD interface for Team. -type TeamExpansion interface { - PatchUpdate(team *v1.Team) (result *v1.Team, err error) -} - -// PatchUpdate takes the representation of a team and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the team, and an error, if there is any. -func (c *teams) PatchUpdate(team *v1.Team) (*v1.Team, error) { - resourceName := team.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, team) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/team_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/team_expansion_test.go deleted file mode 100644 index 628a606..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/team_expansion_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testTeam = &v1.Team{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: v1.TeamSpec{}, - } -) - -func TestPatchUpdateTeamNoModification(t *testing.T) { - json, err := json.Marshal(testTeam) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - teams := teams{ - client: fakeClient, - ns: "default", - } - - updated, err := teams.PatchUpdate(testTeam) - assert.NoError(t, err) - assert.Equal(t, testTeam, updated) -} - -func TestPatchUpdateTeamWithChange(t *testing.T) { - label := "Black Team" - clonedTeam := testTeam.DeepCopy() - clonedTeam.Spec.Label = label - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testTeam) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedTeam) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - teams := teams{ - client: fakeClient, - ns: "default", - } - - updated, err := teams.PatchUpdate(clonedTeam) - assert.NoError(t, err) - assert.NotEqual(t, testTeam, updated) - assert.Equal(t, label, updated.Spec.Label) -} - -func TestPatchUpdateTeamWithErrorInGet(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringGETMessage) - } - - fakeClient := newClientForTest(get, nil) - - teams := teams{ - client: fakeClient, - ns: "default", - } - - updated, err := teams.PatchUpdate(testTeam) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringGETMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdateTeamWithErrorInPatch(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testTeam) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringPATCHMessage) - } - - fakeClient := newClientForTest(get, patch) - - teams := teams{ - client: fakeClient, - ns: "default", - } - label := "Black Team" - clonedTeam := testTeam.DeepCopy() - clonedTeam.Spec.Label = label - updated, err := teams.PatchUpdate(clonedTeam) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringPATCHMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/testutil.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/testutil.go deleted file mode 100644 index ba9e40b..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/testutil.go +++ /dev/null @@ -1,82 +0,0 @@ -package v1 - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "net/http" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/serializer" - fakerest "k8s.io/client-go/rest/fake" -) - -var ( - codecs = serializer.WithoutConversionCodecFactory{CodecFactory: scheme.Codecs} -) - -const ( - FactNameUpdate string = "susfu" - errorDuringGETMessage string = "error during GET" - errorDuringPATCHMessage string = "error during PATCH" -) - -type fakeGetPatchRequest struct { - get func(*http.Request) (*http.Response, error) - patch func(*http.Request) (*http.Response, error) -} - -//nolint:bodyclose -func newClientForTest(get func(*http.Request) (*http.Response, error), patch func(*http.Request) (*http.Response, error)) *fakerest.RESTClient { - faker := newGetPatchRequest(get, patch) - - fakeClient := &fakerest.RESTClient{ - Client: fakerest.CreateHTTPClient(faker.GetHandler()), - NegotiatedSerializer: codecs, - GroupVersion: v1.SchemeGroupVersion, - VersionedAPIPath: "/not/a/real/path", - } - - return fakeClient -} - -func newGetPatchRequest(get func(*http.Request) (*http.Response, error), patch func(*http.Request) (*http.Response, error)) *fakeGetPatchRequest { - return &fakeGetPatchRequest{ - get: get, - patch: patch, - } -} - -func (f *fakeGetPatchRequest) GetHandler() func(*http.Request) (*http.Response, error) { - return f.fakeReqHandler -} - -func (f *fakeGetPatchRequest) fakeReqHandler(req *http.Request) (*http.Response, error) { - switch req.Method { - case "GET": - if f.get == nil { - return nil, fmt.Errorf("unexpected request for URL %q with method %q", req.URL.String(), req.Method) - } - return f.get(req) - case "PATCH": - if f.patch == nil { - return nil, fmt.Errorf("unexpected request for URL %q with method %q", req.URL.String(), req.Method) - } - return f.patch(req) - default: - return nil, fmt.Errorf("unexpected request for URL %q with method %q", req.URL.String(), req.Method) - } -} - -func bytesBody(bodyBytes []byte) io.ReadCloser { - return ioutil.NopCloser(bytes.NewReader(bodyBytes)) -} - -func defaultHeaders() http.Header { - header := http.Header{} - header.Set("Content-Type", runtime.ContentTypeJSON) - return header -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/user.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/user.go index cd2491b..5248185 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/user.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/user.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/user_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/user_expansion.go deleted file mode 100644 index a45c3f6..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/user_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// UserExpansion expands the default CRUD interface for User. -type UserExpansion interface { - PatchUpdate(user *v1.User) (result *v1.User, err error) -} - -// PatchUpdate takes the representation of a user and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the user, and an error, if there is any. -func (c *users) PatchUpdate(user *v1.User) (*v1.User, error) { - resourceName := user.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, user) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/user_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/user_expansion_test.go deleted file mode 100644 index c691950..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/user_expansion_test.go +++ /dev/null @@ -1,126 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testUser = &v1.User{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: v1.UserDetails{}, - } -) - -func TestPatchUpdateUserNoModification(t *testing.T) { - json, err := json.Marshal(testUser) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - users := users{ - client: fakeClient, - ns: "default", - } - - updated, err := users.PatchUpdate(testUser) - assert.NoError(t, err) - assert.Equal(t, testUser, updated) -} - -func TestPatchUpdateUserWithChange(t *testing.T) { - clonedUser := testUser.DeepCopy() - clonedUser.Spec.Name = FactNameUpdate - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testUser) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedUser) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - users := users{ - client: fakeClient, - ns: "default", - } - - updated, err := users.PatchUpdate(clonedUser) - assert.NoError(t, err) - assert.NotEqual(t, testUser, updated) - assert.Equal(t, FactNameUpdate, updated.Spec.Name) -} - -func TestPatchUpdateUserWithErrorInGet(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringGETMessage) - } - - fakeClient := newClientForTest(get, nil) - - users := users{ - client: fakeClient, - ns: "default", - } - - updated, err := users.PatchUpdate(testUser) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringGETMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdateUserWithErrorInPatch(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testUser) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringPATCHMessage) - } - - fakeClient := newClientForTest(get, patch) - - users := users{ - client: fakeClient, - ns: "default", - } - name := "susfu" - clonedUser := testUser.DeepCopy() - clonedUser.Spec.Name = name - updated, err := users.PatchUpdate(clonedUser) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringPATCHMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go index ecb772c..677c170 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by client-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow_expansion.go deleted file mode 100644 index 0acf8da..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow_expansion.go +++ /dev/null @@ -1,42 +0,0 @@ -package v1 - -import ( - "bytes" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - util "github.com/jenkins-x/jx-api/pkg/util/json" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" -) - -// WorkflowExpansion expands the default CRUD interface for Workflow. -type WorkflowExpansion interface { - PatchUpdate(workflow *v1.Workflow) (result *v1.Workflow, err error) -} - -// PatchUpdate takes the representation of a workflow and updates using Patch generating a JSON patch to do so. -// Returns the server's representation of the workflow, and an error, if there is any. -func (c *workflows) PatchUpdate(workflow *v1.Workflow) (*v1.Workflow, error) { - resourceName := workflow.ObjectMeta.Name - - // force retrieval from cache - options := metav1.GetOptions{ResourceVersion: "0"} - orig, err := c.Get(resourceName, options) - if err != nil { - return nil, err - } - - patch, err := util.CreatePatch(orig, workflow) - if err != nil { - return nil, err - } - if bytes.Equal(patch, []byte("[]")) { - return orig, nil - } - patched, err := c.Patch(resourceName, types.JSONPatchType, patch) - if err != nil { - return nil, err - } - - return patched, nil -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow_expansion_test.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow_expansion_test.go deleted file mode 100644 index 5b771bc..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow_expansion_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//nolint:dupl -package v1 - -import ( - "encoding/json" - "errors" - "net/http" - "testing" - - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/stretchr/testify/assert" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -var ( - testWorkflow = &v1.Workflow{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - Spec: v1.WorkflowSpec{}, - } -) - -func TestPatchUpdateWorkflowNoModification(t *testing.T) { - json, err := json.Marshal(testWorkflow) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - get := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - workflows := workflows{ - client: fakeClient, - ns: "default", - } - - updated, err := workflows.PatchUpdate(testWorkflow) - assert.NoError(t, err) - assert.Equal(t, testWorkflow, updated) -} - -func TestPatchUpdateWorkflowWithChange(t *testing.T) { - pipelineName := "dummy-pipeline" - clonedWorkflow := testWorkflow.DeepCopy() - clonedWorkflow.Spec.PipelineName = pipelineName - - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testWorkflow) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(clonedWorkflow) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - fakeClient := newClientForTest(get, patch) - - workflows := workflows{ - client: fakeClient, - ns: "default", - } - - updated, err := workflows.PatchUpdate(clonedWorkflow) - assert.NoError(t, err) - assert.NotEqual(t, testWorkflow, updated) - assert.Equal(t, pipelineName, updated.Spec.PipelineName) -} - -func TestPatchUpdateWorkflowWithErrorInGet(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringGETMessage) - } - - fakeClient := newClientForTest(get, nil) - - workflows := workflows{ - client: fakeClient, - ns: "default", - } - - updated, err := workflows.PatchUpdate(testWorkflow) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringGETMessage) - assert.Nil(t, updated) -} - -func TestPatchUpdateWorkflowWithErrorInPatch(t *testing.T) { - get := func(*http.Request) (*http.Response, error) { - json, err := json.Marshal(testWorkflow) - if err != nil { - assert.Failf(t, "unable to marshal test instance: %s", err.Error()) - } - return &http.Response{StatusCode: 200, Header: defaultHeaders(), Body: bytesBody(json)}, nil - } - - patch := func(*http.Request) (*http.Response, error) { - return nil, errors.New(errorDuringPATCHMessage) - } - - fakeClient := newClientForTest(get, patch) - - workflows := workflows{ - client: fakeClient, - ns: "default", - } - pipelineName := "dummy-pipeline" - clonedWorkflow := testWorkflow.DeepCopy() - clonedWorkflow.Spec.PipelineName = pipelineName - updated, err := workflows.PatchUpdate(clonedWorkflow) - assert.Error(t, err) - assert.Contains(t, err.Error(), errorDuringPATCHMessage) - assert.Nil(t, updated) -} diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 1a0c594..9717c95 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package externalversions diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index b968383..787a794 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package externalversions diff --git a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go index 40dd605..c8459a8 100644 --- a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package internalinterfaces diff --git a/pkg/client/informers/externalversions/jenkins.io/interface.go b/pkg/client/informers/externalversions/jenkins.io/interface.go index b14a1fc..f7179e9 100644 --- a/pkg/client/informers/externalversions/jenkins.io/interface.go +++ b/pkg/client/informers/externalversions/jenkins.io/interface.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package jenkins diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/app.go b/pkg/client/informers/externalversions/jenkins.io/v1/app.go index bc36a64..ca1ff19 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/app.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/app.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/buildpack.go b/pkg/client/informers/externalversions/jenkins.io/v1/buildpack.go index acf6420..65def86 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/buildpack.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/buildpack.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/commitstatus.go b/pkg/client/informers/externalversions/jenkins.io/v1/commitstatus.go index 2cbb313..96b41df 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/commitstatus.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/commitstatus.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/environment.go b/pkg/client/informers/externalversions/jenkins.io/v1/environment.go index 0b1dd18..138d4c4 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/environment.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/environment.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/environmentrolebinding.go b/pkg/client/informers/externalversions/jenkins.io/v1/environmentrolebinding.go index 6c3c531..71d014a 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/environmentrolebinding.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/environmentrolebinding.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/extension.go b/pkg/client/informers/externalversions/jenkins.io/v1/extension.go index 551d541..0950c7c 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/extension.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/extension.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/fact.go b/pkg/client/informers/externalversions/jenkins.io/v1/fact.go index c889475..cfacdb5 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/fact.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/fact.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/gitservice.go b/pkg/client/informers/externalversions/jenkins.io/v1/gitservice.go index 10a7e51..c8efd91 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/gitservice.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/gitservice.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/interface.go b/pkg/client/informers/externalversions/jenkins.io/v1/interface.go index c39fbdb..a6dfbb2 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/interface.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/interface.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/pipelineactivity.go b/pkg/client/informers/externalversions/jenkins.io/v1/pipelineactivity.go index 42fc2da..79cee10 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/pipelineactivity.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/pipelineactivity.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go b/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go index be66fa7..d6de95b 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/plugin.go b/pkg/client/informers/externalversions/jenkins.io/v1/plugin.go index cfcb2f6..bf145c1 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/plugin.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/plugin.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/release.go b/pkg/client/informers/externalversions/jenkins.io/v1/release.go index 8d99e5f..3fbaadd 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/release.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/release.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go b/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go index 33dca80..d4e3aa2 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepository.go b/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepository.go index bb508da..b0362b5 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepository.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepository.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepositorygroup.go b/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepositorygroup.go index f73db20..fadf077 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepositorygroup.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepositorygroup.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/team.go b/pkg/client/informers/externalversions/jenkins.io/v1/team.go index 66224d8..7ffb15a 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/team.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/team.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/user.go b/pkg/client/informers/externalversions/jenkins.io/v1/user.go index ecd7d46..852dcee 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/user.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/user.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go b/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go index 3275e9c..b1acb94 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by informer-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/app.go b/pkg/client/listers/jenkins.io/v1/app.go index 7bc1ef7..6704a64 100644 --- a/pkg/client/listers/jenkins.io/v1/app.go +++ b/pkg/client/listers/jenkins.io/v1/app.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/buildpack.go b/pkg/client/listers/jenkins.io/v1/buildpack.go index 1fe6372..fc2a227 100644 --- a/pkg/client/listers/jenkins.io/v1/buildpack.go +++ b/pkg/client/listers/jenkins.io/v1/buildpack.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/commitstatus.go b/pkg/client/listers/jenkins.io/v1/commitstatus.go index bb69518..0e3fd59 100644 --- a/pkg/client/listers/jenkins.io/v1/commitstatus.go +++ b/pkg/client/listers/jenkins.io/v1/commitstatus.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/environment.go b/pkg/client/listers/jenkins.io/v1/environment.go index d9c2413..89159e4 100644 --- a/pkg/client/listers/jenkins.io/v1/environment.go +++ b/pkg/client/listers/jenkins.io/v1/environment.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/environmentrolebinding.go b/pkg/client/listers/jenkins.io/v1/environmentrolebinding.go index ffd8ab6..e183e52 100644 --- a/pkg/client/listers/jenkins.io/v1/environmentrolebinding.go +++ b/pkg/client/listers/jenkins.io/v1/environmentrolebinding.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/expansion_generated.go b/pkg/client/listers/jenkins.io/v1/expansion_generated.go index a7ce8a7..ac87c9a 100644 --- a/pkg/client/listers/jenkins.io/v1/expansion_generated.go +++ b/pkg/client/listers/jenkins.io/v1/expansion_generated.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/extension.go b/pkg/client/listers/jenkins.io/v1/extension.go index 210faf7..09c977e 100644 --- a/pkg/client/listers/jenkins.io/v1/extension.go +++ b/pkg/client/listers/jenkins.io/v1/extension.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/fact.go b/pkg/client/listers/jenkins.io/v1/fact.go index dcfb3e3..924231f 100644 --- a/pkg/client/listers/jenkins.io/v1/fact.go +++ b/pkg/client/listers/jenkins.io/v1/fact.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/gitservice.go b/pkg/client/listers/jenkins.io/v1/gitservice.go index 151ed11..d35321b 100644 --- a/pkg/client/listers/jenkins.io/v1/gitservice.go +++ b/pkg/client/listers/jenkins.io/v1/gitservice.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/pipelineactivity.go b/pkg/client/listers/jenkins.io/v1/pipelineactivity.go index acf868f..cd682f2 100644 --- a/pkg/client/listers/jenkins.io/v1/pipelineactivity.go +++ b/pkg/client/listers/jenkins.io/v1/pipelineactivity.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/pipelinestructure.go b/pkg/client/listers/jenkins.io/v1/pipelinestructure.go index 73671d4..47431aa 100644 --- a/pkg/client/listers/jenkins.io/v1/pipelinestructure.go +++ b/pkg/client/listers/jenkins.io/v1/pipelinestructure.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/plugin.go b/pkg/client/listers/jenkins.io/v1/plugin.go index e325df8..1ac189c 100644 --- a/pkg/client/listers/jenkins.io/v1/plugin.go +++ b/pkg/client/listers/jenkins.io/v1/plugin.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/release.go b/pkg/client/listers/jenkins.io/v1/release.go index 3187145..6c05246 100644 --- a/pkg/client/listers/jenkins.io/v1/release.go +++ b/pkg/client/listers/jenkins.io/v1/release.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/scheduler.go b/pkg/client/listers/jenkins.io/v1/scheduler.go index 810dc5c..eec9220 100644 --- a/pkg/client/listers/jenkins.io/v1/scheduler.go +++ b/pkg/client/listers/jenkins.io/v1/scheduler.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/sourcerepository.go b/pkg/client/listers/jenkins.io/v1/sourcerepository.go index c595d9d..ccb093a 100644 --- a/pkg/client/listers/jenkins.io/v1/sourcerepository.go +++ b/pkg/client/listers/jenkins.io/v1/sourcerepository.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/sourcerepositorygroup.go b/pkg/client/listers/jenkins.io/v1/sourcerepositorygroup.go index 98d3060..8ad0fe9 100644 --- a/pkg/client/listers/jenkins.io/v1/sourcerepositorygroup.go +++ b/pkg/client/listers/jenkins.io/v1/sourcerepositorygroup.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/team.go b/pkg/client/listers/jenkins.io/v1/team.go index 0b6c6b0..aa8693d 100644 --- a/pkg/client/listers/jenkins.io/v1/team.go +++ b/pkg/client/listers/jenkins.io/v1/team.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/user.go b/pkg/client/listers/jenkins.io/v1/user.go index c3859fa..73e662c 100644 --- a/pkg/client/listers/jenkins.io/v1/user.go +++ b/pkg/client/listers/jenkins.io/v1/user.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/listers/jenkins.io/v1/workflow.go b/pkg/client/listers/jenkins.io/v1/workflow.go index 391bdec..eae8a58 100644 --- a/pkg/client/listers/jenkins.io/v1/workflow.go +++ b/pkg/client/listers/jenkins.io/v1/workflow.go @@ -1,3 +1,18 @@ +/* +Copyright 2020 The Jenkins X Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ // Code generated by lister-gen. DO NOT EDIT. package v1 diff --git a/pkg/client/openapi/all/openapi_generated.go b/pkg/client/openapi/all/openapi_generated.go deleted file mode 100644 index 5e1f6e2..0000000 --- a/pkg/client/openapi/all/openapi_generated.go +++ /dev/null @@ -1,65 +0,0 @@ -// +build !ignore_autogenerated - -// Code generated by jx create client. DO NOT EDIT. -package openapi - -import ( - openapicore "github.com/jenkins-x/jx-api/pkg/client/openapi/core" - - openapi0 "github.com/jenkins-x/jx-api/pkg/client/openapi/k8s_io_apimachinery_meta_v1" - - openapi1 "github.com/jenkins-x/jx-api/pkg/client/openapi/k8s_io_apimachinery_resource_unversioned" - - openapi2 "github.com/jenkins-x/jx-api/pkg/client/openapi/k8s_io_apimachinery_intstr_unversioned" - - openapi3 "github.com/jenkins-x/jx-api/pkg/client/openapi/k8s_io_api_batch_v1" - - openapi4 "github.com/jenkins-x/jx-api/pkg/client/openapi/k8s_io_api_core_v1" - - openapi5 "github.com/jenkins-x/jx-api/pkg/client/openapi/k8s_io_api_rbac_v1" - - "k8s.io/kube-openapi/pkg/common" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - result := make(map[string]common.OpenAPIDefinition) - // This is our core openapi definitions (the ones for this module) - for k, v := range openapicore.GetOpenAPIDefinitions(ref) { - result[k] = v - } - // These are the ones we depend on - - for k, v := range openapi0.GetOpenAPIDefinitions(ref) { - result[k] = v - } - - for k, v := range openapi1.GetOpenAPIDefinitions(ref) { - result[k] = v - } - - for k, v := range openapi2.GetOpenAPIDefinitions(ref) { - result[k] = v - } - - for k, v := range openapi3.GetOpenAPIDefinitions(ref) { - result[k] = v - } - - for k, v := range openapi4.GetOpenAPIDefinitions(ref) { - result[k] = v - } - - for k, v := range openapi5.GetOpenAPIDefinitions(ref) { - result[k] = v - } - - return result -} - -func GetNames(ref common.ReferenceCallback) []string { - result := make([]string, 0) - for k, _ := range openapicore.GetOpenAPIDefinitions(ref) { - result = append(result, k) - } - return result -} diff --git a/pkg/client/openapi/core/openapi_generated.go b/pkg/client/openapi/core/openapi_generated.go deleted file mode 100644 index 6b2dc25..0000000 --- a/pkg/client/openapi/core/openapi_generated.go +++ /dev/null @@ -1,6861 +0,0 @@ -// +build !ignore_autogenerated - -// Code generated by openapi-gen. DO NOT EDIT. - -// This file was autogenerated by openapi-gen. Do not edit it manually! - -package core - -import ( - spec "github.com/go-openapi/spec" - common "k8s.io/kube-openapi/pkg/common" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - return map[string]common.OpenAPIDefinition{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.AccountReference": schema_pkg_apis_jenkinsio_v1_AccountReference(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.App": schema_pkg_apis_jenkinsio_v1_App(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.AppList": schema_pkg_apis_jenkinsio_v1_AppList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.AppSpec": schema_pkg_apis_jenkinsio_v1_AppSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Approve": schema_pkg_apis_jenkinsio_v1_Approve(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Attachment": schema_pkg_apis_jenkinsio_v1_Attachment(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.BatchPipelineActivity": schema_pkg_apis_jenkinsio_v1_BatchPipelineActivity(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Binary": schema_pkg_apis_jenkinsio_v1_Binary(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.BranchProtectionContextPolicy": schema_pkg_apis_jenkinsio_v1_BranchProtectionContextPolicy(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Brancher": schema_pkg_apis_jenkinsio_v1_Brancher(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.BuildPack": schema_pkg_apis_jenkinsio_v1_BuildPack(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.BuildPackList": schema_pkg_apis_jenkinsio_v1_BuildPackList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.BuildPackSpec": schema_pkg_apis_jenkinsio_v1_BuildPackSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ChartRef": schema_pkg_apis_jenkinsio_v1_ChartRef(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatus": schema_pkg_apis_jenkinsio_v1_CommitStatus(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatusCommitReference": schema_pkg_apis_jenkinsio_v1_CommitStatusCommitReference(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatusDetails": schema_pkg_apis_jenkinsio_v1_CommitStatusDetails(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatusItem": schema_pkg_apis_jenkinsio_v1_CommitStatusItem(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatusList": schema_pkg_apis_jenkinsio_v1_CommitStatusList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatusSpec": schema_pkg_apis_jenkinsio_v1_CommitStatusSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitSummary": schema_pkg_apis_jenkinsio_v1_CommitSummary(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ConfigMapSpec": schema_pkg_apis_jenkinsio_v1_ConfigMapSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ConfigUpdater": schema_pkg_apis_jenkinsio_v1_ConfigUpdater(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ContextPolicy": schema_pkg_apis_jenkinsio_v1_ContextPolicy(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CoreActivityStep": schema_pkg_apis_jenkinsio_v1_CoreActivityStep(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.DependencyUpdate": schema_pkg_apis_jenkinsio_v1_DependencyUpdate(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.DependencyUpdateDetails": schema_pkg_apis_jenkinsio_v1_DependencyUpdateDetails(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.DeployOptions": schema_pkg_apis_jenkinsio_v1_DeployOptions(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Environment": schema_pkg_apis_jenkinsio_v1_Environment(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentFilter": schema_pkg_apis_jenkinsio_v1_EnvironmentFilter(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentList": schema_pkg_apis_jenkinsio_v1_EnvironmentList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentRepository": schema_pkg_apis_jenkinsio_v1_EnvironmentRepository(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentRoleBinding": schema_pkg_apis_jenkinsio_v1_EnvironmentRoleBinding(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentRoleBindingList": schema_pkg_apis_jenkinsio_v1_EnvironmentRoleBindingList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentRoleBindingSpec": schema_pkg_apis_jenkinsio_v1_EnvironmentRoleBindingSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentRoleBindingStatus": schema_pkg_apis_jenkinsio_v1_EnvironmentRoleBindingStatus(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentSpec": schema_pkg_apis_jenkinsio_v1_EnvironmentSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentStatus": schema_pkg_apis_jenkinsio_v1_EnvironmentStatus(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentVariable": schema_pkg_apis_jenkinsio_v1_EnvironmentVariable(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Extension": schema_pkg_apis_jenkinsio_v1_Extension(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionConfig": schema_pkg_apis_jenkinsio_v1_ExtensionConfig(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionConfigList": schema_pkg_apis_jenkinsio_v1_ExtensionConfigList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionDefinition": schema_pkg_apis_jenkinsio_v1_ExtensionDefinition(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionDefinitionChildReference": schema_pkg_apis_jenkinsio_v1_ExtensionDefinitionChildReference(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionDefinitionList": schema_pkg_apis_jenkinsio_v1_ExtensionDefinitionList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionDefinitionReference": schema_pkg_apis_jenkinsio_v1_ExtensionDefinitionReference(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionDefinitionReferenceList": schema_pkg_apis_jenkinsio_v1_ExtensionDefinitionReferenceList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionExecution": schema_pkg_apis_jenkinsio_v1_ExtensionExecution(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionList": schema_pkg_apis_jenkinsio_v1_ExtensionList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionParameter": schema_pkg_apis_jenkinsio_v1_ExtensionParameter(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionParameterValue": schema_pkg_apis_jenkinsio_v1_ExtensionParameterValue(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionRepositoryReference": schema_pkg_apis_jenkinsio_v1_ExtensionRepositoryReference(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionRepositoryReferenceList": schema_pkg_apis_jenkinsio_v1_ExtensionRepositoryReferenceList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionSpec": schema_pkg_apis_jenkinsio_v1_ExtensionSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExternalPlugin": schema_pkg_apis_jenkinsio_v1_ExternalPlugin(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Fact": schema_pkg_apis_jenkinsio_v1_Fact(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.FactList": schema_pkg_apis_jenkinsio_v1_FactList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.FactSpec": schema_pkg_apis_jenkinsio_v1_FactSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.FactStatus": schema_pkg_apis_jenkinsio_v1_FactStatus(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.GitService": schema_pkg_apis_jenkinsio_v1_GitService(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.GitServiceList": schema_pkg_apis_jenkinsio_v1_GitServiceList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.GitServiceSpec": schema_pkg_apis_jenkinsio_v1_GitServiceSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.GitStatus": schema_pkg_apis_jenkinsio_v1_GitStatus(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.GlobalProtectionPolicy": schema_pkg_apis_jenkinsio_v1_GlobalProtectionPolicy(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.IssueLabel": schema_pkg_apis_jenkinsio_v1_IssueLabel(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.IssueSummary": schema_pkg_apis_jenkinsio_v1_IssueSummary(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.JobBase": schema_pkg_apis_jenkinsio_v1_JobBase(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Lgtm": schema_pkg_apis_jenkinsio_v1_Lgtm(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Measurement": schema_pkg_apis_jenkinsio_v1_Measurement(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Merger": schema_pkg_apis_jenkinsio_v1_Merger(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Original": schema_pkg_apis_jenkinsio_v1_Original(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Periodic": schema_pkg_apis_jenkinsio_v1_Periodic(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Periodics": schema_pkg_apis_jenkinsio_v1_Periodics(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineActivity": schema_pkg_apis_jenkinsio_v1_PipelineActivity(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineActivityList": schema_pkg_apis_jenkinsio_v1_PipelineActivityList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineActivitySpec": schema_pkg_apis_jenkinsio_v1_PipelineActivitySpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineActivityStatus": schema_pkg_apis_jenkinsio_v1_PipelineActivityStatus(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineActivityStep": schema_pkg_apis_jenkinsio_v1_PipelineActivityStep(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineExtension": schema_pkg_apis_jenkinsio_v1_PipelineExtension(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineStructure": schema_pkg_apis_jenkinsio_v1_PipelineStructure(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineStructureList": schema_pkg_apis_jenkinsio_v1_PipelineStructureList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineStructureStage": schema_pkg_apis_jenkinsio_v1_PipelineStructureStage(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Plugin": schema_pkg_apis_jenkinsio_v1_Plugin(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PluginList": schema_pkg_apis_jenkinsio_v1_PluginList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PluginSpec": schema_pkg_apis_jenkinsio_v1_PluginSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Postsubmit": schema_pkg_apis_jenkinsio_v1_Postsubmit(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Postsubmits": schema_pkg_apis_jenkinsio_v1_Postsubmits(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Presubmit": schema_pkg_apis_jenkinsio_v1_Presubmit(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Presubmits": schema_pkg_apis_jenkinsio_v1_Presubmits(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PreviewActivityStep": schema_pkg_apis_jenkinsio_v1_PreviewActivityStep(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PreviewGitSpec": schema_pkg_apis_jenkinsio_v1_PreviewGitSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PromoteActivityStep": schema_pkg_apis_jenkinsio_v1_PromoteActivityStep(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PromotePullRequestStep": schema_pkg_apis_jenkinsio_v1_PromotePullRequestStep(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PromoteUpdateStep": schema_pkg_apis_jenkinsio_v1_PromoteUpdateStep(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PromoteWorkflowStep": schema_pkg_apis_jenkinsio_v1_PromoteWorkflowStep(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ProtectionPolicies": schema_pkg_apis_jenkinsio_v1_ProtectionPolicies(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ProtectionPolicy": schema_pkg_apis_jenkinsio_v1_ProtectionPolicy(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PullRequestInfo": schema_pkg_apis_jenkinsio_v1_PullRequestInfo(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Query": schema_pkg_apis_jenkinsio_v1_Query(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.QuickStartLocation": schema_pkg_apis_jenkinsio_v1_QuickStartLocation(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.RegexpChangeMatcher": schema_pkg_apis_jenkinsio_v1_RegexpChangeMatcher(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Release": schema_pkg_apis_jenkinsio_v1_Release(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReleaseList": schema_pkg_apis_jenkinsio_v1_ReleaseList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReleaseSpec": schema_pkg_apis_jenkinsio_v1_ReleaseSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReleaseStatus": schema_pkg_apis_jenkinsio_v1_ReleaseStatus(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableMapOfStringContextPolicy": schema_pkg_apis_jenkinsio_v1_ReplaceableMapOfStringContextPolicy(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableMapOfStringString": schema_pkg_apis_jenkinsio_v1_ReplaceableMapOfStringString(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfExternalPlugins": schema_pkg_apis_jenkinsio_v1_ReplaceableSliceOfExternalPlugins(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings": schema_pkg_apis_jenkinsio_v1_ReplaceableSliceOfStrings(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.RepoContextPolicy": schema_pkg_apis_jenkinsio_v1_RepoContextPolicy(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ResourceReference": schema_pkg_apis_jenkinsio_v1_ResourceReference(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Restrictions": schema_pkg_apis_jenkinsio_v1_Restrictions(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReviewPolicy": schema_pkg_apis_jenkinsio_v1_ReviewPolicy(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Scheduler": schema_pkg_apis_jenkinsio_v1_Scheduler(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SchedulerAgent": schema_pkg_apis_jenkinsio_v1_SchedulerAgent(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SchedulerList": schema_pkg_apis_jenkinsio_v1_SchedulerList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SchedulerSpec": schema_pkg_apis_jenkinsio_v1_SchedulerSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SourceRepository": schema_pkg_apis_jenkinsio_v1_SourceRepository(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SourceRepositoryGroup": schema_pkg_apis_jenkinsio_v1_SourceRepositoryGroup(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SourceRepositoryGroupList": schema_pkg_apis_jenkinsio_v1_SourceRepositoryGroupList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SourceRepositoryGroupSpec": schema_pkg_apis_jenkinsio_v1_SourceRepositoryGroupSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SourceRepositoryList": schema_pkg_apis_jenkinsio_v1_SourceRepositoryList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SourceRepositorySpec": schema_pkg_apis_jenkinsio_v1_SourceRepositorySpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.StageActivityStep": schema_pkg_apis_jenkinsio_v1_StageActivityStep(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Statement": schema_pkg_apis_jenkinsio_v1_Statement(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.StorageLocation": schema_pkg_apis_jenkinsio_v1_StorageLocation(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Team": schema_pkg_apis_jenkinsio_v1_Team(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.TeamList": schema_pkg_apis_jenkinsio_v1_TeamList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.TeamSettings": schema_pkg_apis_jenkinsio_v1_TeamSettings(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.TeamSpec": schema_pkg_apis_jenkinsio_v1_TeamSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.TeamStatus": schema_pkg_apis_jenkinsio_v1_TeamStatus(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Trigger": schema_pkg_apis_jenkinsio_v1_Trigger(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.User": schema_pkg_apis_jenkinsio_v1_User(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserDetails": schema_pkg_apis_jenkinsio_v1_UserDetails(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserList": schema_pkg_apis_jenkinsio_v1_UserList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserSpec": schema_pkg_apis_jenkinsio_v1_UserSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Welcome": schema_pkg_apis_jenkinsio_v1_Welcome(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Workflow": schema_pkg_apis_jenkinsio_v1_Workflow(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.WorkflowList": schema_pkg_apis_jenkinsio_v1_WorkflowList(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.WorkflowPreconditions": schema_pkg_apis_jenkinsio_v1_WorkflowPreconditions(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.WorkflowSpec": schema_pkg_apis_jenkinsio_v1_WorkflowSpec(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.WorkflowStatus": schema_pkg_apis_jenkinsio_v1_WorkflowStatus(ref), - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.WorkflowStep": schema_pkg_apis_jenkinsio_v1_WorkflowStep(ref), - } -} - -func schema_pkg_apis_jenkinsio_v1_AccountReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AccountReference is a reference to a user account in another system that is attached to this user", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "provider": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "id": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_App(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "App is the metadata for an App", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.AppSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.AppSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_AppList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AppList is a structure used by k8s to store lists of apps", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.App"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.App", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_AppSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AppSpec provides details of the metadata for an App", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "schemaPreprocessor": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Container"), - }, - }, - "schemaPreprocessorRole": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/rbac/v1.Role"), - }, - }, - "pipelineExtension": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineExtension"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineExtension", "k8s.io/api/core/v1.Container", "k8s.io/api/rbac/v1.Role"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Approve(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Approve specifies a configuration for a single approve.\n\nThe configuration for the approve plugin is defined as a list of these structures.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "issueRequired": { - SchemaProps: spec.SchemaProps{ - Description: "IssueRequired indicates if an associated issue is required for approval in the specified repos.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "requireSelfApproval": { - SchemaProps: spec.SchemaProps{ - Description: "RequireSelfApproval requires PR authors to explicitly approve their PRs. Otherwise the plugin assumes the author of the PR approves the changes in the PR.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "lgtmActsAsApprove": { - SchemaProps: spec.SchemaProps{ - Description: "LgtmActsAsApprove indicates that the lgtm command should be used to indicate approval", - Type: []string{"boolean"}, - Format: "", - }, - }, - "ignoreReviewState": { - SchemaProps: spec.SchemaProps{ - Description: "IgnoreReviewState causes the approve plugin to ignore the GitHub review state. Otherwise: * an APPROVE github review is equivalent to leaving an \"/approve\" message. * A REQUEST_CHANGES github review is equivalent to leaving an /approve cancel\" message.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Attachment(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "urls": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_BatchPipelineActivity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BatchPipelineActivity contains information about a batch build, used by both the batch build and its comprising PRs for linking them together", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "batchBuildNumber": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "batchBranchName": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "pullRequestInfo": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PullRequestInfo"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PullRequestInfo"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Binary(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Binary provies the details of a downloadable binary", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "goarch": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "goos": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "url": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_BranchProtectionContextPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BranchProtectionContextPolicy configures required git provider contexts. Strict determines whether merging to the branch invalidates existing contexts.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "contexts": { - SchemaProps: spec.SchemaProps{ - Description: "Contexts appends required contexts that must be green to merge", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - "strict": { - SchemaProps: spec.SchemaProps{ - Description: "Strict overrides whether new commits in the base branch require updating the PR if set", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Brancher(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Brancher is for shared code between jobs that only run against certain branches. An empty brancher runs against all branches.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "skipBranches": { - SchemaProps: spec.SchemaProps{ - Description: "Do not run against these branches. Default is no branches.", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - "branches": { - SchemaProps: spec.SchemaProps{ - Description: "Only run against these branches. Default is all branches.", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_BuildPack(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BuildPack represents a set of language specific build packs and associated quickstarts", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.BuildPackSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.BuildPackSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_BuildPackList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BuildPackList is a list of TypeMeta resources", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.BuildPack"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.BuildPack", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_BuildPackSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "BuildPackSpec is the specification of an BuildPack", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "label": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitRef": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "quickstartLocations": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.QuickStartLocation"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.QuickStartLocation"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ChartRef(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "repo": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "repoName": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_CommitStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CommitStatus represents the commit statuses for a particular pull request", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatusSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatusSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_CommitStatusCommitReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "gitUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "pullRequest": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "sha": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_CommitStatusDetails(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "pipelineActivity": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ResourceReference"), - }, - }, - "Items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatusItem"), - }, - }, - }, - }, - }, - "checked": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - "commit": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatusCommitReference"), - }, - }, - "context": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"pipelineActivity", "checked", "commit", "context"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatusCommitReference", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatusItem", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ResourceReference"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_CommitStatusItem(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "pass": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"pass"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_CommitStatusList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CommitStatusList is a structure used by k8s to store lists of commit statuses", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "Items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatus"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "Items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_CommitStatusSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CommitStatusSpec provides details of a particular commit status", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatusDetails"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitStatusDetails"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_CommitSummary(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CommitSummary is the summary of a commit", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "message": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "sha": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "url": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "author": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserDetails"), - }, - }, - "committer": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserDetails"), - }, - }, - "branch": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "issueIds": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserDetails"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ConfigMapSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ConfigMapSpec contains configuration options for the configMap being updated by the config-updater plugin.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of ConfigMap", - Type: []string{"string"}, - Format: "", - }, - }, - "key": { - SchemaProps: spec.SchemaProps{ - Description: "Key is the key in the ConfigMap to update with the file contents. If no explicit key is given, the basename of the file will be used.", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace in which the configMap needs to be deployed. If no namespace is specified it will be deployed to the ProwJobNamespace.", - Type: []string{"string"}, - Format: "", - }, - }, - "additional_namespaces": { - SchemaProps: spec.SchemaProps{ - Description: "Namespaces in which the configMap needs to be deployed, in addition to the above namespace provided, or the default if it is not set.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ConfigUpdater(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ConfigUpdater holds configuration for the config updater plugin", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "map": { - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ConfigMapSpec"), - }, - }, - }, - }, - }, - "configFile": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "pluginFile": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "ConfigMap": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ConfigMapSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ConfigMapSpec"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ContextPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ContextPolicy configures options about how to handle various contexts.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "skipUnknownContexts": { - SchemaProps: spec.SchemaProps{ - Description: "whether to consider unknown contexts optional (skip) or required.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "requiredContexts": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - "requiredIfPresentContexts": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - "optionalContexts": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - "fromBranchProtection": { - SchemaProps: spec.SchemaProps{ - Description: "Infer required and optional jobs from Branch Protection configuration", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_CoreActivityStep(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "CoreActivityStep is a base step included in Stages of a pipeline or other kinds of step", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "startedTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "completedTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_DependencyUpdate(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DependencyUpdate describes an dependency update message from the commit log", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "host": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "owner": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "repo": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "component": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "url": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "fromVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "fromReleaseHTMLURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "fromReleaseName": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "toVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "toReleaseHTMLURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "toReleaseName": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "paths": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.DependencyUpdateDetails"), - }, - }, - }, - }, - }, - }, - }, - }, - }, - Required: []string{"host", "owner", "repo", "component", "url", "fromVersion", "fromReleaseHTMLURL", "fromReleaseName", "toVersion", "toReleaseHTMLURL", "toReleaseName"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.DependencyUpdateDetails"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_DependencyUpdateDetails(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DependencyUpdateDetails are the details of a dependency update", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "host": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "owner": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "repo": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "component": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "url": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "fromVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "fromReleaseHTMLURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "fromReleaseName": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "toVersion": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "toReleaseHTMLURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "toReleaseName": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"host", "owner", "repo", "component", "url", "fromVersion", "fromReleaseHTMLURL", "fromReleaseName", "toVersion", "toReleaseHTMLURL", "toReleaseName"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_DeployOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DeployOptions configures options for how to deploy applications by default such as using progressive delivery or using horizontal pod autoscaler", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "canary": { - SchemaProps: spec.SchemaProps{ - Description: "Canary should we enable canary rollouts (progressive delivery) for apps by default", - Type: []string{"boolean"}, - Format: "", - }, - }, - "hpa": { - SchemaProps: spec.SchemaProps{ - Description: "should we use the horizontal pod autoscaler on new apps by default?", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Environment(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Environment represents an environment like Dev, Test, Staging, Production where code lives", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentSpec", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_EnvironmentFilter(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvironmentFilter specifies the environments to apply the role binding to", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "includes": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "excludes": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_EnvironmentList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvironmentList is a list of TypeMeta resources", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Environment"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Environment", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_EnvironmentRepository(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvironmentRepository is the repository for an environment using GitOps", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "url": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "ref": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_EnvironmentRoleBinding(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvironmentRoleBinding is like a vanilla RoleBinding but applies to a set of Namespaces based on an Environment filter so that roles can be bound to multiple namespaces easily.\n\nFor example to specify the binding of roles on all Preview environments or on all permanent environments.", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentRoleBindingSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentRoleBindingStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentRoleBindingSpec", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentRoleBindingStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_EnvironmentRoleBindingList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvironmentRoleBindingList is a list of TypeMeta resources", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentRoleBinding"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentRoleBinding", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_EnvironmentRoleBindingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvironmentRoleBindingSpec is the specification of an EnvironmentRoleBinding", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "subjects": { - SchemaProps: spec.SchemaProps{ - Description: "Subjects holds references to the objects the role applies to.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/rbac/v1.Subject"), - }, - }, - }, - }, - }, - "roleRef": { - SchemaProps: spec.SchemaProps{ - Description: "RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.", - Ref: ref("k8s.io/api/rbac/v1.RoleRef"), - }, - }, - "environments": { - SchemaProps: spec.SchemaProps{ - Description: "specifies which sets of environments this binding applies to", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentFilter"), - }, - }, - }, - }, - }, - }, - Required: []string{"subjects", "roleRef"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentFilter", "k8s.io/api/rbac/v1.RoleRef", "k8s.io/api/rbac/v1.Subject"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_EnvironmentRoleBindingStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvironmentRoleBindingStatus is the status for an EnvironmentRoleBinding resource", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_EnvironmentSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvironmentSpec is the specification of an Environment", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "label": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "cluster": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "promotionStrategy": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "source": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentRepository"), - }, - }, - "order": { - SchemaProps: spec.SchemaProps{ - Type: []string{"integer"}, - Format: "int32", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "pullRequestURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "teamSettings": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.TeamSettings"), - }, - }, - "previewGitInfo": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PreviewGitSpec"), - }, - }, - "webHookEngine": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "remoteCluster": { - SchemaProps: spec.SchemaProps{ - Description: "RemoteCluster flag indicates if the Environment is deployed in a separate cluster to the Development Environment", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentRepository", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PreviewGitSpec", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.TeamSettings"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_EnvironmentStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvironmentStatus is the status for an Environment resource", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_EnvironmentVariable(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Extension(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Extension represents an extension available to this Jenkins X install", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExtensionConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExtensionConfig is the configuration and enablement for an extension inside an app", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "parameters": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionParameterValue"), - }, - }, - }, - }, - }, - }, - Required: []string{"name", "namespace", "parameters"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionParameterValue"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExtensionConfigList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExtensionsConfigList contains a list of ExtensionConfig items", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "extensions": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionConfig"), - }, - }, - }, - }, - }, - }, - Required: []string{"extensions"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionConfig"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExtensionDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExtensionDefinition defines an Extension", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "uuid": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "when": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "given": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "children": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionDefinitionChildReference"), - }, - }, - }, - }, - }, - "scriptFile": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "parameters": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionParameter"), - }, - }, - }, - }, - }, - }, - Required: []string{"name", "namespace", "uuid"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionDefinitionChildReference", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionParameter"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExtensionDefinitionChildReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExtensionDefinitionChildReference provides a reference to a child", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "uuid": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "remote": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "tag": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExtensionDefinitionList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExtensionDefinitionList contains a list of ExtensionDefinition items", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "extensions": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionDefinition"), - }, - }, - }, - }, - }, - }, - Required: []string{"extensions"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionDefinition"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExtensionDefinitionReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExtensionRepositoryReference references a GitHub repo that contains extension definitions", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "remote": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "tag": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"remote", "tag"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExtensionDefinitionReferenceList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExtensionDefinitionReferenceList contains a list of ExtensionRepository items", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "remotes": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionDefinitionReference"), - }, - }, - }, - }, - }, - }, - Required: []string{"remotes"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionDefinitionReference"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExtensionExecution(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExtensionExecution is an executable instance of an extension which can be attached into a pipeline for later execution. It differs from an Extension as it cannot have children and parameters have been resolved to environment variables", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "script": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "environmentVariables": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentVariable"), - }, - }, - }, - }, - }, - "given": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "uuid": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.EnvironmentVariable"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExtensionList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExtensionList is a list of Extensions available for a team", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Extension"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Extension", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExtensionParameter(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExtensionParameter describes a parameter definition for an extension", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "environmentVariableName": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "defaultValue": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExtensionParameterValue(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "value"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExtensionRepositoryReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "url": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "github": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "chart": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ChartRef"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ChartRef"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExtensionRepositoryReferenceList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "repositories": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionRepositoryReference"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionRepositoryReference"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExtensionSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExtensionSpec provides details of an extension available for a team", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "script": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "when": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "given": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "parameters": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionParameter"), - }, - }, - }, - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "uuid": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "children": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionParameter"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ExternalPlugin(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExternalPlugin holds configuration for registering an external plugin.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the plugin.", - Type: []string{"string"}, - Format: "", - }, - }, - "endpoint": { - SchemaProps: spec.SchemaProps{ - Description: "Endpoint is the location of the external plugin. Defaults to the name of the plugin, ie. \"http://{{name}}\".", - Type: []string{"string"}, - Format: "", - }, - }, - "events": { - SchemaProps: spec.SchemaProps{ - Description: "ReplaceableSliceOfStrings are the events that need to be demuxed by the hook server to the external plugin. If no events are specified, everything is sent.", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Fact(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Fact represents observed facts. Apps will generate Facts about the system. A naming schema is required since each Fact has a name that's unique for the whole system. Apps should prefix their generated Facts with the name of the App, like -. This makes that different Apps can't possibly have conflicting Fact names.\n\nFor an app generating facts on a pipeline, which will be have several different executions, we recommend --.", - 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: "The Fact labels will be used to query the API for interesting Facts. The Apps responsible for creating Facts need to add the relevant labels. For example, creating Facts on a pipeline would create Facts with the following labels {\n subjectkind: PipelineActivity\n pipelineName: my-org-my-app-master-23\n org: my-org\n repo: my-app\n branch: master\n buildNumber: 23\n}", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.FactSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.FactStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.FactSpec", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.FactStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_FactList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FactList is a list of Fact resources", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Fact"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Fact", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_FactSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FactSpec is the specification of a Fact", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "factType": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "measurements": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Measurement"), - }, - }, - }, - }, - }, - "statements": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Statement"), - }, - }, - }, - }, - }, - "original": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Original"), - }, - }, - "tags": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "subject": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ResourceReference"), - }, - }, - }, - Required: []string{"name", "factType", "subject"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Measurement", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Original", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ResourceReference", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Statement"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_FactStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FactStatus is the status for an Fact resource", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_GitService(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GitService represents a git provider so we can map the host name to a kinda of git service", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.GitServiceSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.GitServiceSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_GitServiceList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GitServiceList is a list of GitService resources", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.GitService"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.GitService", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_GitServiceSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GitServiceSpec is the specification of an GitService", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "gitKind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "url": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_GitStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GitStatus the status of a git commit in terms of CI/CD", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "url": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_GlobalProtectionPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "GlobalProtectionPolicy defines the default branch protection policy for the scheduler", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ProtectionPolicy": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ProtectionPolicy"), - }, - }, - "protectTested": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ProtectionPolicy"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_IssueLabel(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "url": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "color": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_IssueSummary(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "IssueSummary is the summary of an issue", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "id": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "url": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "title": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "body": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "state": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "user": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserDetails"), - }, - }, - "assignees": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserDetails"), - }, - }, - }, - }, - }, - "closedBy": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserDetails"), - }, - }, - "creationTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "labels": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.IssueLabel"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.IssueLabel", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserDetails", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_JobBase(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "JobBase contains attributes common to all job types", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the job. Must match regex [A-Za-z0-9-._]+ e.g. pull-test-infra-bazel-build", - Type: []string{"string"}, - Format: "", - }, - }, - "labels": { - SchemaProps: spec.SchemaProps{ - Description: "ReplaceableMapOfStringString are added to jobs and pods created for this job.", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableMapOfStringString"), - }, - }, - "maxConcurrency": { - SchemaProps: spec.SchemaProps{ - Description: "MaximumConcurrency of this job, 0 implies no limit.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "agent": { - SchemaProps: spec.SchemaProps{ - Description: "Agent that will take care of running this job.", - Type: []string{"string"}, - Format: "", - }, - }, - "cluster": { - SchemaProps: spec.SchemaProps{ - Description: "Cluster is the alias of the cluster to run this job in. (Default: kube.DefaultClusterAlias)", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace is the namespace in which pods schedule.\n empty: results in scheduler.DefaultNamespace", - Type: []string{"string"}, - Format: "", - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec is the Kubernetes pod spec used if Agent is kubernetes.", - Ref: ref("k8s.io/api/core/v1.PodSpec"), - }, - }, - }, - Required: []string{"name", "agent"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableMapOfStringString", "k8s.io/api/core/v1.PodSpec"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Lgtm(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Lgtm specifies a configuration for a single lgtm. The configuration for the lgtm plugin is defined as a list of these structures.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "reviewActsAsLgtm": { - SchemaProps: spec.SchemaProps{ - Description: "ReviewActsAsLgtm indicates that a Github review of \"approve\" or \"request changes\" acts as adding or removing the lgtm label", - Type: []string{"boolean"}, - Format: "", - }, - }, - "storeTreeHash": { - SchemaProps: spec.SchemaProps{ - Description: "StoreTreeHash indicates if tree_hash should be stored inside a comment to detect squashed commits before removing lgtm labels", - Type: []string{"boolean"}, - Format: "", - }, - }, - "trustedTeamForStickyLgtm": { - SchemaProps: spec.SchemaProps{ - Description: "WARNING: This disables the security mechanism that prevents a malicious member (or compromised GitHub account) from merging arbitrary code. Use with caution.\n\nStickyLgtmTeam specifies the Github team whose members are trusted with sticky LGTM, which eliminates the need to re-lgtm minor fixes/updates.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Measurement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Measurement is a percentage or a count, something measured that the system will capture within a fact", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "measurementType": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "measurementValue": { - SchemaProps: spec.SchemaProps{ - Type: []string{"integer"}, - Format: "int32", - }, - }, - "tags": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"name", "measurementType", "measurementValue"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Merger(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Merger defines the options used to merge the PR", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "targetUrl": { - SchemaProps: spec.SchemaProps{ - Description: "URL for status contexts.", - Type: []string{"string"}, - Format: "", - }, - }, - "prStatusBaseUrl": { - SchemaProps: spec.SchemaProps{ - Description: "PRStatusBaseURL is the base URL for the PR status page. This is used to link to a merge requirements overview in the status context.", - Type: []string{"string"}, - Format: "", - }, - }, - "blockerLabel": { - SchemaProps: spec.SchemaProps{ - Description: "BlockerLabel is an optional label that is used to identify merge blocking Git Provider issues. Leave this blank to disable this feature and save 1 API token per sync loop.", - Type: []string{"string"}, - Format: "", - }, - }, - "squashLabel": { - SchemaProps: spec.SchemaProps{ - Description: "SquashLabel is an optional label that is used to identify PRs that should always be squash merged. Leave this blank to disable this feature.", - Type: []string{"string"}, - Format: "", - }, - }, - "maxGoroutines": { - SchemaProps: spec.SchemaProps{ - Description: "MaxGoroutines is the maximum number of goroutines spawned inside the controller to handle org/repo:branch pools. Defaults to 20. Needs to be a positive number.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "mergeMethod": { - SchemaProps: spec.SchemaProps{ - Description: "Override the default method of merge. Valid options are squash, rebase, and merge.", - Type: []string{"string"}, - Format: "", - }, - }, - "policy": { - SchemaProps: spec.SchemaProps{ - Description: "ContextOptions defines the default merge options. If not set it will infer the required and optional contexts from the jobs configured and use the Git Provider combined status; otherwise it may apply the branch protection setting or let user define their own options in case branch protection is not used.", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ContextPolicy"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ContextPolicy"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Original(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Original contains the report", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "mimetype": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "url": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "tags": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Periodic(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Periodic defines a job to be run periodically", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "JobBase": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.JobBase"), - }, - }, - "interval": { - SchemaProps: spec.SchemaProps{ - Description: "Interval to wait between two runs of the job.", - Type: []string{"string"}, - Format: "", - }, - }, - "cron": { - SchemaProps: spec.SchemaProps{ - Description: "Cron representation of job trigger time", - Type: []string{"string"}, - Format: "", - }, - }, - "tags": { - SchemaProps: spec.SchemaProps{ - Description: "Tags for config entries", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - }, - Required: []string{"interval", "cron"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.JobBase", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Periodics(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Periodics is a list of jobs to be run periodically", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "entries": { - SchemaProps: spec.SchemaProps{ - Description: "Items are the post submit configurations", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Periodic"), - }, - }, - }, - }, - }, - "replace": { - SchemaProps: spec.SchemaProps{ - Description: "Replace the existing entries", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Periodic"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PipelineActivity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PipelineActivity represents pipeline activity for a particular run of a pipeline", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineActivitySpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineActivityStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineActivitySpec", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineActivityStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PipelineActivityList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PipelineActivityList is a list of PipelineActivity resources", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineActivity"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineActivity", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PipelineActivitySpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PipelineActivitySpec is the specification of the pipeline activity", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "pipeline": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "build": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "startedTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "completedTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "steps": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineActivityStep"), - }, - }, - }, - }, - }, - "buildUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "buildLogsUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitRepository": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitOwner": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitBranch": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "author": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "authorAvatarURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "authorURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "pullTitle": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "releaseNotesURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "lastCommitSHA": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "lastCommitMessage": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "lastCommitURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "workflow": { - SchemaProps: spec.SchemaProps{ - Description: "Deprecated - Workflow functionality was removed and is obsolete Keeping these fields to ensure backwards compatibility Should be removed when we increment spec version", - Type: []string{"string"}, - Format: "", - }, - }, - "workflowStatus": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "workflowMessage": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "postExtensions": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionExecution"), - }, - }, - }, - }, - }, - "attachments": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Attachment"), - }, - }, - }, - }, - }, - "batchPipelineActivity": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.BatchPipelineActivity"), - }, - }, - "context": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "baseSHA": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Attachment", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.BatchPipelineActivity", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExtensionExecution", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineActivityStep", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PipelineActivityStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PipelineActivityStatus is the status for an Environment resource", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PipelineActivityStep(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PipelineActivityStep represents a step in a pipeline activity", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "stage": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.StageActivityStep"), - }, - }, - "promote": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PromoteActivityStep"), - }, - }, - "preview": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PreviewActivityStep"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PreviewActivityStep", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PromoteActivityStep", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.StageActivityStep"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PipelineExtension(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PipelineExtension defines the image and command of an app which wants to modify/extend the pipeline", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the container specified as a DNS_LABEL.", - Type: []string{"string"}, - Format: "", - }, - }, - "image": { - SchemaProps: spec.SchemaProps{ - Description: "Docker image name.", - Type: []string{"string"}, - Format: "", - }, - }, - "command": { - SchemaProps: spec.SchemaProps{ - Description: "Entrypoint array. Not executed within a shell.", - Type: []string{"string"}, - Format: "", - }, - }, - "args": { - SchemaProps: spec.SchemaProps{ - Description: "Arguments to the entrypoint.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PipelineStructure(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PipelineStructure contains references to the Pipeline and PipelineRun, and a list of PipelineStructureStages in the pipeline. This allows us to map between a running Pod to its TaskRun, to the TaskRun's Task and PipelineRun, and finally from there to the stage and potential parent stages that the Pod is actually executing, for use with populating PipelineActivity and providing logs.", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "pipelineRef": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "pipelineRunRef": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "stages": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineStructureStage"), - }, - }, - }, - }, - }, - }, - Required: []string{"pipelineRef", "pipelineRunRef"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineStructureStage", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PipelineStructureList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PipelineStructureList is a list of PipelineStructureList resources", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineStructure"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PipelineStructure", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PipelineStructureStage(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PipelineStructureStage contains the stage's name, one of either a reference to the Task corresponding to the stage if it has steps, a list of sequential stage names nested within this stage, or a list of parallel stage names nested within this stage, and information on this stage's depth within the PipelineStructure as a whole, the name of its parent stage, if any, the name of the stage before it in execution order, if any, and the name of the stage after it in execution order, if any.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "taskRef": { - SchemaProps: spec.SchemaProps{ - Description: "Must have one of TaskRef+TaskRunRef, Stages, or Parallel", - Type: []string{"string"}, - Format: "", - }, - }, - "taskRunRef": { - SchemaProps: spec.SchemaProps{ - Description: "Populated during pod discovery, not at initial creation time.", - Type: []string{"string"}, - Format: "", - }, - }, - "stages": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "parallel": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "depth": { - SchemaProps: spec.SchemaProps{ - Type: []string{"integer"}, - Format: "byte", - }, - }, - "parent": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "previous": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "next": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "depth"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Plugin(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Plugin represents a binary plugin installed into this Jenkins X team", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PluginSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PluginSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PluginList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PluginList is a list of Plugins available for a team", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Plugin"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Plugin", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PluginSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PluginSpec provides details of a binary plugin available for a team", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "subCommand": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "group": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "binaries": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Binary"), - }, - }, - }, - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Binary"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Postsubmit(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Postsubmit runs on push events.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "JobBase": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.JobBase"), - }, - }, - "RegexpChangeMatcher": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.RegexpChangeMatcher"), - }, - }, - "Brancher": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Brancher"), - }, - }, - "context": { - SchemaProps: spec.SchemaProps{ - Description: "Context is the name of the GitHub status context for the job.", - Type: []string{"string"}, - Format: "", - }, - }, - "report": { - SchemaProps: spec.SchemaProps{ - Description: "Report will comment and set status on GitHub.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"context"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Brancher", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.JobBase", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.RegexpChangeMatcher"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Postsubmits(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Postsubmits is a list of Postsubmit job configurations that can optionally completely replace the Postsubmit job configurations in the parent scheduler", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "entries": { - SchemaProps: spec.SchemaProps{ - Description: "Items are the post submit configurations", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Postsubmit"), - }, - }, - }, - }, - }, - "replace": { - SchemaProps: spec.SchemaProps{ - Description: "Replace the existing entries", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Postsubmit"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Presubmit(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Presubmit defines a job configuration for pull requests", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "JobBase": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.JobBase"), - }, - }, - "Brancher": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Brancher"), - }, - }, - "RegexpChangeMatcher": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.RegexpChangeMatcher"), - }, - }, - "alwaysRun": { - SchemaProps: spec.SchemaProps{ - Description: "AlwaysRun automatically for every PR, or only when a comment triggers it. By default true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "context": { - SchemaProps: spec.SchemaProps{ - Description: "Context is the name of the Git Provider status context for the job.", - Type: []string{"string"}, - Format: "", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Optional indicates that the job's status context should not be required for merge. By default false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "report": { - SchemaProps: spec.SchemaProps{ - Description: "Report enables reporting the job status on the git provider", - Type: []string{"boolean"}, - Format: "", - }, - }, - "trigger": { - SchemaProps: spec.SchemaProps{ - Description: "Trigger is the regular expression to trigger the job. e.g. `@k8s-bot e2e test this` RerunCommand must also be specified if this field is specified. (Default: `(?m)^/test (?:.*? )?(?: .*?)?$`)", - Type: []string{"string"}, - Format: "", - }, - }, - "rerunCommand": { - SchemaProps: spec.SchemaProps{ - Description: "The RerunCommand to give users. Must match Trigger. Trigger must also be specified if this field is specified. (Default: `/test `)", - Type: []string{"string"}, - Format: "", - }, - }, - "mergeMethod": { - SchemaProps: spec.SchemaProps{ - Description: "Override the default method of merge. Valid options are squash, rebase, and merge.", - Type: []string{"string"}, - Format: "", - }, - }, - "queries": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Query"), - }, - }, - }, - }, - }, - "policy": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ProtectionPolicies"), - }, - }, - "context_options": { - SchemaProps: spec.SchemaProps{ - Description: "ContextOptions defines the merge options. If not set it will infer the required and optional contexts from the jobs configured and use the Git Provider combined status; otherwise it may apply the branch protection setting or let user define their own options in case branch protection is not used.", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.RepoContextPolicy"), - }, - }, - }, - Required: []string{"alwaysRun", "context", "trigger", "rerunCommand"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Brancher", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.JobBase", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ProtectionPolicies", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Query", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.RegexpChangeMatcher", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.RepoContextPolicy"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Presubmits(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Presubmits is a list of Presubmit job configurations that can optionally completely replace the Presubmit job configurations in the parent scheduler", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "entries": { - SchemaProps: spec.SchemaProps{ - Description: "Items are the Presubmit configurtations", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Presubmit"), - }, - }, - }, - }, - }, - "replace": { - SchemaProps: spec.SchemaProps{ - Description: "Replace the existing entries", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Presubmit"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PreviewActivityStep(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PreviewActivityStep is the step of creating a preview environment as part of a Pull Request pipeline", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "startedTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "completedTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "environment": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "pullRequestURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "applicationURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PreviewGitSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PreviewGitSpec is the preview git branch/pull request details", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "url": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "user": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserSpec"), - }, - }, - "title": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "buildStatus": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "buildStatusUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "appName": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "applicationURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserSpec"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PromoteActivityStep(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PromoteActivityStep is the step of promoting a version of an application to an environment", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "startedTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "completedTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "environment": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "pullRequest": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PromotePullRequestStep"), - }, - }, - "update": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PromoteUpdateStep"), - }, - }, - "applicationURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PromotePullRequestStep", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PromoteUpdateStep", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PromotePullRequestStep(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PromotePullRequestStep is the step for promoting a version to an environment by raising a Pull Request on the git repository of the environment", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "startedTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "completedTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "pullRequestURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "mergeCommitSHA": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PromoteUpdateStep(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PromoteUpdateStep is the step for updating a promotion after the Pull Request merges to master", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "startedTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "completedTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "statuses": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.GitStatus"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.GitStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PromoteWorkflowStep(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PromoteWorkflowStep is the step of promoting a version of an application to an environment", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "environment": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ProtectionPolicies(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ProtectionPolicies defines the branch protection policies", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ProtectionPolicy": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ProtectionPolicy"), - }, - }, - "Replace": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - "entries": { - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ProtectionPolicy"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ProtectionPolicy"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ProtectionPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ProtectionPolicy for merging.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "protect": { - SchemaProps: spec.SchemaProps{ - Description: "Protect overrides whether branch protection is enabled if set.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "requiredStatusChecks": { - SchemaProps: spec.SchemaProps{ - Description: "RequiredStatusChecks configures github contexts", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.BranchProtectionContextPolicy"), - }, - }, - "enforceAdmins": { - SchemaProps: spec.SchemaProps{ - Description: "Admins overrides whether protections apply to admins if set.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "restrictions": { - SchemaProps: spec.SchemaProps{ - Description: "Restrictions limits who can merge", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Restrictions"), - }, - }, - "requiredPullRequestReviews": { - SchemaProps: spec.SchemaProps{ - Description: "RequiredPullRequestReviews specifies approval/review criteria.", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReviewPolicy"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.BranchProtectionContextPolicy", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Restrictions", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReviewPolicy"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_PullRequestInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PullRequestInfo contains information about a PR included in a batch, like its PR number, the last build number, and SHA", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "pullRequestNumber": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "lastBuildNumberForCommit": { - SchemaProps: spec.SchemaProps{ - Description: "LastBuildNumberForCommit is the number of the last successful build of this PR outside of a batch", - Type: []string{"string"}, - Format: "", - }, - }, - "lastBuildSHA": { - SchemaProps: spec.SchemaProps{ - Description: "LastBuildSHA is the commit SHA in the last successful build of this PR outside of a batch.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Query(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Query is turned into a Git Provider search query. See the docs for details: https://help.github.com/articles/searching-issues-and-pull-requests/", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "excludedBranches": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - "includedBranches": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - "labels": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - "missingLabels": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - "milestone": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "reviewApprovedRequired": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_QuickStartLocation(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "QuickStartLocation", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "gitUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitKind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "owner": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "includes": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "excludes": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_RegexpChangeMatcher(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RegexpChangeMatcher is for code shared between jobs that run only when certain files are changed.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "runIfChanged": { - SchemaProps: spec.SchemaProps{ - Description: "RunIfChanged defines a regex used to select which subset of file changes should trigger this job. If any file in the changeset matches this regex, the job will be triggered", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Release(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Release represents a single version of an app that has been released", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReleaseSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReleaseStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReleaseSpec", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReleaseStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ReleaseList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReleaseList is a list of Release resources", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Release"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Release", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ReleaseSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReleaseSpec is the specification of the Release", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitHttpUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitCloneUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "commits": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitSummary"), - }, - }, - }, - }, - }, - "issues": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.IssueSummary"), - }, - }, - }, - }, - }, - "pullRequests": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.IssueSummary"), - }, - }, - }, - }, - }, - "dependencyUpdates": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.DependencyUpdate"), - }, - }, - }, - }, - }, - "releaseNotesURL": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitRepository": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitOwner": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CommitSummary", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.DependencyUpdate", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.IssueSummary"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ReleaseStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReleaseStatus is the status of a release", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ReplaceableMapOfStringContextPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplaceableMapOfStringContextPolicy is a map of context policies that can optionally completely replace any context policies defined in the parent scheduler", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "replace": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - "Items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ContextPolicy"), - }, - }, - }, - }, - }, - }, - Required: []string{"Items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ContextPolicy"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ReplaceableMapOfStringString(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplaceableMapOfStringString is a map of strings that can optionally completely replace the map of strings in the parent scheduler", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "entries": { - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "replace": { - SchemaProps: spec.SchemaProps{ - Description: "Replace the existing entries", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ReplaceableSliceOfExternalPlugins(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplaceableSliceOfExternalPlugins is a list of external plugins that can optionally completely replace the plugins in any parent SchedulerSpec", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "Replace": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - "entries": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExternalPlugin"), - }, - }, - }, - }, - }, - }, - Required: []string{"Replace"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ExternalPlugin"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ReplaceableSliceOfStrings(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplaceableSliceOfStrings is a slice of strings that can optionally completely replace the slice of strings defined in the parent scheduler", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "entries": { - SchemaProps: spec.SchemaProps{ - Description: "Items is the string values", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "replace": { - SchemaProps: spec.SchemaProps{ - Description: "Replace the existing entries", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_RepoContextPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RepoContextPolicy overrides the policy for repo, and any branch overrides.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ContextPolicy": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ContextPolicy"), - }, - }, - "branches": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableMapOfStringContextPolicy"), - }, - }, - }, - Required: []string{"ContextPolicy"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ContextPolicy", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableMapOfStringContextPolicy"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ResourceReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "API version of the referent.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"kind", "name"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Restrictions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Restrictions limits who can merge Users and Teams entries are appended to parent lists.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "users": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - "teams": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - }, - Required: []string{"users", "teams"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_ReviewPolicy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReviewPolicy specifies git provider approval/review criteria. Any nil values inherit the policy from the parent, otherwise bool/ints are overridden. Non-empty lists are appended to parent lists.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "dismissalRestrictions": { - SchemaProps: spec.SchemaProps{ - Description: "Restrictions appends users/teams that are allowed to merge", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Restrictions"), - }, - }, - "dismissStaleReviews": { - SchemaProps: spec.SchemaProps{ - Description: "DismissStale overrides whether new commits automatically dismiss old reviews if set", - Type: []string{"boolean"}, - Format: "", - }, - }, - "requireCodeOwnerReviews": { - SchemaProps: spec.SchemaProps{ - Description: "RequireOwners overrides whether CODEOWNERS must approve PRs if set", - Type: []string{"boolean"}, - Format: "", - }, - }, - "requiredApprovingReviewCount": { - SchemaProps: spec.SchemaProps{ - Description: "Approvals overrides the number of approvals required if set (set to 0 to disable)", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Restrictions"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Scheduler(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Scheduler is configuration for a pipeline scheduler", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SchedulerSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SchedulerSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_SchedulerAgent(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SchedulerAgent defines the scheduler agent configuration", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "agent": { - SchemaProps: spec.SchemaProps{ - Description: "Agent defines the agent used to schedule jobs, by default Prow", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"agent"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_SchedulerList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SchedulerList is a list of configurations for a pipeline scheduler", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Scheduler"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Scheduler", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_SchedulerSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SchedulerSpec defines the pipeline scheduler (e.g. Prow) configuration", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "schedulerAgent": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SchedulerAgent"), - }, - }, - "policy": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.GlobalProtectionPolicy"), - }, - }, - "presubmits": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Presubmits"), - }, - }, - "postsubmits": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Postsubmits"), - }, - }, - "trigger": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Trigger"), - }, - }, - "approve": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Approve"), - }, - }, - "lgtm": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Lgtm"), - }, - }, - "externalPlugins": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfExternalPlugins"), - }, - }, - "merger": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Merger"), - }, - }, - "plugins": { - SchemaProps: spec.SchemaProps{ - Description: "Plugins is a list of plugin names enabled for a repo", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings"), - }, - }, - "configUpdater": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ConfigUpdater"), - }, - }, - "welcome": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Welcome"), - }, - }, - }, - }, - }, - "periodics": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Periodics"), - }, - }, - "attachments": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Attachment"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Approve", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Attachment", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ConfigUpdater", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.GlobalProtectionPolicy", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Lgtm", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Merger", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Periodics", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Postsubmits", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Presubmits", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfExternalPlugins", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ReplaceableSliceOfStrings", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SchedulerAgent", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Trigger", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Welcome"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_SourceRepository(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SourceRepository is the metadata for an Application/Project/SourceRepository", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SourceRepositorySpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SourceRepositorySpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_SourceRepositoryGroup(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SourceRepositoryGroup is the metadata for an Application/Project/SourceRepository", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SourceRepositoryGroupSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SourceRepositoryGroupSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_SourceRepositoryGroupList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SourceRepositoryGroupList is a structure used by k8s to store lists of apps", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SourceRepositoryGroup"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SourceRepositoryGroup", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_SourceRepositoryGroupSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SourceRepositoryGroupSpec is the metadata for an Application/Project/SourceRepository", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "repositories": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ResourceReference"), - }, - }, - }, - }, - }, - "scheduler": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ResourceReference"), - }, - }, - }, - Required: []string{"repositories", "scheduler"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ResourceReference", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_SourceRepositoryList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SourceRepositoryList is a structure used by k8s to store lists of apps", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SourceRepository"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.SourceRepository", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_SourceRepositorySpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SourceRepositorySpec provides details of the metadata for an App", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "provider": { - SchemaProps: spec.SchemaProps{ - Description: "Provider stores the URL of the git provider such as https://github.com", - Type: []string{"string"}, - Format: "", - }, - }, - "org": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "repo": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "providerName": { - SchemaProps: spec.SchemaProps{ - Description: "ProviderName is a logical name for the provider without any URL scheme which can be used in a label selector", - Type: []string{"string"}, - Format: "", - }, - }, - "providerKind": { - SchemaProps: spec.SchemaProps{ - Description: "ProviderKind is the kind of provider (github / bitbucketcloud / bitbucketserver etc)", - Type: []string{"string"}, - Format: "", - }, - }, - "url": { - SchemaProps: spec.SchemaProps{ - Description: "URL is the web URL of the project page", - Type: []string{"string"}, - Format: "", - }, - }, - "sshCloneURL": { - SchemaProps: spec.SchemaProps{ - Description: "SSHCloneURL is the git URL to clone this repository using SSH", - Type: []string{"string"}, - Format: "", - }, - }, - "httpCloneURL": { - SchemaProps: spec.SchemaProps{ - Description: "HTTPCloneURL is the git URL to clone this repository using HTTP/HTTPS", - Type: []string{"string"}, - Format: "", - }, - }, - "scheduler": { - SchemaProps: spec.SchemaProps{ - Description: "Scheduler a reference to a custom scheduler otherwise we default to the Team's Scededuler", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ResourceReference"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ResourceReference"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_StageActivityStep(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "StageActivityStep represents a stage of zero to more sub steps in a jenkins pipeline", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "startedTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "completedTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "steps": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CoreActivityStep"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.CoreActivityStep", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Statement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Statement represents a decision that was made, for example that a promotion was approved or denied", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "statementType": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "measurementValue": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - "tags": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"name", "statementType", "measurementValue"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_StorageLocation(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "StorageLocation", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "classifier": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitBranch": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "bucketUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Team(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Team represents a request to create an actual Team which is a group of users, a development environment and optional other environments", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.TeamSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.TeamStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.TeamSpec", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.TeamStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_TeamList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TeamList is a list of TypeMeta resources", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Team"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Team", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_TeamSettings(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TeamSettings the default settings for a team", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "useGitOps": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - "askOnCreate": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - "branchPatterns": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "forkBranchPatterns": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "quickstartLocations": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.QuickStartLocation"), - }, - }, - }, - }, - }, - "buildPackUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "buildPackRef": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "helmBinary": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "postPreviewJobs": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/batch/v1.Job"), - }, - }, - }, - }, - }, - "promotionEngine": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "noTiller": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - "helmTemplate": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - "gitServer": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "organisation": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "envOrganisation": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "pipelineUsername": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "pipelineUserEmail": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "dockerRegistryOrg": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "gitPublic": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - "kubeProvider": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "appsRepository": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "buildPackName": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "storageLocations": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.StorageLocation"), - }, - }, - }, - }, - }, - "deployKind": { - SchemaProps: spec.SchemaProps{ - Description: "DeployKind what kind of deployment (\"default\" uses regular Kubernetes Services and Deployments, \"knative\" uses the Knative Service resource instead)", - Type: []string{"string"}, - Format: "", - }, - }, - "importMode": { - SchemaProps: spec.SchemaProps{ - Description: "ImportMode indicates what kind of", - Type: []string{"string"}, - Format: "", - }, - }, - "prowEngine": { - SchemaProps: spec.SchemaProps{ - Description: "ProwEngine is the kind of prow engine used such as knative build or build pipeline", - Type: []string{"string"}, - Format: "", - }, - }, - "versionStreamUrl": { - SchemaProps: spec.SchemaProps{ - Description: "VersionStreamURL contains the git clone URL for the Version Stream which is the set of versions to use for charts, images, packages etc", - Type: []string{"string"}, - Format: "", - }, - }, - "versionStreamRef": { - SchemaProps: spec.SchemaProps{ - Description: "VersionStreamRef contains the git ref (tag or branch) in the VersionStreamURL repository to use as the version stream", - Type: []string{"string"}, - Format: "", - }, - }, - "appPrefixes": { - SchemaProps: spec.SchemaProps{ - Description: "AppsPrefixes is the list of prefixes for appNames", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "defaultScheduler": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ResourceReference"), - }, - }, - "prowConfig": { - SchemaProps: spec.SchemaProps{ - Description: "ProwConfig is the way we manage prow configurations", - Type: []string{"string"}, - Format: "", - }, - }, - "profile": { - SchemaProps: spec.SchemaProps{ - Description: "Profile is the profile in use (see jx profile)", - Type: []string{"string"}, - Format: "", - }, - }, - "bootRequirements": { - SchemaProps: spec.SchemaProps{ - Description: "BootRequirements is a marshaled string of the jx-requirements.yml used in the most recent run for this cluster", - Type: []string{"string"}, - Format: "", - }, - }, - "deployOptions": { - SchemaProps: spec.SchemaProps{ - Description: "DeployOptions configures options for how to deploy applications by default such as using canary rollouts (progressive delivery) or using horizontal pod autoscaler", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.DeployOptions"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.DeployOptions", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.QuickStartLocation", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.ResourceReference", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.StorageLocation", "k8s.io/api/batch/v1.Job"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_TeamSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TeamSpec is the specification of an Team", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "label": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "members": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_TeamStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TeamStatus is the status for an Team resource", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "provisionStatus": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Trigger(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Trigger specifies a configuration for a single trigger.\n\nThe configuration for the trigger plugin is defined as a list of these structures.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "trustedOrg": { - SchemaProps: spec.SchemaProps{ - Description: "TrustedOrg is the org whose members' PRs will be automatically built for PRs to the above repos. The default is the PR's org.", - Type: []string{"string"}, - Format: "", - }, - }, - "joinOrgUrl": { - SchemaProps: spec.SchemaProps{ - Description: "JoinOrgURL is a link that redirects users to a location where they should be able to read more about joining the organization in order to become trusted members. Defaults to the Github link of TrustedOrg.", - Type: []string{"string"}, - Format: "", - }, - }, - "onlyOrgMembers": { - SchemaProps: spec.SchemaProps{ - Description: "OnlyOrgMembers requires PRs and/or /ok-to-test comments to come from org members. By default, trigger also include repo collaborators.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "ignoreOkToTest": { - SchemaProps: spec.SchemaProps{ - Description: "IgnoreOkToTest makes trigger ignore /ok-to-test comments. This is a security mitigation to only allow testing from trusted users.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_User(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "User represents a git user so we have a cache to find by email address", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "user": { - SchemaProps: spec.SchemaProps{ - Description: "Deprecated, use Spec", - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserDetails"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserDetails"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.UserDetails", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_UserDetails(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "UserDetails containers details of a user", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "login": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "email": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "creationTimestamp": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "url": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "avatarUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "serviceAccount": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "accountReference": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.AccountReference"), - }, - }, - }, - }, - }, - "externalUser": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.AccountReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_UserList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "UserList is a list of User resources", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.User"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.User", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_UserSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "UserSpec is the user details", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "username": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "linkUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "imageUrl": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Welcome(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Welcome welcome plugin config", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "message_template": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_Workflow(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Workflow represents pipeline activity for a particular run of a pipeline", - 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/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.WorkflowSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.WorkflowStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.WorkflowSpec", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.WorkflowStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_WorkflowList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "WorkflowList is a list of Workflow resources", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Workflow"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.Workflow", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_WorkflowPreconditions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "WorkflowPreconditions is the trigger to start a step", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "environments": { - SchemaProps: spec.SchemaProps{ - Description: "the names of the environments which need to have promoted before this step can be triggered", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_WorkflowSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "WorkflowSpec is the specification of the pipeline activity", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "pipeline": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "steps": { - SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.WorkflowStep"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.WorkflowStep"}, - } -} - -func schema_pkg_apis_jenkinsio_v1_WorkflowStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "WorkflowStatus is the status for an Environment resource", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_pkg_apis_jenkinsio_v1_WorkflowStep(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "WorkflowStep represents a step in a pipeline activity", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "trigger": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.WorkflowPreconditions"), - }, - }, - "promote": { - SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PromoteWorkflowStep"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.PromoteWorkflowStep", "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1.WorkflowPreconditions"}, - } -} diff --git a/pkg/client/openapi/k8s_io_api_batch_v1/openapi_generated.go b/pkg/client/openapi/k8s_io_api_batch_v1/openapi_generated.go deleted file mode 100644 index f3c2db8..0000000 --- a/pkg/client/openapi/k8s_io_api_batch_v1/openapi_generated.go +++ /dev/null @@ -1,311 +0,0 @@ -// +build !ignore_autogenerated - -// Code generated by openapi-gen. DO NOT EDIT. - -// This file was autogenerated by openapi-gen. Do not edit it manually! - -package k8s_io_api_batch_v1 - -import ( - spec "github.com/go-openapi/spec" - common "k8s.io/kube-openapi/pkg/common" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - return map[string]common.OpenAPIDefinition{ - "k8s.io/api/batch/v1.Job": schema_k8sio_api_batch_v1_Job(ref), - "k8s.io/api/batch/v1.JobCondition": schema_k8sio_api_batch_v1_JobCondition(ref), - "k8s.io/api/batch/v1.JobList": schema_k8sio_api_batch_v1_JobList(ref), - "k8s.io/api/batch/v1.JobSpec": schema_k8sio_api_batch_v1_JobSpec(ref), - "k8s.io/api/batch/v1.JobStatus": schema_k8sio_api_batch_v1_JobStatus(ref), - } -} - -func schema_k8sio_api_batch_v1_Job(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Job represents the configuration of a single job.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Specification of the desired behavior of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/batch/v1.JobSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Current status of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/batch/v1.JobStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/batch/v1.JobSpec", "k8s.io/api/batch/v1.JobStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_batch_v1_JobCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "JobCondition describes current state of a job.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of job condition, Complete or Failed.", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition, one of True, False, Unknown.", - Type: []string{"string"}, - Format: "", - }, - }, - "lastProbeTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time the condition was checked.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time the condition transit from one status to another.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "(brief) 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"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_batch_v1_JobList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "JobList is a collection of jobs.", - 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#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "items is the list of Jobs.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/batch/v1.Job"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/batch/v1.Job", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_batch_v1_JobSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "JobSpec describes how the job execution will look like.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "parallelism": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the maximum desired number of pods the job should run at any given time. The actual number of pods running in steady state will be less than this number when ((.spec.completions - .status.successful) < .spec.parallelism), i.e. when the work left to do is less than max parallelism. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "completions": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the desired number of successfully finished pods the job should be run with. Setting to nil means that the success of any pod signals the success of all pods, and allows parallelism to have any positive value. Setting to 1 means that parallelism is limited to 1 and the success of that pod signals the success of the job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "activeDeadlineSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the duration in seconds relative to the startTime that the job may be active before the system tries to terminate it; value must be positive integer", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "backoffLimit": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the number of retries before marking this job failed. Defaults to 6", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "selector": { - SchemaProps: spec.SchemaProps{ - Description: "A label query over pods that should match the pod count. Normally, the system sets this field for you. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), - }, - }, - "manualSelector": { - SchemaProps: spec.SchemaProps{ - Description: "manualSelector controls generation of pod labels and pod selectors. Leave `manualSelector` unset unless you are certain what you are doing. When false or unset, the system pick labels unique to this job and appends those labels to the pod template. When true, the user is responsible for picking unique labels and specifying the selector. Failure to pick a unique label may cause this and other jobs to not function correctly. However, You may see `manualSelector=true` in jobs that were created with the old `extensions/v1beta1` API. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/#specifying-your-own-pod-selector", - Type: []string{"boolean"}, - Format: "", - }, - }, - "template": { - SchemaProps: spec.SchemaProps{ - Description: "Describes the pod that will be created when executing a job. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", - Ref: ref("k8s.io/api/core/v1.PodTemplateSpec"), - }, - }, - "ttlSecondsAfterFinished": { - SchemaProps: spec.SchemaProps{ - Description: "ttlSecondsAfterFinished limits the lifetime of a Job that has finished execution (either Complete or Failed). If this field is set, ttlSecondsAfterFinished after the Job finishes, it is eligible to be automatically deleted. When the Job is being deleted, its lifecycle guarantees (e.g. finalizers) will be honored. If this field is unset, the Job won't be automatically deleted. If this field is set to zero, the Job becomes eligible to be deleted immediately after it finishes. This field is alpha-level and is only honored by servers that enable the TTLAfterFinished feature.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"template"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodTemplateSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, - } -} - -func schema_k8sio_api_batch_v1_JobStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "JobStatus represents the current state of a Job.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "The latest available observations of an object's current state. When a job fails, one of the conditions will have type == \"Failed\". More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/batch/v1.JobCondition"), - }, - }, - }, - }, - }, - "startTime": { - SchemaProps: spec.SchemaProps{ - Description: "Represents time when the job was acknowledged by the job controller. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "completionTime": { - SchemaProps: spec.SchemaProps{ - Description: "Represents time when the job was completed. It is not guaranteed to be set in happens-before order across separate operations. It is represented in RFC3339 form and is in UTC. The completion time is only set when the job finishes successfully.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "active": { - SchemaProps: spec.SchemaProps{ - Description: "The number of actively running pods.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "succeeded": { - SchemaProps: spec.SchemaProps{ - Description: "The number of pods which reached phase Succeeded.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "failed": { - SchemaProps: spec.SchemaProps{ - Description: "The number of pods which reached phase Failed.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/batch/v1.JobCondition", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} diff --git a/pkg/client/openapi/k8s_io_api_core_v1/openapi_generated.go b/pkg/client/openapi/k8s_io_api_core_v1/openapi_generated.go deleted file mode 100644 index 108f133..0000000 --- a/pkg/client/openapi/k8s_io_api_core_v1/openapi_generated.go +++ /dev/null @@ -1,11262 +0,0 @@ -// +build !ignore_autogenerated - -// Code generated by openapi-gen. DO NOT EDIT. - -// This file was autogenerated by openapi-gen. Do not edit it manually! - -package k8s_io_api_core_v1 - -import ( - spec "github.com/go-openapi/spec" - common "k8s.io/kube-openapi/pkg/common" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - return map[string]common.OpenAPIDefinition{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource": schema_k8sio_api_core_v1_AWSElasticBlockStoreVolumeSource(ref), - "k8s.io/api/core/v1.Affinity": schema_k8sio_api_core_v1_Affinity(ref), - "k8s.io/api/core/v1.AttachedVolume": schema_k8sio_api_core_v1_AttachedVolume(ref), - "k8s.io/api/core/v1.AvoidPods": schema_k8sio_api_core_v1_AvoidPods(ref), - "k8s.io/api/core/v1.AzureDiskVolumeSource": schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref), - "k8s.io/api/core/v1.AzureFilePersistentVolumeSource": schema_k8sio_api_core_v1_AzureFilePersistentVolumeSource(ref), - "k8s.io/api/core/v1.AzureFileVolumeSource": schema_k8sio_api_core_v1_AzureFileVolumeSource(ref), - "k8s.io/api/core/v1.Binding": schema_k8sio_api_core_v1_Binding(ref), - "k8s.io/api/core/v1.CSIPersistentVolumeSource": schema_k8sio_api_core_v1_CSIPersistentVolumeSource(ref), - "k8s.io/api/core/v1.CSIVolumeSource": schema_k8sio_api_core_v1_CSIVolumeSource(ref), - "k8s.io/api/core/v1.Capabilities": schema_k8sio_api_core_v1_Capabilities(ref), - "k8s.io/api/core/v1.CephFSPersistentVolumeSource": schema_k8sio_api_core_v1_CephFSPersistentVolumeSource(ref), - "k8s.io/api/core/v1.CephFSVolumeSource": schema_k8sio_api_core_v1_CephFSVolumeSource(ref), - "k8s.io/api/core/v1.CinderPersistentVolumeSource": schema_k8sio_api_core_v1_CinderPersistentVolumeSource(ref), - "k8s.io/api/core/v1.CinderVolumeSource": schema_k8sio_api_core_v1_CinderVolumeSource(ref), - "k8s.io/api/core/v1.ClientIPConfig": schema_k8sio_api_core_v1_ClientIPConfig(ref), - "k8s.io/api/core/v1.ComponentCondition": schema_k8sio_api_core_v1_ComponentCondition(ref), - "k8s.io/api/core/v1.ComponentStatus": schema_k8sio_api_core_v1_ComponentStatus(ref), - "k8s.io/api/core/v1.ComponentStatusList": schema_k8sio_api_core_v1_ComponentStatusList(ref), - "k8s.io/api/core/v1.ConfigMap": schema_k8sio_api_core_v1_ConfigMap(ref), - "k8s.io/api/core/v1.ConfigMapEnvSource": schema_k8sio_api_core_v1_ConfigMapEnvSource(ref), - "k8s.io/api/core/v1.ConfigMapKeySelector": schema_k8sio_api_core_v1_ConfigMapKeySelector(ref), - "k8s.io/api/core/v1.ConfigMapList": schema_k8sio_api_core_v1_ConfigMapList(ref), - "k8s.io/api/core/v1.ConfigMapNodeConfigSource": schema_k8sio_api_core_v1_ConfigMapNodeConfigSource(ref), - "k8s.io/api/core/v1.ConfigMapProjection": schema_k8sio_api_core_v1_ConfigMapProjection(ref), - "k8s.io/api/core/v1.ConfigMapVolumeSource": schema_k8sio_api_core_v1_ConfigMapVolumeSource(ref), - "k8s.io/api/core/v1.Container": schema_k8sio_api_core_v1_Container(ref), - "k8s.io/api/core/v1.ContainerImage": schema_k8sio_api_core_v1_ContainerImage(ref), - "k8s.io/api/core/v1.ContainerPort": schema_k8sio_api_core_v1_ContainerPort(ref), - "k8s.io/api/core/v1.ContainerState": schema_k8sio_api_core_v1_ContainerState(ref), - "k8s.io/api/core/v1.ContainerStateRunning": schema_k8sio_api_core_v1_ContainerStateRunning(ref), - "k8s.io/api/core/v1.ContainerStateTerminated": schema_k8sio_api_core_v1_ContainerStateTerminated(ref), - "k8s.io/api/core/v1.ContainerStateWaiting": schema_k8sio_api_core_v1_ContainerStateWaiting(ref), - "k8s.io/api/core/v1.ContainerStatus": schema_k8sio_api_core_v1_ContainerStatus(ref), - "k8s.io/api/core/v1.DaemonEndpoint": schema_k8sio_api_core_v1_DaemonEndpoint(ref), - "k8s.io/api/core/v1.DownwardAPIProjection": schema_k8sio_api_core_v1_DownwardAPIProjection(ref), - "k8s.io/api/core/v1.DownwardAPIVolumeFile": schema_k8sio_api_core_v1_DownwardAPIVolumeFile(ref), - "k8s.io/api/core/v1.DownwardAPIVolumeSource": schema_k8sio_api_core_v1_DownwardAPIVolumeSource(ref), - "k8s.io/api/core/v1.EmptyDirVolumeSource": schema_k8sio_api_core_v1_EmptyDirVolumeSource(ref), - "k8s.io/api/core/v1.EndpointAddress": schema_k8sio_api_core_v1_EndpointAddress(ref), - "k8s.io/api/core/v1.EndpointPort": schema_k8sio_api_core_v1_EndpointPort(ref), - "k8s.io/api/core/v1.EndpointSubset": schema_k8sio_api_core_v1_EndpointSubset(ref), - "k8s.io/api/core/v1.Endpoints": schema_k8sio_api_core_v1_Endpoints(ref), - "k8s.io/api/core/v1.EndpointsList": schema_k8sio_api_core_v1_EndpointsList(ref), - "k8s.io/api/core/v1.EnvFromSource": schema_k8sio_api_core_v1_EnvFromSource(ref), - "k8s.io/api/core/v1.EnvVar": schema_k8sio_api_core_v1_EnvVar(ref), - "k8s.io/api/core/v1.EnvVarSource": schema_k8sio_api_core_v1_EnvVarSource(ref), - "k8s.io/api/core/v1.EphemeralContainer": schema_k8sio_api_core_v1_EphemeralContainer(ref), - "k8s.io/api/core/v1.EphemeralContainerCommon": schema_k8sio_api_core_v1_EphemeralContainerCommon(ref), - "k8s.io/api/core/v1.EphemeralContainers": schema_k8sio_api_core_v1_EphemeralContainers(ref), - "k8s.io/api/core/v1.EphemeralVolumeSource": schema_k8sio_api_core_v1_EphemeralVolumeSource(ref), - "k8s.io/api/core/v1.Event": schema_k8sio_api_core_v1_Event(ref), - "k8s.io/api/core/v1.EventList": schema_k8sio_api_core_v1_EventList(ref), - "k8s.io/api/core/v1.EventSeries": schema_k8sio_api_core_v1_EventSeries(ref), - "k8s.io/api/core/v1.EventSource": schema_k8sio_api_core_v1_EventSource(ref), - "k8s.io/api/core/v1.ExecAction": schema_k8sio_api_core_v1_ExecAction(ref), - "k8s.io/api/core/v1.FCVolumeSource": schema_k8sio_api_core_v1_FCVolumeSource(ref), - "k8s.io/api/core/v1.FlexPersistentVolumeSource": schema_k8sio_api_core_v1_FlexPersistentVolumeSource(ref), - "k8s.io/api/core/v1.FlexVolumeSource": schema_k8sio_api_core_v1_FlexVolumeSource(ref), - "k8s.io/api/core/v1.FlockerVolumeSource": schema_k8sio_api_core_v1_FlockerVolumeSource(ref), - "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource": schema_k8sio_api_core_v1_GCEPersistentDiskVolumeSource(ref), - "k8s.io/api/core/v1.GitRepoVolumeSource": schema_k8sio_api_core_v1_GitRepoVolumeSource(ref), - "k8s.io/api/core/v1.GlusterfsPersistentVolumeSource": schema_k8sio_api_core_v1_GlusterfsPersistentVolumeSource(ref), - "k8s.io/api/core/v1.GlusterfsVolumeSource": schema_k8sio_api_core_v1_GlusterfsVolumeSource(ref), - "k8s.io/api/core/v1.HTTPGetAction": schema_k8sio_api_core_v1_HTTPGetAction(ref), - "k8s.io/api/core/v1.HTTPHeader": schema_k8sio_api_core_v1_HTTPHeader(ref), - "k8s.io/api/core/v1.Handler": schema_k8sio_api_core_v1_Handler(ref), - "k8s.io/api/core/v1.HostAlias": schema_k8sio_api_core_v1_HostAlias(ref), - "k8s.io/api/core/v1.HostPathVolumeSource": schema_k8sio_api_core_v1_HostPathVolumeSource(ref), - "k8s.io/api/core/v1.ISCSIPersistentVolumeSource": schema_k8sio_api_core_v1_ISCSIPersistentVolumeSource(ref), - "k8s.io/api/core/v1.ISCSIVolumeSource": schema_k8sio_api_core_v1_ISCSIVolumeSource(ref), - "k8s.io/api/core/v1.KeyToPath": schema_k8sio_api_core_v1_KeyToPath(ref), - "k8s.io/api/core/v1.Lifecycle": schema_k8sio_api_core_v1_Lifecycle(ref), - "k8s.io/api/core/v1.LimitRange": schema_k8sio_api_core_v1_LimitRange(ref), - "k8s.io/api/core/v1.LimitRangeItem": schema_k8sio_api_core_v1_LimitRangeItem(ref), - "k8s.io/api/core/v1.LimitRangeList": schema_k8sio_api_core_v1_LimitRangeList(ref), - "k8s.io/api/core/v1.LimitRangeSpec": schema_k8sio_api_core_v1_LimitRangeSpec(ref), - "k8s.io/api/core/v1.List": schema_k8sio_api_core_v1_List(ref), - "k8s.io/api/core/v1.LoadBalancerIngress": schema_k8sio_api_core_v1_LoadBalancerIngress(ref), - "k8s.io/api/core/v1.LoadBalancerStatus": schema_k8sio_api_core_v1_LoadBalancerStatus(ref), - "k8s.io/api/core/v1.LocalObjectReference": schema_k8sio_api_core_v1_LocalObjectReference(ref), - "k8s.io/api/core/v1.LocalVolumeSource": schema_k8sio_api_core_v1_LocalVolumeSource(ref), - "k8s.io/api/core/v1.NFSVolumeSource": schema_k8sio_api_core_v1_NFSVolumeSource(ref), - "k8s.io/api/core/v1.Namespace": schema_k8sio_api_core_v1_Namespace(ref), - "k8s.io/api/core/v1.NamespaceCondition": schema_k8sio_api_core_v1_NamespaceCondition(ref), - "k8s.io/api/core/v1.NamespaceList": schema_k8sio_api_core_v1_NamespaceList(ref), - "k8s.io/api/core/v1.NamespaceSpec": schema_k8sio_api_core_v1_NamespaceSpec(ref), - "k8s.io/api/core/v1.NamespaceStatus": schema_k8sio_api_core_v1_NamespaceStatus(ref), - "k8s.io/api/core/v1.Node": schema_k8sio_api_core_v1_Node(ref), - "k8s.io/api/core/v1.NodeAddress": schema_k8sio_api_core_v1_NodeAddress(ref), - "k8s.io/api/core/v1.NodeAffinity": schema_k8sio_api_core_v1_NodeAffinity(ref), - "k8s.io/api/core/v1.NodeCondition": schema_k8sio_api_core_v1_NodeCondition(ref), - "k8s.io/api/core/v1.NodeConfigSource": schema_k8sio_api_core_v1_NodeConfigSource(ref), - "k8s.io/api/core/v1.NodeConfigStatus": schema_k8sio_api_core_v1_NodeConfigStatus(ref), - "k8s.io/api/core/v1.NodeDaemonEndpoints": schema_k8sio_api_core_v1_NodeDaemonEndpoints(ref), - "k8s.io/api/core/v1.NodeList": schema_k8sio_api_core_v1_NodeList(ref), - "k8s.io/api/core/v1.NodeProxyOptions": schema_k8sio_api_core_v1_NodeProxyOptions(ref), - "k8s.io/api/core/v1.NodeResources": schema_k8sio_api_core_v1_NodeResources(ref), - "k8s.io/api/core/v1.NodeSelector": schema_k8sio_api_core_v1_NodeSelector(ref), - "k8s.io/api/core/v1.NodeSelectorRequirement": schema_k8sio_api_core_v1_NodeSelectorRequirement(ref), - "k8s.io/api/core/v1.NodeSelectorTerm": schema_k8sio_api_core_v1_NodeSelectorTerm(ref), - "k8s.io/api/core/v1.NodeSpec": schema_k8sio_api_core_v1_NodeSpec(ref), - "k8s.io/api/core/v1.NodeStatus": schema_k8sio_api_core_v1_NodeStatus(ref), - "k8s.io/api/core/v1.NodeSystemInfo": schema_k8sio_api_core_v1_NodeSystemInfo(ref), - "k8s.io/api/core/v1.ObjectFieldSelector": schema_k8sio_api_core_v1_ObjectFieldSelector(ref), - "k8s.io/api/core/v1.ObjectReference": schema_k8sio_api_core_v1_ObjectReference(ref), - "k8s.io/api/core/v1.PersistentVolume": schema_k8sio_api_core_v1_PersistentVolume(ref), - "k8s.io/api/core/v1.PersistentVolumeClaim": schema_k8sio_api_core_v1_PersistentVolumeClaim(ref), - "k8s.io/api/core/v1.PersistentVolumeClaimCondition": schema_k8sio_api_core_v1_PersistentVolumeClaimCondition(ref), - "k8s.io/api/core/v1.PersistentVolumeClaimList": schema_k8sio_api_core_v1_PersistentVolumeClaimList(ref), - "k8s.io/api/core/v1.PersistentVolumeClaimSpec": schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref), - "k8s.io/api/core/v1.PersistentVolumeClaimStatus": schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref), - "k8s.io/api/core/v1.PersistentVolumeClaimTemplate": schema_k8sio_api_core_v1_PersistentVolumeClaimTemplate(ref), - "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource": schema_k8sio_api_core_v1_PersistentVolumeClaimVolumeSource(ref), - "k8s.io/api/core/v1.PersistentVolumeList": schema_k8sio_api_core_v1_PersistentVolumeList(ref), - "k8s.io/api/core/v1.PersistentVolumeSource": schema_k8sio_api_core_v1_PersistentVolumeSource(ref), - "k8s.io/api/core/v1.PersistentVolumeSpec": schema_k8sio_api_core_v1_PersistentVolumeSpec(ref), - "k8s.io/api/core/v1.PersistentVolumeStatus": schema_k8sio_api_core_v1_PersistentVolumeStatus(ref), - "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource": schema_k8sio_api_core_v1_PhotonPersistentDiskVolumeSource(ref), - "k8s.io/api/core/v1.Pod": schema_k8sio_api_core_v1_Pod(ref), - "k8s.io/api/core/v1.PodAffinity": schema_k8sio_api_core_v1_PodAffinity(ref), - "k8s.io/api/core/v1.PodAffinityTerm": schema_k8sio_api_core_v1_PodAffinityTerm(ref), - "k8s.io/api/core/v1.PodAntiAffinity": schema_k8sio_api_core_v1_PodAntiAffinity(ref), - "k8s.io/api/core/v1.PodAttachOptions": schema_k8sio_api_core_v1_PodAttachOptions(ref), - "k8s.io/api/core/v1.PodCondition": schema_k8sio_api_core_v1_PodCondition(ref), - "k8s.io/api/core/v1.PodDNSConfig": schema_k8sio_api_core_v1_PodDNSConfig(ref), - "k8s.io/api/core/v1.PodDNSConfigOption": schema_k8sio_api_core_v1_PodDNSConfigOption(ref), - "k8s.io/api/core/v1.PodExecOptions": schema_k8sio_api_core_v1_PodExecOptions(ref), - "k8s.io/api/core/v1.PodIP": schema_k8sio_api_core_v1_PodIP(ref), - "k8s.io/api/core/v1.PodList": schema_k8sio_api_core_v1_PodList(ref), - "k8s.io/api/core/v1.PodLogOptions": schema_k8sio_api_core_v1_PodLogOptions(ref), - "k8s.io/api/core/v1.PodPortForwardOptions": schema_k8sio_api_core_v1_PodPortForwardOptions(ref), - "k8s.io/api/core/v1.PodProxyOptions": schema_k8sio_api_core_v1_PodProxyOptions(ref), - "k8s.io/api/core/v1.PodReadinessGate": schema_k8sio_api_core_v1_PodReadinessGate(ref), - "k8s.io/api/core/v1.PodSecurityContext": schema_k8sio_api_core_v1_PodSecurityContext(ref), - "k8s.io/api/core/v1.PodSignature": schema_k8sio_api_core_v1_PodSignature(ref), - "k8s.io/api/core/v1.PodSpec": schema_k8sio_api_core_v1_PodSpec(ref), - "k8s.io/api/core/v1.PodStatus": schema_k8sio_api_core_v1_PodStatus(ref), - "k8s.io/api/core/v1.PodStatusResult": schema_k8sio_api_core_v1_PodStatusResult(ref), - "k8s.io/api/core/v1.PodTemplate": schema_k8sio_api_core_v1_PodTemplate(ref), - "k8s.io/api/core/v1.PodTemplateList": schema_k8sio_api_core_v1_PodTemplateList(ref), - "k8s.io/api/core/v1.PodTemplateSpec": schema_k8sio_api_core_v1_PodTemplateSpec(ref), - "k8s.io/api/core/v1.PortworxVolumeSource": schema_k8sio_api_core_v1_PortworxVolumeSource(ref), - "k8s.io/api/core/v1.PreferAvoidPodsEntry": schema_k8sio_api_core_v1_PreferAvoidPodsEntry(ref), - "k8s.io/api/core/v1.PreferredSchedulingTerm": schema_k8sio_api_core_v1_PreferredSchedulingTerm(ref), - "k8s.io/api/core/v1.Probe": schema_k8sio_api_core_v1_Probe(ref), - "k8s.io/api/core/v1.ProjectedVolumeSource": schema_k8sio_api_core_v1_ProjectedVolumeSource(ref), - "k8s.io/api/core/v1.QuobyteVolumeSource": schema_k8sio_api_core_v1_QuobyteVolumeSource(ref), - "k8s.io/api/core/v1.RBDPersistentVolumeSource": schema_k8sio_api_core_v1_RBDPersistentVolumeSource(ref), - "k8s.io/api/core/v1.RBDVolumeSource": schema_k8sio_api_core_v1_RBDVolumeSource(ref), - "k8s.io/api/core/v1.RangeAllocation": schema_k8sio_api_core_v1_RangeAllocation(ref), - "k8s.io/api/core/v1.ReplicationController": schema_k8sio_api_core_v1_ReplicationController(ref), - "k8s.io/api/core/v1.ReplicationControllerCondition": schema_k8sio_api_core_v1_ReplicationControllerCondition(ref), - "k8s.io/api/core/v1.ReplicationControllerList": schema_k8sio_api_core_v1_ReplicationControllerList(ref), - "k8s.io/api/core/v1.ReplicationControllerSpec": schema_k8sio_api_core_v1_ReplicationControllerSpec(ref), - "k8s.io/api/core/v1.ReplicationControllerStatus": schema_k8sio_api_core_v1_ReplicationControllerStatus(ref), - "k8s.io/api/core/v1.ResourceFieldSelector": schema_k8sio_api_core_v1_ResourceFieldSelector(ref), - "k8s.io/api/core/v1.ResourceQuota": schema_k8sio_api_core_v1_ResourceQuota(ref), - "k8s.io/api/core/v1.ResourceQuotaList": schema_k8sio_api_core_v1_ResourceQuotaList(ref), - "k8s.io/api/core/v1.ResourceQuotaSpec": schema_k8sio_api_core_v1_ResourceQuotaSpec(ref), - "k8s.io/api/core/v1.ResourceQuotaStatus": schema_k8sio_api_core_v1_ResourceQuotaStatus(ref), - "k8s.io/api/core/v1.ResourceRequirements": schema_k8sio_api_core_v1_ResourceRequirements(ref), - "k8s.io/api/core/v1.SELinuxOptions": schema_k8sio_api_core_v1_SELinuxOptions(ref), - "k8s.io/api/core/v1.ScaleIOPersistentVolumeSource": schema_k8sio_api_core_v1_ScaleIOPersistentVolumeSource(ref), - "k8s.io/api/core/v1.ScaleIOVolumeSource": schema_k8sio_api_core_v1_ScaleIOVolumeSource(ref), - "k8s.io/api/core/v1.ScopeSelector": schema_k8sio_api_core_v1_ScopeSelector(ref), - "k8s.io/api/core/v1.ScopedResourceSelectorRequirement": schema_k8sio_api_core_v1_ScopedResourceSelectorRequirement(ref), - "k8s.io/api/core/v1.SeccompProfile": schema_k8sio_api_core_v1_SeccompProfile(ref), - "k8s.io/api/core/v1.Secret": schema_k8sio_api_core_v1_Secret(ref), - "k8s.io/api/core/v1.SecretEnvSource": schema_k8sio_api_core_v1_SecretEnvSource(ref), - "k8s.io/api/core/v1.SecretKeySelector": schema_k8sio_api_core_v1_SecretKeySelector(ref), - "k8s.io/api/core/v1.SecretList": schema_k8sio_api_core_v1_SecretList(ref), - "k8s.io/api/core/v1.SecretProjection": schema_k8sio_api_core_v1_SecretProjection(ref), - "k8s.io/api/core/v1.SecretReference": schema_k8sio_api_core_v1_SecretReference(ref), - "k8s.io/api/core/v1.SecretVolumeSource": schema_k8sio_api_core_v1_SecretVolumeSource(ref), - "k8s.io/api/core/v1.SecurityContext": schema_k8sio_api_core_v1_SecurityContext(ref), - "k8s.io/api/core/v1.SerializedReference": schema_k8sio_api_core_v1_SerializedReference(ref), - "k8s.io/api/core/v1.Service": schema_k8sio_api_core_v1_Service(ref), - "k8s.io/api/core/v1.ServiceAccount": schema_k8sio_api_core_v1_ServiceAccount(ref), - "k8s.io/api/core/v1.ServiceAccountList": schema_k8sio_api_core_v1_ServiceAccountList(ref), - "k8s.io/api/core/v1.ServiceAccountTokenProjection": schema_k8sio_api_core_v1_ServiceAccountTokenProjection(ref), - "k8s.io/api/core/v1.ServiceList": schema_k8sio_api_core_v1_ServiceList(ref), - "k8s.io/api/core/v1.ServicePort": schema_k8sio_api_core_v1_ServicePort(ref), - "k8s.io/api/core/v1.ServiceProxyOptions": schema_k8sio_api_core_v1_ServiceProxyOptions(ref), - "k8s.io/api/core/v1.ServiceSpec": schema_k8sio_api_core_v1_ServiceSpec(ref), - "k8s.io/api/core/v1.ServiceStatus": schema_k8sio_api_core_v1_ServiceStatus(ref), - "k8s.io/api/core/v1.SessionAffinityConfig": schema_k8sio_api_core_v1_SessionAffinityConfig(ref), - "k8s.io/api/core/v1.StorageOSPersistentVolumeSource": schema_k8sio_api_core_v1_StorageOSPersistentVolumeSource(ref), - "k8s.io/api/core/v1.StorageOSVolumeSource": schema_k8sio_api_core_v1_StorageOSVolumeSource(ref), - "k8s.io/api/core/v1.Sysctl": schema_k8sio_api_core_v1_Sysctl(ref), - "k8s.io/api/core/v1.TCPSocketAction": schema_k8sio_api_core_v1_TCPSocketAction(ref), - "k8s.io/api/core/v1.Taint": schema_k8sio_api_core_v1_Taint(ref), - "k8s.io/api/core/v1.Toleration": schema_k8sio_api_core_v1_Toleration(ref), - "k8s.io/api/core/v1.TopologySelectorLabelRequirement": schema_k8sio_api_core_v1_TopologySelectorLabelRequirement(ref), - "k8s.io/api/core/v1.TopologySelectorTerm": schema_k8sio_api_core_v1_TopologySelectorTerm(ref), - "k8s.io/api/core/v1.TopologySpreadConstraint": schema_k8sio_api_core_v1_TopologySpreadConstraint(ref), - "k8s.io/api/core/v1.TypedLocalObjectReference": schema_k8sio_api_core_v1_TypedLocalObjectReference(ref), - "k8s.io/api/core/v1.Volume": schema_k8sio_api_core_v1_Volume(ref), - "k8s.io/api/core/v1.VolumeDevice": schema_k8sio_api_core_v1_VolumeDevice(ref), - "k8s.io/api/core/v1.VolumeMount": schema_k8sio_api_core_v1_VolumeMount(ref), - "k8s.io/api/core/v1.VolumeNodeAffinity": schema_k8sio_api_core_v1_VolumeNodeAffinity(ref), - "k8s.io/api/core/v1.VolumeProjection": schema_k8sio_api_core_v1_VolumeProjection(ref), - "k8s.io/api/core/v1.VolumeSource": schema_k8sio_api_core_v1_VolumeSource(ref), - "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource": schema_k8sio_api_core_v1_VsphereVirtualDiskVolumeSource(ref), - "k8s.io/api/core/v1.WeightedPodAffinityTerm": schema_k8sio_api_core_v1_WeightedPodAffinityTerm(ref), - "k8s.io/api/core/v1.WindowsSecurityContextOptions": schema_k8sio_api_core_v1_WindowsSecurityContextOptions(ref), - } -} - -func schema_k8sio_api_core_v1_AWSElasticBlockStoreVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Persistent Disk resource in AWS.\n\nAn AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumeID": { - SchemaProps: spec.SchemaProps{ - Description: "Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - Type: []string{"string"}, - Format: "", - }, - }, - "partition": { - SchemaProps: spec.SchemaProps{ - Description: "The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty).", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Specify \"true\" to force and set the ReadOnly property in VolumeMounts to \"true\". If omitted, the default is \"false\". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"volumeID"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_Affinity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Affinity is a group of affinity scheduling rules.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "nodeAffinity": { - SchemaProps: spec.SchemaProps{ - Description: "Describes node affinity scheduling rules for the pod.", - Ref: ref("k8s.io/api/core/v1.NodeAffinity"), - }, - }, - "podAffinity": { - SchemaProps: spec.SchemaProps{ - Description: "Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).", - Ref: ref("k8s.io/api/core/v1.PodAffinity"), - }, - }, - "podAntiAffinity": { - SchemaProps: spec.SchemaProps{ - Description: "Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).", - Ref: ref("k8s.io/api/core/v1.PodAntiAffinity"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeAffinity", "k8s.io/api/core/v1.PodAffinity", "k8s.io/api/core/v1.PodAntiAffinity"}, - } -} - -func schema_k8sio_api_core_v1_AttachedVolume(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AttachedVolume describes a volume attached to a node", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the attached volume", - Type: []string{"string"}, - Format: "", - }, - }, - "devicePath": { - SchemaProps: spec.SchemaProps{ - Description: "DevicePath represents the device path where the volume should be available", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "devicePath"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_AvoidPods(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AvoidPods describes pods that should avoid this node. This is the value for a Node annotation with key scheduler.alpha.kubernetes.io/preferAvoidPods and will eventually become a field of NodeStatus.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "preferAvoidPods": { - SchemaProps: spec.SchemaProps{ - Description: "Bounded-sized list of signatures of pods that should avoid this node, sorted in timestamp order from oldest to newest. Size of the slice is unspecified.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PreferAvoidPodsEntry"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PreferAvoidPodsEntry"}, - } -} - -func schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "diskName": { - SchemaProps: spec.SchemaProps{ - Description: "The Name of the data disk in the blob storage", - Type: []string{"string"}, - Format: "", - }, - }, - "diskURI": { - SchemaProps: spec.SchemaProps{ - Description: "The URI the data disk in the blob storage", - Type: []string{"string"}, - Format: "", - }, - }, - "cachingMode": { - SchemaProps: spec.SchemaProps{ - Description: "Host Caching mode: None, Read Only, Read Write.", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Expected values Shared: multiple blob disks per storage account Dedicated: single blob disk per storage account Managed: azure managed data disk (only in managed availability set). defaults to shared", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"diskName", "diskURI"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_AzureFilePersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "secretName": { - SchemaProps: spec.SchemaProps{ - Description: "the name of secret that contains Azure Storage Account Name and Key", - Type: []string{"string"}, - Format: "", - }, - }, - "shareName": { - SchemaProps: spec.SchemaProps{ - Description: "Share Name", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "secretNamespace": { - SchemaProps: spec.SchemaProps{ - Description: "the namespace of the secret that contains Azure Storage Account Name and Key default is the same as the Pod", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"secretName", "shareName"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_AzureFileVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "secretName": { - SchemaProps: spec.SchemaProps{ - Description: "the name of secret that contains Azure Storage Account Name and Key", - Type: []string{"string"}, - Format: "", - }, - }, - "shareName": { - SchemaProps: spec.SchemaProps{ - Description: "Share Name", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"secretName", "shareName"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_Binding(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Binding ties one object to another; for example, a pod is bound to a node by a scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "target": { - SchemaProps: spec.SchemaProps{ - Description: "The target object that you want to bind to the standard object.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - }, - Required: []string{"target"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_CSIPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents storage that is managed by an external CSI volume driver (Beta feature)", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "driver": { - SchemaProps: spec.SchemaProps{ - Description: "Driver is the name of the driver to use for this volume. Required.", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeHandle": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeHandle is the unique volume name returned by the CSI volume plugin’s CreateVolume to refer to the volume on all subsequent calls. Required.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: The value to pass to ControllerPublishVolumeRequest. Defaults to false (read/write).", - Type: []string{"boolean"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\".", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeAttributes": { - SchemaProps: spec.SchemaProps{ - Description: "Attributes of the volume to publish.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "controllerPublishSecretRef": { - SchemaProps: spec.SchemaProps{ - Description: "ControllerPublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "nodeStageSecretRef": { - SchemaProps: spec.SchemaProps{ - Description: "NodeStageSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "nodePublishSecretRef": { - SchemaProps: spec.SchemaProps{ - Description: "NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "controllerExpandSecretRef": { - SchemaProps: spec.SchemaProps{ - Description: "ControllerExpandSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. This is an alpha field and requires enabling ExpandCSIVolumes feature gate. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - }, - Required: []string{"driver", "volumeHandle"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference"}, - } -} - -func schema_k8sio_api_core_v1_CSIVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a source location of a volume to mount, managed by an external CSI driver", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "driver": { - SchemaProps: spec.SchemaProps{ - Description: "Driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies a read-only configuration for the volume. Defaults to false (read/write).", - Type: []string{"boolean"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Ex. \"ext4\", \"xfs\", \"ntfs\". If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeAttributes": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver's documentation for supported values.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "nodePublishSecretRef": { - SchemaProps: spec.SchemaProps{ - Description: "NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - }, - Required: []string{"driver"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_Capabilities(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Adds and removes POSIX capabilities from running containers.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "add": { - SchemaProps: spec.SchemaProps{ - Description: "Added capabilities", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "drop": { - SchemaProps: spec.SchemaProps{ - Description: "Removed capabilities", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_CephFSPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "monitors": { - SchemaProps: spec.SchemaProps{ - Description: "Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Used as the mounted root, rather than the full Ceph tree, default is /", - Type: []string{"string"}, - Format: "", - }, - }, - "user": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "secretFile": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"monitors"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference"}, - } -} - -func schema_k8sio_api_core_v1_CephFSVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "monitors": { - SchemaProps: spec.SchemaProps{ - Description: "Required: Monitors is a collection of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Used as the mounted root, rather than the full Ceph tree, default is /", - Type: []string{"string"}, - Format: "", - }, - }, - "user": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: User is the rados user name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "secretFile": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: SecretFile is the path to key ring for User, default is /etc/ceph/user.secret More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: SecretRef is reference to the authentication secret for User, default is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"monitors"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_CinderPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumeID": { - SchemaProps: spec.SchemaProps{ - Description: "volume id used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", - Type: []string{"boolean"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: points to a secret object containing parameters used to connect to OpenStack.", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - }, - Required: []string{"volumeID"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference"}, - } -} - -func schema_k8sio_api_core_v1_CinderVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumeID": { - SchemaProps: spec.SchemaProps{ - Description: "volume id used to identify the volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", - Type: []string{"boolean"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: points to a secret object containing parameters used to connect to OpenStack.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - }, - Required: []string{"volumeID"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_ClientIPConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ClientIPConfig represents the configurations of Client IP based session affinity.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "timeoutSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && <=86400(for 1 day) if ServiceAffinity == \"ClientIP\". Default value is 10800(for 3 hours).", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ComponentCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Information about the condition of a component.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of condition for a component. Valid value: \"Healthy\"", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition for a component. Valid values for \"Healthy\": \"True\", \"False\", or \"Unknown\".", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Message about the condition for a component. For example, information about a health check.", - Type: []string{"string"}, - Format: "", - }, - }, - "error": { - SchemaProps: spec.SchemaProps{ - Description: "Condition error code for a component. For example, a health check error code.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ComponentStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ComponentStatus (and ComponentStatusList) holds the cluster validation info. Deprecated: This API is deprecated in v1.19+", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of component conditions observed", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ComponentCondition"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ComponentCondition", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_ComponentStatusList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Status of all the conditions for the component as a list of ComponentStatus objects. Deprecated: This API is deprecated in v1.19+", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of ComponentStatus objects.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ComponentStatus"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ComponentStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_ConfigMap(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ConfigMap holds configuration data for pods to consume.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "immutable": { - SchemaProps: spec.SchemaProps{ - Description: "Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is a beta field enabled by ImmutableEphemeralVolumes feature gate.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "data": { - SchemaProps: spec.SchemaProps{ - Description: "Data contains the configuration data. Each key must consist of alphanumeric characters, '-', '_' or '.'. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "binaryData": { - SchemaProps: spec.SchemaProps{ - Description: "BinaryData contains the binary data. Each key must consist of alphanumeric characters, '-', '_' or '.'. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "byte", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_ConfigMapEnvSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ConfigMapEnvSource selects a ConfigMap to populate the environment variables with.\n\nThe contents of the target ConfigMap's Data field will represent the key-value pairs as environment variables.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the ConfigMap must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ConfigMapKeySelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Selects a key from a ConfigMap.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "key": { - SchemaProps: spec.SchemaProps{ - Description: "The key to select.", - Type: []string{"string"}, - Format: "", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the ConfigMap or its key must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"key"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ConfigMapList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ConfigMapList is a resource containing a list of ConfigMap 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: "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is the list of ConfigMaps.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ConfigMap"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMap", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_ConfigMapNodeConfigSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace is the metadata.namespace of the referenced ConfigMap. This field is required in all cases.", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the metadata.name of the referenced ConfigMap. This field is required in all cases.", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID is the metadata.UID of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.", - Type: []string{"string"}, - Format: "", - }, - }, - "kubeletConfigKey": { - SchemaProps: spec.SchemaProps{ - Description: "KubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure This field is required in all cases.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"namespace", "name", "kubeletConfigKey"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ConfigMapProjection(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Adapts a ConfigMap into a projected volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.KeyToPath"), - }, - }, - }, - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the ConfigMap or its keys must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.KeyToPath"}, - } -} - -func schema_k8sio_api_core_v1_ConfigMapVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Adapts a ConfigMap into a volume.\n\nThe contents of the target ConfigMap's Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.KeyToPath"), - }, - }, - }, - }, - }, - "defaultMode": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the ConfigMap or its keys must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.KeyToPath"}, - } -} - -func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A single application container that you want to run within a pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "image": { - SchemaProps: spec.SchemaProps{ - Description: "Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.", - Type: []string{"string"}, - Format: "", - }, - }, - "command": { - SchemaProps: spec.SchemaProps{ - Description: "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "args": { - SchemaProps: spec.SchemaProps{ - Description: "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "workingDir": { - SchemaProps: spec.SchemaProps{ - Description: "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "ports": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []string{ - "containerPort", - "protocol", - }, - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "containerPort", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default \"0.0.0.0\" address inside a container will be accessible from the network. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ContainerPort"), - }, - }, - }, - }, - }, - "envFrom": { - SchemaProps: spec.SchemaProps{ - Description: "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EnvFromSource"), - }, - }, - }, - }, - }, - "env": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of environment variables to set in the container. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EnvVar"), - }, - }, - }, - }, - }, - "resources": { - SchemaProps: spec.SchemaProps{ - Description: "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", - Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), - }, - }, - "volumeMounts": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "mountPath", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Pod volumes to mount into the container's filesystem. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.VolumeMount"), - }, - }, - }, - }, - }, - "volumeDevices": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "devicePath", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "volumeDevices is the list of block devices to be used by the container.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.VolumeDevice"), - }, - }, - }, - }, - }, - "livenessProbe": { - SchemaProps: spec.SchemaProps{ - Description: "Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - Ref: ref("k8s.io/api/core/v1.Probe"), - }, - }, - "readinessProbe": { - SchemaProps: spec.SchemaProps{ - Description: "Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - Ref: ref("k8s.io/api/core/v1.Probe"), - }, - }, - "startupProbe": { - SchemaProps: spec.SchemaProps{ - Description: "StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - Ref: ref("k8s.io/api/core/v1.Probe"), - }, - }, - "lifecycle": { - SchemaProps: spec.SchemaProps{ - Description: "Actions that the management system should take in response to container lifecycle events. Cannot be updated.", - Ref: ref("k8s.io/api/core/v1.Lifecycle"), - }, - }, - "terminationMessagePath": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "terminationMessagePolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "imagePullPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", - Type: []string{"string"}, - Format: "", - }, - }, - "securityContext": { - SchemaProps: spec.SchemaProps{ - Description: "Security options the pod should run with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/", - Ref: ref("k8s.io/api/core/v1.SecurityContext"), - }, - }, - "stdin": { - SchemaProps: spec.SchemaProps{ - Description: "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "stdinOnce": { - SchemaProps: spec.SchemaProps{ - Description: "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", - Type: []string{"boolean"}, - Format: "", - }, - }, - "tty": { - SchemaProps: spec.SchemaProps{ - Description: "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, - } -} - -func schema_k8sio_api_core_v1_ContainerImage(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Describe a container image", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "names": { - SchemaProps: spec.SchemaProps{ - Description: "Names by which this image is known. e.g. [\"k8s.gcr.io/hyperkube:v1.0.7\", \"dockerhub.io/google_containers/hyperkube:v1.0.7\"]", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "sizeBytes": { - SchemaProps: spec.SchemaProps{ - Description: "The size of the image in bytes.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - }, - Required: []string{"names"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ContainerPort(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ContainerPort represents a network port in a single container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.", - Type: []string{"string"}, - Format: "", - }, - }, - "hostPort": { - SchemaProps: spec.SchemaProps{ - Description: "Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "containerPort": { - SchemaProps: spec.SchemaProps{ - Description: "Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "protocol": { - SchemaProps: spec.SchemaProps{ - Description: "Protocol for port. Must be UDP, TCP, or SCTP. Defaults to \"TCP\".", - Type: []string{"string"}, - Format: "", - }, - }, - "hostIP": { - SchemaProps: spec.SchemaProps{ - Description: "What host IP to bind the external port to.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"containerPort"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ContainerState(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ContainerState holds a possible state of container. Only one of its members may be specified. If none of them is specified, the default one is ContainerStateWaiting.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "waiting": { - SchemaProps: spec.SchemaProps{ - Description: "Details about a waiting container", - Ref: ref("k8s.io/api/core/v1.ContainerStateWaiting"), - }, - }, - "running": { - SchemaProps: spec.SchemaProps{ - Description: "Details about a running container", - Ref: ref("k8s.io/api/core/v1.ContainerStateRunning"), - }, - }, - "terminated": { - SchemaProps: spec.SchemaProps{ - Description: "Details about a terminated container", - Ref: ref("k8s.io/api/core/v1.ContainerStateTerminated"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ContainerStateRunning", "k8s.io/api/core/v1.ContainerStateTerminated", "k8s.io/api/core/v1.ContainerStateWaiting"}, - } -} - -func schema_k8sio_api_core_v1_ContainerStateRunning(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ContainerStateRunning is a running state of a container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "startedAt": { - SchemaProps: spec.SchemaProps{ - Description: "Time at which the container was last (re-)started", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_ContainerStateTerminated(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ContainerStateTerminated is a terminated state of a container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "exitCode": { - SchemaProps: spec.SchemaProps{ - Description: "Exit status from the last termination of the container", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "signal": { - SchemaProps: spec.SchemaProps{ - Description: "Signal from the last termination of the container", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "(brief) reason from the last termination of the container", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Message regarding the last termination of the container", - Type: []string{"string"}, - Format: "", - }, - }, - "startedAt": { - SchemaProps: spec.SchemaProps{ - Description: "Time at which previous execution of the container started", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "finishedAt": { - SchemaProps: spec.SchemaProps{ - Description: "Time at which the container last terminated", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "containerID": { - SchemaProps: spec.SchemaProps{ - Description: "Container's ID in the format 'docker://'", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"exitCode"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_ContainerStateWaiting(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ContainerStateWaiting is a waiting state of a container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "(brief) reason the container is not yet running.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Message regarding why the container is not yet running.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ContainerStatus contains details for the current status of this container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "This must be a DNS_LABEL. Each container in a pod must have a unique name. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "state": { - SchemaProps: spec.SchemaProps{ - Description: "Details about the container's current condition.", - Ref: ref("k8s.io/api/core/v1.ContainerState"), - }, - }, - "lastState": { - SchemaProps: spec.SchemaProps{ - Description: "Details about the container's last termination condition.", - Ref: ref("k8s.io/api/core/v1.ContainerState"), - }, - }, - "ready": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies whether the container has passed its readiness probe.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "restartCount": { - SchemaProps: spec.SchemaProps{ - Description: "The number of times the container has been restarted, currently based on the number of dead containers that have not yet been removed. Note that this is calculated from dead containers. But those containers are subject to garbage collection. This value will get capped at 5 by GC.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "image": { - SchemaProps: spec.SchemaProps{ - Description: "The image the container is running. More info: https://kubernetes.io/docs/concepts/containers/images", - Type: []string{"string"}, - Format: "", - }, - }, - "imageID": { - SchemaProps: spec.SchemaProps{ - Description: "ImageID of the container's image.", - Type: []string{"string"}, - Format: "", - }, - }, - "containerID": { - SchemaProps: spec.SchemaProps{ - Description: "Container's ID in the format 'docker://'.", - Type: []string{"string"}, - Format: "", - }, - }, - "started": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies whether the container has passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. Is always true when no startupProbe is defined.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"name", "ready", "restartCount", "image", "imageID"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ContainerState"}, - } -} - -func schema_k8sio_api_core_v1_DaemonEndpoint(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DaemonEndpoint contains information about a single Daemon endpoint.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "Port": { - SchemaProps: spec.SchemaProps{ - Description: "Port number of the given endpoint.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"Port"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_DownwardAPIProjection(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of DownwardAPIVolume file", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.DownwardAPIVolumeFile"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.DownwardAPIVolumeFile"}, - } -} - -func schema_k8sio_api_core_v1_DownwardAPIVolumeFile(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DownwardAPIVolumeFile represents information to create the file containing the pod field", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Required: Path is the relative path name of the file to be created. Must not be absolute or contain the '..' path. Must be utf-8 encoded. The first item of the relative path must not start with '..'", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldRef": { - SchemaProps: spec.SchemaProps{ - Description: "Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.", - Ref: ref("k8s.io/api/core/v1.ObjectFieldSelector"), - }, - }, - "resourceFieldRef": { - SchemaProps: spec.SchemaProps{ - Description: "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.", - Ref: ref("k8s.io/api/core/v1.ResourceFieldSelector"), - }, - }, - "mode": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits used to set permissions on this file, must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"path"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ObjectFieldSelector", "k8s.io/api/core/v1.ResourceFieldSelector"}, - } -} - -func schema_k8sio_api_core_v1_DownwardAPIVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of downward API volume file", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.DownwardAPIVolumeFile"), - }, - }, - }, - }, - }, - "defaultMode": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits to use on created files by default. Must be a Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.DownwardAPIVolumeFile"}, - } -} - -func schema_k8sio_api_core_v1_EmptyDirVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "medium": { - SchemaProps: spec.SchemaProps{ - Description: "What type of storage medium should back this directory. The default is \"\" which means to use the node's default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", - Type: []string{"string"}, - Format: "", - }, - }, - "sizeLimit": { - SchemaProps: spec.SchemaProps{ - Description: "Total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir", - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_EndpointAddress(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EndpointAddress is a tuple that describes single IP address.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ip": { - SchemaProps: spec.SchemaProps{ - Description: "The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6 is also accepted but not fully supported on all platforms. Also, certain kubernetes components, like kube-proxy, are not IPv6 ready.", - Type: []string{"string"}, - Format: "", - }, - }, - "hostname": { - SchemaProps: spec.SchemaProps{ - Description: "The Hostname of this endpoint", - Type: []string{"string"}, - Format: "", - }, - }, - "nodeName": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node.", - Type: []string{"string"}, - Format: "", - }, - }, - "targetRef": { - SchemaProps: spec.SchemaProps{ - Description: "Reference to object providing the endpoint.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - }, - Required: []string{"ip"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_EndpointPort(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EndpointPort is a tuple that describes a single port.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "The name of this port. This must match the 'name' field in the corresponding ServicePort. Must be a DNS_LABEL. Optional only if one port is defined.", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "The port number of the endpoint.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "protocol": { - SchemaProps: spec.SchemaProps{ - Description: "The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.", - Type: []string{"string"}, - Format: "", - }, - }, - "appProtocol": { - SchemaProps: spec.SchemaProps{ - Description: "The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol. This is a beta field that is guarded by the ServiceAppProtocol feature gate and enabled by default.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"port"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_EndpointSubset(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given:\n {\n Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n }\nThe resulting set of endpoints can be viewed as:\n a: [ 10.10.1.1:8675, 10.10.2.2:8675 ],\n b: [ 10.10.1.1:309, 10.10.2.2:309 ]", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "addresses": { - SchemaProps: spec.SchemaProps{ - Description: "IP addresses which offer the related ports that are marked as ready. These endpoints should be considered safe for load balancers and clients to utilize.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EndpointAddress"), - }, - }, - }, - }, - }, - "notReadyAddresses": { - SchemaProps: spec.SchemaProps{ - Description: "IP addresses which offer the related ports but are not currently marked as ready because they have not yet finished starting, have recently failed a readiness check, or have recently failed a liveness check.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EndpointAddress"), - }, - }, - }, - }, - }, - "ports": { - SchemaProps: spec.SchemaProps{ - Description: "Port numbers available on the related IP addresses.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EndpointPort"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.EndpointAddress", "k8s.io/api/core/v1.EndpointPort"}, - } -} - -func schema_k8sio_api_core_v1_Endpoints(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Endpoints is a collection of endpoints that implement the actual service. Example:\n Name: \"mysvc\",\n Subsets: [\n {\n Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n },\n {\n Addresses: [{\"ip\": \"10.10.3.3\"}],\n Ports: [{\"name\": \"a\", \"port\": 93}, {\"name\": \"b\", \"port\": 76}]\n },\n ]", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "subsets": { - SchemaProps: spec.SchemaProps{ - Description: "The set of all endpoints is the union of all subsets. Addresses are placed into subsets according to the IPs they share. A single address with multiple ports, some of which are ready and some of which are not (because they come from different containers) will result in the address being displayed in different subsets for the different ports. No address will appear in both Addresses and NotReadyAddresses in the same subset. Sets of addresses and ports that comprise a service.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EndpointSubset"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.EndpointSubset", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_EndpointsList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EndpointsList is a list of endpoints.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of endpoints.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Endpoints"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Endpoints", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_EnvFromSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvFromSource represents the source of a set of ConfigMaps", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "prefix": { - SchemaProps: spec.SchemaProps{ - Description: "An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.", - Type: []string{"string"}, - Format: "", - }, - }, - "configMapRef": { - SchemaProps: spec.SchemaProps{ - Description: "The ConfigMap to select from", - Ref: ref("k8s.io/api/core/v1.ConfigMapEnvSource"), - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "The Secret to select from", - Ref: ref("k8s.io/api/core/v1.SecretEnvSource"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMapEnvSource", "k8s.io/api/core/v1.SecretEnvSource"}, - } -} - -func schema_k8sio_api_core_v1_EnvVar(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvVar represents an environment variable present in a Container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the environment variable. Must be a C_IDENTIFIER.", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "Variable references $(VAR_NAME) are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to \"\".", - Type: []string{"string"}, - Format: "", - }, - }, - "valueFrom": { - SchemaProps: spec.SchemaProps{ - Description: "Source for the environment variable's value. Cannot be used if value is not empty.", - Ref: ref("k8s.io/api/core/v1.EnvVarSource"), - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.EnvVarSource"}, - } -} - -func schema_k8sio_api_core_v1_EnvVarSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EnvVarSource represents a source for the value of an EnvVar.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "fieldRef": { - SchemaProps: spec.SchemaProps{ - Description: "Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.", - Ref: ref("k8s.io/api/core/v1.ObjectFieldSelector"), - }, - }, - "resourceFieldRef": { - SchemaProps: spec.SchemaProps{ - Description: "Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.", - Ref: ref("k8s.io/api/core/v1.ResourceFieldSelector"), - }, - }, - "configMapKeyRef": { - SchemaProps: spec.SchemaProps{ - Description: "Selects a key of a ConfigMap.", - Ref: ref("k8s.io/api/core/v1.ConfigMapKeySelector"), - }, - }, - "secretKeyRef": { - SchemaProps: spec.SchemaProps{ - Description: "Selects a key of a secret in the pod's namespace", - Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMapKeySelector", "k8s.io/api/core/v1.ObjectFieldSelector", "k8s.io/api/core/v1.ResourceFieldSelector", "k8s.io/api/core/v1.SecretKeySelector"}, - } -} - -func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "An EphemeralContainer is a container that may be added temporarily to an existing pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a pod is removed or restarted. If an ephemeral container causes a pod to exceed its resource allocation, the pod may be evicted. Ephemeral containers may not be added by directly updating the pod spec. They must be added via the pod's ephemeralcontainers subresource, and they will appear in the pod spec once added. This is an alpha feature enabled by the EphemeralContainers feature flag.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.", - Type: []string{"string"}, - Format: "", - }, - }, - "image": { - SchemaProps: spec.SchemaProps{ - Description: "Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images", - Type: []string{"string"}, - Format: "", - }, - }, - "command": { - SchemaProps: spec.SchemaProps{ - Description: "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "args": { - SchemaProps: spec.SchemaProps{ - Description: "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "workingDir": { - SchemaProps: spec.SchemaProps{ - Description: "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "ports": { - SchemaProps: spec.SchemaProps{ - Description: "Ports are not allowed for ephemeral containers.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ContainerPort"), - }, - }, - }, - }, - }, - "envFrom": { - SchemaProps: spec.SchemaProps{ - Description: "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EnvFromSource"), - }, - }, - }, - }, - }, - "env": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of environment variables to set in the container. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EnvVar"), - }, - }, - }, - }, - }, - "resources": { - SchemaProps: spec.SchemaProps{ - Description: "Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.", - Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), - }, - }, - "volumeMounts": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "mountPath", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Pod volumes to mount into the container's filesystem. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.VolumeMount"), - }, - }, - }, - }, - }, - "volumeDevices": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "devicePath", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "volumeDevices is the list of block devices to be used by the container.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.VolumeDevice"), - }, - }, - }, - }, - }, - "livenessProbe": { - SchemaProps: spec.SchemaProps{ - Description: "Probes are not allowed for ephemeral containers.", - Ref: ref("k8s.io/api/core/v1.Probe"), - }, - }, - "readinessProbe": { - SchemaProps: spec.SchemaProps{ - Description: "Probes are not allowed for ephemeral containers.", - Ref: ref("k8s.io/api/core/v1.Probe"), - }, - }, - "startupProbe": { - SchemaProps: spec.SchemaProps{ - Description: "Probes are not allowed for ephemeral containers.", - Ref: ref("k8s.io/api/core/v1.Probe"), - }, - }, - "lifecycle": { - SchemaProps: spec.SchemaProps{ - Description: "Lifecycle is not allowed for ephemeral containers.", - Ref: ref("k8s.io/api/core/v1.Lifecycle"), - }, - }, - "terminationMessagePath": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "terminationMessagePolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "imagePullPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", - Type: []string{"string"}, - Format: "", - }, - }, - "securityContext": { - SchemaProps: spec.SchemaProps{ - Description: "SecurityContext is not allowed for ephemeral containers.", - Ref: ref("k8s.io/api/core/v1.SecurityContext"), - }, - }, - "stdin": { - SchemaProps: spec.SchemaProps{ - Description: "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "stdinOnce": { - SchemaProps: spec.SchemaProps{ - Description: "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", - Type: []string{"boolean"}, - Format: "", - }, - }, - "tty": { - SchemaProps: spec.SchemaProps{ - Description: "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "targetContainerName": { - SchemaProps: spec.SchemaProps{ - Description: "If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container is run in whatever namespaces are shared for the pod. Note that the container runtime must support this feature.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, - } -} - -func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EphemeralContainerCommon is a copy of all fields in Container to be inlined in EphemeralContainer. This separate type allows easy conversion from EphemeralContainer to Container and allows separate documentation for the fields of EphemeralContainer. When a new field is added to Container it must be added here as well.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.", - Type: []string{"string"}, - Format: "", - }, - }, - "image": { - SchemaProps: spec.SchemaProps{ - Description: "Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images", - Type: []string{"string"}, - Format: "", - }, - }, - "command": { - SchemaProps: spec.SchemaProps{ - Description: "Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "args": { - SchemaProps: spec.SchemaProps{ - Description: "Arguments to the entrypoint. The docker image's CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container's environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "workingDir": { - SchemaProps: spec.SchemaProps{ - Description: "Container's working directory. If not specified, the container runtime's default will be used, which might be configured in the container image. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "ports": { - SchemaProps: spec.SchemaProps{ - Description: "Ports are not allowed for ephemeral containers.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ContainerPort"), - }, - }, - }, - }, - }, - "envFrom": { - SchemaProps: spec.SchemaProps{ - Description: "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EnvFromSource"), - }, - }, - }, - }, - }, - "env": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of environment variables to set in the container. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EnvVar"), - }, - }, - }, - }, - }, - "resources": { - SchemaProps: spec.SchemaProps{ - Description: "Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.", - Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), - }, - }, - "volumeMounts": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "mountPath", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Pod volumes to mount into the container's filesystem. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.VolumeMount"), - }, - }, - }, - }, - }, - "volumeDevices": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "devicePath", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "volumeDevices is the list of block devices to be used by the container.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.VolumeDevice"), - }, - }, - }, - }, - }, - "livenessProbe": { - SchemaProps: spec.SchemaProps{ - Description: "Probes are not allowed for ephemeral containers.", - Ref: ref("k8s.io/api/core/v1.Probe"), - }, - }, - "readinessProbe": { - SchemaProps: spec.SchemaProps{ - Description: "Probes are not allowed for ephemeral containers.", - Ref: ref("k8s.io/api/core/v1.Probe"), - }, - }, - "startupProbe": { - SchemaProps: spec.SchemaProps{ - Description: "Probes are not allowed for ephemeral containers.", - Ref: ref("k8s.io/api/core/v1.Probe"), - }, - }, - "lifecycle": { - SchemaProps: spec.SchemaProps{ - Description: "Lifecycle is not allowed for ephemeral containers.", - Ref: ref("k8s.io/api/core/v1.Lifecycle"), - }, - }, - "terminationMessagePath": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "terminationMessagePolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.", - Type: []string{"string"}, - Format: "", - }, - }, - "imagePullPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images", - Type: []string{"string"}, - Format: "", - }, - }, - "securityContext": { - SchemaProps: spec.SchemaProps{ - Description: "SecurityContext is not allowed for ephemeral containers.", - Ref: ref("k8s.io/api/core/v1.SecurityContext"), - }, - }, - "stdin": { - SchemaProps: spec.SchemaProps{ - Description: "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "stdinOnce": { - SchemaProps: spec.SchemaProps{ - Description: "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false", - Type: []string{"boolean"}, - Format: "", - }, - }, - "tty": { - SchemaProps: spec.SchemaProps{ - Description: "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, - } -} - -func schema_k8sio_api_core_v1_EphemeralContainers(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A list of ephemeral containers used with the Pod ephemeralcontainers subresource.", - 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{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "ephemeralContainers": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "A list of ephemeral containers associated with this pod. New ephemeral containers may be appended to this list, but existing ephemeral containers may not be removed or modified.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EphemeralContainer"), - }, - }, - }, - }, - }, - }, - Required: []string{"ephemeralContainers"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.EphemeralContainer", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_EphemeralVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents an ephemeral volume that is handled by a normal storage driver.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumeClaimTemplate": { - SchemaProps: spec.SchemaProps{ - Description: "Will be used to create a stand-alone PVC to provision the volume. The pod in which this EphemeralVolumeSource is embedded will be the owner of the PVC, i.e. the PVC will be deleted together with the pod. The name of the PVC will be `-` where `` is the name from the `PodSpec.Volumes` array entry. Pod validation will reject the pod if the concatenated name is not valid for a PVC (for example, too long).\n\nAn existing PVC with that name that is not owned by the pod will *not* be used for the pod to avoid using an unrelated volume by mistake. Starting the pod is then blocked until the unrelated PVC is removed. If such a pre-created PVC is meant to be used by the pod, the PVC has to updated with an owner reference to the pod once the pod exists. Normally this should not be necessary, but it may be useful when manually reconstructing a broken cluster.\n\nThis field is read-only and no changes will be made by Kubernetes to the PVC after it has been created.\n\nRequired, must not be nil.", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimTemplate"), - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies a read-only configuration for the volume. Defaults to false (read/write).", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimTemplate"}, - } -} - -func schema_k8sio_api_core_v1_Event(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Event is a report of an event somewhere in the cluster.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "involvedObject": { - SchemaProps: spec.SchemaProps{ - Description: "The object that this event is about.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "This should be a short, machine understandable string that gives the reason for the transition into the object's current status.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human-readable description of the status of this operation.", - Type: []string{"string"}, - Format: "", - }, - }, - "source": { - SchemaProps: spec.SchemaProps{ - Description: "The component reporting this event. Should be a short machine understandable string.", - Ref: ref("k8s.io/api/core/v1.EventSource"), - }, - }, - "firstTimestamp": { - SchemaProps: spec.SchemaProps{ - Description: "The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTimestamp": { - SchemaProps: spec.SchemaProps{ - Description: "The time at which the most recent occurrence of this event was recorded.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "count": { - SchemaProps: spec.SchemaProps{ - Description: "The number of times this event has occurred.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of this event (Normal, Warning), new types could be added in the future", - Type: []string{"string"}, - Format: "", - }, - }, - "eventTime": { - SchemaProps: spec.SchemaProps{ - Description: "Time when this Event was first observed.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"), - }, - }, - "series": { - SchemaProps: spec.SchemaProps{ - Description: "Data about the Event series this event represents or nil if it's a singleton Event.", - Ref: ref("k8s.io/api/core/v1.EventSeries"), - }, - }, - "action": { - SchemaProps: spec.SchemaProps{ - Description: "What action was taken/failed regarding to the Regarding object.", - Type: []string{"string"}, - Format: "", - }, - }, - "related": { - SchemaProps: spec.SchemaProps{ - Description: "Optional secondary object for more complex actions.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - "reportingComponent": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`.", - Type: []string{"string"}, - Format: "", - }, - }, - "reportingInstance": { - SchemaProps: spec.SchemaProps{ - Description: "ID of the controller instance, e.g. `kubelet-xyzf`.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"metadata", "involvedObject"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.EventSeries", "k8s.io/api/core/v1.EventSource", "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_EventList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EventList is a list of events.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of events", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Event"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Event", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_EventSeries(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "count": { - SchemaProps: spec.SchemaProps{ - Description: "Number of occurrences in this series up to the last heartbeat time", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "lastObservedTime": { - SchemaProps: spec.SchemaProps{ - Description: "Time of the last occurrence observed", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"}, - } -} - -func schema_k8sio_api_core_v1_EventSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "EventSource contains information for an event.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "component": { - SchemaProps: spec.SchemaProps{ - Description: "Component from which the event is generated.", - Type: []string{"string"}, - Format: "", - }, - }, - "host": { - SchemaProps: spec.SchemaProps{ - Description: "Node name on which the event is generated.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ExecAction(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExecAction describes a \"run in container\" action.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "command": { - SchemaProps: spec.SchemaProps{ - Description: "Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem. The command is simply exec'd, it is not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_FCVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "targetWWNs": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: FC target worldwide names (WWNs)", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "lun": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: FC target lun number", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "wwids": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_FlexPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FlexPersistentVolumeSource represents a generic persistent volume resource that is provisioned/attached using an exec based plugin.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "driver": { - SchemaProps: spec.SchemaProps{ - Description: "Driver is the name of the driver to use for this volume.", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "options": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Extra command options if any.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"driver"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference"}, - } -} - -func schema_k8sio_api_core_v1_FlexVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "driver": { - SchemaProps: spec.SchemaProps{ - Description: "Driver is the name of the driver to use for this volume.", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default filesystem depends on FlexVolume script.", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "options": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Extra command options if any.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"driver"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_FlockerVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "datasetName": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated", - Type: []string{"string"}, - Format: "", - }, - }, - "datasetUUID": { - SchemaProps: spec.SchemaProps{ - Description: "UUID of the dataset. This is unique identifier of a Flocker dataset", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_GCEPersistentDiskVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Persistent Disk resource in Google Compute Engine.\n\nA GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "pdName": { - SchemaProps: spec.SchemaProps{ - Description: "Unique name of the PD resource in GCE. Used to identify the disk in GCE. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Type: []string{"string"}, - Format: "", - }, - }, - "partition": { - SchemaProps: spec.SchemaProps{ - Description: "The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"pdName"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_GitRepoVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling.\n\nDEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "repository": { - SchemaProps: spec.SchemaProps{ - Description: "Repository URL", - Type: []string{"string"}, - Format: "", - }, - }, - "revision": { - SchemaProps: spec.SchemaProps{ - Description: "Commit hash for the specified revision.", - Type: []string{"string"}, - Format: "", - }, - }, - "directory": { - SchemaProps: spec.SchemaProps{ - Description: "Target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"repository"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_GlusterfsPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "endpoints": { - SchemaProps: spec.SchemaProps{ - Description: "EndpointsName is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", - Type: []string{"string"}, - Format: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", - Type: []string{"boolean"}, - Format: "", - }, - }, - "endpointsNamespace": { - SchemaProps: spec.SchemaProps{ - Description: "EndpointsNamespace is the namespace that contains Glusterfs endpoint. If this field is empty, the EndpointNamespace defaults to the same namespace as the bound PVC. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"endpoints", "path"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_GlusterfsVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "endpoints": { - SchemaProps: spec.SchemaProps{ - Description: "EndpointsName is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", - Type: []string{"string"}, - Format: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path is the Glusterfs volume path. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the Glusterfs volume to be mounted with read-only permissions. Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"endpoints", "path"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_HTTPGetAction(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPGetAction describes an action based on HTTP Get requests.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path to access on the HTTP server.", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.", - Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), - }, - }, - "host": { - SchemaProps: spec.SchemaProps{ - Description: "Host name to connect to, defaults to the pod IP. You probably want to set \"Host\" in httpHeaders instead.", - Type: []string{"string"}, - Format: "", - }, - }, - "scheme": { - SchemaProps: spec.SchemaProps{ - Description: "Scheme to use for connecting to the host. Defaults to HTTP.", - Type: []string{"string"}, - Format: "", - }, - }, - "httpHeaders": { - SchemaProps: spec.SchemaProps{ - Description: "Custom headers to set in the request. HTTP allows repeated headers.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.HTTPHeader"), - }, - }, - }, - }, - }, - }, - Required: []string{"port"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.HTTPHeader", "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, - } -} - -func schema_k8sio_api_core_v1_HTTPHeader(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HTTPHeader describes a custom header to be used in HTTP probes", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "The header field name", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "The header field value", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "value"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_Handler(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Handler defines a specific action that should be taken", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "exec": { - SchemaProps: spec.SchemaProps{ - Description: "One and only one of the following should be specified. Exec specifies the action to take.", - Ref: ref("k8s.io/api/core/v1.ExecAction"), - }, - }, - "httpGet": { - SchemaProps: spec.SchemaProps{ - Description: "HTTPGet specifies the http request to perform.", - Ref: ref("k8s.io/api/core/v1.HTTPGetAction"), - }, - }, - "tcpSocket": { - SchemaProps: spec.SchemaProps{ - Description: "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported", - Ref: ref("k8s.io/api/core/v1.TCPSocketAction"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ExecAction", "k8s.io/api/core/v1.HTTPGetAction", "k8s.io/api/core/v1.TCPSocketAction"}, - } -} - -func schema_k8sio_api_core_v1_HostAlias(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod's hosts file.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ip": { - SchemaProps: spec.SchemaProps{ - Description: "IP address of the host file entry.", - Type: []string{"string"}, - Format: "", - }, - }, - "hostnames": { - SchemaProps: spec.SchemaProps{ - Description: "Hostnames for the above IP address.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_HostPathVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path of the directory on the host. If the path is a symlink, it will follow the link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - Type: []string{"string"}, - Format: "", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"path"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ISCSIPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ISCSIPersistentVolumeSource represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "targetPortal": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", - Type: []string{"string"}, - Format: "", - }, - }, - "iqn": { - SchemaProps: spec.SchemaProps{ - Description: "Target iSCSI Qualified Name.", - Type: []string{"string"}, - Format: "", - }, - }, - "lun": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Target Lun number.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "iscsiInterface": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "portals": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Target Portal List. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "chapAuthDiscovery": { - SchemaProps: spec.SchemaProps{ - Description: "whether support iSCSI Discovery CHAP authentication", - Type: []string{"boolean"}, - Format: "", - }, - }, - "chapAuthSession": { - SchemaProps: spec.SchemaProps{ - Description: "whether support iSCSI Session CHAP authentication", - Type: []string{"boolean"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "CHAP Secret for iSCSI target and initiator authentication", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "initiatorName": { - SchemaProps: spec.SchemaProps{ - Description: "Custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"targetPortal", "iqn", "lun"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference"}, - } -} - -func schema_k8sio_api_core_v1_ISCSIVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "targetPortal": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", - Type: []string{"string"}, - Format: "", - }, - }, - "iqn": { - SchemaProps: spec.SchemaProps{ - Description: "Target iSCSI Qualified Name.", - Type: []string{"string"}, - Format: "", - }, - }, - "lun": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Target Lun number.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "iscsiInterface": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Interface Name that uses an iSCSI transport. Defaults to 'default' (tcp).", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "portals": { - SchemaProps: spec.SchemaProps{ - Description: "iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "chapAuthDiscovery": { - SchemaProps: spec.SchemaProps{ - Description: "whether support iSCSI Discovery CHAP authentication", - Type: []string{"boolean"}, - Format: "", - }, - }, - "chapAuthSession": { - SchemaProps: spec.SchemaProps{ - Description: "whether support iSCSI Session CHAP authentication", - Type: []string{"boolean"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "CHAP Secret for iSCSI target and initiator authentication", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "initiatorName": { - SchemaProps: spec.SchemaProps{ - Description: "Custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface : will be created for the connection.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"targetPortal", "iqn", "lun"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_KeyToPath(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Maps a string key to a path within a volume.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "The key to project.", - Type: []string{"string"}, - Format: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "The relative path of the file to map the key to. May not be an absolute path. May not contain the path element '..'. May not start with the string '..'.", - Type: []string{"string"}, - Format: "", - }, - }, - "mode": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits used to set permissions on this file. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"key", "path"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_Lifecycle(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "postStart": { - SchemaProps: spec.SchemaProps{ - Description: "PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks", - Ref: ref("k8s.io/api/core/v1.Handler"), - }, - }, - "preStop": { - SchemaProps: spec.SchemaProps{ - Description: "PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod's termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod's termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks", - Ref: ref("k8s.io/api/core/v1.Handler"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Handler"}, - } -} - -func schema_k8sio_api_core_v1_LimitRange(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LimitRange sets resource usage limits for each kind of resource in a Namespace.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the limits enforced. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.LimitRangeSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LimitRangeSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_LimitRangeItem(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LimitRangeItem defines a min/max usage limit for any resource that matches on kind.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of resource that this limit applies to.", - Type: []string{"string"}, - Format: "", - }, - }, - "max": { - SchemaProps: spec.SchemaProps{ - Description: "Max usage constraints on this kind by resource name.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "min": { - SchemaProps: spec.SchemaProps{ - Description: "Min usage constraints on this kind by resource name.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "default": { - SchemaProps: spec.SchemaProps{ - Description: "Default resource requirement limit value by resource name if resource limit is omitted.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "defaultRequest": { - SchemaProps: spec.SchemaProps{ - Description: "DefaultRequest is the default resource requirement request value by resource name if resource request is omitted.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "maxLimitRequestRatio": { - SchemaProps: spec.SchemaProps{ - Description: "MaxLimitRequestRatio if specified, the named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - }, - Required: []string{"type"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_LimitRangeList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LimitRangeList is a list of LimitRange items.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of LimitRange objects. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LimitRange"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LimitRange", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_LimitRangeSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LimitRangeSpec defines a min/max usage limit for resources that match on kind.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "limits": { - SchemaProps: spec.SchemaProps{ - Description: "Limits is the list of LimitRangeItem objects that are enforced.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LimitRangeItem"), - }, - }, - }, - }, - }, - }, - Required: []string{"limits"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LimitRangeItem"}, - } -} - -func schema_k8sio_api_core_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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of objects", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -func schema_k8sio_api_core_v1_LoadBalancerIngress(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ip": { - SchemaProps: spec.SchemaProps{ - Description: "IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)", - Type: []string{"string"}, - Format: "", - }, - }, - "hostname": { - SchemaProps: spec.SchemaProps{ - Description: "Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers)", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_LoadBalancerStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LoadBalancerStatus represents the status of a load-balancer.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ingress": { - SchemaProps: spec.SchemaProps{ - Description: "Ingress is a list containing ingress points for the load-balancer. Traffic intended for the service should be sent to these ingress points.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LoadBalancerIngress"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LoadBalancerIngress"}, - } -} - -func schema_k8sio_api_core_v1_LocalObjectReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_LocalVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Local represents directly-attached storage with node affinity (Beta feature)", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "path": { - SchemaProps: spec.SchemaProps{ - Description: "The full path to the volume on the node. It can be either a directory or block device (disk, partition, ...).", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. It applies only when the Path is a block device. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". The default value is to auto-select a fileystem if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"path"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_NFSVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "server": { - SchemaProps: spec.SchemaProps{ - Description: "Server is the hostname or IP address of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - Type: []string{"string"}, - Format: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path that is exported by the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the NFS export to be mounted with read-only permissions. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"server", "path"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_Namespace(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Namespace provides a scope for Names. Use of multiple namespaces is optional.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the behavior of the Namespace. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.NamespaceSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status describes the current status of a Namespace. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.NamespaceStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NamespaceSpec", "k8s.io/api/core/v1.NamespaceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_NamespaceCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NamespaceCondition contains details about state of namespace.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of namespace controller condition.", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition, one of True, False, Unknown.", - Type: []string{"string"}, - Format: "", - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_NamespaceList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NamespaceList is a list of Namespaces.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is the list of Namespace objects in the list. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Namespace"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Namespace", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_NamespaceSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NamespaceSpec describes the attributes on a Namespace.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "finalizers": { - SchemaProps: spec.SchemaProps{ - Description: "Finalizers is an opaque list of values that must be empty to permanently remove object from storage. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_NamespaceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NamespaceStatus is information about the current status of a Namespace.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "Phase is the current lifecycle phase of the namespace. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/", - Type: []string{"string"}, - Format: "", - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Represents the latest available observations of a namespace's current state.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.NamespaceCondition"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NamespaceCondition"}, - } -} - -func schema_k8sio_api_core_v1_Node(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. 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{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the behavior of a node. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.NodeSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Most recently observed status of the node. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.NodeStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeSpec", "k8s.io/api/core/v1.NodeStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_NodeAddress(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeAddress contains information for the node's address.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Node address type, one of Hostname, ExternalIP or InternalIP.", - Type: []string{"string"}, - Format: "", - }, - }, - "address": { - SchemaProps: spec.SchemaProps{ - Description: "The node address.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "address"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_NodeAffinity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Node affinity is a group of node affinity scheduling rules.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "requiredDuringSchedulingIgnoredDuringExecution": { - SchemaProps: spec.SchemaProps{ - Description: "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.", - Ref: ref("k8s.io/api/core/v1.NodeSelector"), - }, - }, - "preferredDuringSchedulingIgnoredDuringExecution": { - SchemaProps: spec.SchemaProps{ - Description: "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PreferredSchedulingTerm"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelector", "k8s.io/api/core/v1.PreferredSchedulingTerm"}, - } -} - -func schema_k8sio_api_core_v1_NodeCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeCondition contains condition information for a node.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of node condition.", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition, one of True, False, Unknown.", - Type: []string{"string"}, - Format: "", - }, - }, - "lastHeartbeatTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time we got an update on a given condition.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time the condition transit from one status to another.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "(brief) 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"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_NodeConfigSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configMap": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigMap is a reference to a Node's ConfigMap", - Ref: ref("k8s.io/api/core/v1.ConfigMapNodeConfigSource"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMapNodeConfigSource"}, - } -} - -func schema_k8sio_api_core_v1_NodeConfigStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeConfigStatus describes the status of the config assigned by Node.Spec.ConfigSource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "assigned": { - SchemaProps: spec.SchemaProps{ - Description: "Assigned reports the checkpointed config the node will try to use. When Node.Spec.ConfigSource is updated, the node checkpoints the associated config payload to local disk, along with a record indicating intended config. The node refers to this record to choose its config checkpoint, and reports this record in Assigned. Assigned only updates in the status after the record has been checkpointed to disk. When the Kubelet is restarted, it tries to make the Assigned config the Active config by loading and validating the checkpointed payload identified by Assigned.", - Ref: ref("k8s.io/api/core/v1.NodeConfigSource"), - }, - }, - "active": { - SchemaProps: spec.SchemaProps{ - Description: "Active reports the checkpointed config the node is actively using. Active will represent either the current version of the Assigned config, or the current LastKnownGood config, depending on whether attempting to use the Assigned config results in an error.", - Ref: ref("k8s.io/api/core/v1.NodeConfigSource"), - }, - }, - "lastKnownGood": { - SchemaProps: spec.SchemaProps{ - Description: "LastKnownGood reports the checkpointed config the node will fall back to when it encounters an error attempting to use the Assigned config. The Assigned config becomes the LastKnownGood config when the node determines that the Assigned config is stable and correct. This is currently implemented as a 10-minute soak period starting when the local record of Assigned config is updated. If the Assigned config is Active at the end of this period, it becomes the LastKnownGood. Note that if Spec.ConfigSource is reset to nil (use local defaults), the LastKnownGood is also immediately reset to nil, because the local default config is always assumed good. You should not make assumptions about the node's method of determining config stability and correctness, as this may change or become configurable in the future.", - Ref: ref("k8s.io/api/core/v1.NodeConfigSource"), - }, - }, - "error": { - SchemaProps: spec.SchemaProps{ - Description: "Error describes any problems reconciling the Spec.ConfigSource to the Active config. Errors may occur, for example, attempting to checkpoint Spec.ConfigSource to the local Assigned record, attempting to checkpoint the payload associated with Spec.ConfigSource, attempting to load or validate the Assigned config, etc. Errors may occur at different points while syncing config. Earlier errors (e.g. download or checkpointing errors) will not result in a rollback to LastKnownGood, and may resolve across Kubelet retries. Later errors (e.g. loading or validating a checkpointed config) will result in a rollback to LastKnownGood. In the latter case, it is usually possible to resolve the error by fixing the config assigned in Spec.ConfigSource. You can find additional information for debugging by searching the error message in the Kubelet log. Error is a human-readable description of the error state; machines can check whether or not Error is empty, but should not rely on the stability of the Error text across Kubelet versions.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeConfigSource"}, - } -} - -func schema_k8sio_api_core_v1_NodeDaemonEndpoints(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeDaemonEndpoints lists ports opened by daemons running on the Node.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kubeletEndpoint": { - SchemaProps: spec.SchemaProps{ - Description: "Endpoint on which Kubelet is listening.", - Ref: ref("k8s.io/api/core/v1.DaemonEndpoint"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.DaemonEndpoint"}, - } -} - -func schema_k8sio_api_core_v1_NodeList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeList is the whole list of all Nodes which have been registered with master.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of nodes", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Node"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Node", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_NodeProxyOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeProxyOptions is the query options to a Node's proxy 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: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path is the URL path to use for the current proxy request to node.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_NodeResources(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeResources is an object for conveying resource information about a node. see https://kubernetes.io/docs/concepts/architecture/nodes/#capacity for more details.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "Capacity": { - SchemaProps: spec.SchemaProps{ - Description: "Capacity represents the available resources of a node", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - }, - Required: []string{"Capacity"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_NodeSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "nodeSelectorTerms": { - SchemaProps: spec.SchemaProps{ - Description: "Required. A list of node selector terms. The terms are ORed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.NodeSelectorTerm"), - }, - }, - }, - }, - }, - }, - Required: []string{"nodeSelectorTerms"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelectorTerm"}, - } -} - -func schema_k8sio_api_core_v1_NodeSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A node 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: "The label key that the selector applies to.", - Type: []string{"string"}, - Format: "", - }, - }, - "operator": { - SchemaProps: spec.SchemaProps{ - Description: "Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.", - Type: []string{"string"}, - Format: "", - }, - }, - "values": { - SchemaProps: spec.SchemaProps{ - Description: "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. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. 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"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_NodeSelectorTerm(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "matchExpressions": { - SchemaProps: spec.SchemaProps{ - Description: "A list of node selector requirements by node's labels.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.NodeSelectorRequirement"), - }, - }, - }, - }, - }, - "matchFields": { - SchemaProps: spec.SchemaProps{ - Description: "A list of node selector requirements by node's fields.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.NodeSelectorRequirement"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelectorRequirement"}, - } -} - -func schema_k8sio_api_core_v1_NodeSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeSpec describes the attributes that a node is created with.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "podCIDR": { - SchemaProps: spec.SchemaProps{ - Description: "PodCIDR represents the pod IP range assigned to the node.", - Type: []string{"string"}, - Format: "", - }, - }, - "podCIDRs": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "podCIDRs represents the IP ranges assigned to the node for usage by Pods on that node. If this field is specified, the 0th entry must match the podCIDR field. It may contain at most 1 value for each of IPv4 and IPv6.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "providerID": { - SchemaProps: spec.SchemaProps{ - Description: "ID of the node assigned by the cloud provider in the format: ://", - Type: []string{"string"}, - Format: "", - }, - }, - "unschedulable": { - SchemaProps: spec.SchemaProps{ - Description: "Unschedulable controls node schedulability of new pods. By default, node is schedulable. More info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration", - Type: []string{"boolean"}, - Format: "", - }, - }, - "taints": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the node's taints.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Taint"), - }, - }, - }, - }, - }, - "configSource": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the source to get node configuration from The DynamicKubeletConfig feature gate must be enabled for the Kubelet to use this field", - Ref: ref("k8s.io/api/core/v1.NodeConfigSource"), - }, - }, - "externalID": { - SchemaProps: spec.SchemaProps{ - Description: "Deprecated. Not all kubelets will set this field. Remove field after 1.13. see: https://issues.k8s.io/61966", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeConfigSource", "k8s.io/api/core/v1.Taint"}, - } -} - -func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeStatus is information about the current status of a node.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "capacity": { - SchemaProps: spec.SchemaProps{ - Description: "Capacity represents the total resources of a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "allocatable": { - SchemaProps: spec.SchemaProps{ - Description: "Allocatable represents the resources of a node that are available for scheduling. Defaults to Capacity.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "NodePhase is the recently observed lifecycle phase of the node. More info: https://kubernetes.io/docs/concepts/nodes/node/#phase The field is never populated, and now is deprecated.", - Type: []string{"string"}, - Format: "", - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Conditions is an array of current observed node conditions. More info: https://kubernetes.io/docs/concepts/nodes/node/#condition", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.NodeCondition"), - }, - }, - }, - }, - }, - "addresses": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of addresses reachable to the node. Queried from cloud provider, if available. More info: https://kubernetes.io/docs/concepts/nodes/node/#addresses Note: This field is declared as mergeable, but the merge key is not sufficiently unique, which can cause data corruption when it is merged. Callers should instead use a full-replacement patch. See http://pr.k8s.io/79391 for an example.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.NodeAddress"), - }, - }, - }, - }, - }, - "daemonEndpoints": { - SchemaProps: spec.SchemaProps{ - Description: "Endpoints of daemons running on the Node.", - Ref: ref("k8s.io/api/core/v1.NodeDaemonEndpoints"), - }, - }, - "nodeInfo": { - SchemaProps: spec.SchemaProps{ - Description: "Set of ids/uuids to uniquely identify the node. More info: https://kubernetes.io/docs/concepts/nodes/node/#info", - Ref: ref("k8s.io/api/core/v1.NodeSystemInfo"), - }, - }, - "images": { - SchemaProps: spec.SchemaProps{ - Description: "List of container images on this node", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ContainerImage"), - }, - }, - }, - }, - }, - "volumesInUse": { - SchemaProps: spec.SchemaProps{ - Description: "List of attachable volumes in use (mounted) by the node.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "volumesAttached": { - SchemaProps: spec.SchemaProps{ - Description: "List of volumes that are attached to the node.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.AttachedVolume"), - }, - }, - }, - }, - }, - "config": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the config assigned to the node via the dynamic Kubelet config feature.", - Ref: ref("k8s.io/api/core/v1.NodeConfigStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.AttachedVolume", "k8s.io/api/core/v1.ContainerImage", "k8s.io/api/core/v1.NodeAddress", "k8s.io/api/core/v1.NodeCondition", "k8s.io/api/core/v1.NodeConfigStatus", "k8s.io/api/core/v1.NodeDaemonEndpoints", "k8s.io/api/core/v1.NodeSystemInfo", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_NodeSystemInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "NodeSystemInfo is a set of ids/uuids to uniquely identify the node.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "machineID": { - SchemaProps: spec.SchemaProps{ - Description: "MachineID reported by the node. For unique machine identification in the cluster this field is preferred. Learn more from man(5) machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html", - Type: []string{"string"}, - Format: "", - }, - }, - "systemUUID": { - SchemaProps: spec.SchemaProps{ - Description: "SystemUUID reported by the node. For unique machine identification MachineID is preferred. This field is specific to Red Hat hosts https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/rhsm/uuid", - Type: []string{"string"}, - Format: "", - }, - }, - "bootID": { - SchemaProps: spec.SchemaProps{ - Description: "Boot ID reported by the node.", - Type: []string{"string"}, - Format: "", - }, - }, - "kernelVersion": { - SchemaProps: spec.SchemaProps{ - Description: "Kernel Version reported by the node from 'uname -r' (e.g. 3.16.0-0.bpo.4-amd64).", - Type: []string{"string"}, - Format: "", - }, - }, - "osImage": { - SchemaProps: spec.SchemaProps{ - Description: "OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).", - Type: []string{"string"}, - Format: "", - }, - }, - "containerRuntimeVersion": { - SchemaProps: spec.SchemaProps{ - Description: "ContainerRuntime Version reported by the node through runtime remote API (e.g. docker://1.5.0).", - Type: []string{"string"}, - Format: "", - }, - }, - "kubeletVersion": { - SchemaProps: spec.SchemaProps{ - Description: "Kubelet Version reported by the node.", - Type: []string{"string"}, - Format: "", - }, - }, - "kubeProxyVersion": { - SchemaProps: spec.SchemaProps{ - Description: "KubeProxy Version reported by the node.", - Type: []string{"string"}, - Format: "", - }, - }, - "operatingSystem": { - SchemaProps: spec.SchemaProps{ - Description: "The Operating System reported by the node", - Type: []string{"string"}, - Format: "", - }, - }, - "architecture": { - SchemaProps: spec.SchemaProps{ - Description: "The Architecture reported by the node", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"machineID", "systemUUID", "bootID", "kernelVersion", "osImage", "containerRuntimeVersion", "kubeletVersion", "kubeProxyVersion", "operatingSystem", "architecture"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ObjectFieldSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ObjectFieldSelector selects an APIVersioned field of an object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "Version of the schema the FieldPath is written in terms of, defaults to \"v1\".", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldPath": { - SchemaProps: spec.SchemaProps{ - Description: "Path of the field to select in the specified API version.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"fieldPath"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ObjectReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ObjectReference contains enough information to let you inspect or modify the referred object.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "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", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/", - 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", - 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", - Type: []string{"string"}, - Format: "", - }, - }, - "apiVersion": { - SchemaProps: spec.SchemaProps{ - Description: "API version of the referent.", - Type: []string{"string"}, - Format: "", - }, - }, - "resourceVersion": { - SchemaProps: spec.SchemaProps{ - Description: "Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", - Type: []string{"string"}, - Format: "", - }, - }, - "fieldPath": { - SchemaProps: spec.SchemaProps{ - Description: "If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: \"spec.containers{name}\" (where \"name\" refers to the name of the container that triggered the event) or if no container name is specified \"spec.containers[2]\" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolume(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolume (PV) is a storage resource provisioned by an administrator. It is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines a specification of a persistent volume owned by the cluster. Provisioned by an administrator. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistent-volumes", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status represents the current information/status for the persistent volume. Populated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistent-volumes", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeSpec", "k8s.io/api/core/v1.PersistentVolumeStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeClaim(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaim is a user's request for and claim to a persistent volume", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status represents the current information/status of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "k8s.io/api/core/v1.PersistentVolumeClaimStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeClaimCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimCondition contails details about state of pvc", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "lastProbeTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time we probed the condition.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time the condition transitioned from one status to another.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "Unique, this should be a short, machine understandable string that gives the reason for condition's last transition. If it reports \"ResizeStarted\" that means the underlying persistent volume is being resized.", - 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"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeClaimList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimList is a list of PersistentVolumeClaim items.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "A list of persistent volume claims. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaim"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaim", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "accessModes": { - SchemaProps: spec.SchemaProps{ - Description: "AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "selector": { - SchemaProps: spec.SchemaProps{ - Description: "A label query over volumes to consider for binding.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), - }, - }, - "resources": { - SchemaProps: spec.SchemaProps{ - Description: "Resources represents the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources", - Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), - }, - }, - "volumeName": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeName is the binding reference to the PersistentVolume backing this claim.", - Type: []string{"string"}, - Format: "", - }, - }, - "storageClassName": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeMode": { - SchemaProps: spec.SchemaProps{ - Description: "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.", - Type: []string{"string"}, - Format: "", - }, - }, - "dataSource": { - SchemaProps: spec.SchemaProps{ - Description: "This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot - Beta) * An existing PVC (PersistentVolumeClaim) * An existing custom resource/object that implements data population (Alpha) In order to use VolumeSnapshot object types, the appropriate feature gate must be enabled (VolumeSnapshotDataSource or AnyVolumeDataSource) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the specified data source is not supported, the volume will not be created and the failure will be reported as an event. In the future, we plan to support more data source types and the behavior of the provisioner may change.", - Ref: ref("k8s.io/api/core/v1.TypedLocalObjectReference"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.TypedLocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimStatus is the current status of a persistent volume claim.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "Phase represents the current phase of PersistentVolumeClaim.", - Type: []string{"string"}, - Format: "", - }, - }, - "accessModes": { - SchemaProps: spec.SchemaProps{ - Description: "AccessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "capacity": { - SchemaProps: spec.SchemaProps{ - Description: "Represents the actual resources of the underlying volume.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimCondition"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimCondition", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeClaimTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "May contain labels and annotations that will be copied into the PVC when creating it. No other fields are allowed and will be rejected during validation.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "The specification for the PersistentVolumeClaim. The entire content is copied unchanged into the PVC that gets created from this template. The same fields as in a PersistentVolumeClaim are also valid here.", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimSpec"), - }, - }, - }, - Required: []string{"spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeClaimVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimVolumeSource references the user's PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "claimName": { - SchemaProps: spec.SchemaProps{ - Description: "ClaimName is the name of a PersistentVolumeClaim in the same namespace as the pod using this volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Will force the ReadOnly setting in VolumeMounts. Default false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"claimName"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeList is a list of PersistentVolume items.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of persistent volumes. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PersistentVolume"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolume", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeSource is similar to VolumeSource but meant for the administrator who creates PVs. Exactly one of its members must be set.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "gcePersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Ref: ref("k8s.io/api/core/v1.GCEPersistentDiskVolumeSource"), - }, - }, - "awsElasticBlockStore": { - SchemaProps: spec.SchemaProps{ - Description: "AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - Ref: ref("k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource"), - }, - }, - "hostPath": { - SchemaProps: spec.SchemaProps{ - Description: "HostPath represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - Ref: ref("k8s.io/api/core/v1.HostPathVolumeSource"), - }, - }, - "glusterfs": { - SchemaProps: spec.SchemaProps{ - Description: "Glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md", - Ref: ref("k8s.io/api/core/v1.GlusterfsPersistentVolumeSource"), - }, - }, - "nfs": { - SchemaProps: spec.SchemaProps{ - Description: "NFS represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - Ref: ref("k8s.io/api/core/v1.NFSVolumeSource"), - }, - }, - "rbd": { - SchemaProps: spec.SchemaProps{ - Description: "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md", - Ref: ref("k8s.io/api/core/v1.RBDPersistentVolumeSource"), - }, - }, - "iscsi": { - SchemaProps: spec.SchemaProps{ - Description: "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin.", - Ref: ref("k8s.io/api/core/v1.ISCSIPersistentVolumeSource"), - }, - }, - "cinder": { - SchemaProps: spec.SchemaProps{ - Description: "Cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", - Ref: ref("k8s.io/api/core/v1.CinderPersistentVolumeSource"), - }, - }, - "cephfs": { - SchemaProps: spec.SchemaProps{ - Description: "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.CephFSPersistentVolumeSource"), - }, - }, - "fc": { - SchemaProps: spec.SchemaProps{ - Description: "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.", - Ref: ref("k8s.io/api/core/v1.FCVolumeSource"), - }, - }, - "flocker": { - SchemaProps: spec.SchemaProps{ - Description: "Flocker represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running", - Ref: ref("k8s.io/api/core/v1.FlockerVolumeSource"), - }, - }, - "flexVolume": { - SchemaProps: spec.SchemaProps{ - Description: "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", - Ref: ref("k8s.io/api/core/v1.FlexPersistentVolumeSource"), - }, - }, - "azureFile": { - SchemaProps: spec.SchemaProps{ - Description: "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureFilePersistentVolumeSource"), - }, - }, - "vsphereVolume": { - SchemaProps: spec.SchemaProps{ - Description: "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"), - }, - }, - "quobyte": { - SchemaProps: spec.SchemaProps{ - Description: "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.QuobyteVolumeSource"), - }, - }, - "azureDisk": { - SchemaProps: spec.SchemaProps{ - Description: "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureDiskVolumeSource"), - }, - }, - "photonPersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource"), - }, - }, - "portworxVolume": { - SchemaProps: spec.SchemaProps{ - Description: "PortworxVolume represents a portworx volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PortworxVolumeSource"), - }, - }, - "scaleIO": { - SchemaProps: spec.SchemaProps{ - Description: "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.", - Ref: ref("k8s.io/api/core/v1.ScaleIOPersistentVolumeSource"), - }, - }, - "local": { - SchemaProps: spec.SchemaProps{ - Description: "Local represents directly-attached storage with node affinity", - Ref: ref("k8s.io/api/core/v1.LocalVolumeSource"), - }, - }, - "storageos": { - SchemaProps: spec.SchemaProps{ - Description: "StorageOS represents a StorageOS volume that is attached to the kubelet's host machine and mounted into the pod More info: https://examples.k8s.io/volumes/storageos/README.md", - Ref: ref("k8s.io/api/core/v1.StorageOSPersistentVolumeSource"), - }, - }, - "csi": { - SchemaProps: spec.SchemaProps{ - Description: "CSI represents storage that is handled by an external CSI driver (Beta feature).", - Ref: ref("k8s.io/api/core/v1.CSIPersistentVolumeSource"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFilePersistentVolumeSource", "k8s.io/api/core/v1.CSIPersistentVolumeSource", "k8s.io/api/core/v1.CephFSPersistentVolumeSource", "k8s.io/api/core/v1.CinderPersistentVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexPersistentVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GlusterfsPersistentVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIPersistentVolumeSource", "k8s.io/api/core/v1.LocalVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDPersistentVolumeSource", "k8s.io/api/core/v1.ScaleIOPersistentVolumeSource", "k8s.io/api/core/v1.StorageOSPersistentVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeSpec is the specification of a persistent volume.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "capacity": { - SchemaProps: spec.SchemaProps{ - Description: "A description of the persistent volume's resources and capacity. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "gcePersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Ref: ref("k8s.io/api/core/v1.GCEPersistentDiskVolumeSource"), - }, - }, - "awsElasticBlockStore": { - SchemaProps: spec.SchemaProps{ - Description: "AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - Ref: ref("k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource"), - }, - }, - "hostPath": { - SchemaProps: spec.SchemaProps{ - Description: "HostPath represents a directory on the host. Provisioned by a developer or tester. This is useful for single-node development and testing only! On-host storage is not supported in any way and WILL NOT WORK in a multi-node cluster. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - Ref: ref("k8s.io/api/core/v1.HostPathVolumeSource"), - }, - }, - "glusterfs": { - SchemaProps: spec.SchemaProps{ - Description: "Glusterfs represents a Glusterfs volume that is attached to a host and exposed to the pod. Provisioned by an admin. More info: https://examples.k8s.io/volumes/glusterfs/README.md", - Ref: ref("k8s.io/api/core/v1.GlusterfsPersistentVolumeSource"), - }, - }, - "nfs": { - SchemaProps: spec.SchemaProps{ - Description: "NFS represents an NFS mount on the host. Provisioned by an admin. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - Ref: ref("k8s.io/api/core/v1.NFSVolumeSource"), - }, - }, - "rbd": { - SchemaProps: spec.SchemaProps{ - Description: "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md", - Ref: ref("k8s.io/api/core/v1.RBDPersistentVolumeSource"), - }, - }, - "iscsi": { - SchemaProps: spec.SchemaProps{ - Description: "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. Provisioned by an admin.", - Ref: ref("k8s.io/api/core/v1.ISCSIPersistentVolumeSource"), - }, - }, - "cinder": { - SchemaProps: spec.SchemaProps{ - Description: "Cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", - Ref: ref("k8s.io/api/core/v1.CinderPersistentVolumeSource"), - }, - }, - "cephfs": { - SchemaProps: spec.SchemaProps{ - Description: "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.CephFSPersistentVolumeSource"), - }, - }, - "fc": { - SchemaProps: spec.SchemaProps{ - Description: "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.", - Ref: ref("k8s.io/api/core/v1.FCVolumeSource"), - }, - }, - "flocker": { - SchemaProps: spec.SchemaProps{ - Description: "Flocker represents a Flocker volume attached to a kubelet's host machine and exposed to the pod for its usage. This depends on the Flocker control service being running", - Ref: ref("k8s.io/api/core/v1.FlockerVolumeSource"), - }, - }, - "flexVolume": { - SchemaProps: spec.SchemaProps{ - Description: "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", - Ref: ref("k8s.io/api/core/v1.FlexPersistentVolumeSource"), - }, - }, - "azureFile": { - SchemaProps: spec.SchemaProps{ - Description: "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureFilePersistentVolumeSource"), - }, - }, - "vsphereVolume": { - SchemaProps: spec.SchemaProps{ - Description: "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"), - }, - }, - "quobyte": { - SchemaProps: spec.SchemaProps{ - Description: "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.QuobyteVolumeSource"), - }, - }, - "azureDisk": { - SchemaProps: spec.SchemaProps{ - Description: "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureDiskVolumeSource"), - }, - }, - "photonPersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource"), - }, - }, - "portworxVolume": { - SchemaProps: spec.SchemaProps{ - Description: "PortworxVolume represents a portworx volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PortworxVolumeSource"), - }, - }, - "scaleIO": { - SchemaProps: spec.SchemaProps{ - Description: "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.", - Ref: ref("k8s.io/api/core/v1.ScaleIOPersistentVolumeSource"), - }, - }, - "local": { - SchemaProps: spec.SchemaProps{ - Description: "Local represents directly-attached storage with node affinity", - Ref: ref("k8s.io/api/core/v1.LocalVolumeSource"), - }, - }, - "storageos": { - SchemaProps: spec.SchemaProps{ - Description: "StorageOS represents a StorageOS volume that is attached to the kubelet's host machine and mounted into the pod More info: https://examples.k8s.io/volumes/storageos/README.md", - Ref: ref("k8s.io/api/core/v1.StorageOSPersistentVolumeSource"), - }, - }, - "csi": { - SchemaProps: spec.SchemaProps{ - Description: "CSI represents storage that is handled by an external CSI driver (Beta feature).", - Ref: ref("k8s.io/api/core/v1.CSIPersistentVolumeSource"), - }, - }, - "accessModes": { - SchemaProps: spec.SchemaProps{ - Description: "AccessModes contains all ways the volume can be mounted. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "claimRef": { - SchemaProps: spec.SchemaProps{ - Description: "ClaimRef is part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim. Expected to be non-nil when bound. claim.VolumeName is the authoritative bind between PV and PVC. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#binding", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - "persistentVolumeReclaimPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "What happens to a persistent volume when released from its claim. Valid options are Retain (default for manually created PersistentVolumes), Delete (default for dynamically provisioned PersistentVolumes), and Recycle (deprecated). Recycle must be supported by the volume plugin underlying this PersistentVolume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming", - Type: []string{"string"}, - Format: "", - }, - }, - "storageClassName": { - SchemaProps: spec.SchemaProps{ - Description: "Name of StorageClass to which this persistent volume belongs. Empty value means that this volume does not belong to any StorageClass.", - Type: []string{"string"}, - Format: "", - }, - }, - "mountOptions": { - SchemaProps: spec.SchemaProps{ - Description: "A list of mount options, e.g. [\"ro\", \"soft\"]. Not validated - mount will simply fail if one is invalid. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "volumeMode": { - SchemaProps: spec.SchemaProps{ - Description: "volumeMode defines if a volume is intended to be used with a formatted filesystem or to remain in raw block state. Value of Filesystem is implied when not included in spec.", - Type: []string{"string"}, - Format: "", - }, - }, - "nodeAffinity": { - SchemaProps: spec.SchemaProps{ - Description: "NodeAffinity defines constraints that limit what nodes this volume can be accessed from. This field influences the scheduling of pods that use this volume.", - Ref: ref("k8s.io/api/core/v1.VolumeNodeAffinity"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFilePersistentVolumeSource", "k8s.io/api/core/v1.CSIPersistentVolumeSource", "k8s.io/api/core/v1.CephFSPersistentVolumeSource", "k8s.io/api/core/v1.CinderPersistentVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexPersistentVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GlusterfsPersistentVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIPersistentVolumeSource", "k8s.io/api/core/v1.LocalVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.ObjectReference", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDPersistentVolumeSource", "k8s.io/api/core/v1.ScaleIOPersistentVolumeSource", "k8s.io/api/core/v1.StorageOSPersistentVolumeSource", "k8s.io/api/core/v1.VolumeNodeAffinity", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_PersistentVolumeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeStatus is the current status of a persistent volume.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "Phase indicates if a volume is available, bound to a claim, or released by a claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#phase", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human-readable message indicating details about why the volume is in this state.", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "Reason is a brief CamelCase string that describes any failure and is meant for machine parsing and tidy display in the CLI.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_PhotonPersistentDiskVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Photon Controller persistent disk resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "pdID": { - SchemaProps: spec.SchemaProps{ - Description: "ID that identifies Photon Controller persistent disk", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"pdID"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_Pod(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.PodSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Most recently observed status of the pod. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.PodStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodSpec", "k8s.io/api/core/v1.PodStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_PodAffinity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Pod affinity is a group of inter pod affinity scheduling rules.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "requiredDuringSchedulingIgnoredDuringExecution": { - SchemaProps: spec.SchemaProps{ - Description: "If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PodAffinityTerm"), - }, - }, - }, - }, - }, - "preferredDuringSchedulingIgnoredDuringExecution": { - SchemaProps: spec.SchemaProps{ - Description: "The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.WeightedPodAffinityTerm"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodAffinityTerm", "k8s.io/api/core/v1.WeightedPodAffinityTerm"}, - } -} - -func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "labelSelector": { - SchemaProps: spec.SchemaProps{ - Description: "A label query over a set of resources, in this case pods.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), - }, - }, - "namespaces": { - SchemaProps: spec.SchemaProps{ - Description: "namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means \"this pod's namespace\"", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "topologyKey": { - SchemaProps: spec.SchemaProps{ - Description: "This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"topologyKey"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, - } -} - -func schema_k8sio_api_core_v1_PodAntiAffinity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Pod anti affinity is a group of inter pod anti affinity scheduling rules.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "requiredDuringSchedulingIgnoredDuringExecution": { - SchemaProps: spec.SchemaProps{ - Description: "If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PodAffinityTerm"), - }, - }, - }, - }, - }, - "preferredDuringSchedulingIgnoredDuringExecution": { - SchemaProps: spec.SchemaProps{ - Description: "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.WeightedPodAffinityTerm"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodAffinityTerm", "k8s.io/api/core/v1.WeightedPodAffinityTerm"}, - } -} - -func schema_k8sio_api_core_v1_PodAttachOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodAttachOptions is the query options to a Pod's remote attach 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: "", - }, - }, - "stdin": { - SchemaProps: spec.SchemaProps{ - Description: "Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "stdout": { - SchemaProps: spec.SchemaProps{ - Description: "Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "stderr": { - SchemaProps: spec.SchemaProps{ - Description: "Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "tty": { - SchemaProps: spec.SchemaProps{ - Description: "TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "container": { - SchemaProps: spec.SchemaProps{ - Description: "The container in which to execute the command. Defaults to only container if there is only one container in the pod.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_PodCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodCondition contains details for the current condition of this pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type is the type of the condition. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status is the status of the condition. Can be True, False, Unknown. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", - Type: []string{"string"}, - Format: "", - }, - }, - "lastProbeTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time we probed the condition.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Description: "Last time the condition transitioned from one status to another.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "Unique, one-word, CamelCase 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"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_PodDNSConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "nameservers": { - SchemaProps: spec.SchemaProps{ - Description: "A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "searches": { - SchemaProps: spec.SchemaProps{ - Description: "A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "options": { - SchemaProps: spec.SchemaProps{ - Description: "A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PodDNSConfigOption"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodDNSConfigOption"}, - } -} - -func schema_k8sio_api_core_v1_PodDNSConfigOption(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodDNSConfigOption defines DNS resolver options of a pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Required.", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_PodExecOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodExecOptions is the query options to a Pod's remote exec 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: "", - }, - }, - "stdin": { - SchemaProps: spec.SchemaProps{ - Description: "Redirect the standard input stream of the pod for this call. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "stdout": { - SchemaProps: spec.SchemaProps{ - Description: "Redirect the standard output stream of the pod for this call. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "stderr": { - SchemaProps: spec.SchemaProps{ - Description: "Redirect the standard error stream of the pod for this call. Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "tty": { - SchemaProps: spec.SchemaProps{ - Description: "TTY if true indicates that a tty will be allocated for the exec call. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "container": { - SchemaProps: spec.SchemaProps{ - Description: "Container in which to execute the command. Defaults to only container if there is only one container in the pod.", - Type: []string{"string"}, - Format: "", - }, - }, - "command": { - SchemaProps: spec.SchemaProps{ - Description: "Command is the remote command to execute. argv array. Not executed within a shell.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"command"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_PodIP(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "IP address information for entries in the (plural) PodIPs field. Each entry includes:\n IP: An IP address allocated to the pod. Routable at least within the cluster.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ip": { - SchemaProps: spec.SchemaProps{ - Description: "ip is an IP address (IPv4 or IPv6) assigned to the pod", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_PodList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodList is a list of Pods.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of pods. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Pod"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Pod", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_PodLogOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodLogOptions is the query options for a Pod's logs REST 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: "", - }, - }, - "container": { - SchemaProps: spec.SchemaProps{ - Description: "The container for which to stream logs. Defaults to only container if there is one container in the pod.", - Type: []string{"string"}, - Format: "", - }, - }, - "follow": { - SchemaProps: spec.SchemaProps{ - Description: "Follow the log stream of the pod. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "previous": { - SchemaProps: spec.SchemaProps{ - Description: "Return previous terminated container logs. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "sinceSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "sinceTime": { - SchemaProps: spec.SchemaProps{ - Description: "An RFC3339 timestamp from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "timestamps": { - SchemaProps: spec.SchemaProps{ - Description: "If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "tailLines": { - SchemaProps: spec.SchemaProps{ - Description: "If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "limitBytes": { - SchemaProps: spec.SchemaProps{ - Description: "If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "insecureSkipTLSVerifyBackend": { - SchemaProps: spec.SchemaProps{ - Description: "insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real kubelet. If the kubelet is configured to verify the apiserver's TLS credentials, it does not mean the connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept the actual log data coming from the real kubelet).", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_PodPortForwardOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodPortForwardOptions is the query options to a Pod's port forward call when using WebSockets. The `port` query parameter must specify the port or ports (comma separated) to forward over. Port forwarding over SPDY does not use these options. It requires the port to be passed in the `port` header as part of request.", - 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: "", - }, - }, - "ports": { - SchemaProps: spec.SchemaProps{ - Description: "List of ports to forward Required when using WebSockets", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_PodProxyOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodProxyOptions is the query options to a Pod's proxy 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: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path is the URL path to use for the current proxy request to pod.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_PodReadinessGate(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodReadinessGate contains the reference to a pod condition", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "conditionType": { - SchemaProps: spec.SchemaProps{ - Description: "ConditionType refers to a condition in the pod's condition list with matching type.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"conditionType"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "seLinuxOptions": { - SchemaProps: spec.SchemaProps{ - Description: "The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.", - Ref: ref("k8s.io/api/core/v1.SELinuxOptions"), - }, - }, - "windowsOptions": { - SchemaProps: spec.SchemaProps{ - Description: "The Windows specific settings applied to all containers. If unspecified, the options within a container's SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - Ref: ref("k8s.io/api/core/v1.WindowsSecurityContextOptions"), - }, - }, - "runAsUser": { - SchemaProps: spec.SchemaProps{ - Description: "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "runAsGroup": { - SchemaProps: spec.SchemaProps{ - Description: "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "runAsNonRoot": { - SchemaProps: spec.SchemaProps{ - Description: "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "supplementalGroups": { - SchemaProps: spec.SchemaProps{ - Description: "A list of groups applied to the first process run in each container, in addition to the container's primary GID. If unspecified, no groups will be added to any container.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"integer"}, - Format: "int64", - }, - }, - }, - }, - }, - "fsGroup": { - SchemaProps: spec.SchemaProps{ - Description: "A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod:\n\n1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR'd with rw-rw----\n\nIf unset, the Kubelet will not modify the ownership and permissions of any volume.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "sysctls": { - SchemaProps: spec.SchemaProps{ - Description: "Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Sysctl"), - }, - }, - }, - }, - }, - "fsGroupChangePolicy": { - SchemaProps: spec.SchemaProps{ - Description: "fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are \"OnRootMismatch\" and \"Always\". If not specified defaults to \"Always\".", - Type: []string{"string"}, - Format: "", - }, - }, - "seccompProfile": { - SchemaProps: spec.SchemaProps{ - Description: "The seccomp options to use by the containers in this pod.", - Ref: ref("k8s.io/api/core/v1.SeccompProfile"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SELinuxOptions", "k8s.io/api/core/v1.SeccompProfile", "k8s.io/api/core/v1.Sysctl", "k8s.io/api/core/v1.WindowsSecurityContextOptions"}, - } -} - -func schema_k8sio_api_core_v1_PodSignature(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Describes the class of pods that should avoid this node. Exactly one field should be set.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "podController": { - SchemaProps: spec.SchemaProps{ - Description: "Reference to controller whose pods should avoid this node.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference"}, - } -} - -func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodSpec is a description of a pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumes": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge,retainKeys", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Volume"), - }, - }, - }, - }, - }, - "initContainers": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Container"), - }, - }, - }, - }, - }, - "containers": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Container"), - }, - }, - }, - }, - }, - "ephemeralContainers": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod's ephemeralcontainers subresource. This field is alpha-level and is only honored by servers that enable the EphemeralContainers feature.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.EphemeralContainer"), - }, - }, - }, - }, - }, - "restartPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy", - Type: []string{"string"}, - Format: "", - }, - }, - "terminationGracePeriodSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "activeDeadlineSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "dnsPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "Set DNS policy for the pod. Defaults to \"ClusterFirst\". Valid values are 'ClusterFirstWithHostNet', 'ClusterFirst', 'Default' or 'None'. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to 'ClusterFirstWithHostNet'.", - Type: []string{"string"}, - Format: "", - }, - }, - "nodeSelector": { - SchemaProps: spec.SchemaProps{ - Description: "NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "serviceAccountName": { - SchemaProps: spec.SchemaProps{ - Description: "ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", - Type: []string{"string"}, - Format: "", - }, - }, - "serviceAccount": { - SchemaProps: spec.SchemaProps{ - Description: "DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", - Type: []string{"string"}, - Format: "", - }, - }, - "automountServiceAccountToken": { - SchemaProps: spec.SchemaProps{ - Description: "AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "nodeName": { - SchemaProps: spec.SchemaProps{ - Description: "NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.", - Type: []string{"string"}, - Format: "", - }, - }, - "hostNetwork": { - SchemaProps: spec.SchemaProps{ - Description: "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "hostPID": { - SchemaProps: spec.SchemaProps{ - Description: "Use the host's pid namespace. Optional: Default to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "hostIPC": { - SchemaProps: spec.SchemaProps{ - Description: "Use the host's ipc namespace. Optional: Default to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "shareProcessNamespace": { - SchemaProps: spec.SchemaProps{ - Description: "Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "securityContext": { - SchemaProps: spec.SchemaProps{ - Description: "SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.", - Ref: ref("k8s.io/api/core/v1.PodSecurityContext"), - }, - }, - "imagePullSecrets": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - }, - }, - }, - "hostname": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the hostname of the Pod If not specified, the pod's hostname will be set to a system-defined value.", - Type: []string{"string"}, - Format: "", - }, - }, - "subdomain": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the fully qualified Pod hostname will be \"...svc.\". If not specified, the pod will not have a domainname at all.", - Type: []string{"string"}, - Format: "", - }, - }, - "affinity": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the pod's scheduling constraints", - Ref: ref("k8s.io/api/core/v1.Affinity"), - }, - }, - "schedulerName": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.", - Type: []string{"string"}, - Format: "", - }, - }, - "tolerations": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, the pod's tolerations.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Toleration"), - }, - }, - }, - }, - }, - "hostAliases": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "ip", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified. This is only valid for non-hostNetwork pods.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.HostAlias"), - }, - }, - }, - }, - }, - "priorityClassName": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.", - Type: []string{"string"}, - Format: "", - }, - }, - "priority": { - SchemaProps: spec.SchemaProps{ - Description: "The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "dnsConfig": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.", - Ref: ref("k8s.io/api/core/v1.PodDNSConfig"), - }, - }, - "readinessGates": { - SchemaProps: spec.SchemaProps{ - Description: "If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to \"True\" More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PodReadinessGate"), - }, - }, - }, - }, - }, - "runtimeClassName": { - SchemaProps: spec.SchemaProps{ - Description: "RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the \"legacy\" RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md This is a beta feature as of Kubernetes v1.14.", - Type: []string{"string"}, - Format: "", - }, - }, - "enableServiceLinks": { - SchemaProps: spec.SchemaProps{ - Description: "EnableServiceLinks indicates whether information about services should be injected into pod's environment variables, matching the syntax of Docker links. Optional: Defaults to true.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "preemptionPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is beta-level, gated by the NonPreemptingPriority feature-gate.", - Type: []string{"string"}, - Format: "", - }, - }, - "overhead": { - SchemaProps: spec.SchemaProps{ - Description: "Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md This field is alpha-level as of Kubernetes v1.16, and is only honored by servers that enable the PodOverhead feature.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "topologySpreadConstraints": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []string{ - "topologyKey", - "whenUnsatisfiable", - }, - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "topologyKey", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.TopologySpreadConstraint"), - }, - }, - }, - }, - }, - "setHostnameAsFQDN": { - SchemaProps: spec.SchemaProps{ - Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"containers"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Affinity", "k8s.io/api/core/v1.Container", "k8s.io/api/core/v1.EphemeralContainer", "k8s.io/api/core/v1.HostAlias", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PodDNSConfig", "k8s.io/api/core/v1.PodReadinessGate", "k8s.io/api/core/v1.PodSecurityContext", "k8s.io/api/core/v1.Toleration", "k8s.io/api/core/v1.TopologySpreadConstraint", "k8s.io/api/core/v1.Volume", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodStatus represents information about the status of a pod. Status may trail the actual state of a system, especially if the node that hosts the pod cannot contact the control plane.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. The conditions array, the reason and message fields, and the individual container status arrays contain more detail about the pod's status. There are five possible phase values:\n\nPending: The pod has been accepted by the Kubernetes system, but one or more of the container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while. Running: The pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting. Succeeded: All containers in the pod have terminated in success, and will not be restarted. Failed: All containers in the pod have terminated, and at least one container has terminated in failure. The container either exited with non-zero status or was terminated by the system. Unknown: For some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod.\n\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase", - Type: []string{"string"}, - Format: "", - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Current service state of pod. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PodCondition"), - }, - }, - }, - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human readable message indicating details about why the pod is in this condition.", - Type: []string{"string"}, - Format: "", - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "A brief CamelCase message indicating details about why the pod is in this state. e.g. 'Evicted'", - Type: []string{"string"}, - Format: "", - }, - }, - "nominatedNodeName": { - SchemaProps: spec.SchemaProps{ - Description: "nominatedNodeName is set only when this pod preempts other pods on the node, but it cannot be scheduled right away as preemption victims receive their graceful termination periods. This field does not guarantee that the pod will be scheduled on this node. Scheduler may decide to place the pod elsewhere if other nodes become available sooner. Scheduler may also decide to give the resources on this node to a higher priority pod that is created after preemption. As a result, this field may be different than PodSpec.nodeName when the pod is scheduled.", - Type: []string{"string"}, - Format: "", - }, - }, - "hostIP": { - SchemaProps: spec.SchemaProps{ - Description: "IP address of the host to which the pod is assigned. Empty if not yet scheduled.", - Type: []string{"string"}, - Format: "", - }, - }, - "podIP": { - SchemaProps: spec.SchemaProps{ - Description: "IP address allocated to the pod. Routable at least within the cluster. Empty if not yet allocated.", - Type: []string{"string"}, - Format: "", - }, - }, - "podIPs": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "ip", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "podIPs holds the IP addresses allocated to the pod. If this field is specified, the 0th entry must match the podIP field. Pods may be allocated at most 1 value for each of IPv4 and IPv6. This list is empty if no IPs have been allocated yet.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PodIP"), - }, - }, - }, - }, - }, - "startTime": { - SchemaProps: spec.SchemaProps{ - Description: "RFC 3339 date and time at which the object was acknowledged by the Kubelet. This is before the Kubelet pulled the container image(s) for the pod.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "initContainerStatuses": { - SchemaProps: spec.SchemaProps{ - Description: "The list has one entry per init container in the manifest. The most recent successful init container will have ready = true, the most recently started container will have startTime set. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ContainerStatus"), - }, - }, - }, - }, - }, - "containerStatuses": { - SchemaProps: spec.SchemaProps{ - Description: "The list has one entry per container in the manifest. Each entry is currently the output of `docker inspect`. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-and-container-status", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ContainerStatus"), - }, - }, - }, - }, - }, - "qosClass": { - SchemaProps: spec.SchemaProps{ - Description: "The Quality of Service (QOS) classification assigned to the pod based on resource requirements See PodQOSClass type for available QOS classes More info: https://git.k8s.io/community/contributors/design-proposals/node/resource-qos.md", - Type: []string{"string"}, - Format: "", - }, - }, - "ephemeralContainerStatuses": { - SchemaProps: spec.SchemaProps{ - Description: "Status for any ephemeral containers that have run in this pod. This field is alpha-level and is only populated by servers that enable the EphemeralContainers feature.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ContainerStatus"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ContainerStatus", "k8s.io/api/core/v1.PodCondition", "k8s.io/api/core/v1.PodIP", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_PodStatusResult(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodStatusResult is a wrapper for PodStatus returned by kubelet that can be encode/decoded", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Most recently observed status of the pod. This data may not be up to date. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.PodStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_PodTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodTemplate describes a template for creating copies of a predefined pod.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "template": { - SchemaProps: spec.SchemaProps{ - Description: "Template defines the pods that will be created from this pod template. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.PodTemplateSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodTemplateSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_PodTemplateList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodTemplateList is a list of PodTemplates.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of pod templates", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.PodTemplate"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodTemplate", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_PodTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PodTemplateSpec describes the data a pod should have when created from a template", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "metadata": { - SchemaProps: spec.SchemaProps{ - Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Specification of the desired behavior of the pod. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.PodSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_PortworxVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PortworxVolumeSource represents a Portworx volume resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumeID": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeID uniquely identifies a Portworx volume", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "FSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\". Implicitly inferred to be \"ext4\" if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"volumeID"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_PreferAvoidPodsEntry(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Describes a class of pods that should avoid this node.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "podSignature": { - SchemaProps: spec.SchemaProps{ - Description: "The class of pods.", - Ref: ref("k8s.io/api/core/v1.PodSignature"), - }, - }, - "evictionTime": { - SchemaProps: spec.SchemaProps{ - Description: "Time at which this entry was added to the list.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "(brief) reason why this entry was added to the list.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "Human readable message indicating why this entry was added to the list.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"podSignature"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodSignature", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_PreferredSchedulingTerm(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "weight": { - SchemaProps: spec.SchemaProps{ - Description: "Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "preference": { - SchemaProps: spec.SchemaProps{ - Description: "A node selector term, associated with the corresponding weight.", - Ref: ref("k8s.io/api/core/v1.NodeSelectorTerm"), - }, - }, - }, - Required: []string{"weight", "preference"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelectorTerm"}, - } -} - -func schema_k8sio_api_core_v1_Probe(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "exec": { - SchemaProps: spec.SchemaProps{ - Description: "One and only one of the following should be specified. Exec specifies the action to take.", - Ref: ref("k8s.io/api/core/v1.ExecAction"), - }, - }, - "httpGet": { - SchemaProps: spec.SchemaProps{ - Description: "HTTPGet specifies the http request to perform.", - Ref: ref("k8s.io/api/core/v1.HTTPGetAction"), - }, - }, - "tcpSocket": { - SchemaProps: spec.SchemaProps{ - Description: "TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported", - Ref: ref("k8s.io/api/core/v1.TCPSocketAction"), - }, - }, - "initialDelaySeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "timeoutSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "periodSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "successThreshold": { - SchemaProps: spec.SchemaProps{ - Description: "Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "failureThreshold": { - SchemaProps: spec.SchemaProps{ - Description: "Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ExecAction", "k8s.io/api/core/v1.HTTPGetAction", "k8s.io/api/core/v1.TCPSocketAction"}, - } -} - -func schema_k8sio_api_core_v1_ProjectedVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a projected volume source", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "sources": { - SchemaProps: spec.SchemaProps{ - Description: "list of volume projections", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.VolumeProjection"), - }, - }, - }, - }, - }, - "defaultMode": { - SchemaProps: spec.SchemaProps{ - Description: "Mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.VolumeProjection"}, - } -} - -func schema_k8sio_api_core_v1_QuobyteVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "registry": { - SchemaProps: spec.SchemaProps{ - Description: "Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes", - Type: []string{"string"}, - Format: "", - }, - }, - "volume": { - SchemaProps: spec.SchemaProps{ - Description: "Volume is a string that references an already created Quobyte volume by name.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "user": { - SchemaProps: spec.SchemaProps{ - Description: "User to map volume access to Defaults to serivceaccount user", - Type: []string{"string"}, - Format: "", - }, - }, - "group": { - SchemaProps: spec.SchemaProps{ - Description: "Group to map volume access to Default is no group", - Type: []string{"string"}, - Format: "", - }, - }, - "tenant": { - SchemaProps: spec.SchemaProps{ - Description: "Tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"registry", "volume"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_RBDPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "monitors": { - SchemaProps: spec.SchemaProps{ - Description: "A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "image": { - SchemaProps: spec.SchemaProps{ - Description: "The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd", - Type: []string{"string"}, - Format: "", - }, - }, - "pool": { - SchemaProps: spec.SchemaProps{ - Description: "The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "user": { - SchemaProps: spec.SchemaProps{ - Description: "The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "keyring": { - SchemaProps: spec.SchemaProps{ - Description: "Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"monitors", "image"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference"}, - } -} - -func schema_k8sio_api_core_v1_RBDVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "monitors": { - SchemaProps: spec.SchemaProps{ - Description: "A collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "image": { - SchemaProps: spec.SchemaProps{ - Description: "The rados image name. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#rbd", - Type: []string{"string"}, - Format: "", - }, - }, - "pool": { - SchemaProps: spec.SchemaProps{ - Description: "The rados pool name. Default is rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "user": { - SchemaProps: spec.SchemaProps{ - Description: "The rados user name. Default is admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "keyring": { - SchemaProps: spec.SchemaProps{ - Description: "Keyring is the path to key ring for RBDUser. Default is /etc/ceph/keyring. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef is name of the authentication secret for RBDUser. If provided overrides keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"monitors", "image"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_RangeAllocation(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RangeAllocation is not a public type.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "range": { - SchemaProps: spec.SchemaProps{ - Description: "Range is string that identifies the range represented by 'data'.", - Type: []string{"string"}, - Format: "", - }, - }, - "data": { - SchemaProps: spec.SchemaProps{ - Description: "Data is a bit array containing all allocated addresses in the previous segment.", - Type: []string{"string"}, - Format: "byte", - }, - }, - }, - Required: []string{"range", "data"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_ReplicationController(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplicationController represents the configuration of a replication controller.", - 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: "If the Labels of a ReplicationController are empty, they are defaulted to be the same as the Pod(s) that the replication controller manages. Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the specification of the desired behavior of the replication controller. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.ReplicationControllerSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status is the most recently observed status of the replication controller. This data may be out of date by some window of time. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.ReplicationControllerStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ReplicationControllerSpec", "k8s.io/api/core/v1.ReplicationControllerStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_ReplicationControllerCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplicationControllerCondition describes the state of a replication controller at a certain point.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type of replication controller condition.", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition, one of True, False, Unknown.", - Type: []string{"string"}, - Format: "", - }, - }, - "lastTransitionTime": { - SchemaProps: spec.SchemaProps{ - Description: "The last time the condition transitioned from one status to another.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "reason": { - SchemaProps: spec.SchemaProps{ - Description: "The reason for the condition's last transition.", - Type: []string{"string"}, - Format: "", - }, - }, - "message": { - SchemaProps: spec.SchemaProps{ - Description: "A human readable message indicating details about the transition.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_ReplicationControllerList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplicationControllerList is a collection of replication controllers.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of replication controllers. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ReplicationController"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ReplicationController", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_ReplicationControllerSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplicationControllerSpec is the specification of a replication controller.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "replicas": { - SchemaProps: spec.SchemaProps{ - Description: "Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "minReadySeconds": { - SchemaProps: spec.SchemaProps{ - Description: "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "selector": { - SchemaProps: spec.SchemaProps{ - Description: "Selector is a label query over pods that should match the Replicas count. If Selector is empty, it is defaulted to the labels present on the Pod template. Label keys and values that must match in order to be controlled by this replication controller, if empty defaulted to labels on Pod template. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "template": { - SchemaProps: spec.SchemaProps{ - Description: "Template is the object that describes the pod that will be created if insufficient replicas are detected. This takes precedence over a TemplateRef. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template", - Ref: ref("k8s.io/api/core/v1.PodTemplateSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodTemplateSpec"}, - } -} - -func schema_k8sio_api_core_v1_ReplicationControllerStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ReplicationControllerStatus represents the current status of a replication controller.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "replicas": { - SchemaProps: spec.SchemaProps{ - Description: "Replicas is the most recently oberved number of replicas. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "fullyLabeledReplicas": { - SchemaProps: spec.SchemaProps{ - Description: "The number of pods that have labels matching the labels of the pod template of the replication controller.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "readyReplicas": { - SchemaProps: spec.SchemaProps{ - Description: "The number of ready replicas for this replication controller.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "availableReplicas": { - SchemaProps: spec.SchemaProps{ - Description: "The number of available replicas (ready for at least minReadySeconds) for this replication controller.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "observedGeneration": { - SchemaProps: spec.SchemaProps{ - Description: "ObservedGeneration reflects the generation of the most recently observed replication controller.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "conditions": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "type", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Represents the latest available observations of a replication controller's current state.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ReplicationControllerCondition"), - }, - }, - }, - }, - }, - }, - Required: []string{"replicas"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ReplicationControllerCondition"}, - } -} - -func schema_k8sio_api_core_v1_ResourceFieldSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceFieldSelector represents container resources (cpu, memory) and their output format", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "containerName": { - SchemaProps: spec.SchemaProps{ - Description: "Container name: required for volumes, optional for env vars", - Type: []string{"string"}, - Format: "", - }, - }, - "resource": { - SchemaProps: spec.SchemaProps{ - Description: "Required: resource to select", - Type: []string{"string"}, - Format: "", - }, - }, - "divisor": { - SchemaProps: spec.SchemaProps{ - Description: "Specifies the output format of the exposed resources, defaults to \"1\"", - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - Required: []string{"resource"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_ResourceQuota(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceQuota sets aggregate quota restrictions enforced per namespace", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the desired quota. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.ResourceQuotaSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status defines the actual enforced quota and its current usage. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.ResourceQuotaStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ResourceQuotaSpec", "k8s.io/api/core/v1.ResourceQuotaStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_ResourceQuotaList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceQuotaList is a list of ResourceQuota items.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of ResourceQuota objects. More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ResourceQuota"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ResourceQuota", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_ResourceQuotaSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceQuotaSpec defines the desired hard limits to enforce for Quota.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "hard": { - SchemaProps: spec.SchemaProps{ - Description: "hard is the set of desired hard limits for each named resource. More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "scopes": { - SchemaProps: spec.SchemaProps{ - Description: "A collection of filters that must match each object tracked by a quota. If not specified, the quota matches all objects.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "scopeSelector": { - SchemaProps: spec.SchemaProps{ - Description: "scopeSelector is also a collection of filters like scopes that must match each object tracked by a quota but expressed using ScopeSelectorOperator in combination with possible values. For a resource to match, both scopes AND scopeSelector (if specified in spec), must be matched.", - Ref: ref("k8s.io/api/core/v1.ScopeSelector"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ScopeSelector", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_ResourceQuotaStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceQuotaStatus defines the enforced hard limits and observed use.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "hard": { - SchemaProps: spec.SchemaProps{ - Description: "Hard is the set of enforced hard limits for each named resource. More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "used": { - SchemaProps: spec.SchemaProps{ - Description: "Used is the current observed total usage of the resource in the namespace.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_ResourceRequirements(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ResourceRequirements describes the compute resource requirements.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "limits": { - SchemaProps: spec.SchemaProps{ - Description: "Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - "requests": { - SchemaProps: spec.SchemaProps{ - Description: "Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - -func schema_k8sio_api_core_v1_SELinuxOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SELinuxOptions are the labels to be applied to the container", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "user": { - SchemaProps: spec.SchemaProps{ - Description: "User is a SELinux user label that applies to the container.", - Type: []string{"string"}, - Format: "", - }, - }, - "role": { - SchemaProps: spec.SchemaProps{ - Description: "Role is a SELinux role label that applies to the container.", - Type: []string{"string"}, - Format: "", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Type is a SELinux type label that applies to the container.", - Type: []string{"string"}, - Format: "", - }, - }, - "level": { - SchemaProps: spec.SchemaProps{ - Description: "Level is SELinux level label that applies to the container.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ScaleIOPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "gateway": { - SchemaProps: spec.SchemaProps{ - Description: "The host address of the ScaleIO API Gateway.", - Type: []string{"string"}, - Format: "", - }, - }, - "system": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the storage system as configured in ScaleIO.", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.", - Ref: ref("k8s.io/api/core/v1.SecretReference"), - }, - }, - "sslEnabled": { - SchemaProps: spec.SchemaProps{ - Description: "Flag to enable/disable SSL communication with Gateway, default false", - Type: []string{"boolean"}, - Format: "", - }, - }, - "protectionDomain": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the ScaleIO Protection Domain for the configured storage.", - Type: []string{"string"}, - Format: "", - }, - }, - "storagePool": { - SchemaProps: spec.SchemaProps{ - Description: "The ScaleIO Storage Pool associated with the protection domain.", - Type: []string{"string"}, - Format: "", - }, - }, - "storageMode": { - SchemaProps: spec.SchemaProps{ - Description: "Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeName": { - SchemaProps: spec.SchemaProps{ - Description: "The name of a volume already created in the ScaleIO system that is associated with this volume source.", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\"", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"gateway", "system", "secretRef"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference"}, - } -} - -func schema_k8sio_api_core_v1_ScaleIOVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ScaleIOVolumeSource represents a persistent ScaleIO volume", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "gateway": { - SchemaProps: spec.SchemaProps{ - Description: "The host address of the ScaleIO API Gateway.", - Type: []string{"string"}, - Format: "", - }, - }, - "system": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the storage system as configured in ScaleIO.", - Type: []string{"string"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "sslEnabled": { - SchemaProps: spec.SchemaProps{ - Description: "Flag to enable/disable SSL communication with Gateway, default false", - Type: []string{"boolean"}, - Format: "", - }, - }, - "protectionDomain": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the ScaleIO Protection Domain for the configured storage.", - Type: []string{"string"}, - Format: "", - }, - }, - "storagePool": { - SchemaProps: spec.SchemaProps{ - Description: "The ScaleIO Storage Pool associated with the protection domain.", - Type: []string{"string"}, - Format: "", - }, - }, - "storageMode": { - SchemaProps: spec.SchemaProps{ - Description: "Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeName": { - SchemaProps: spec.SchemaProps{ - Description: "The name of a volume already created in the ScaleIO system that is associated with this volume source.", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Default is \"xfs\".", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"gateway", "system", "secretRef"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_ScopeSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A scope selector represents the AND of the selectors represented by the scoped-resource selector requirements.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "matchExpressions": { - SchemaProps: spec.SchemaProps{ - Description: "A list of scope selector requirements by scope of the resources.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ScopedResourceSelectorRequirement"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ScopedResourceSelectorRequirement"}, - } -} - -func schema_k8sio_api_core_v1_ScopedResourceSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A scoped-resource selector requirement is a selector that contains values, a scope name, and an operator that relates the scope name and values.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "scopeName": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the scope that the selector applies to.", - Type: []string{"string"}, - Format: "", - }, - }, - "operator": { - SchemaProps: spec.SchemaProps{ - Description: "Represents a scope's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist.", - Type: []string{"string"}, - Format: "", - }, - }, - "values": { - SchemaProps: spec.SchemaProps{ - Description: "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{"scopeName", "operator"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_SeccompProfile(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "type indicates which kind of seccomp profile will be applied. Valid options are:\n\nLocalhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied.", - Type: []string{"string"}, - Format: "", - }, - }, - "localhostProfile": { - SchemaProps: spec.SchemaProps{ - Description: "localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must only be set if type is \"Localhost\".", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_Secret(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "immutable": { - SchemaProps: spec.SchemaProps{ - Description: "Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is a beta field enabled by ImmutableEphemeralVolumes feature gate.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "data": { - SchemaProps: spec.SchemaProps{ - Description: "Data contains the secret data. Each key must consist of alphanumeric characters, '-', '_' or '.'. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "byte", - }, - }, - }, - }, - }, - "stringData": { - SchemaProps: spec.SchemaProps{ - Description: "stringData allows specifying non-binary secret data in string form. It is provided as a write-only convenience method. All keys and values are merged into the data field on write, overwriting any existing values. It is never output when reading from the API.", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "Used to facilitate programmatic handling of secret data.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_SecretEnvSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SecretEnvSource selects a Secret to populate the environment variables with.\n\nThe contents of the target Secret's Data field will represent the key-value pairs as environment variables.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the Secret must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_SecretKeySelector(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SecretKeySelector selects a key of a Secret.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "key": { - SchemaProps: spec.SchemaProps{ - Description: "The key of the secret to select from. Must be a valid secret key.", - Type: []string{"string"}, - Format: "", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the Secret or its key must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"key"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_SecretList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SecretList is a list of Secret.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of secret objects. More info: https://kubernetes.io/docs/concepts/configuration/secret", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Secret"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Secret", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_SecretProjection(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Adapts a secret into a projected volume.\n\nThe contents of the target Secret's Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.KeyToPath"), - }, - }, - }, - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the Secret or its key must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.KeyToPath"}, - } -} - -func schema_k8sio_api_core_v1_SecretReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is unique within a namespace to reference a secret resource.", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace defines the space within which the secret name must be unique.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_SecretVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Adapts a Secret into a volume.\n\nThe contents of the target Secret's Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "secretName": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the secret in the pod's namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret", - Type: []string{"string"}, - Format: "", - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the '..' path or start with '..'.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.KeyToPath"), - }, - }, - }, - }, - }, - "defaultMode": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: mode bits used to set permissions on created files by default. Must be an octal value between 0000 and 0777 or a decimal value between 0 and 511. YAML accepts both octal and decimal values, JSON requires decimal values for mode bits. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "optional": { - SchemaProps: spec.SchemaProps{ - Description: "Specify whether the Secret or its keys must be defined", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.KeyToPath"}, - } -} - -func schema_k8sio_api_core_v1_SecurityContext(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "capabilities": { - SchemaProps: spec.SchemaProps{ - Description: "The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime.", - Ref: ref("k8s.io/api/core/v1.Capabilities"), - }, - }, - "privileged": { - SchemaProps: spec.SchemaProps{ - Description: "Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "seLinuxOptions": { - SchemaProps: spec.SchemaProps{ - Description: "The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - Ref: ref("k8s.io/api/core/v1.SELinuxOptions"), - }, - }, - "windowsOptions": { - SchemaProps: spec.SchemaProps{ - Description: "The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - Ref: ref("k8s.io/api/core/v1.WindowsSecurityContextOptions"), - }, - }, - "runAsUser": { - SchemaProps: spec.SchemaProps{ - Description: "The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "runAsGroup": { - SchemaProps: spec.SchemaProps{ - Description: "The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "runAsNonRoot": { - SchemaProps: spec.SchemaProps{ - Description: "Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "readOnlyRootFilesystem": { - SchemaProps: spec.SchemaProps{ - Description: "Whether this container has a read-only root filesystem. Default is false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "allowPrivilegeEscalation": { - SchemaProps: spec.SchemaProps{ - Description: "AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN", - Type: []string{"boolean"}, - Format: "", - }, - }, - "procMount": { - SchemaProps: spec.SchemaProps{ - Description: "procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled.", - Type: []string{"string"}, - Format: "", - }, - }, - "seccompProfile": { - SchemaProps: spec.SchemaProps{ - Description: "The seccomp options to use by this container. If seccomp options are provided at both the pod & container level, the container options override the pod options.", - Ref: ref("k8s.io/api/core/v1.SeccompProfile"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Capabilities", "k8s.io/api/core/v1.SELinuxOptions", "k8s.io/api/core/v1.SeccompProfile", "k8s.io/api/core/v1.WindowsSecurityContextOptions"}, - } -} - -func schema_k8sio_api_core_v1_SerializedReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SerializedReference is a reference to serialized 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: "", - }, - }, - "reference": { - SchemaProps: spec.SchemaProps{ - Description: "The reference to an object in the system.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_Service(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Service is a named abstraction of software service (for example, mysql) consisting of local port (for example 3306) that the proxy listens on, and the selector that determines which pods will answer requests sent through the proxy.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Spec defines the behavior of a service. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.ServiceSpec"), - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Most recently observed status of the service. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Ref: ref("k8s.io/api/core/v1.ServiceStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ServiceSpec", "k8s.io/api/core/v1.ServiceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_ServiceAccount(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceAccount binds together: * a name, understood by users, and perhaps by peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "secrets": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "name", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "Secrets is the list of secrets allowed to be used by pods running using this ServiceAccount. More info: https://kubernetes.io/docs/concepts/configuration/secret", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - }, - }, - }, - "imagePullSecrets": { - SchemaProps: spec.SchemaProps{ - Description: "ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - }, - }, - }, - "automountServiceAccountToken": { - SchemaProps: spec.SchemaProps{ - Description: "AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. Can be overridden at the pod level.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_core_v1_ServiceAccountList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceAccountList is a list of ServiceAccount 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of ServiceAccounts. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ServiceAccount"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ServiceAccount", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_ServiceAccountTokenProjection(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "audience": { - SchemaProps: spec.SchemaProps{ - Description: "Audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.", - Type: []string{"string"}, - Format: "", - }, - }, - "expirationSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "ExpirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path is the path relative to the mount point of the file to project the token into.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"path"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ServiceList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceList holds a list of services.", - 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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of services", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.Service"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.Service", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_core_v1_ServicePort(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServicePort contains information on service's port.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. When considering the endpoints for a Service, this must match the 'name' field in the EndpointPort. Optional if only one ServicePort is defined on this service.", - Type: []string{"string"}, - Format: "", - }, - }, - "protocol": { - SchemaProps: spec.SchemaProps{ - Description: "The IP protocol for this port. Supports \"TCP\", \"UDP\", and \"SCTP\". Default is TCP.", - Type: []string{"string"}, - Format: "", - }, - }, - "appProtocol": { - SchemaProps: spec.SchemaProps{ - Description: "The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol. This is a beta field that is guarded by the ServiceAppProtocol feature gate and enabled by default.", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "The port that will be exposed by this service.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "targetPort": { - SchemaProps: spec.SchemaProps{ - Description: "Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod's container ports. If this is not specified, the value of the 'port' field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the 'port' field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service", - Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), - }, - }, - "nodePort": { - SchemaProps: spec.SchemaProps{ - Description: "The port on each node on which this service is exposed when type=NodePort or LoadBalancer. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one. More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"port"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, - } -} - -func schema_k8sio_api_core_v1_ServiceProxyOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceProxyOptions is the query options to a Service's proxy 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: "", - }, - }, - "path": { - SchemaProps: spec.SchemaProps{ - Description: "Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceSpec describes the attributes that a user creates on a service.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ports": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []string{ - "port", - "protocol", - }, - "x-kubernetes-list-type": "map", - "x-kubernetes-patch-merge-key": "port", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "The list of ports that are exposed by this service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.ServicePort"), - }, - }, - }, - }, - }, - "selector": { - SchemaProps: spec.SchemaProps{ - Description: "Route service traffic to pods with label keys and values matching this selector. If empty or not present, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "clusterIP": { - SchemaProps: spec.SchemaProps{ - Description: "clusterIP is the IP address of the service and is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. This field can not be changed through updates. Valid values are \"None\", empty string (\"\"), or a valid IP address. \"None\" can be specified for headless services when proxying is not required. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", - Type: []string{"string"}, - Format: "", - }, - }, - "type": { - SchemaProps: spec.SchemaProps{ - Description: "type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer. \"ExternalName\" maps to the specified externalName. \"ClusterIP\" allocates a cluster-internal IP address for load-balancing to endpoints. Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object. If clusterIP is \"None\", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a stable IP. \"NodePort\" builds on ClusterIP and allocates a port on every node which routes to the clusterIP. \"LoadBalancer\" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the clusterIP. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types", - Type: []string{"string"}, - Format: "", - }, - }, - "externalIPs": { - SchemaProps: spec.SchemaProps{ - Description: "externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "sessionAffinity": { - SchemaProps: spec.SchemaProps{ - Description: "Supports \"ClientIP\" and \"None\". Used to maintain session affinity. Enable client IP based session affinity. Must be ClientIP or None. Defaults to None. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies", - Type: []string{"string"}, - Format: "", - }, - }, - "loadBalancerIP": { - SchemaProps: spec.SchemaProps{ - Description: "Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature.", - Type: []string{"string"}, - Format: "", - }, - }, - "loadBalancerSourceRanges": { - SchemaProps: spec.SchemaProps{ - Description: "If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature.\" More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "externalName": { - SchemaProps: spec.SchemaProps{ - Description: "externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a lowercase RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) and requires Type to be ExternalName.", - Type: []string{"string"}, - Format: "", - }, - }, - "externalTrafficPolicy": { - SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.", - Type: []string{"string"}, - Format: "", - }, - }, - "healthCheckNodePort": { - SchemaProps: spec.SchemaProps{ - Description: "healthCheckNodePort specifies the healthcheck nodePort for the service. If not specified, HealthCheckNodePort is created by the service api backend with the allocated nodePort. Will use user-specified nodePort value if specified by the client. Only effects when Type is set to LoadBalancer and ExternalTrafficPolicy is set to Local.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "publishNotReadyAddresses": { - SchemaProps: spec.SchemaProps{ - Description: "publishNotReadyAddresses indicates that any agent which deals with endpoints for this Service should disregard any indications of ready/not-ready. The primary use case for setting this field is for a StatefulSet's Headless Service to propagate SRV DNS records for its Pods for the purpose of peer discovery. The Kubernetes controllers that generate Endpoints and EndpointSlice resources for Services interpret this to mean that all endpoints are considered \"ready\" even if the Pods themselves are not. Agents which consume only Kubernetes generated endpoints through the Endpoints or EndpointSlice resources can safely assume this behavior.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "sessionAffinityConfig": { - SchemaProps: spec.SchemaProps{ - Description: "sessionAffinityConfig contains the configurations of session affinity.", - Ref: ref("k8s.io/api/core/v1.SessionAffinityConfig"), - }, - }, - "ipFamily": { - SchemaProps: spec.SchemaProps{ - Description: "ipFamily specifies whether this Service has a preference for a particular IP family (e.g. IPv4 vs. IPv6) when the IPv6DualStack feature gate is enabled. In a dual-stack cluster, you can specify ipFamily when creating a ClusterIP Service to determine whether the controller will allocate an IPv4 or IPv6 IP for it, and you can specify ipFamily when creating a headless Service to determine whether it will have IPv4 or IPv6 Endpoints. In either case, if you do not specify an ipFamily explicitly, it will default to the cluster's primary IP family. This field is part of an alpha feature, and you should not make any assumptions about its semantics other than those described above. In particular, you should not assume that it can (or cannot) be changed after creation time; that it can only have the values \"IPv4\" and \"IPv6\"; or that its current value on a given Service correctly reflects the current state of that Service. (For ClusterIP Services, look at clusterIP to see if the Service is IPv4 or IPv6. For headless Services, look at the endpoints, which may be dual-stack in the future. For ExternalName Services, ipFamily has no meaning, but it may be set to an irrelevant value anyway.)", - Type: []string{"string"}, - Format: "", - }, - }, - "topologyKeys": { - SchemaProps: spec.SchemaProps{ - Description: "topologyKeys is a preference-order list of topology keys which implementations of services should use to preferentially sort endpoints when accessing this Service, it can not be used at the same time as externalTrafficPolicy=Local. Topology keys must be valid label keys and at most 16 keys may be specified. Endpoints are chosen based on the first topology key with available backends. If this field is specified and all entries have no backends that match the topology of the client, the service has no backends for that client and connections should fail. The special value \"*\" may be used to mean \"any topology\". This catch-all value, if used, only makes sense as the last value in the list. If this is not specified or empty, no topology constraints will be applied.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ServicePort", "k8s.io/api/core/v1.SessionAffinityConfig"}, - } -} - -func schema_k8sio_api_core_v1_ServiceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ServiceStatus represents the current status of a service.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "loadBalancer": { - SchemaProps: spec.SchemaProps{ - Description: "LoadBalancer contains the current status of the load-balancer, if one is present.", - Ref: ref("k8s.io/api/core/v1.LoadBalancerStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LoadBalancerStatus"}, - } -} - -func schema_k8sio_api_core_v1_SessionAffinityConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SessionAffinityConfig represents the configurations of session affinity.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "clientIP": { - SchemaProps: spec.SchemaProps{ - Description: "clientIP contains the configurations of Client IP based session affinity.", - Ref: ref("k8s.io/api/core/v1.ClientIPConfig"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ClientIPConfig"}, - } -} - -func schema_k8sio_api_core_v1_StorageOSPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a StorageOS persistent volume resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumeName": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeNamespace": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_StorageOSVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a StorageOS persistent volume resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumeName": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.", - Type: []string{"string"}, - Format: "", - }, - }, - "volumeNamespace": { - SchemaProps: spec.SchemaProps{ - Description: "VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod's namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to \"default\" if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "secretRef": { - SchemaProps: spec.SchemaProps{ - Description: "SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_k8sio_api_core_v1_Sysctl(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Sysctl defines a kernel parameter to be set", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of a property to set", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "Value of a property to set", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "value"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_TCPSocketAction(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TCPSocketAction describes an action based on opening a socket", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "port": { - SchemaProps: spec.SchemaProps{ - Description: "Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.", - Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), - }, - }, - "host": { - SchemaProps: spec.SchemaProps{ - Description: "Optional: Host name to connect to, defaults to the pod IP.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"port"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, - } -} - -func schema_k8sio_api_core_v1_Taint(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "The node this Taint is attached to has the \"effect\" on any pod that does not tolerate the Taint.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "Required. The taint key to be applied to a node.", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "The taint value corresponding to the taint key.", - Type: []string{"string"}, - Format: "", - }, - }, - "effect": { - SchemaProps: spec.SchemaProps{ - Description: "Required. The effect of the taint on pods that do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule and NoExecute.", - Type: []string{"string"}, - Format: "", - }, - }, - "timeAdded": { - SchemaProps: spec.SchemaProps{ - Description: "TimeAdded represents the time at which the taint was added. It is only written for NoExecute taints.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - }, - Required: []string{"key", "effect"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -func schema_k8sio_api_core_v1_Toleration(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator .", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.", - Type: []string{"string"}, - Format: "", - }, - }, - "operator": { - SchemaProps: spec.SchemaProps{ - Description: "Operator represents a key's relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.", - Type: []string{"string"}, - Format: "", - }, - }, - "value": { - SchemaProps: spec.SchemaProps{ - Description: "Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.", - Type: []string{"string"}, - Format: "", - }, - }, - "effect": { - SchemaProps: spec.SchemaProps{ - Description: "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.", - Type: []string{"string"}, - Format: "", - }, - }, - "tolerationSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_TopologySelectorLabelRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A topology selector requirement is a selector that matches given label. This is an alpha feature and may change in the future.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "key": { - SchemaProps: spec.SchemaProps{ - Description: "The label key that the selector applies to.", - Type: []string{"string"}, - Format: "", - }, - }, - "values": { - SchemaProps: spec.SchemaProps{ - Description: "An array of string values. One value must match the label to be selected. Each entry in Values is ORed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"key", "values"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_TopologySelectorTerm(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "A topology selector term represents the result of label queries. A null or empty topology selector term matches no objects. The requirements of them are ANDed. It provides a subset of functionality as NodeSelectorTerm. This is an alpha feature and may change in the future.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "matchLabelExpressions": { - SchemaProps: spec.SchemaProps{ - Description: "A list of topology selector requirements by labels.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.TopologySelectorLabelRequirement"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.TopologySelectorLabelRequirement"}, - } -} - -func schema_k8sio_api_core_v1_TopologySpreadConstraint(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TopologySpreadConstraint specifies how to spread matching pods among the given topology.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "maxSkew": { - SchemaProps: spec.SchemaProps{ - Description: "MaxSkew describes the degree to which pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, it is the maximum permitted difference between the number of matching pods in the target topology and the global minimum. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, it is used to give higher precedence to topologies that satisfy it. It's a required field. Default value is 1 and 0 is not allowed.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "topologyKey": { - SchemaProps: spec.SchemaProps{ - Description: "TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each as a \"bucket\", and try to put balanced number of pods into each bucket. It's a required field.", - Type: []string{"string"}, - Format: "", - }, - }, - "whenUnsatisfiable": { - SchemaProps: spec.SchemaProps{ - Description: "WhenUnsatisfiable indicates how to deal with a pod if it doesn't satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it. - ScheduleAnyway tells the scheduler to schedule the pod in any location,\n but giving higher precedence to topologies that would help reduce the\n skew.\nA constraint is considered \"Unsatisfiable\" for an incoming pod if and only if every possible node assigment for that pod would violate \"MaxSkew\" on some topology. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won't make it *more* imbalanced. It's a required field.", - Type: []string{"string"}, - Format: "", - }, - }, - "labelSelector": { - SchemaProps: spec.SchemaProps{ - Description: "LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), - }, - }, - }, - Required: []string{"maxSkew", "topologyKey", "whenUnsatisfiable"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, - } -} - -func schema_k8sio_api_core_v1_TypedLocalObjectReference(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiGroup": { - SchemaProps: spec.SchemaProps{ - Description: "APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is the type of resource being referenced", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of resource being referenced", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"kind", "name"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_Volume(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Volume represents a named volume in a pod that may be accessed by any container in the pod.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Volume's name. Must be a DNS_LABEL and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", - Type: []string{"string"}, - Format: "", - }, - }, - "hostPath": { - SchemaProps: spec.SchemaProps{ - Description: "HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - Ref: ref("k8s.io/api/core/v1.HostPathVolumeSource"), - }, - }, - "emptyDir": { - SchemaProps: spec.SchemaProps{ - Description: "EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", - Ref: ref("k8s.io/api/core/v1.EmptyDirVolumeSource"), - }, - }, - "gcePersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Ref: ref("k8s.io/api/core/v1.GCEPersistentDiskVolumeSource"), - }, - }, - "awsElasticBlockStore": { - SchemaProps: spec.SchemaProps{ - Description: "AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - Ref: ref("k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource"), - }, - }, - "gitRepo": { - SchemaProps: spec.SchemaProps{ - Description: "GitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.", - Ref: ref("k8s.io/api/core/v1.GitRepoVolumeSource"), - }, - }, - "secret": { - SchemaProps: spec.SchemaProps{ - Description: "Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret", - Ref: ref("k8s.io/api/core/v1.SecretVolumeSource"), - }, - }, - "nfs": { - SchemaProps: spec.SchemaProps{ - Description: "NFS represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - Ref: ref("k8s.io/api/core/v1.NFSVolumeSource"), - }, - }, - "iscsi": { - SchemaProps: spec.SchemaProps{ - Description: "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md", - Ref: ref("k8s.io/api/core/v1.ISCSIVolumeSource"), - }, - }, - "glusterfs": { - SchemaProps: spec.SchemaProps{ - Description: "Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md", - Ref: ref("k8s.io/api/core/v1.GlusterfsVolumeSource"), - }, - }, - "persistentVolumeClaim": { - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource"), - }, - }, - "rbd": { - SchemaProps: spec.SchemaProps{ - Description: "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md", - Ref: ref("k8s.io/api/core/v1.RBDVolumeSource"), - }, - }, - "flexVolume": { - SchemaProps: spec.SchemaProps{ - Description: "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", - Ref: ref("k8s.io/api/core/v1.FlexVolumeSource"), - }, - }, - "cinder": { - SchemaProps: spec.SchemaProps{ - Description: "Cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", - Ref: ref("k8s.io/api/core/v1.CinderVolumeSource"), - }, - }, - "cephfs": { - SchemaProps: spec.SchemaProps{ - Description: "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.CephFSVolumeSource"), - }, - }, - "flocker": { - SchemaProps: spec.SchemaProps{ - Description: "Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running", - Ref: ref("k8s.io/api/core/v1.FlockerVolumeSource"), - }, - }, - "downwardAPI": { - SchemaProps: spec.SchemaProps{ - Description: "DownwardAPI represents downward API about the pod that should populate this volume", - Ref: ref("k8s.io/api/core/v1.DownwardAPIVolumeSource"), - }, - }, - "fc": { - SchemaProps: spec.SchemaProps{ - Description: "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.", - Ref: ref("k8s.io/api/core/v1.FCVolumeSource"), - }, - }, - "azureFile": { - SchemaProps: spec.SchemaProps{ - Description: "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureFileVolumeSource"), - }, - }, - "configMap": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigMap represents a configMap that should populate this volume", - Ref: ref("k8s.io/api/core/v1.ConfigMapVolumeSource"), - }, - }, - "vsphereVolume": { - SchemaProps: spec.SchemaProps{ - Description: "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"), - }, - }, - "quobyte": { - SchemaProps: spec.SchemaProps{ - Description: "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.QuobyteVolumeSource"), - }, - }, - "azureDisk": { - SchemaProps: spec.SchemaProps{ - Description: "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureDiskVolumeSource"), - }, - }, - "photonPersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource"), - }, - }, - "projected": { - SchemaProps: spec.SchemaProps{ - Description: "Items for all in one resources secrets, configmaps, and downward API", - Ref: ref("k8s.io/api/core/v1.ProjectedVolumeSource"), - }, - }, - "portworxVolume": { - SchemaProps: spec.SchemaProps{ - Description: "PortworxVolume represents a portworx volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PortworxVolumeSource"), - }, - }, - "scaleIO": { - SchemaProps: spec.SchemaProps{ - Description: "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.", - Ref: ref("k8s.io/api/core/v1.ScaleIOVolumeSource"), - }, - }, - "storageos": { - SchemaProps: spec.SchemaProps{ - Description: "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.", - Ref: ref("k8s.io/api/core/v1.StorageOSVolumeSource"), - }, - }, - "csi": { - SchemaProps: spec.SchemaProps{ - Description: "CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).", - Ref: ref("k8s.io/api/core/v1.CSIVolumeSource"), - }, - }, - "ephemeral": { - SchemaProps: spec.SchemaProps{ - Description: "Ephemeral represents a volume that is handled by a cluster storage driver (Alpha feature). The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.", - Ref: ref("k8s.io/api/core/v1.EphemeralVolumeSource"), - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.EphemeralVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, - } -} - -func schema_k8sio_api_core_v1_VolumeDevice(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "volumeDevice describes a mapping of a raw block device within a container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name must match the name of a persistentVolumeClaim in the pod", - Type: []string{"string"}, - Format: "", - }, - }, - "devicePath": { - SchemaProps: spec.SchemaProps{ - Description: "devicePath is the path inside of the container that the device will be mapped to.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "devicePath"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_VolumeMount(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VolumeMount describes a mounting of a Volume within a container.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "This must match the Name of a Volume.", - Type: []string{"string"}, - Format: "", - }, - }, - "readOnly": { - SchemaProps: spec.SchemaProps{ - Description: "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "mountPath": { - SchemaProps: spec.SchemaProps{ - Description: "Path within the container at which the volume should be mounted. Must not contain ':'.", - Type: []string{"string"}, - Format: "", - }, - }, - "subPath": { - SchemaProps: spec.SchemaProps{ - Description: "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).", - Type: []string{"string"}, - Format: "", - }, - }, - "mountPropagation": { - SchemaProps: spec.SchemaProps{ - Description: "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.", - Type: []string{"string"}, - Format: "", - }, - }, - "subPathExpr": { - SchemaProps: spec.SchemaProps{ - Description: "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"name", "mountPath"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_VolumeNodeAffinity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "required": { - SchemaProps: spec.SchemaProps{ - Description: "Required specifies hard node constraints that must be met.", - Ref: ref("k8s.io/api/core/v1.NodeSelector"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelector"}, - } -} - -func schema_k8sio_api_core_v1_VolumeProjection(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Projection that may be projected along with other supported volume types", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "secret": { - SchemaProps: spec.SchemaProps{ - Description: "information about the secret data to project", - Ref: ref("k8s.io/api/core/v1.SecretProjection"), - }, - }, - "downwardAPI": { - SchemaProps: spec.SchemaProps{ - Description: "information about the downwardAPI data to project", - Ref: ref("k8s.io/api/core/v1.DownwardAPIProjection"), - }, - }, - "configMap": { - SchemaProps: spec.SchemaProps{ - Description: "information about the configMap data to project", - Ref: ref("k8s.io/api/core/v1.ConfigMapProjection"), - }, - }, - "serviceAccountToken": { - SchemaProps: spec.SchemaProps{ - Description: "information about the serviceAccountToken data to project", - Ref: ref("k8s.io/api/core/v1.ServiceAccountTokenProjection"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMapProjection", "k8s.io/api/core/v1.DownwardAPIProjection", "k8s.io/api/core/v1.SecretProjection", "k8s.io/api/core/v1.ServiceAccountTokenProjection"}, - } -} - -func schema_k8sio_api_core_v1_VolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents the source of a volume to mount. Only one of its members may be specified.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "hostPath": { - SchemaProps: spec.SchemaProps{ - Description: "HostPath represents a pre-existing file or directory on the host machine that is directly exposed to the container. This is generally used for system agents or other privileged things that are allowed to see the host machine. Most containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath", - Ref: ref("k8s.io/api/core/v1.HostPathVolumeSource"), - }, - }, - "emptyDir": { - SchemaProps: spec.SchemaProps{ - Description: "EmptyDir represents a temporary directory that shares a pod's lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir", - Ref: ref("k8s.io/api/core/v1.EmptyDirVolumeSource"), - }, - }, - "gcePersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk", - Ref: ref("k8s.io/api/core/v1.GCEPersistentDiskVolumeSource"), - }, - }, - "awsElasticBlockStore": { - SchemaProps: spec.SchemaProps{ - Description: "AWSElasticBlockStore represents an AWS Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore", - Ref: ref("k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource"), - }, - }, - "gitRepo": { - SchemaProps: spec.SchemaProps{ - Description: "GitRepo represents a git repository at a particular revision. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod's container.", - Ref: ref("k8s.io/api/core/v1.GitRepoVolumeSource"), - }, - }, - "secret": { - SchemaProps: spec.SchemaProps{ - Description: "Secret represents a secret that should populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret", - Ref: ref("k8s.io/api/core/v1.SecretVolumeSource"), - }, - }, - "nfs": { - SchemaProps: spec.SchemaProps{ - Description: "NFS represents an NFS mount on the host that shares a pod's lifetime More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs", - Ref: ref("k8s.io/api/core/v1.NFSVolumeSource"), - }, - }, - "iscsi": { - SchemaProps: spec.SchemaProps{ - Description: "ISCSI represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md", - Ref: ref("k8s.io/api/core/v1.ISCSIVolumeSource"), - }, - }, - "glusterfs": { - SchemaProps: spec.SchemaProps{ - Description: "Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/glusterfs/README.md", - Ref: ref("k8s.io/api/core/v1.GlusterfsVolumeSource"), - }, - }, - "persistentVolumeClaim": { - SchemaProps: spec.SchemaProps{ - Description: "PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims", - Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource"), - }, - }, - "rbd": { - SchemaProps: spec.SchemaProps{ - Description: "RBD represents a Rados Block Device mount on the host that shares a pod's lifetime. More info: https://examples.k8s.io/volumes/rbd/README.md", - Ref: ref("k8s.io/api/core/v1.RBDVolumeSource"), - }, - }, - "flexVolume": { - SchemaProps: spec.SchemaProps{ - Description: "FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.", - Ref: ref("k8s.io/api/core/v1.FlexVolumeSource"), - }, - }, - "cinder": { - SchemaProps: spec.SchemaProps{ - Description: "Cinder represents a cinder volume attached and mounted on kubelets host machine. More info: https://examples.k8s.io/mysql-cinder-pd/README.md", - Ref: ref("k8s.io/api/core/v1.CinderVolumeSource"), - }, - }, - "cephfs": { - SchemaProps: spec.SchemaProps{ - Description: "CephFS represents a Ceph FS mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.CephFSVolumeSource"), - }, - }, - "flocker": { - SchemaProps: spec.SchemaProps{ - Description: "Flocker represents a Flocker volume attached to a kubelet's host machine. This depends on the Flocker control service being running", - Ref: ref("k8s.io/api/core/v1.FlockerVolumeSource"), - }, - }, - "downwardAPI": { - SchemaProps: spec.SchemaProps{ - Description: "DownwardAPI represents downward API about the pod that should populate this volume", - Ref: ref("k8s.io/api/core/v1.DownwardAPIVolumeSource"), - }, - }, - "fc": { - SchemaProps: spec.SchemaProps{ - Description: "FC represents a Fibre Channel resource that is attached to a kubelet's host machine and then exposed to the pod.", - Ref: ref("k8s.io/api/core/v1.FCVolumeSource"), - }, - }, - "azureFile": { - SchemaProps: spec.SchemaProps{ - Description: "AzureFile represents an Azure File Service mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureFileVolumeSource"), - }, - }, - "configMap": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigMap represents a configMap that should populate this volume", - Ref: ref("k8s.io/api/core/v1.ConfigMapVolumeSource"), - }, - }, - "vsphereVolume": { - SchemaProps: spec.SchemaProps{ - Description: "VsphereVolume represents a vSphere volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"), - }, - }, - "quobyte": { - SchemaProps: spec.SchemaProps{ - Description: "Quobyte represents a Quobyte mount on the host that shares a pod's lifetime", - Ref: ref("k8s.io/api/core/v1.QuobyteVolumeSource"), - }, - }, - "azureDisk": { - SchemaProps: spec.SchemaProps{ - Description: "AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.", - Ref: ref("k8s.io/api/core/v1.AzureDiskVolumeSource"), - }, - }, - "photonPersistentDisk": { - SchemaProps: spec.SchemaProps{ - Description: "PhotonPersistentDisk represents a PhotonController persistent disk attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource"), - }, - }, - "projected": { - SchemaProps: spec.SchemaProps{ - Description: "Items for all in one resources secrets, configmaps, and downward API", - Ref: ref("k8s.io/api/core/v1.ProjectedVolumeSource"), - }, - }, - "portworxVolume": { - SchemaProps: spec.SchemaProps{ - Description: "PortworxVolume represents a portworx volume attached and mounted on kubelets host machine", - Ref: ref("k8s.io/api/core/v1.PortworxVolumeSource"), - }, - }, - "scaleIO": { - SchemaProps: spec.SchemaProps{ - Description: "ScaleIO represents a ScaleIO persistent volume attached and mounted on Kubernetes nodes.", - Ref: ref("k8s.io/api/core/v1.ScaleIOVolumeSource"), - }, - }, - "storageos": { - SchemaProps: spec.SchemaProps{ - Description: "StorageOS represents a StorageOS volume attached and mounted on Kubernetes nodes.", - Ref: ref("k8s.io/api/core/v1.StorageOSVolumeSource"), - }, - }, - "csi": { - SchemaProps: spec.SchemaProps{ - Description: "CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).", - Ref: ref("k8s.io/api/core/v1.CSIVolumeSource"), - }, - }, - "ephemeral": { - SchemaProps: spec.SchemaProps{ - Description: "Ephemeral represents a volume that is handled by a cluster storage driver (Alpha feature). The volume's lifecycle is tied to the pod that defines it - it will be created before the pod starts, and deleted when the pod is removed.\n\nUse this if: a) the volume is only needed while the pod runs, b) features of normal volumes like restoring from snapshot or capacity\n tracking are needed,\nc) the storage driver is specified through a storage class, and d) the storage driver supports dynamic volume provisioning through\n a PersistentVolumeClaim (see EphemeralVolumeSource for more\n information on the connection between this volume type\n and PersistentVolumeClaim).\n\nUse PersistentVolumeClaim or one of the vendor-specific APIs for volumes that persist for longer than the lifecycle of an individual pod.\n\nUse CSI for light-weight local ephemeral volumes if the CSI driver is meant to be used that way - see the documentation of the driver for more information.\n\nA pod can use both types of ephemeral volumes and persistent volumes at the same time.", - Ref: ref("k8s.io/api/core/v1.EphemeralVolumeSource"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.AWSElasticBlockStoreVolumeSource", "k8s.io/api/core/v1.AzureDiskVolumeSource", "k8s.io/api/core/v1.AzureFileVolumeSource", "k8s.io/api/core/v1.CSIVolumeSource", "k8s.io/api/core/v1.CephFSVolumeSource", "k8s.io/api/core/v1.CinderVolumeSource", "k8s.io/api/core/v1.ConfigMapVolumeSource", "k8s.io/api/core/v1.DownwardAPIVolumeSource", "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.EphemeralVolumeSource", "k8s.io/api/core/v1.FCVolumeSource", "k8s.io/api/core/v1.FlexVolumeSource", "k8s.io/api/core/v1.FlockerVolumeSource", "k8s.io/api/core/v1.GCEPersistentDiskVolumeSource", "k8s.io/api/core/v1.GitRepoVolumeSource", "k8s.io/api/core/v1.GlusterfsVolumeSource", "k8s.io/api/core/v1.HostPathVolumeSource", "k8s.io/api/core/v1.ISCSIVolumeSource", "k8s.io/api/core/v1.NFSVolumeSource", "k8s.io/api/core/v1.PersistentVolumeClaimVolumeSource", "k8s.io/api/core/v1.PhotonPersistentDiskVolumeSource", "k8s.io/api/core/v1.PortworxVolumeSource", "k8s.io/api/core/v1.ProjectedVolumeSource", "k8s.io/api/core/v1.QuobyteVolumeSource", "k8s.io/api/core/v1.RBDVolumeSource", "k8s.io/api/core/v1.ScaleIOVolumeSource", "k8s.io/api/core/v1.SecretVolumeSource", "k8s.io/api/core/v1.StorageOSVolumeSource", "k8s.io/api/core/v1.VsphereVirtualDiskVolumeSource"}, - } -} - -func schema_k8sio_api_core_v1_VsphereVirtualDiskVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Represents a vSphere volume resource.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "volumePath": { - SchemaProps: spec.SchemaProps{ - Description: "Path that identifies vSphere volume vmdk", - Type: []string{"string"}, - Format: "", - }, - }, - "fsType": { - SchemaProps: spec.SchemaProps{ - Description: "Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified.", - Type: []string{"string"}, - Format: "", - }, - }, - "storagePolicyName": { - SchemaProps: spec.SchemaProps{ - Description: "Storage Policy Based Management (SPBM) profile name.", - Type: []string{"string"}, - Format: "", - }, - }, - "storagePolicyID": { - SchemaProps: spec.SchemaProps{ - Description: "Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"volumePath"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_core_v1_WeightedPodAffinityTerm(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "weight": { - SchemaProps: spec.SchemaProps{ - Description: "weight associated with matching the corresponding podAffinityTerm, in the range 1-100.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "podAffinityTerm": { - SchemaProps: spec.SchemaProps{ - Description: "Required. A pod affinity term, associated with the corresponding weight.", - Ref: ref("k8s.io/api/core/v1.PodAffinityTerm"), - }, - }, - }, - Required: []string{"weight", "podAffinityTerm"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.PodAffinityTerm"}, - } -} - -func schema_k8sio_api_core_v1_WindowsSecurityContextOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "WindowsSecurityContextOptions contain Windows-specific options and credentials.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "gmsaCredentialSpecName": { - SchemaProps: spec.SchemaProps{ - Description: "GMSACredentialSpecName is the name of the GMSA credential spec to use.", - Type: []string{"string"}, - Format: "", - }, - }, - "gmsaCredentialSpec": { - SchemaProps: spec.SchemaProps{ - Description: "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.", - Type: []string{"string"}, - Format: "", - }, - }, - "runAsUserName": { - SchemaProps: spec.SchemaProps{ - Description: "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} diff --git a/pkg/client/openapi/k8s_io_api_rbac_v1/openapi_generated.go b/pkg/client/openapi/k8s_io_api_rbac_v1/openapi_generated.go deleted file mode 100644 index ceb5690..0000000 --- a/pkg/client/openapi/k8s_io_api_rbac_v1/openapi_generated.go +++ /dev/null @@ -1,629 +0,0 @@ -// +build !ignore_autogenerated - -// Code generated by openapi-gen. DO NOT EDIT. - -// This file was autogenerated by openapi-gen. Do not edit it manually! - -package k8s_io_api_rbac_v1 - -import ( - spec "github.com/go-openapi/spec" - common "k8s.io/kube-openapi/pkg/common" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - return map[string]common.OpenAPIDefinition{ - "k8s.io/api/rbac/v1.AggregationRule": schema_k8sio_api_rbac_v1_AggregationRule(ref), - "k8s.io/api/rbac/v1.ClusterRole": schema_k8sio_api_rbac_v1_ClusterRole(ref), - "k8s.io/api/rbac/v1.ClusterRoleBinding": schema_k8sio_api_rbac_v1_ClusterRoleBinding(ref), - "k8s.io/api/rbac/v1.ClusterRoleBindingList": schema_k8sio_api_rbac_v1_ClusterRoleBindingList(ref), - "k8s.io/api/rbac/v1.ClusterRoleList": schema_k8sio_api_rbac_v1_ClusterRoleList(ref), - "k8s.io/api/rbac/v1.PolicyRule": schema_k8sio_api_rbac_v1_PolicyRule(ref), - "k8s.io/api/rbac/v1.Role": schema_k8sio_api_rbac_v1_Role(ref), - "k8s.io/api/rbac/v1.RoleBinding": schema_k8sio_api_rbac_v1_RoleBinding(ref), - "k8s.io/api/rbac/v1.RoleBindingList": schema_k8sio_api_rbac_v1_RoleBindingList(ref), - "k8s.io/api/rbac/v1.RoleList": schema_k8sio_api_rbac_v1_RoleList(ref), - "k8s.io/api/rbac/v1.RoleRef": schema_k8sio_api_rbac_v1_RoleRef(ref), - "k8s.io/api/rbac/v1.Subject": schema_k8sio_api_rbac_v1_Subject(ref), - } -} - -func schema_k8sio_api_rbac_v1_AggregationRule(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "clusterRoleSelectors": { - SchemaProps: spec.SchemaProps{ - Description: "ClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole's permissions will be added", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, - } -} - -func schema_k8sio_api_rbac_v1_ClusterRole(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.", - 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "rules": { - SchemaProps: spec.SchemaProps{ - Description: "Rules holds all the PolicyRules for this ClusterRole", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/rbac/v1.PolicyRule"), - }, - }, - }, - }, - }, - "aggregationRule": { - SchemaProps: spec.SchemaProps{ - Description: "AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller.", - Ref: ref("k8s.io/api/rbac/v1.AggregationRule"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/rbac/v1.AggregationRule", "k8s.io/api/rbac/v1.PolicyRule", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_rbac_v1_ClusterRoleBinding(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject.", - 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "subjects": { - SchemaProps: spec.SchemaProps{ - Description: "Subjects holds references to the objects the role applies to.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/rbac/v1.Subject"), - }, - }, - }, - }, - }, - "roleRef": { - SchemaProps: spec.SchemaProps{ - Description: "RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.", - Ref: ref("k8s.io/api/rbac/v1.RoleRef"), - }, - }, - }, - Required: []string{"roleRef"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/rbac/v1.RoleRef", "k8s.io/api/rbac/v1.Subject", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_rbac_v1_ClusterRoleBindingList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ClusterRoleBindingList is a collection of ClusterRoleBindings", - 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of ClusterRoleBindings", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/rbac/v1.ClusterRoleBinding"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/rbac/v1.ClusterRoleBinding", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_rbac_v1_ClusterRoleList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ClusterRoleList is a collection of ClusterRoles", - 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of ClusterRoles", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/rbac/v1.ClusterRole"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/rbac/v1.ClusterRole", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_rbac_v1_PolicyRule(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "verbs": { - SchemaProps: spec.SchemaProps{ - Description: "Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions contained in this rule. VerbAll represents all kinds.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "apiGroups": { - SchemaProps: spec.SchemaProps{ - Description: "APIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "resources": { - SchemaProps: spec.SchemaProps{ - Description: "Resources is a list of resources this rule applies to. ResourceAll represents all resources.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "resourceNames": { - SchemaProps: spec.SchemaProps{ - Description: "ResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "nonResourceURLs": { - SchemaProps: spec.SchemaProps{ - Description: "NonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as \"pods\" or \"secrets\") or non-resource URL paths (such as \"/api\"), but not both.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - Required: []string{"verbs"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_rbac_v1_Role(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.", - 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "rules": { - SchemaProps: spec.SchemaProps{ - Description: "Rules holds all the PolicyRules for this Role", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/rbac/v1.PolicyRule"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/rbac/v1.PolicyRule", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_rbac_v1_RoleBinding(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace.", - 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "subjects": { - SchemaProps: spec.SchemaProps{ - Description: "Subjects holds references to the objects the role applies to.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/rbac/v1.Subject"), - }, - }, - }, - }, - }, - "roleRef": { - SchemaProps: spec.SchemaProps{ - Description: "RoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error.", - Ref: ref("k8s.io/api/rbac/v1.RoleRef"), - }, - }, - }, - Required: []string{"roleRef"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/rbac/v1.RoleRef", "k8s.io/api/rbac/v1.Subject", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -func schema_k8sio_api_rbac_v1_RoleBindingList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RoleBindingList is a collection of RoleBindings", - 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of RoleBindings", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/rbac/v1.RoleBinding"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/rbac/v1.RoleBinding", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_rbac_v1_RoleList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RoleList is a collection of Roles", - 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of Roles", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/rbac/v1.Role"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/rbac/v1.Role", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, - } -} - -func schema_k8sio_api_rbac_v1_RoleRef(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RoleRef contains information that points to the role being used", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "apiGroup": { - SchemaProps: spec.SchemaProps{ - Description: "APIGroup is the group for the resource being referenced", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind is the type of resource being referenced", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name is the name of resource being referenced", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"apiGroup", "kind", "name"}, - }, - }, - Dependencies: []string{}, - } -} - -func schema_k8sio_api_rbac_v1_Subject(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "Kind of object being referenced. Values defined by this API group are \"User\", \"Group\", and \"ServiceAccount\". If the Authorizer does not recognized the kind value, the Authorizer should report an error.", - Type: []string{"string"}, - Format: "", - }, - }, - "apiGroup": { - SchemaProps: spec.SchemaProps{ - Description: "APIGroup holds the API group of the referenced subject. Defaults to \"\" for ServiceAccount subjects. Defaults to \"rbac.authorization.k8s.io\" for User and Group subjects.", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the object being referenced.", - Type: []string{"string"}, - Format: "", - }, - }, - "namespace": { - SchemaProps: spec.SchemaProps{ - Description: "Namespace of the referenced object. If the object kind is non-namespace, such as \"User\" or \"Group\", and this value is not empty the Authorizer should report an error.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"kind", "name"}, - }, - }, - Dependencies: []string{}, - } -} diff --git a/pkg/client/openapi/k8s_io_apimachinery_intstr_unversioned/openapi_generated.go b/pkg/client/openapi/k8s_io_apimachinery_intstr_unversioned/openapi_generated.go deleted file mode 100644 index f02a066..0000000 --- a/pkg/client/openapi/k8s_io_apimachinery_intstr_unversioned/openapi_generated.go +++ /dev/null @@ -1,31 +0,0 @@ -// +build !ignore_autogenerated - -// Code generated by openapi-gen. DO NOT EDIT. - -// This file was autogenerated by openapi-gen. Do not edit it manually! - -package k8s_io_apimachinery_intstr_unversioned - -import ( - "github.com/go-openapi/spec" - intstr "k8s.io/apimachinery/pkg/util/intstr" - common "k8s.io/kube-openapi/pkg/common" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - return map[string]common.OpenAPIDefinition{ - "k8s.io/apimachinery/pkg/util/intstr.IntOrString": schema_apimachinery_pkg_util_intstr_IntOrString(ref), - } -} - -func schema_apimachinery_pkg_util_intstr_IntOrString(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.", - Type: intstr.IntOrString{}.OpenAPISchemaType(), - Format: intstr.IntOrString{}.OpenAPISchemaFormat(), - }, - }, - } -} diff --git a/pkg/client/openapi/k8s_io_apimachinery_meta_v1/openapi_generated.go b/pkg/client/openapi/k8s_io_apimachinery_meta_v1/openapi_generated.go deleted file mode 100644 index 16cb6ea..0000000 --- a/pkg/client/openapi/k8s_io_apimachinery_meta_v1/openapi_generated.go +++ /dev/null @@ -1,2231 +0,0 @@ -// +build !ignore_autogenerated - -// Code generated by openapi-gen. DO NOT EDIT. - -// This file was autogenerated by openapi-gen. Do not edit it manually! - -package k8s_io_apimachinery_meta_v1 - -import ( - spec "github.com/go-openapi/spec" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - common "k8s.io/kube-openapi/pkg/common" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - return map[string]common.OpenAPIDefinition{ - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition": schema_pkg_apis_meta_v1_Condition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ExportOptions": schema_pkg_apis_meta_v1_ExportOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry": schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata": schema_pkg_apis_meta_v1_PartialObjectMetadata(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadataList": schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PatchOptions": schema_pkg_apis_meta_v1_PatchOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Table": schema_pkg_apis_meta_v1_Table(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition": schema_pkg_apis_meta_v1_TableColumnDefinition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableOptions": schema_pkg_apis_meta_v1_TableOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow": schema_pkg_apis_meta_v1_TableRow(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition": schema_pkg_apis_meta_v1_TableRowCondition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.UpdateOptions": schema_pkg_apis_meta_v1_UpdateOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref), - } -} - -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.", - Type: []string{"string"}, - Format: "", - }, - }, - "versions": { - 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("k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery"), - }, - }, - }, - }, - }, - "preferredVersion": { - SchemaProps: spec.SchemaProps{ - Description: "preferredVersion is the version preferred by the API server, which probably is the storage version.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery"), - }, - }, - "serverAddressByClientCIDRs": { - 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("k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"), - }, - }, - }, - }, - }, - }, - Required: []string{"name", "versions"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery", "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"}, - } -} - -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": { - SchemaProps: spec.SchemaProps{ - Description: "groups is a list of APIGroup.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup"), - }, - }, - }, - }, - }, - }, - Required: []string{"groups"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup"}, - } -} - -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.", - 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.", - Type: []string{"string"}, - Format: "", - }, - }, - "namespaced": { - SchemaProps: spec.SchemaProps{ - Description: "namespaced indicates if a resource is namespaced or not.", - 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')", - 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": { - 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": { - 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"}, - }, - }, - Dependencies: []string{}, - } -} - -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.", - Type: []string{"string"}, - Format: "", - }, - }, - "resources": { - 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("k8s.io/apimachinery/pkg/apis/meta/v1.APIResource"), - }, - }, - }, - }, - }, - }, - Required: []string{"groupVersion", "resources"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource"}, - } -} - -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": { - 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": { - 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("k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"), - }, - }, - }, - }, - }, - }, - Required: []string{"versions", "serverAddressByClientCIDRs"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"}, - } -} - -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.", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "status of the condition, one of True, False, Unknown.", - 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("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "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.", - 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.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "status", "lastTransitionTime", "reason", "message"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -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": { - 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: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -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("k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions"), - }, - }, - "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": { - 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: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions"}, - } -} - -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_ExportOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ExportOptions is the query options to the standard REST get call. Deprecated. Planned for removal in 1.18.", - 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: "", - }, - }, - "export": { - SchemaProps: spec.SchemaProps{ - Description: "Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "exact": { - SchemaProps: spec.SchemaProps{ - Description: "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - Required: []string{"export", "exact"}, - }, - }, - Dependencies: []string{}, - } -} - -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"}, - Properties: map[string]spec.Schema{}, - }, - }, - Dependencies: []string{}, - } -} - -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: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -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{ - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "kind"}, - }, - }, - Dependencies: []string{}, - } -} - -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{ - Type: []string{"string"}, - Format: "", - }, - }, - "resource": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "resource"}, - }, - }, - Dependencies: []string{}, - } -} - -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{ - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version"}, - }, - }, - Dependencies: []string{}, - } -} - -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\"", - 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.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"groupVersion", "version"}, - }, - }, - Dependencies: []string{}, - } -} - -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 coersion. It doesn't use a GroupVersion to avoid custom marshalling", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version", "kind"}, - }, - }, - Dependencies: []string{}, - } -} - -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 coersion. It doesn't use a GroupVersion to avoid custom marshalling", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - "resource": { - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"group", "version", "resource"}, - }, - }, - Dependencies: []string{}, - } -} - -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{ - 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.", - Ref: ref("k8s.io/apimachinery/pkg/runtime.Object"), - }, - }, - }, - Required: []string{"Type", "Object"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/runtime.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{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "matchExpressions": { - 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("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"}, - } -} - -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": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-patch-merge-key": "key", - "x-kubernetes-patch-strategy": "merge", - }, - }, - SchemaProps: spec.SchemaProps{ - Description: "key is the label key that the selector applies to.", - 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.", - Type: []string{"string"}, - Format: "", - }, - }, - "values": { - 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"}, - }, - }, - Dependencies: []string{}, - } -} - -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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "List of objects", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -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: "selfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.", - 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", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -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. If the feature gate WatchBookmarks is not enabled in apiserver, 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: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -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 timestamp of when these fields were set. It should always be empty if Operation is 'Apply'", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "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("k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -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: http://kubernetes.io/docs/user-guide/identifiers#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 NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\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: http://kubernetes.io/docs/user-guide/namespaces", - Type: []string{"string"}, - Format: "", - }, - }, - "selfLink": { - SchemaProps: spec.SchemaProps{ - Description: "SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.", - 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: http://kubernetes.io/docs/user-guide/identifiers#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("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "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("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "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: http://kubernetes.io/docs/user-guide/labels", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - 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: http://kubernetes.io/docs/user-guide/annotations", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "ownerReferences": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "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("k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference"), - }, - }, - }, - }, - }, - "finalizers": { - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "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: "", - }, - }, - }, - }, - }, - "clusterName": { - SchemaProps: spec.SchemaProps{ - Description: "The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.", - Type: []string{"string"}, - Format: "", - }, - }, - "managedFields": { - 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("k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry", "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, - } -} - -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.", - 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", - Type: []string{"string"}, - Format: "", - }, - }, - "name": { - SchemaProps: spec.SchemaProps{ - Description: "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names", - Type: []string{"string"}, - Format: "", - }, - }, - "uid": { - SchemaProps: spec.SchemaProps{ - Description: "UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids", - 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. 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"}, - }, - }, - Dependencies: []string{}, - } -} - -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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, - } -} - -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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "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("k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata"}, - } -} - -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"}, - Properties: map[string]spec.Schema{}, - }, - }, - Dependencies: []string{}, - } -} - -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": { - 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: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -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: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -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": { - 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"}, - }, - }, - Dependencies: []string{}, - } -} - -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.", - 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.", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"clientCIDR", "serverAddress"}, - }, - }, - Dependencies: []string{}, - } -} - -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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "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("k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails"), - }, - }, - "code": { - SchemaProps: spec.SchemaProps{ - Description: "Suggested HTTP return code for this status, 0 if not set.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails"}, - } -} - -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: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -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: http://kubernetes.io/docs/user-guide/identifiers#uids", - Type: []string{"string"}, - Format: "", - }, - }, - "causes": { - 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("k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause"), - }, - }, - }, - }, - }, - "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{ - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause"}, - } -} - -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", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "columnDefinitions": { - 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("k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition"), - }, - }, - }, - }, - }, - "rows": { - 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("k8s.io/apimachinery/pkg/apis/meta/v1.TableRow"), - }, - }, - }, - }, - }, - }, - Required: []string{"columnDefinitions", "rows"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition", "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow"}, - } -} - -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.", - 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.", - 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.", - Type: []string{"string"}, - Format: "", - }, - }, - "description": { - SchemaProps: spec.SchemaProps{ - Description: "description is a human readable description of this column.", - 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.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"name", "type", "format", "description", "priority"}, - }, - }, - Dependencies: []string{}, - } -} - -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: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -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": { - 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": { - 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("k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition"), - }, - }, - }, - }, - }, - "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("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - Required: []string{"cells"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} - -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.", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "Status of the condition, one of True, False, Unknown.", - 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"}, - }, - }, - Dependencies: []string{}, - } -} - -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.", - 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.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"seconds", "nanos"}, - }, - }, - Dependencies: []string{}, - } -} - -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: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -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": { - 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: "", - }, - }, - }, - }, - }, - Dependencies: []string{}, - } -} - -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{ - 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("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - Required: []string{"type", "object"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/runtime.RawExtension"}, - } -} diff --git a/pkg/client/openapi/k8s_io_apimachinery_resource_unversioned/openapi_generated.go b/pkg/client/openapi/k8s_io_apimachinery_resource_unversioned/openapi_generated.go deleted file mode 100644 index 775e489..0000000 --- a/pkg/client/openapi/k8s_io_apimachinery_resource_unversioned/openapi_generated.go +++ /dev/null @@ -1,59 +0,0 @@ -// +build !ignore_autogenerated - -// Code generated by openapi-gen. DO NOT EDIT. - -// This file was autogenerated by openapi-gen. Do not edit it manually! - -package k8s_io_apimachinery_resource_unversioned - -import ( - spec "github.com/go-openapi/spec" - resource "k8s.io/apimachinery/pkg/api/resource" - common "k8s.io/kube-openapi/pkg/common" -) - -func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { - return map[string]common.OpenAPIDefinition{ - "k8s.io/apimachinery/pkg/api/resource.Quantity": schema_apimachinery_pkg_api_resource_Quantity(ref), - "k8s.io/apimachinery/pkg/api/resource.int64Amount": schema_apimachinery_pkg_api_resource_int64Amount(ref), - } -} - -func schema_apimachinery_pkg_api_resource_Quantity(ref common.ReferenceCallback) common.OpenAPIDefinition { - return 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 (Note that may be empty, from the \"\" case in .)\n ::= 0 | 1 | ... | 9 ::= | ::= | . | . | . ::= \"+\" | \"-\" ::= | ::= | | ::= Ki | Mi | Gi | Ti | Pi | Ei\n (International System of units; See: http://physics.nist.gov/cuu/Units/binary.html)\n ::= m | \"\" | k | M | G | T | P | E\n (Note that 1024 = 1Ki but 1000 = 1k; I didn't choose the capitalization.)\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 a. No precision is lost\n b. No fractional digits will be emitted\n c. The exponent (or suffix) is as large as possible.\nThe sign will be omitted unless the number is negative.\n\nExamples:\n 1.5 will be serialized as \"1500m\"\n 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{ - Type: []string{"integer"}, - Format: "int64", - }, - }, - "scale": { - SchemaProps: spec.SchemaProps{ - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"value", "scale"}, - }, - }, - Dependencies: []string{}, - } -} diff --git a/pkg/client/openapi/schema_writer_generated.go b/pkg/client/openapi/schema_writer_generated.go deleted file mode 100644 index 1398ed5..0000000 --- a/pkg/client/openapi/schema_writer_generated.go +++ /dev/null @@ -1,42 +0,0 @@ -package main - -import ( - "flag" - "os" - "strings" - - openapi "github.com/jenkins-x/jx-api/pkg/client/openapi/all" - - "github.com/go-openapi/spec" - - "github.com/pkg/errors" - - "github.com/jenkins-x/jx-api/cmd/codegen/generator" -) - -func main() { - var outputDir, namesStr, title, version string - flag.StringVar(&outputDir, "output-directory", "", "directory to write generated files to") - flag.StringVar(&namesStr, "names", "", "comma separated list of resources to generate schema for, "+ - "if empty all resources will be generated") - flag.StringVar(&title, "title", "", "title for OpenAPI and HTML generated docs") - flag.StringVar(&version, "version", "", "version for OpenAPI and HTML generated docs") - flag.Parse() - if outputDir == "" { - panic(errors.New("--output-directory cannot be empty")) - } - var names []string - if namesStr != "" { - names = strings.Split(namesStr, ",") - } else { - refCallback := func(path string) spec.Ref { - return spec.Ref{} - } - names = openapi.GetNames(refCallback) - } - err := generator.WriteSchemaToDisk(outputDir, title, version, openapi.GetOpenAPIDefinitions, names) - if err != nil { - panic(errors.Wrapf(err, "writing schema to %s", outputDir)) - } - os.Exit(0) -} From 37b281c3160cf6cf04f08eae3d855124ecf6a7d7 Mon Sep 17 00:00:00 2001 From: James Rawlings Date: Wed, 30 Sep 2020 22:06:29 +0100 Subject: [PATCH 3/9] chore: update to latest code-generator so we can generate 0.19.2 compliant clients --- Makefile.codegen | 3 ++- cmd/README.md | 3 +++ cmd/code-generator | 1 + go.mod | 1 + go.sum | 11 +++++++++++ hack/update-codegen.sh | 2 +- 6 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 cmd/README.md create mode 160000 cmd/code-generator diff --git a/Makefile.codegen b/Makefile.codegen index 17e03aa..28cd7eb 100644 --- a/Makefile.codegen +++ b/Makefile.codegen @@ -19,7 +19,8 @@ test-codegen: ## Test the code geneator # Generate go code using generate directives in files and kubernetes code generation # Anything generated by this target should be checked in -generate: build-codegen generate-openapi generate-client ## Generate the Go code (crds, mocks, openapi, client) +generate: ## Generate the Go code (crds, mocks, openapi, client) + ./hack/update-codegen.sh @$(MAKE) fmt @$(MAKE) importfmt @echo "Generation complete" diff --git a/cmd/README.md b/cmd/README.md new file mode 100644 index 0000000..3ab037c --- /dev/null +++ b/cmd/README.md @@ -0,0 +1,3 @@ +The code-generator dir in this folder is a clone from https://github.com/kubernetes/code-generator + +Then removed the git details from that repo `git rm --cached cmd/code-generator` \ No newline at end of file diff --git a/cmd/code-generator b/cmd/code-generator new file mode 160000 index 0000000..4116974 --- /dev/null +++ b/cmd/code-generator @@ -0,0 +1 @@ +Subproject commit 4116974d9b4427d8809e90e2cef0eb0c0e076190 diff --git a/go.mod b/go.mod index bd3917d..da07f0f 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/ghodss/yaml v1.0.0 github.com/go-openapi/spec v0.19.7 // indirect github.com/imdario/mergo v0.3.9 + github.com/jenkins-x/gen-crd-api-reference-docs v0.1.6 // indirect github.com/jenkins-x/jx-logging/v3 v3.0.0 github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index c27ef19..24653f7 100644 --- a/go.sum +++ b/go.sum @@ -140,6 +140,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/jenkins-x/gen-crd-api-reference-docs v0.1.6 h1:jV0THW6KeMYC0rcawdPeix7+ZmDZMR0UMU+QJr5gU6Y= +github.com/jenkins-x/gen-crd-api-reference-docs v0.1.6/go.mod h1:a4dzSf/nNLMMMqultm6IlV/04xq26uICEYPkSTOahWQ= github.com/jenkins-x/jx-logging/v3 v3.0.0 h1:Oqidp7EL+PUlZUUdPvOeWju9mMq2mzpd9/HWXdVM68E= github.com/jenkins-x/jx-logging/v3 v3.0.0/go.mod h1:bOYlj+Cdd9v7/vDXjkwlUylxGs5sfQJvYnuYbCL0IrY= github.com/jenkins-x/logrus-stackdriver-formatter v0.2.3 h1:NuRWKUPCEX1wKlXA8ZYSG28qGKd41R7BK11YDQkPwqo= @@ -194,6 +196,7 @@ github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGV github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -202,11 +205,16 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/rickar/props v0.0.0-20170718221555-0b06aeb2f037 h1:HFsTO5S+nnw/Xs9lRYF+UUJvH8wMSRMRal321W0hfdY= github.com/rickar/props v0.0.0-20170718221555-0b06aeb2f037/go.mod h1:F1p8BNM4IXv2UcptwSp8HJOapKurodd/PYu1D6Gtn9Y= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= @@ -375,9 +383,12 @@ k8s.io/client-go v0.19.2 h1:gMJuU3xJZs86L1oQ99R4EViAADUPMHHtS9jFshasHSc= k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA= k8s.io/code-generator v0.19.2 h1:7uaWJll6fyCPj2j3sfNN1AiY2gZU1VFN2dFR2uoxGWI= k8s.io/code-generator v0.19.2/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= +k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14 h1:t4L10Qfx/p7ASH3gXCdIUtPbbIuegCoUJf3TMSFekjw= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c= +k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 6bb7b06..5c7adc2 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -20,7 +20,7 @@ set -o nounset set -o pipefail SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} +CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ./cmd/code-generator)} # generate the code with: # --output-base because this script should also be able to run inside the vendor dir of From 4423761713094a12342557ad782f68d7c4428644 Mon Sep 17 00:00:00 2001 From: James Rawlings Date: Wed, 30 Sep 2020 22:12:59 +0100 Subject: [PATCH 4/9] chore: simplify codegen scripts and use the latest code-generator code from the update-codegen.sh script --- Makefile.codegen | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/Makefile.codegen b/Makefile.codegen index 28cd7eb..babb754 100644 --- a/Makefile.codegen +++ b/Makefile.codegen @@ -1,54 +1,13 @@ -CODE_GEN_BIN_NAME := codegen -CODE_GEN_GO_DEPENDENCIES := $(call rwildcard,cmd/codegen/,*.go) -CODE_GEN_BUILDFLAGS := -ifdef DEBUG -CODE_GEN_BUILDFLAGS := -gcflags "all=-N -l" $(CODE_GEN_BUILDFLAGS) -endif - CLIENTSET_GENERATOR_VERSION := kubernetes-1.19.2 -GEN_APIDOCS_VERSION := v0.0.0-20190912061656-a61bc210ee54 -OPENAPI_GEN_VERSION := 36ebc4887cdc - -build-codegen: build/$(CODE_GEN_BIN_NAME) ## Build the code generator - -build/$(CODE_GEN_BIN_NAME): $(CODE_GEN_GO_DEPENDENCIES) - CGO_ENABLED=$(CGO_ENABLED) $(GO) build $(CODE_GEN_BUILDFLAGS) -o build/$(CODE_GEN_BIN_NAME) cmd/codegen/codegen.go - -test-codegen: ## Test the code geneator - CGO_ENABLED=$(CGO_ENABLED) $(GO) test -v -short ./cmd/codegen/... # Generate go code using generate directives in files and kubernetes code generation # Anything generated by this target should be checked in generate: ## Generate the Go code (crds, mocks, openapi, client) - ./hack/update-codegen.sh + ./hack/update-codegen.sh @$(MAKE) fmt @$(MAKE) importfmt @echo "Generation complete" -generate-client: codegen-clientset codegen-config fmt importfmt ## Generate the client - -codegen-clientset: build-codegen ## Generate the k8s types and clients - # sleep for one second to prevent collision with previous codegen's replacement of go.mod - sleep 1 - @echo "Generating Kubernetes Clients for pkg/apis in pkg/client for jenkins.io:v1" - ./build/$(CODE_GEN_BIN_NAME) --generator-version $(CLIENTSET_GENERATOR_VERSION) clientset --output-package=pkg/client --input-package=pkg/apis --group-with-version=jenkins.io:v1 - -codegen-config: build-codegen ## Generate the deepcopy for the config, jenkinsfile, and tekton/syntax packages - # sleep for one second to prevent collision with previous codegen's replacement of go.mod - sleep 1 - ./build/$(CODE_GEN_BIN_NAME) --generator-version $(CLIENTSET_GENERATOR_VERSION) clientset --generator deepcopy --output-package=pkg --input-package=pkg --group-with-version=config: - -# Generated docs are not checked in -generate-docs: build-codegen ## Generate the docs - @echo "Generating HTML docs for Kubernetes Clients" - ./build/$(CODE_GEN_BIN_NAME) --generator-version $(GEN_APIDOCS_VERSION) docs - -generate-openapi: codegen-openapi fmt importfmt - -codegen-openapi: build-codegen - @echo "Generating OpenAPI structs for Kubernetes Clients" - ./build/$(CODE_GEN_BIN_NAME) --generator-version $(OPENAPI_GEN_VERSION) openapi --output-package=pkg/client --input-package=github.com/jenkins-x/jx-api/pkg/apis --group-with-version=jenkins.io:v1 --version=1.0 --module-name=github.com/jenkins-x/jx-api - install-refdocs: $(GO) get github.com/jenkins-x/gen-crd-api-reference-docs From d1da95c7b5e58f948b0193b22d1f954e00c9665f Mon Sep 17 00:00:00 2001 From: James Rawlings Date: Wed, 30 Sep 2020 22:24:44 +0100 Subject: [PATCH 5/9] chore: add badges so we can see https://pkg.go.dev/mod/github.com/jenkins-x/jx-api --- README.md | 6 + cmd/README.md | 4 +- cmd/code-generator | 1 - .../.github/PULL_REQUEST_TEMPLATE.md | 2 + cmd/code-generator/CONTRIBUTING.md | 7 + cmd/code-generator/Godeps/Godeps.json | 206 ++ cmd/code-generator/Godeps/OWNERS | 4 + cmd/code-generator/Godeps/Readme | 5 + cmd/code-generator/LICENSE | 202 ++ cmd/code-generator/OWNERS | 13 + cmd/code-generator/README.md | 24 + cmd/code-generator/SECURITY_CONTACTS | 16 + .../HyphenGroup/apis/example/v1/doc.go | 21 + .../HyphenGroup/apis/example/v1/register.go | 59 + .../HyphenGroup/apis/example/v1/types.go | 74 + .../apis/example/v1/zz_generated.deepcopy.go | 177 ++ .../apis/example/v1/zz_generated.defaults.go | 32 + .../clientset/versioned/clientset.go | 97 + .../HyphenGroup/clientset/versioned/doc.go | 20 + .../versioned/fake/clientset_generated.go | 82 + .../clientset/versioned/fake/doc.go | 20 + .../clientset/versioned/fake/register.go | 56 + .../clientset/versioned/scheme/doc.go | 20 + .../clientset/versioned/scheme/register.go | 56 + .../typed/example/v1/clustertesttype.go | 215 ++ .../versioned/typed/example/v1/doc.go | 20 + .../typed/example/v1/example_client.go | 94 + .../versioned/typed/example/v1/fake/doc.go | 20 + .../example/v1/fake/fake_clustertesttype.go | 154 + .../example/v1/fake/fake_example_client.go | 44 + .../typed/example/v1/fake/fake_testtype.go | 142 + .../typed/example/v1/generated_expansion.go | 23 + .../versioned/typed/example/v1/testtype.go | 195 ++ .../externalversions/example/interface.go | 46 + .../example/v1/clustertesttype.go | 89 + .../externalversions/example/v1/interface.go | 52 + .../externalversions/example/v1/testtype.go | 90 + .../informers/externalversions/factory.go | 180 ++ .../informers/externalversions/generic.go | 64 + .../internalinterfaces/factory_interfaces.go | 40 + .../listers/example/v1/clustertesttype.go | 68 + .../listers/example/v1/expansion_generated.go | 31 + .../listers/example/v1/testtype.go | 99 + .../MixedCase/apis/example/v1/doc.go | 20 + .../MixedCase/apis/example/v1/register.go | 59 + .../MixedCase/apis/example/v1/types.go | 74 + .../apis/example/v1/zz_generated.deepcopy.go | 177 ++ .../apis/example/v1/zz_generated.defaults.go | 32 + .../clientset/versioned/clientset.go | 97 + .../MixedCase/clientset/versioned/doc.go | 20 + .../versioned/fake/clientset_generated.go | 82 + .../MixedCase/clientset/versioned/fake/doc.go | 20 + .../clientset/versioned/fake/register.go | 56 + .../clientset/versioned/scheme/doc.go | 20 + .../clientset/versioned/scheme/register.go | 56 + .../typed/example/v1/clustertesttype.go | 215 ++ .../versioned/typed/example/v1/doc.go | 20 + .../typed/example/v1/example_client.go | 94 + .../versioned/typed/example/v1/fake/doc.go | 20 + .../example/v1/fake/fake_clustertesttype.go | 154 + .../example/v1/fake/fake_example_client.go | 44 + .../typed/example/v1/fake/fake_testtype.go | 142 + .../typed/example/v1/generated_expansion.go | 23 + .../versioned/typed/example/v1/testtype.go | 195 ++ .../externalversions/example/interface.go | 46 + .../example/v1/clustertesttype.go | 89 + .../externalversions/example/v1/interface.go | 52 + .../externalversions/example/v1/testtype.go | 90 + .../informers/externalversions/factory.go | 180 ++ .../informers/externalversions/generic.go | 64 + .../internalinterfaces/factory_interfaces.go | 40 + .../listers/example/v1/clustertesttype.go | 68 + .../listers/example/v1/expansion_generated.go | 31 + .../MixedCase/listers/example/v1/testtype.go | 99 + .../_examples/apiserver/apis/example/doc.go | 20 + .../apiserver/apis/example/install/install.go | 34 + .../apiserver/apis/example/register.go | 45 + .../_examples/apiserver/apis/example/types.go | 44 + .../apiserver/apis/example/v1/doc.go | 23 + .../apiserver/apis/example/v1/register.go | 59 + .../apiserver/apis/example/v1/types.go | 47 + .../example/v1/zz_generated.conversion.go | 137 + .../apis/example/v1/zz_generated.deepcopy.go | 101 + .../apis/example/v1/zz_generated.defaults.go | 32 + .../apis/example/zz_generated.deepcopy.go | 101 + .../_examples/apiserver/apis/example2/doc.go | 21 + .../apis/example2/install/install.go | 34 + .../apiserver/apis/example2/register.go | 45 + .../apiserver/apis/example2/types.go | 44 + .../apiserver/apis/example2/v1/doc.go | 24 + .../apiserver/apis/example2/v1/register.go | 59 + .../apiserver/apis/example2/v1/types.go | 47 + .../example2/v1/zz_generated.conversion.go | 137 + .../apis/example2/v1/zz_generated.deepcopy.go | 101 + .../apis/example2/v1/zz_generated.defaults.go | 32 + .../apis/example2/zz_generated.deepcopy.go | 101 + .../apiserver/apis/example3.io/doc.go | 21 + .../apis/example3.io/install/install.go | 34 + .../apiserver/apis/example3.io/register.go | 45 + .../apiserver/apis/example3.io/types.go | 44 + .../apiserver/apis/example3.io/v1/doc.go | 24 + .../apiserver/apis/example3.io/v1/register.go | 59 + .../apiserver/apis/example3.io/v1/types.go | 47 + .../example3.io/v1/zz_generated.conversion.go | 137 + .../example3.io/v1/zz_generated.deepcopy.go | 101 + .../example3.io/v1/zz_generated.defaults.go | 32 + .../apis/example3.io/zz_generated.deepcopy.go | 101 + .../clientset/internalversion/clientset.go | 125 + .../clientset/internalversion/doc.go | 20 + .../fake/clientset_generated.go | 96 + .../clientset/internalversion/fake/doc.go | 20 + .../internalversion/fake/register.go | 60 + .../clientset/internalversion/scheme/doc.go | 20 + .../internalversion/scheme/register.go | 45 + .../typed/example/internalversion/doc.go | 20 + .../example/internalversion/example_client.go | 96 + .../typed/example/internalversion/fake/doc.go | 20 + .../fake/fake_example_client.go | 40 + .../internalversion/fake/fake_testtype.go | 142 + .../internalversion/generated_expansion.go | 21 + .../typed/example/internalversion/testtype.go | 195 ++ .../typed/example2/internalversion/doc.go | 20 + .../internalversion/example2_client.go | 96 + .../example2/internalversion/fake/doc.go | 20 + .../fake/fake_example2_client.go | 40 + .../internalversion/fake/fake_testtype.go | 133 + .../internalversion/generated_expansion.go | 21 + .../example2/internalversion/testtype.go | 184 ++ .../typed/example3.io/internalversion/doc.go | 20 + .../internalversion/example3.io_client.go | 96 + .../example3.io/internalversion/fake/doc.go | 20 + .../fake/fake_example3.io_client.go | 40 + .../internalversion/fake/fake_testtype.go | 142 + .../internalversion/generated_expansion.go | 21 + .../example3.io/internalversion/testtype.go | 195 ++ .../clientset/versioned/clientset.go | 125 + .../apiserver/clientset/versioned/doc.go | 20 + .../versioned/fake/clientset_generated.go | 96 + .../apiserver/clientset/versioned/fake/doc.go | 20 + .../clientset/versioned/fake/register.go | 60 + .../clientset/versioned/scheme/doc.go | 20 + .../clientset/versioned/scheme/register.go | 60 + .../versioned/typed/example/v1/doc.go | 20 + .../typed/example/v1/example_client.go | 89 + .../versioned/typed/example/v1/fake/doc.go | 20 + .../example/v1/fake/fake_example_client.go | 40 + .../typed/example/v1/fake/fake_testtype.go | 142 + .../typed/example/v1/generated_expansion.go | 21 + .../versioned/typed/example/v1/testtype.go | 195 ++ .../versioned/typed/example2/v1/doc.go | 20 + .../typed/example2/v1/example2_client.go | 89 + .../versioned/typed/example2/v1/fake/doc.go | 20 + .../example2/v1/fake/fake_example2_client.go | 40 + .../typed/example2/v1/fake/fake_testtype.go | 142 + .../typed/example2/v1/generated_expansion.go | 21 + .../versioned/typed/example2/v1/testtype.go | 195 ++ .../versioned/typed/example3.io/v1/doc.go | 20 + .../example3.io/v1/example3.io_client.go | 89 + .../typed/example3.io/v1/fake/doc.go | 20 + .../v1/fake/fake_example3.io_client.go | 40 + .../example3.io/v1/fake/fake_testtype.go | 142 + .../example3.io/v1/generated_expansion.go | 21 + .../typed/example3.io/v1/testtype.go | 195 ++ .../externalversions/example/interface.go | 46 + .../externalversions/example/v1/interface.go | 45 + .../externalversions/example/v1/testtype.go | 90 + .../externalversions/example2/interface.go | 46 + .../externalversions/example2/v1/interface.go | 45 + .../externalversions/example2/v1/testtype.go | 90 + .../externalversions/example3.io/interface.go | 46 + .../example3.io/v1/interface.go | 45 + .../example3.io/v1/testtype.go | 90 + .../informers/externalversions/factory.go | 192 ++ .../informers/externalversions/generic.go | 72 + .../internalinterfaces/factory_interfaces.go | 40 + .../internalversion/example/interface.go | 46 + .../example/internalversion/interface.go | 45 + .../example/internalversion/testtype.go | 90 + .../internalversion/example2/interface.go | 46 + .../example2/internalversion/interface.go | 45 + .../example2/internalversion/testtype.go | 89 + .../internalversion/example3.io/interface.go | 46 + .../example3.io/internalversion/interface.go | 45 + .../example3.io/internalversion/testtype.go | 90 + .../informers/internalversion/factory.go | 192 ++ .../informers/internalversion/generic.go | 72 + .../internalinterfaces/factory_interfaces.go | 40 + .../internalversion/expansion_generated.go | 27 + .../example/internalversion/testtype.go | 99 + .../listers/example/v1/expansion_generated.go | 27 + .../apiserver/listers/example/v1/testtype.go | 99 + .../internalversion/expansion_generated.go | 23 + .../example2/internalversion/testtype.go | 68 + .../example2/v1/expansion_generated.go | 27 + .../apiserver/listers/example2/v1/testtype.go | 99 + .../internalversion/expansion_generated.go | 27 + .../example3.io/internalversion/testtype.go | 99 + .../example3.io/v1/expansion_generated.go | 27 + .../listers/example3.io/v1/testtype.go | 99 + .../apiserver/openapi/zz_generated.openapi.go | 2700 +++++++++++++++++ .../_examples/crd/apis/example/v1/doc.go | 21 + .../_examples/crd/apis/example/v1/register.go | 59 + .../_examples/crd/apis/example/v1/types.go | 74 + .../apis/example/v1/zz_generated.deepcopy.go | 177 ++ .../apis/example/v1/zz_generated.defaults.go | 32 + .../_examples/crd/apis/example2/v1/doc.go | 22 + .../crd/apis/example2/v1/register.go | 59 + .../_examples/crd/apis/example2/v1/types.go | 47 + .../apis/example2/v1/zz_generated.deepcopy.go | 101 + .../apis/example2/v1/zz_generated.defaults.go | 32 + .../crd/clientset/versioned/clientset.go | 111 + .../_examples/crd/clientset/versioned/doc.go | 20 + .../versioned/fake/clientset_generated.go | 89 + .../crd/clientset/versioned/fake/doc.go | 20 + .../crd/clientset/versioned/fake/register.go | 58 + .../crd/clientset/versioned/scheme/doc.go | 20 + .../clientset/versioned/scheme/register.go | 58 + .../typed/example/v1/clustertesttype.go | 215 ++ .../versioned/typed/example/v1/doc.go | 20 + .../typed/example/v1/example_client.go | 94 + .../versioned/typed/example/v1/fake/doc.go | 20 + .../example/v1/fake/fake_clustertesttype.go | 154 + .../example/v1/fake/fake_example_client.go | 44 + .../typed/example/v1/fake/fake_testtype.go | 142 + .../typed/example/v1/generated_expansion.go | 23 + .../versioned/typed/example/v1/testtype.go | 195 ++ .../versioned/typed/example2/v1/doc.go | 20 + .../typed/example2/v1/example2_client.go | 89 + .../versioned/typed/example2/v1/fake/doc.go | 20 + .../example2/v1/fake/fake_example2_client.go | 40 + .../typed/example2/v1/fake/fake_testtype.go | 142 + .../typed/example2/v1/generated_expansion.go | 21 + .../versioned/typed/example2/v1/testtype.go | 195 ++ .../externalversions/example/interface.go | 46 + .../example/v1/clustertesttype.go | 89 + .../externalversions/example/v1/interface.go | 52 + .../externalversions/example/v1/testtype.go | 90 + .../externalversions/example2/interface.go | 46 + .../externalversions/example2/v1/interface.go | 45 + .../externalversions/example2/v1/testtype.go | 90 + .../crd/informers/externalversions/factory.go | 186 ++ .../crd/informers/externalversions/generic.go | 69 + .../internalinterfaces/factory_interfaces.go | 40 + .../crd/listers/example/v1/clustertesttype.go | 68 + .../listers/example/v1/expansion_generated.go | 31 + .../crd/listers/example/v1/testtype.go | 99 + .../example2/v1/expansion_generated.go | 27 + .../crd/listers/example2/v1/testtype.go | 99 + cmd/code-generator/cmd/client-gen/OWNERS | 10 + cmd/code-generator/cmd/client-gen/README.md | 4 + .../cmd/client-gen/args/args.go | 126 + .../cmd/client-gen/args/gvpackages.go | 183 ++ .../cmd/client-gen/args/gvpackages_test.go | 116 + .../cmd/client-gen/args/gvtype.go | 110 + .../client-gen/generators/client_generator.go | 401 +++ .../generators/fake/fake_client_generator.go | 130 + .../fake/generator_fake_for_clientset.go | 167 + .../fake/generator_fake_for_group.go | 130 + .../fake/generator_fake_for_type.go | 482 +++ .../generators/generator_for_clientset.go | 183 ++ .../generators/generator_for_expansion.go | 54 + .../generators/generator_for_group.go | 246 ++ .../generators/generator_for_type.go | 610 ++++ .../generators/scheme/generator_for_scheme.go | 187 ++ .../cmd/client-gen/generators/util/tags.go | 341 +++ .../client-gen/generators/util/tags_test.go | 148 + cmd/code-generator/cmd/client-gen/main.go | 66 + .../cmd/client-gen/path/path.go | 31 + .../cmd/client-gen/types/helpers.go | 121 + .../cmd/client-gen/types/helpers_test.go | 32 + .../cmd/client-gen/types/types.go | 75 + .../cmd/conversion-gen/args/args.go | 83 + .../conversion-gen/generators/conversion.go | 1190 ++++++++ cmd/code-generator/cmd/conversion-gen/main.go | 125 + .../cmd/deepcopy-gen/args/args.go | 54 + cmd/code-generator/cmd/deepcopy-gen/main.go | 85 + .../cmd/defaulter-gen/args/args.go | 54 + cmd/code-generator/cmd/defaulter-gen/main.go | 84 + .../cmd/go-to-protobuf/.gitignore | 1 + cmd/code-generator/cmd/go-to-protobuf/OWNERS | 6 + cmd/code-generator/cmd/go-to-protobuf/main.go | 39 + .../cmd/go-to-protobuf/protobuf/cmd.go | 460 +++ .../cmd/go-to-protobuf/protobuf/cmd_test.go | 65 + .../cmd/go-to-protobuf/protobuf/generator.go | 773 +++++ .../go-to-protobuf/protobuf/import_tracker.go | 50 + .../cmd/go-to-protobuf/protobuf/namer.go | 208 ++ .../cmd/go-to-protobuf/protobuf/namer_test.go | 50 + .../cmd/go-to-protobuf/protobuf/package.go | 215 ++ .../cmd/go-to-protobuf/protobuf/parser.go | 464 +++ .../go-to-protobuf/protobuf/parser_test.go | 121 + .../cmd/go-to-protobuf/protobuf/tags.go | 33 + .../go-to-protobuf/protoc-gen-gogo/main.go | 32 + cmd/code-generator/cmd/import-boss/.gitignore | 1 + cmd/code-generator/cmd/import-boss/README.md | 97 + cmd/code-generator/cmd/import-boss/main.go | 49 + .../cmd/informer-gen/args/args.go | 83 + .../cmd/informer-gen/generators/factory.go | 258 ++ .../generators/factoryinterface.go | 90 + .../cmd/informer-gen/generators/generic.go | 184 ++ .../informer-gen/generators/groupinterface.go | 118 + .../cmd/informer-gen/generators/informer.go | 186 ++ .../cmd/informer-gen/generators/packages.go | 347 +++ .../cmd/informer-gen/generators/types.go | 42 + .../generators/versioninterface.go | 109 + cmd/code-generator/cmd/informer-gen/main.go | 63 + .../cmd/lister-gen/args/args.go | 64 + .../cmd/lister-gen/generators/expansion.go | 67 + .../cmd/lister-gen/generators/lister.go | 376 +++ cmd/code-generator/cmd/lister-gen/main.go | 60 + cmd/code-generator/cmd/openapi-gen/main.go | 57 + .../cmd/prerelease-lifecycle-gen/args/args.go | 52 + .../cmd/prerelease-lifecycle-gen/main.go | 74 + .../prerelease-lifecycle-generators/status.go | 499 +++ .../cmd/register-gen/args/args.go | 39 + .../cmd/register-gen/generators/packages.go | 137 + .../generators/register_external.go | 117 + cmd/code-generator/cmd/register-gen/main.go | 53 + cmd/code-generator/cmd/set-gen/.gitignore | 1 + cmd/code-generator/cmd/set-gen/main.go | 56 + cmd/code-generator/code-of-conduct.md | 3 + cmd/code-generator/generate-groups.sh | 95 + .../generate-internal-groups.sh | 122 + cmd/code-generator/go.mod | 24 + cmd/code-generator/go.sum | 140 + cmd/code-generator/hack/boilerplate.go.txt | 16 + cmd/code-generator/hack/update-codegen.sh | 47 + cmd/code-generator/hack/verify-codegen.sh | 55 + cmd/code-generator/pkg/namer/tag-override.go | 58 + cmd/code-generator/pkg/util/build.go | 69 + .../pkg/util/plural_exceptions.go | 37 + .../third_party/forked/golang/reflect/type.go | 91 + cmd/code-generator/tools.go | 35 + hack/generate.sh | 1 - 333 files changed, 31970 insertions(+), 4 deletions(-) delete mode 160000 cmd/code-generator create mode 100644 cmd/code-generator/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 cmd/code-generator/CONTRIBUTING.md create mode 100644 cmd/code-generator/Godeps/Godeps.json create mode 100644 cmd/code-generator/Godeps/OWNERS create mode 100644 cmd/code-generator/Godeps/Readme create mode 100644 cmd/code-generator/LICENSE create mode 100644 cmd/code-generator/OWNERS create mode 100644 cmd/code-generator/README.md create mode 100644 cmd/code-generator/SECURITY_CONTACTS create mode 100644 cmd/code-generator/_examples/HyphenGroup/apis/example/v1/doc.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/apis/example/v1/register.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/apis/example/v1/types.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/apis/example/v1/zz_generated.deepcopy.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/apis/example/v1/zz_generated.defaults.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/clientset.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/doc.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/fake/clientset_generated.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/fake/doc.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/fake/register.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/scheme/doc.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/scheme/register.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/clustertesttype.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/doc.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/example_client.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/doc.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_example_client.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_testtype.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/generated_expansion.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/testtype.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/interface.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/v1/clustertesttype.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/v1/interface.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/v1/testtype.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/informers/externalversions/factory.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/informers/externalversions/generic.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/informers/externalversions/internalinterfaces/factory_interfaces.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/listers/example/v1/clustertesttype.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/listers/example/v1/expansion_generated.go create mode 100644 cmd/code-generator/_examples/HyphenGroup/listers/example/v1/testtype.go create mode 100644 cmd/code-generator/_examples/MixedCase/apis/example/v1/doc.go create mode 100644 cmd/code-generator/_examples/MixedCase/apis/example/v1/register.go create mode 100644 cmd/code-generator/_examples/MixedCase/apis/example/v1/types.go create mode 100644 cmd/code-generator/_examples/MixedCase/apis/example/v1/zz_generated.deepcopy.go create mode 100644 cmd/code-generator/_examples/MixedCase/apis/example/v1/zz_generated.defaults.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/clientset.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/doc.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/fake/clientset_generated.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/fake/doc.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/fake/register.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/scheme/doc.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/scheme/register.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/doc.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/example_client.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/doc.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_example_client.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_testtype.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/generated_expansion.go create mode 100644 cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go create mode 100644 cmd/code-generator/_examples/MixedCase/informers/externalversions/example/interface.go create mode 100644 cmd/code-generator/_examples/MixedCase/informers/externalversions/example/v1/clustertesttype.go create mode 100644 cmd/code-generator/_examples/MixedCase/informers/externalversions/example/v1/interface.go create mode 100644 cmd/code-generator/_examples/MixedCase/informers/externalversions/example/v1/testtype.go create mode 100644 cmd/code-generator/_examples/MixedCase/informers/externalversions/factory.go create mode 100644 cmd/code-generator/_examples/MixedCase/informers/externalversions/generic.go create mode 100644 cmd/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces/factory_interfaces.go create mode 100644 cmd/code-generator/_examples/MixedCase/listers/example/v1/clustertesttype.go create mode 100644 cmd/code-generator/_examples/MixedCase/listers/example/v1/expansion_generated.go create mode 100644 cmd/code-generator/_examples/MixedCase/listers/example/v1/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example/install/install.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example/register.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example/types.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example/v1/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example/v1/register.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example/v1/types.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversion.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example/v1/zz_generated.deepcopy.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example/v1/zz_generated.defaults.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example/zz_generated.deepcopy.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example2/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example2/install/install.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example2/register.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example2/types.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example2/v1/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example2/v1/register.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example2/v1/types.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.conversion.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.deepcopy.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.defaults.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example2/zz_generated.deepcopy.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example3.io/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example3.io/install/install.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example3.io/register.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example3.io/types.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example3.io/v1/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example3.io/v1/register.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example3.io/v1/types.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example3.io/v1/zz_generated.conversion.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example3.io/v1/zz_generated.deepcopy.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example3.io/v1/zz_generated.defaults.go create mode 100644 cmd/code-generator/_examples/apiserver/apis/example3.io/zz_generated.deepcopy.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/clientset.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/fake/clientset_generated.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/fake/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/fake/register.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/scheme/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/scheme/register.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/example_client.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_example_client.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/generated_expansion.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/example2_client.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_example2_client.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/generated_expansion.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/example3.io_client.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/fake_example3.io_client.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/fake_testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/generated_expansion.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/clientset.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/fake/clientset_generated.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/fake/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/fake/register.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/scheme/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/scheme/register.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/example_client.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_example_client.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/generated_expansion.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/example2_client.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/generated_expansion.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/example3.io_client.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/doc.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/fake_example3.io_client.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/fake_testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/generated_expansion.go create mode 100644 cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/externalversions/example/interface.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/externalversions/example/v1/interface.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/externalversions/example/v1/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/externalversions/example2/interface.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/externalversions/example2/v1/interface.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/externalversions/example2/v1/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/externalversions/example3.io/interface.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/externalversions/example3.io/v1/interface.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/externalversions/example3.io/v1/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/externalversions/factory.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/externalversions/generic.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces/factory_interfaces.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/internalversion/example/interface.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/interface.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/internalversion/example2/interface.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/interface.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/internalversion/example3.io/interface.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/internalversion/example3.io/internalversion/interface.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/internalversion/example3.io/internalversion/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/internalversion/factory.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/internalversion/generic.go create mode 100644 cmd/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces/factory_interfaces.go create mode 100644 cmd/code-generator/_examples/apiserver/listers/example/internalversion/expansion_generated.go create mode 100644 cmd/code-generator/_examples/apiserver/listers/example/internalversion/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/listers/example/v1/expansion_generated.go create mode 100644 cmd/code-generator/_examples/apiserver/listers/example/v1/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/listers/example2/internalversion/expansion_generated.go create mode 100644 cmd/code-generator/_examples/apiserver/listers/example2/internalversion/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/listers/example2/v1/expansion_generated.go create mode 100644 cmd/code-generator/_examples/apiserver/listers/example2/v1/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/listers/example3.io/internalversion/expansion_generated.go create mode 100644 cmd/code-generator/_examples/apiserver/listers/example3.io/internalversion/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/listers/example3.io/v1/expansion_generated.go create mode 100644 cmd/code-generator/_examples/apiserver/listers/example3.io/v1/testtype.go create mode 100644 cmd/code-generator/_examples/apiserver/openapi/zz_generated.openapi.go create mode 100644 cmd/code-generator/_examples/crd/apis/example/v1/doc.go create mode 100644 cmd/code-generator/_examples/crd/apis/example/v1/register.go create mode 100644 cmd/code-generator/_examples/crd/apis/example/v1/types.go create mode 100644 cmd/code-generator/_examples/crd/apis/example/v1/zz_generated.deepcopy.go create mode 100644 cmd/code-generator/_examples/crd/apis/example/v1/zz_generated.defaults.go create mode 100644 cmd/code-generator/_examples/crd/apis/example2/v1/doc.go create mode 100644 cmd/code-generator/_examples/crd/apis/example2/v1/register.go create mode 100644 cmd/code-generator/_examples/crd/apis/example2/v1/types.go create mode 100644 cmd/code-generator/_examples/crd/apis/example2/v1/zz_generated.deepcopy.go create mode 100644 cmd/code-generator/_examples/crd/apis/example2/v1/zz_generated.defaults.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/clientset.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/doc.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/fake/clientset_generated.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/fake/doc.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/fake/register.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/scheme/doc.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/scheme/register.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/doc.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/example_client.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/doc.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_example_client.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/generated_expansion.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/doc.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/example2_client.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/doc.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/generated_expansion.go create mode 100644 cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go create mode 100644 cmd/code-generator/_examples/crd/informers/externalversions/example/interface.go create mode 100644 cmd/code-generator/_examples/crd/informers/externalversions/example/v1/clustertesttype.go create mode 100644 cmd/code-generator/_examples/crd/informers/externalversions/example/v1/interface.go create mode 100644 cmd/code-generator/_examples/crd/informers/externalversions/example/v1/testtype.go create mode 100644 cmd/code-generator/_examples/crd/informers/externalversions/example2/interface.go create mode 100644 cmd/code-generator/_examples/crd/informers/externalversions/example2/v1/interface.go create mode 100644 cmd/code-generator/_examples/crd/informers/externalversions/example2/v1/testtype.go create mode 100644 cmd/code-generator/_examples/crd/informers/externalversions/factory.go create mode 100644 cmd/code-generator/_examples/crd/informers/externalversions/generic.go create mode 100644 cmd/code-generator/_examples/crd/informers/externalversions/internalinterfaces/factory_interfaces.go create mode 100644 cmd/code-generator/_examples/crd/listers/example/v1/clustertesttype.go create mode 100644 cmd/code-generator/_examples/crd/listers/example/v1/expansion_generated.go create mode 100644 cmd/code-generator/_examples/crd/listers/example/v1/testtype.go create mode 100644 cmd/code-generator/_examples/crd/listers/example2/v1/expansion_generated.go create mode 100644 cmd/code-generator/_examples/crd/listers/example2/v1/testtype.go create mode 100644 cmd/code-generator/cmd/client-gen/OWNERS create mode 100644 cmd/code-generator/cmd/client-gen/README.md create mode 100644 cmd/code-generator/cmd/client-gen/args/args.go create mode 100644 cmd/code-generator/cmd/client-gen/args/gvpackages.go create mode 100644 cmd/code-generator/cmd/client-gen/args/gvpackages_test.go create mode 100644 cmd/code-generator/cmd/client-gen/args/gvtype.go create mode 100644 cmd/code-generator/cmd/client-gen/generators/client_generator.go create mode 100644 cmd/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go create mode 100644 cmd/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go create mode 100644 cmd/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go create mode 100644 cmd/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go create mode 100644 cmd/code-generator/cmd/client-gen/generators/generator_for_clientset.go create mode 100644 cmd/code-generator/cmd/client-gen/generators/generator_for_expansion.go create mode 100644 cmd/code-generator/cmd/client-gen/generators/generator_for_group.go create mode 100644 cmd/code-generator/cmd/client-gen/generators/generator_for_type.go create mode 100644 cmd/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go create mode 100644 cmd/code-generator/cmd/client-gen/generators/util/tags.go create mode 100644 cmd/code-generator/cmd/client-gen/generators/util/tags_test.go create mode 100644 cmd/code-generator/cmd/client-gen/main.go create mode 100644 cmd/code-generator/cmd/client-gen/path/path.go create mode 100644 cmd/code-generator/cmd/client-gen/types/helpers.go create mode 100644 cmd/code-generator/cmd/client-gen/types/helpers_test.go create mode 100644 cmd/code-generator/cmd/client-gen/types/types.go create mode 100644 cmd/code-generator/cmd/conversion-gen/args/args.go create mode 100644 cmd/code-generator/cmd/conversion-gen/generators/conversion.go create mode 100644 cmd/code-generator/cmd/conversion-gen/main.go create mode 100644 cmd/code-generator/cmd/deepcopy-gen/args/args.go create mode 100644 cmd/code-generator/cmd/deepcopy-gen/main.go create mode 100644 cmd/code-generator/cmd/defaulter-gen/args/args.go create mode 100644 cmd/code-generator/cmd/defaulter-gen/main.go create mode 100644 cmd/code-generator/cmd/go-to-protobuf/.gitignore create mode 100644 cmd/code-generator/cmd/go-to-protobuf/OWNERS create mode 100644 cmd/code-generator/cmd/go-to-protobuf/main.go create mode 100644 cmd/code-generator/cmd/go-to-protobuf/protobuf/cmd.go create mode 100644 cmd/code-generator/cmd/go-to-protobuf/protobuf/cmd_test.go create mode 100644 cmd/code-generator/cmd/go-to-protobuf/protobuf/generator.go create mode 100644 cmd/code-generator/cmd/go-to-protobuf/protobuf/import_tracker.go create mode 100644 cmd/code-generator/cmd/go-to-protobuf/protobuf/namer.go create mode 100644 cmd/code-generator/cmd/go-to-protobuf/protobuf/namer_test.go create mode 100644 cmd/code-generator/cmd/go-to-protobuf/protobuf/package.go create mode 100644 cmd/code-generator/cmd/go-to-protobuf/protobuf/parser.go create mode 100644 cmd/code-generator/cmd/go-to-protobuf/protobuf/parser_test.go create mode 100644 cmd/code-generator/cmd/go-to-protobuf/protobuf/tags.go create mode 100644 cmd/code-generator/cmd/go-to-protobuf/protoc-gen-gogo/main.go create mode 100644 cmd/code-generator/cmd/import-boss/.gitignore create mode 100644 cmd/code-generator/cmd/import-boss/README.md create mode 100644 cmd/code-generator/cmd/import-boss/main.go create mode 100644 cmd/code-generator/cmd/informer-gen/args/args.go create mode 100644 cmd/code-generator/cmd/informer-gen/generators/factory.go create mode 100644 cmd/code-generator/cmd/informer-gen/generators/factoryinterface.go create mode 100644 cmd/code-generator/cmd/informer-gen/generators/generic.go create mode 100644 cmd/code-generator/cmd/informer-gen/generators/groupinterface.go create mode 100644 cmd/code-generator/cmd/informer-gen/generators/informer.go create mode 100644 cmd/code-generator/cmd/informer-gen/generators/packages.go create mode 100644 cmd/code-generator/cmd/informer-gen/generators/types.go create mode 100644 cmd/code-generator/cmd/informer-gen/generators/versioninterface.go create mode 100644 cmd/code-generator/cmd/informer-gen/main.go create mode 100644 cmd/code-generator/cmd/lister-gen/args/args.go create mode 100644 cmd/code-generator/cmd/lister-gen/generators/expansion.go create mode 100644 cmd/code-generator/cmd/lister-gen/generators/lister.go create mode 100644 cmd/code-generator/cmd/lister-gen/main.go create mode 100644 cmd/code-generator/cmd/openapi-gen/main.go create mode 100644 cmd/code-generator/cmd/prerelease-lifecycle-gen/args/args.go create mode 100644 cmd/code-generator/cmd/prerelease-lifecycle-gen/main.go create mode 100644 cmd/code-generator/cmd/prerelease-lifecycle-gen/prerelease-lifecycle-generators/status.go create mode 100644 cmd/code-generator/cmd/register-gen/args/args.go create mode 100644 cmd/code-generator/cmd/register-gen/generators/packages.go create mode 100644 cmd/code-generator/cmd/register-gen/generators/register_external.go create mode 100644 cmd/code-generator/cmd/register-gen/main.go create mode 100644 cmd/code-generator/cmd/set-gen/.gitignore create mode 100644 cmd/code-generator/cmd/set-gen/main.go create mode 100644 cmd/code-generator/code-of-conduct.md create mode 100755 cmd/code-generator/generate-groups.sh create mode 100755 cmd/code-generator/generate-internal-groups.sh create mode 100644 cmd/code-generator/go.mod create mode 100644 cmd/code-generator/go.sum create mode 100644 cmd/code-generator/hack/boilerplate.go.txt create mode 100755 cmd/code-generator/hack/update-codegen.sh create mode 100755 cmd/code-generator/hack/verify-codegen.sh create mode 100644 cmd/code-generator/pkg/namer/tag-override.go create mode 100644 cmd/code-generator/pkg/util/build.go create mode 100644 cmd/code-generator/pkg/util/plural_exceptions.go create mode 100644 cmd/code-generator/third_party/forked/golang/reflect/type.go create mode 100644 cmd/code-generator/tools.go diff --git a/README.md b/README.md index 77a5906..4c5d7e0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,11 @@ # jx-api +[![Documentation](https://godoc.org/github.com/jenkins-x/jx-api?status.svg)](https://pkg.go.dev/mod/github.com/jenkins-x/jx-api) +[![Go Report Card](https://goreportcard.com/badge/github.com/jenkins-x/jx-api)](https://goreportcard.com/report/github.com/jenkins-x/jx-api) +[![Releases](https://img.shields.io/github/release-pre/jenkins-x/jx-api.svg)](https://github.com/jenkins-x/jx-api/releases) +[![LICENSE](https://img.shields.io/github/license/jenkins-x/jx-api.svg)](https://github.com/jenkins-x/jx-api/blob/master/LICENSE) +[![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://slack.k8s.io/) + Provides an API for JX, can be used with [Jenkins X Kube Client](https://github.com/jenkins-x/jx-kube-client) to create a programatic interface diff --git a/cmd/README.md b/cmd/README.md index 3ab037c..fccbd46 100644 --- a/cmd/README.md +++ b/cmd/README.md @@ -1,3 +1,3 @@ -The code-generator dir in this folder is a clone from https://github.com/kubernetes/code-generator +The code-generator dir in this folder is a copy from https://github.com/kubernetes/code-generator -Then removed the git details from that repo `git rm --cached cmd/code-generator` \ No newline at end of file +Note code-generator is not a clone as we couldn't get gitsubmodules playing nice with the ./hack/generate.sh step in CI diff --git a/cmd/code-generator b/cmd/code-generator deleted file mode 160000 index 4116974..0000000 --- a/cmd/code-generator +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4116974d9b4427d8809e90e2cef0eb0c0e076190 diff --git a/cmd/code-generator/.github/PULL_REQUEST_TEMPLATE.md b/cmd/code-generator/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..e7e5eb8 --- /dev/null +++ b/cmd/code-generator/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,2 @@ +Sorry, we do not accept changes directly against this repository. Please see +CONTRIBUTING.md for information on where and how to contribute instead. diff --git a/cmd/code-generator/CONTRIBUTING.md b/cmd/code-generator/CONTRIBUTING.md new file mode 100644 index 0000000..76625b7 --- /dev/null +++ b/cmd/code-generator/CONTRIBUTING.md @@ -0,0 +1,7 @@ +# Contributing guidelines + +Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes. + +This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/code-generator](https://git.k8s.io/kubernetes/staging/src/k8s.io/code-generator) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). + +Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/sig-architecture/staging.md) for more information diff --git a/cmd/code-generator/Godeps/Godeps.json b/cmd/code-generator/Godeps/Godeps.json new file mode 100644 index 0000000..fbbe93e --- /dev/null +++ b/cmd/code-generator/Godeps/Godeps.json @@ -0,0 +1,206 @@ +{ + "ImportPath": "k8s.io/code-generator", + "GoVersion": "unknown", + "GodepVersion": "gen-godeps", + "Packages": [ + "./..." + ], + "Deps": [ + { + "ImportPath": "github.com/NYTimes/gziphandler", + "Rev": "56545f4a5d46" + }, + { + "ImportPath": "github.com/PuerkitoBio/purell", + "Rev": "v1.1.1" + }, + { + "ImportPath": "github.com/PuerkitoBio/urlesc", + "Rev": "de5bf2ad4578" + }, + { + "ImportPath": "github.com/davecgh/go-spew", + "Rev": "v1.1.1" + }, + { + "ImportPath": "github.com/docopt/docopt-go", + "Rev": "ee0de3bc6815" + }, + { + "ImportPath": "github.com/emicklei/go-restful", + "Rev": "v2.9.5" + }, + { + "ImportPath": "github.com/ghodss/yaml", + "Rev": "73d445a93680" + }, + { + "ImportPath": "github.com/go-logr/logr", + "Rev": "v0.2.0" + }, + { + "ImportPath": "github.com/go-openapi/jsonpointer", + "Rev": "v0.19.3" + }, + { + "ImportPath": "github.com/go-openapi/jsonreference", + "Rev": "v0.19.3" + }, + { + "ImportPath": "github.com/go-openapi/spec", + "Rev": "v0.19.3" + }, + { + "ImportPath": "github.com/go-openapi/swag", + "Rev": "v0.19.5" + }, + { + "ImportPath": "github.com/gogo/protobuf", + "Rev": "v1.3.1" + }, + { + "ImportPath": "github.com/golang/protobuf", + "Rev": "v1.3.3" + }, + { + "ImportPath": "github.com/google/go-cmp", + "Rev": "v0.4.0" + }, + { + "ImportPath": "github.com/google/gofuzz", + "Rev": "v1.0.0" + }, + { + "ImportPath": "github.com/googleapis/gnostic", + "Rev": "v0.4.1" + }, + { + "ImportPath": "github.com/json-iterator/go", + "Rev": "v1.1.10" + }, + { + "ImportPath": "github.com/kisielk/errcheck", + "Rev": "v1.2.0" + }, + { + "ImportPath": "github.com/kisielk/gotool", + "Rev": "v1.0.0" + }, + { + "ImportPath": "github.com/kr/pretty", + "Rev": "v0.2.0" + }, + { + "ImportPath": "github.com/kr/pty", + "Rev": "v1.1.5" + }, + { + "ImportPath": "github.com/kr/text", + "Rev": "v0.1.0" + }, + { + "ImportPath": "github.com/mailru/easyjson", + "Rev": "v0.7.0" + }, + { + "ImportPath": "github.com/modern-go/concurrent", + "Rev": "bacd9c7ef1dd" + }, + { + "ImportPath": "github.com/modern-go/reflect2", + "Rev": "v1.0.1" + }, + { + "ImportPath": "github.com/munnerz/goautoneg", + "Rev": "a547fc61f48d" + }, + { + "ImportPath": "github.com/onsi/ginkgo", + "Rev": "11459a886d9c" + }, + { + "ImportPath": "github.com/onsi/gomega", + "Rev": "dcabb60a477c" + }, + { + "ImportPath": "github.com/pmezard/go-difflib", + "Rev": "v1.0.0" + }, + { + "ImportPath": "github.com/spf13/pflag", + "Rev": "v1.0.5" + }, + { + "ImportPath": "github.com/stretchr/objx", + "Rev": "v0.2.0" + }, + { + "ImportPath": "github.com/stretchr/testify", + "Rev": "v1.4.0" + }, + { + "ImportPath": "github.com/yuin/goldmark", + "Rev": "v1.1.27" + }, + { + "ImportPath": "golang.org/x/crypto", + "Rev": "75b288015ac9" + }, + { + "ImportPath": "golang.org/x/mod", + "Rev": "v0.3.0" + }, + { + "ImportPath": "golang.org/x/net", + "Rev": "ab3426394381" + }, + { + "ImportPath": "golang.org/x/sync", + "Rev": "cd5d95a43a6e" + }, + { + "ImportPath": "golang.org/x/sys", + "Rev": "85ca7c5b95cd" + }, + { + "ImportPath": "golang.org/x/text", + "Rev": "v0.3.3" + }, + { + "ImportPath": "golang.org/x/tools", + "Rev": "c1934b75d054" + }, + { + "ImportPath": "golang.org/x/xerrors", + "Rev": "9bdfabe68543" + }, + { + "ImportPath": "gopkg.in/check.v1", + "Rev": "41f04d3bba15" + }, + { + "ImportPath": "gopkg.in/yaml.v2", + "Rev": "v2.2.8" + }, + { + "ImportPath": "k8s.io/gengo", + "Rev": "8167cfdcfc14" + }, + { + "ImportPath": "k8s.io/klog/v2", + "Rev": "v2.2.0" + }, + { + "ImportPath": "k8s.io/kube-openapi", + "Rev": "6aeccd4b50c6" + }, + { + "ImportPath": "sigs.k8s.io/structured-merge-diff/v4", + "Rev": "v4.0.1" + }, + { + "ImportPath": "sigs.k8s.io/yaml", + "Rev": "v1.2.0" + } + ] +} \ No newline at end of file diff --git a/cmd/code-generator/Godeps/OWNERS b/cmd/code-generator/Godeps/OWNERS new file mode 100644 index 0000000..0f5d2f6 --- /dev/null +++ b/cmd/code-generator/Godeps/OWNERS @@ -0,0 +1,4 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: +- dep-approvers diff --git a/cmd/code-generator/Godeps/Readme b/cmd/code-generator/Godeps/Readme new file mode 100644 index 0000000..4cdaa53 --- /dev/null +++ b/cmd/code-generator/Godeps/Readme @@ -0,0 +1,5 @@ +This directory tree is generated automatically by godep. + +Please do not edit. + +See https://github.com/tools/godep for more information. diff --git a/cmd/code-generator/LICENSE b/cmd/code-generator/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/cmd/code-generator/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/cmd/code-generator/OWNERS b/cmd/code-generator/OWNERS new file mode 100644 index 0000000..6f7abe3 --- /dev/null +++ b/cmd/code-generator/OWNERS @@ -0,0 +1,13 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: +- lavalamp +- wojtek-t +- sttts +reviewers: +- lavalamp +- wojtek-t +- sttts +labels: +- sig/api-machinery +- area/code-generation diff --git a/cmd/code-generator/README.md b/cmd/code-generator/README.md new file mode 100644 index 0000000..e03c6bf --- /dev/null +++ b/cmd/code-generator/README.md @@ -0,0 +1,24 @@ +# code-generator + +Golang code-generators used to implement [Kubernetes-style API types](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md). + +## Purpose + +These code-generators can be used +- in the context of [CustomResourceDefinition](https://kubernetes.io/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/) to build native, versioned clients, + informers and other helpers +- in the context of [User-provider API Servers](https://github.com/kubernetes/apiserver) to build conversions between internal and versioned types, defaulters, protobuf codecs, + internal and versioned clients and informers. + +## Resources +- The example [sample controller](https://github.com/kubernetes/sample-controller) shows a code example of a controller that uses the clients, listers and informers generated by this library. +- The article [Kubernetes Deep Dive: Code Generation for CustomResources](https://blog.openshift.com/kubernetes-deep-dive-code-generation-customresources/) gives a step by step instruction on how to use this library. + +## Compatibility + +HEAD of this repo will match HEAD of k8s.io/apiserver, k8s.io/apimachinery, and k8s.io/client-go. + +## Where does it come from? + +`code-generator` is synced from https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/code-generator. +Code changes are made in that location, merged into `k8s.io/kubernetes` and later synced here. diff --git a/cmd/code-generator/SECURITY_CONTACTS b/cmd/code-generator/SECURITY_CONTACTS new file mode 100644 index 0000000..f600398 --- /dev/null +++ b/cmd/code-generator/SECURITY_CONTACTS @@ -0,0 +1,16 @@ +# Defined below are the security contacts for this repo. +# +# They are the contact point for the Product Security Committee to reach out +# to for triaging and handling of incoming issues. +# +# The below names agree to abide by the +# [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy) +# and will be removed and replaced if they violate that agreement. +# +# DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE +# INSTRUCTIONS AT https://kubernetes.io/security/ + +cheftako +deads2k +lavalamp +sttts diff --git a/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/doc.go b/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/doc.go new file mode 100644 index 0000000..aab826f --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/doc.go @@ -0,0 +1,21 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package +// +k8s:defaulter-gen=TypeMeta +// +groupName=example-group.hyphens.code-generator.k8s.io +// +groupGoName=ExampleGroup +package v1 diff --git a/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/register.go b/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/register.go new file mode 100644 index 0000000..3c837ae --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/register.go @@ -0,0 +1,59 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var SchemeGroupVersion = schema.GroupVersion{Group: "example-group.hyphens.code-generator.k8s.io", Version: "v1"} + +var ( + // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// Adds the list of known types to the given scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &TestType{}, + &TestTypeList{}, + ) + + scheme.AddKnownTypes(SchemeGroupVersion, + &metav1.Status{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/types.go b/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/types.go new file mode 100644 index 0000000..3c97c31 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/types.go @@ -0,0 +1,74 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestType is a top-level type. A client is created for it. +type TestType struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + // +optional + Status TestTypeStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestTypeList is a top-level list type. The client methods for lists are automatically created. +// You are not supposed to create a separated client for this one. +type TestTypeList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + + Items []TestType `json:"items"` +} + +type TestTypeStatus struct { + Blah string +} + +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type ClusterTestTypeList struct { + metav1.TypeMeta + metav1.ListMeta + Items []ClusterTestType +} + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale +// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale + +type ClusterTestType struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + // +optional + Status ClusterTestTypeStatus `json:"status,omitempty"` +} + +type ClusterTestTypeStatus struct { + Blah string +} diff --git a/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/zz_generated.deepcopy.go b/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/zz_generated.deepcopy.go new file mode 100644 index 0000000..9f55a39 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/zz_generated.deepcopy.go @@ -0,0 +1,177 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterTestType) DeepCopyInto(out *ClusterTestType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTestType. +func (in *ClusterTestType) DeepCopy() *ClusterTestType { + if in == nil { + return nil + } + out := new(ClusterTestType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterTestType) 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 *ClusterTestTypeList) DeepCopyInto(out *ClusterTestTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterTestType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTestTypeList. +func (in *ClusterTestTypeList) DeepCopy() *ClusterTestTypeList { + if in == nil { + return nil + } + out := new(ClusterTestTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterTestTypeList) 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 *ClusterTestTypeStatus) DeepCopyInto(out *ClusterTestTypeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTestTypeStatus. +func (in *ClusterTestTypeStatus) DeepCopy() *ClusterTestTypeStatus { + if in == nil { + return nil + } + out := new(ClusterTestTypeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TestType) DeepCopyInto(out *TestType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestType. +func (in *TestType) DeepCopy() *TestType { + if in == nil { + return nil + } + out := new(TestType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestType) 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 *TestTypeList) DeepCopyInto(out *TestTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TestType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeList. +func (in *TestTypeList) DeepCopy() *TestTypeList { + if in == nil { + return nil + } + out := new(TestTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestTypeList) 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 *TestTypeStatus) DeepCopyInto(out *TestTypeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeStatus. +func (in *TestTypeStatus) DeepCopy() *TestTypeStatus { + if in == nil { + return nil + } + out := new(TestTypeStatus) + in.DeepCopyInto(out) + return out +} diff --git a/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/zz_generated.defaults.go b/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/zz_generated.defaults.go new file mode 100644 index 0000000..cce2e60 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/apis/example/v1/zz_generated.defaults.go @@ -0,0 +1,32 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + return nil +} diff --git a/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/clientset.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/clientset.go new file mode 100644 index 0000000..87379ad --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/clientset.go @@ -0,0 +1,97 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" + examplegroupv1 "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + ExampleGroupV1() examplegroupv1.ExampleGroupV1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + exampleGroupV1 *examplegroupv1.ExampleGroupV1Client +} + +// ExampleGroupV1 retrieves the ExampleGroupV1Client +func (c *Clientset) ExampleGroupV1() examplegroupv1.ExampleGroupV1Interface { + return c.exampleGroupV1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + 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. +func NewForConfig(c *rest.Config) (*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.exampleGroupV1, err = examplegroupv1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + 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 { + var cs Clientset + cs.exampleGroupV1 = examplegroupv1.NewForConfigOrDie(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) + return &cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.exampleGroupV1 = examplegroupv1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/doc.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/doc.go new file mode 100644 index 0000000..41721ca --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/fake/clientset_generated.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000..707555b --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,82 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" + clientset "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned" + examplegroupv1 "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1" + fakeexamplegroupv1 "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake" +) + +// 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 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) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + 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.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var _ clientset.Interface = &Clientset{} + +// ExampleGroupV1 retrieves the ExampleGroupV1Client +func (c *Clientset) ExampleGroupV1() examplegroupv1.ExampleGroupV1Interface { + return &fakeexamplegroupv1.FakeExampleGroupV1{Fake: &c.Fake} +} diff --git a/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/fake/doc.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/fake/doc.go new file mode 100644 index 0000000..9b99e71 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/fake/register.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/fake/register.go new file mode 100644 index 0000000..1afbf7f --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/fake/register.go @@ -0,0 +1,56 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + 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" + examplegroupv1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + examplegroupv1.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/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/scheme/doc.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/scheme/doc.go new file mode 100644 index 0000000..7dc3756 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/scheme/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/scheme/register.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/scheme/register.go new file mode 100644 index 0000000..beee862 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/scheme/register.go @@ -0,0 +1,56 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + 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" + examplegroupv1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + examplegroupv1.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/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/clustertesttype.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/clustertesttype.go new file mode 100644 index 0000000..7d2b150 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/clustertesttype.go @@ -0,0 +1,215 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + autoscalingv1 "k8s.io/api/autoscaling/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1" + scheme "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/scheme" +) + +// ClusterTestTypesGetter has a method to return a ClusterTestTypeInterface. +// A group's client should implement this interface. +type ClusterTestTypesGetter interface { + ClusterTestTypes() ClusterTestTypeInterface +} + +// ClusterTestTypeInterface has methods to work with ClusterTestType resources. +type ClusterTestTypeInterface interface { + Create(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.CreateOptions) (*v1.ClusterTestType, error) + Update(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (*v1.ClusterTestType, error) + UpdateStatus(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (*v1.ClusterTestType, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterTestType, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterTestTypeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterTestType, err error) + GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) + UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) + + ClusterTestTypeExpansion +} + +// clusterTestTypes implements ClusterTestTypeInterface +type clusterTestTypes struct { + client rest.Interface +} + +// newClusterTestTypes returns a ClusterTestTypes +func newClusterTestTypes(c *ExampleGroupV1Client) *clusterTestTypes { + return &clusterTestTypes{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterTestType, and returns the corresponding clusterTestType object, and an error if there is any. +func (c *clusterTestTypes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Get(). + Resource("clustertesttypes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterTestTypes that match those selectors. +func (c *clusterTestTypes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterTestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ClusterTestTypeList{} + err = c.client.Get(). + Resource("clustertesttypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterTestTypes. +func (c *clusterTestTypes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("clustertesttypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterTestType and creates it. Returns the server's representation of the clusterTestType, and an error, if there is any. +func (c *clusterTestTypes) Create(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.CreateOptions) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Post(). + Resource("clustertesttypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTestType). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterTestType and updates it. Returns the server's representation of the clusterTestType, and an error, if there is any. +func (c *clusterTestTypes) Update(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Put(). + Resource("clustertesttypes"). + Name(clusterTestType.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTestType). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *clusterTestTypes) UpdateStatus(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Put(). + Resource("clustertesttypes"). + Name(clusterTestType.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTestType). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. +func (c *clusterTestTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("clustertesttypes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterTestTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clustertesttypes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterTestType. +func (c *clusterTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Patch(pt). + Resource("clustertesttypes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// GetScale takes name of the clusterTestType, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. +func (c *clusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { + result = &autoscalingv1.Scale{} + err = c.client.Get(). + Resource("clustertesttypes"). + Name(clusterTestTypeName). + SubResource("scale"). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. +func (c *clusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { + result = &autoscalingv1.Scale{} + err = c.client.Put(). + Resource("clustertesttypes"). + Name(clusterTestTypeName). + SubResource("scale"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(scale). + Do(ctx). + Into(result) + return +} diff --git a/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/doc.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/doc.go new file mode 100644 index 0000000..3af5d05 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/example_client.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/example_client.go new file mode 100644 index 0000000..7ca85cc --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/example_client.go @@ -0,0 +1,94 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1" + "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/scheme" +) + +type ExampleGroupV1Interface interface { + RESTClient() rest.Interface + ClusterTestTypesGetter + TestTypesGetter +} + +// ExampleGroupV1Client is used to interact with features provided by the example-group.hyphens.code-generator.k8s.io group. +type ExampleGroupV1Client struct { + restClient rest.Interface +} + +func (c *ExampleGroupV1Client) ClusterTestTypes() ClusterTestTypeInterface { + return newClusterTestTypes(c) +} + +func (c *ExampleGroupV1Client) TestTypes(namespace string) TestTypeInterface { + return newTestTypes(c, namespace) +} + +// NewForConfig creates a new ExampleGroupV1Client for the given config. +func NewForConfig(c *rest.Config) (*ExampleGroupV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &ExampleGroupV1Client{client}, nil +} + +// NewForConfigOrDie creates a new ExampleGroupV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ExampleGroupV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ExampleGroupV1Client for the given RESTClient. +func New(c rest.Interface) *ExampleGroupV1Client { + return &ExampleGroupV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ExampleGroupV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/doc.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/doc.go new file mode 100644 index 0000000..16f4439 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go new file mode 100644 index 0000000..497d266 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go @@ -0,0 +1,154 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + autoscalingv1 "k8s.io/api/autoscaling/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + examplev1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1" +) + +// FakeClusterTestTypes implements ClusterTestTypeInterface +type FakeClusterTestTypes struct { + Fake *FakeExampleGroupV1 +} + +var clustertesttypesResource = schema.GroupVersionResource{Group: "example-group.hyphens.code-generator.k8s.io", Version: "v1", Resource: "clustertesttypes"} + +var clustertesttypesKind = schema.GroupVersionKind{Group: "example-group.hyphens.code-generator.k8s.io", Version: "v1", Kind: "ClusterTestType"} + +// Get takes name of the clusterTestType, and returns the corresponding clusterTestType object, and an error if there is any. +func (c *FakeClusterTestTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *examplev1.ClusterTestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clustertesttypesResource, name), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// List takes label and field selectors, and returns the list of ClusterTestTypes that match those selectors. +func (c *FakeClusterTestTypes) List(ctx context.Context, opts v1.ListOptions) (result *examplev1.ClusterTestTypeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clustertesttypesResource, clustertesttypesKind, opts), &examplev1.ClusterTestTypeList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &examplev1.ClusterTestTypeList{ListMeta: obj.(*examplev1.ClusterTestTypeList).ListMeta} + for _, item := range obj.(*examplev1.ClusterTestTypeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested clusterTestTypes. +func (c *FakeClusterTestTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clustertesttypesResource, opts)) +} + +// Create takes the representation of a clusterTestType and creates it. Returns the server's representation of the clusterTestType, and an error, if there is any. +func (c *FakeClusterTestTypes) Create(ctx context.Context, clusterTestType *examplev1.ClusterTestType, opts v1.CreateOptions) (result *examplev1.ClusterTestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clustertesttypesResource, clusterTestType), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// Update takes the representation of a clusterTestType and updates it. Returns the server's representation of the clusterTestType, and an error, if there is any. +func (c *FakeClusterTestTypes) Update(ctx context.Context, clusterTestType *examplev1.ClusterTestType, opts v1.UpdateOptions) (result *examplev1.ClusterTestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clustertesttypesResource, clusterTestType), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterTestTypes) UpdateStatus(ctx context.Context, clusterTestType *examplev1.ClusterTestType, opts v1.UpdateOptions) (*examplev1.ClusterTestType, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "status", clusterTestType), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. +func (c *FakeClusterTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(clustertesttypesResource, name), &examplev1.ClusterTestType{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clustertesttypesResource, listOpts) + + _, err := c.Fake.Invokes(action, &examplev1.ClusterTestTypeList{}) + return err +} + +// Patch applies the patch and returns the patched clusterTestType. +func (c *FakeClusterTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *examplev1.ClusterTestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clustertesttypesResource, name, pt, data, subresources...), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// GetScale takes name of the clusterTestType, and returns the corresponding scale object, and an error if there is any. +func (c *FakeClusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetSubresourceAction(clustertesttypesResource, "scale", clusterTestTypeName), &autoscalingv1.Scale{}) + if obj == nil { + return nil, err + } + return obj.(*autoscalingv1.Scale), err +} + +// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. +func (c *FakeClusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts v1.UpdateOptions) (result *autoscalingv1.Scale, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "scale", scale), &autoscalingv1.Scale{}) + if obj == nil { + return nil, err + } + return obj.(*autoscalingv1.Scale), err +} diff --git a/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_example_client.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_example_client.go new file mode 100644 index 0000000..ed30caa --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_example_client.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1 "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1" +) + +type FakeExampleGroupV1 struct { + *testing.Fake +} + +func (c *FakeExampleGroupV1) ClusterTestTypes() v1.ClusterTestTypeInterface { + return &FakeClusterTestTypes{c} +} + +func (c *FakeExampleGroupV1) TestTypes(namespace string) v1.TestTypeInterface { + return &FakeTestTypes{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeExampleGroupV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_testtype.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_testtype.go new file mode 100644 index 0000000..d910dd3 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/fake/fake_testtype.go @@ -0,0 +1,142 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + examplev1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1" +) + +// FakeTestTypes implements TestTypeInterface +type FakeTestTypes struct { + Fake *FakeExampleGroupV1 + ns string +} + +var testtypesResource = schema.GroupVersionResource{Group: "example-group.hyphens.code-generator.k8s.io", Version: "v1", Resource: "testtypes"} + +var testtypesKind = schema.GroupVersionKind{Group: "example-group.hyphens.code-generator.k8s.io", Version: "v1", Kind: "TestType"} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *FakeTestTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *FakeTestTypes) List(ctx context.Context, opts v1.ListOptions) (result *examplev1.TestTypeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &examplev1.TestTypeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &examplev1.TestTypeList{ListMeta: obj.(*examplev1.TestTypeList).ListMeta} + for _, item := range obj.(*examplev1.TestTypeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *FakeTestTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(testtypesResource, c.ns, opts)) + +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Create(ctx context.Context, testType *examplev1.TestType, opts v1.CreateOptions) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Update(ctx context.Context, testType *examplev1.TestType, opts v1.UpdateOptions) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *examplev1.TestType, opts v1.UpdateOptions) (*examplev1.TestType, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &examplev1.TestType{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &examplev1.TestTypeList{}) + return err +} + +// Patch applies the patch and returns the patched testType. +func (c *FakeTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} diff --git a/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/generated_expansion.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/generated_expansion.go new file mode 100644 index 0000000..3059734 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/generated_expansion.go @@ -0,0 +1,23 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type ClusterTestTypeExpansion interface{} + +type TestTypeExpansion interface{} diff --git a/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/testtype.go b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/testtype.go new file mode 100644 index 0000000..798c1f3 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/clientset/versioned/typed/example/v1/testtype.go @@ -0,0 +1,195 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1" + scheme "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned/scheme" +) + +// TestTypesGetter has a method to return a TestTypeInterface. +// A group's client should implement this interface. +type TestTypesGetter interface { + TestTypes(namespace string) TestTypeInterface +} + +// TestTypeInterface has methods to work with TestType resources. +type TestTypeInterface interface { + Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (*v1.TestType, error) + Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) + UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TestType, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TestTypeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TestType, err error) + TestTypeExpansion +} + +// testTypes implements TestTypeInterface +type testTypes struct { + client rest.Interface + ns string +} + +// newTestTypes returns a TestTypes +func newTestTypes(c *ExampleGroupV1Client, namespace string) *testTypes { + return &testTypes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *testTypes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *testTypes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.TestTypeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *testTypes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Post(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *testTypes) UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *testTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *testTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched testType. +func (c *testTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/interface.go b/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/interface.go new file mode 100644 index 0000000..35869dc --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/interface.go @@ -0,0 +1,46 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package example + +import ( + v1 "k8s.io/code-generator/_examples/HyphenGroup/informers/externalversions/example/v1" + internalinterfaces "k8s.io/code-generator/_examples/HyphenGroup/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/v1/clustertesttype.go b/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/v1/clustertesttype.go new file mode 100644 index 0000000..ddd960f --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/v1/clustertesttype.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + examplev1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1" + versioned "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned" + internalinterfaces "k8s.io/code-generator/_examples/HyphenGroup/informers/externalversions/internalinterfaces" + v1 "k8s.io/code-generator/_examples/HyphenGroup/listers/example/v1" +) + +// ClusterTestTypeInformer provides access to a shared informer and lister for +// ClusterTestTypes. +type ClusterTestTypeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ClusterTestTypeLister +} + +type clusterTestTypeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewClusterTestTypeInformer constructs a new informer for ClusterTestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewClusterTestTypeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterTestTypeInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredClusterTestTypeInformer constructs a new informer for ClusterTestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredClusterTestTypeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExampleGroupV1().ClusterTestTypes().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExampleGroupV1().ClusterTestTypes().Watch(context.TODO(), options) + }, + }, + &examplev1.ClusterTestType{}, + resyncPeriod, + indexers, + ) +} + +func (f *clusterTestTypeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterTestTypeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *clusterTestTypeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&examplev1.ClusterTestType{}, f.defaultInformer) +} + +func (f *clusterTestTypeInformer) Lister() v1.ClusterTestTypeLister { + return v1.NewClusterTestTypeLister(f.Informer().GetIndexer()) +} diff --git a/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/v1/interface.go b/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/v1/interface.go new file mode 100644 index 0000000..51b5142 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/v1/interface.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "k8s.io/code-generator/_examples/HyphenGroup/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // ClusterTestTypes returns a ClusterTestTypeInformer. + ClusterTestTypes() ClusterTestTypeInformer + // TestTypes returns a TestTypeInformer. + TestTypes() TestTypeInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// ClusterTestTypes returns a ClusterTestTypeInformer. +func (v *version) ClusterTestTypes() ClusterTestTypeInformer { + return &clusterTestTypeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// TestTypes returns a TestTypeInformer. +func (v *version) TestTypes() TestTypeInformer { + return &testTypeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/v1/testtype.go b/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/v1/testtype.go new file mode 100644 index 0000000..ab9ca41 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/example/v1/testtype.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + examplev1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1" + versioned "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned" + internalinterfaces "k8s.io/code-generator/_examples/HyphenGroup/informers/externalversions/internalinterfaces" + v1 "k8s.io/code-generator/_examples/HyphenGroup/listers/example/v1" +) + +// TestTypeInformer provides access to a shared informer and lister for +// TestTypes. +type TestTypeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.TestTypeLister +} + +type testTypeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExampleGroupV1().TestTypes(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExampleGroupV1().TestTypes(namespace).Watch(context.TODO(), options) + }, + }, + &examplev1.TestType{}, + resyncPeriod, + indexers, + ) +} + +func (f *testTypeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *testTypeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&examplev1.TestType{}, f.defaultInformer) +} + +func (f *testTypeInformer) Lister() v1.TestTypeLister { + return v1.NewTestTypeLister(f.Informer().GetIndexer()) +} diff --git a/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/factory.go b/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/factory.go new file mode 100644 index 0000000..6c81c79 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/factory.go @@ -0,0 +1,180 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + versioned "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned" + example "k8s.io/code-generator/_examples/HyphenGroup/informers/externalversions/example" + internalinterfaces "k8s.io/code-generator/_examples/HyphenGroup/informers/externalversions/internalinterfaces" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + customResync map[reflect.Type]time.Duration + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +// Start initializes all requested informers. +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + go informer.Run(stopCh) + f.startedInformers[informerType] = true + } + } +} + +// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + ExampleGroup() example.Interface +} + +func (f *sharedInformerFactory) ExampleGroup() example.Interface { + return example.New(f, f.namespace, f.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/generic.go b/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/generic.go new file mode 100644 index 0000000..540e507 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/generic.go @@ -0,0 +1,64 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + "fmt" + + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + v1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=example-group.hyphens.code-generator.k8s.io, Version=v1 + case v1.SchemeGroupVersion.WithResource("clustertesttypes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.ExampleGroup().V1().ClusterTestTypes().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("testtypes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.ExampleGroup().V1().TestTypes().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/internalinterfaces/factory_interfaces.go b/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 0000000..0b111ed --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" + versioned "k8s.io/code-generator/_examples/HyphenGroup/clientset/versioned" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/cmd/code-generator/_examples/HyphenGroup/listers/example/v1/clustertesttype.go b/cmd/code-generator/_examples/HyphenGroup/listers/example/v1/clustertesttype.go new file mode 100644 index 0000000..192f76f --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/listers/example/v1/clustertesttype.go @@ -0,0 +1,68 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1" +) + +// ClusterTestTypeLister helps list ClusterTestTypes. +// All objects returned here must be treated as read-only. +type ClusterTestTypeLister interface { + // List lists all ClusterTestTypes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ClusterTestType, err error) + // Get retrieves the ClusterTestType from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ClusterTestType, error) + ClusterTestTypeListerExpansion +} + +// clusterTestTypeLister implements the ClusterTestTypeLister interface. +type clusterTestTypeLister struct { + indexer cache.Indexer +} + +// NewClusterTestTypeLister returns a new ClusterTestTypeLister. +func NewClusterTestTypeLister(indexer cache.Indexer) ClusterTestTypeLister { + return &clusterTestTypeLister{indexer: indexer} +} + +// List lists all ClusterTestTypes in the indexer. +func (s *clusterTestTypeLister) List(selector labels.Selector) (ret []*v1.ClusterTestType, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ClusterTestType)) + }) + return ret, err +} + +// Get retrieves the ClusterTestType from the index for a given name. +func (s *clusterTestTypeLister) Get(name string) (*v1.ClusterTestType, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("clustertesttype"), name) + } + return obj.(*v1.ClusterTestType), nil +} diff --git a/cmd/code-generator/_examples/HyphenGroup/listers/example/v1/expansion_generated.go b/cmd/code-generator/_examples/HyphenGroup/listers/example/v1/expansion_generated.go new file mode 100644 index 0000000..2681a29 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/listers/example/v1/expansion_generated.go @@ -0,0 +1,31 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +// ClusterTestTypeListerExpansion allows custom methods to be added to +// ClusterTestTypeLister. +type ClusterTestTypeListerExpansion interface{} + +// TestTypeListerExpansion allows custom methods to be added to +// TestTypeLister. +type TestTypeListerExpansion interface{} + +// TestTypeNamespaceListerExpansion allows custom methods to be added to +// TestTypeNamespaceLister. +type TestTypeNamespaceListerExpansion interface{} diff --git a/cmd/code-generator/_examples/HyphenGroup/listers/example/v1/testtype.go b/cmd/code-generator/_examples/HyphenGroup/listers/example/v1/testtype.go new file mode 100644 index 0000000..65fac06 --- /dev/null +++ b/cmd/code-generator/_examples/HyphenGroup/listers/example/v1/testtype.go @@ -0,0 +1,99 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1 "k8s.io/code-generator/_examples/HyphenGroup/apis/example/v1" +) + +// TestTypeLister helps list TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeLister interface { + // List lists all TestTypes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TestType, err error) + // TestTypes returns an object that can list and get TestTypes. + TestTypes(namespace string) TestTypeNamespaceLister + TestTypeListerExpansion +} + +// testTypeLister implements the TestTypeLister interface. +type testTypeLister struct { + indexer cache.Indexer +} + +// NewTestTypeLister returns a new TestTypeLister. +func NewTestTypeLister(indexer cache.Indexer) TestTypeLister { + return &testTypeLister{indexer: indexer} +} + +// List lists all TestTypes in the indexer. +func (s *testTypeLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TestType)) + }) + return ret, err +} + +// TestTypes returns an object that can list and get TestTypes. +func (s *testTypeLister) TestTypes(namespace string) TestTypeNamespaceLister { + return testTypeNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// TestTypeNamespaceLister helps list and get TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeNamespaceLister interface { + // List lists all TestTypes in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TestType, err error) + // Get retrieves the TestType from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.TestType, error) + TestTypeNamespaceListerExpansion +} + +// testTypeNamespaceLister implements the TestTypeNamespaceLister +// interface. +type testTypeNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all TestTypes in the indexer for a given namespace. +func (s testTypeNamespaceLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TestType)) + }) + return ret, err +} + +// Get retrieves the TestType from the indexer for a given namespace and name. +func (s testTypeNamespaceLister) Get(name string) (*v1.TestType, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("testtype"), name) + } + return obj.(*v1.TestType), nil +} diff --git a/cmd/code-generator/_examples/MixedCase/apis/example/v1/doc.go b/cmd/code-generator/_examples/MixedCase/apis/example/v1/doc.go new file mode 100644 index 0000000..e6614c0 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/apis/example/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package +// +k8s:defaulter-gen=TypeMeta +// +groupName=example.crd.code-generator.k8s.io +package v1 diff --git a/cmd/code-generator/_examples/MixedCase/apis/example/v1/register.go b/cmd/code-generator/_examples/MixedCase/apis/example/v1/register.go new file mode 100644 index 0000000..58371e0 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/apis/example/v1/register.go @@ -0,0 +1,59 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var SchemeGroupVersion = schema.GroupVersion{Group: "example.crd.code-generator.k8s.io", Version: "v1"} + +var ( + // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// Adds the list of known types to the given scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &TestType{}, + &TestTypeList{}, + ) + + scheme.AddKnownTypes(SchemeGroupVersion, + &metav1.Status{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/cmd/code-generator/_examples/MixedCase/apis/example/v1/types.go b/cmd/code-generator/_examples/MixedCase/apis/example/v1/types.go new file mode 100644 index 0000000..8543ad2 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/apis/example/v1/types.go @@ -0,0 +1,74 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestType is a top-level type. A client is created for it. +type TestType struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + // +optional + Status TestTypeStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestTypeList is a top-level list type. The client methods for lists are automatically created. +// You are not supposed to create a separated client for this one. +type TestTypeList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + + Items []TestType `json:"items"` +} + +type TestTypeStatus struct { + Blah string +} + +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type ClusterTestTypeList struct { + metav1.TypeMeta + metav1.ListMeta + Items []ClusterTestType +} + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale +// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale + +type ClusterTestType struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + // +optional + Status ClusterTestTypeStatus `json:"status,omitempty"` +} + +type ClusterTestTypeStatus struct { + Blah string +} diff --git a/cmd/code-generator/_examples/MixedCase/apis/example/v1/zz_generated.deepcopy.go b/cmd/code-generator/_examples/MixedCase/apis/example/v1/zz_generated.deepcopy.go new file mode 100644 index 0000000..9f55a39 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/apis/example/v1/zz_generated.deepcopy.go @@ -0,0 +1,177 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterTestType) DeepCopyInto(out *ClusterTestType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTestType. +func (in *ClusterTestType) DeepCopy() *ClusterTestType { + if in == nil { + return nil + } + out := new(ClusterTestType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterTestType) 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 *ClusterTestTypeList) DeepCopyInto(out *ClusterTestTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterTestType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTestTypeList. +func (in *ClusterTestTypeList) DeepCopy() *ClusterTestTypeList { + if in == nil { + return nil + } + out := new(ClusterTestTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterTestTypeList) 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 *ClusterTestTypeStatus) DeepCopyInto(out *ClusterTestTypeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTestTypeStatus. +func (in *ClusterTestTypeStatus) DeepCopy() *ClusterTestTypeStatus { + if in == nil { + return nil + } + out := new(ClusterTestTypeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TestType) DeepCopyInto(out *TestType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestType. +func (in *TestType) DeepCopy() *TestType { + if in == nil { + return nil + } + out := new(TestType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestType) 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 *TestTypeList) DeepCopyInto(out *TestTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TestType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeList. +func (in *TestTypeList) DeepCopy() *TestTypeList { + if in == nil { + return nil + } + out := new(TestTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestTypeList) 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 *TestTypeStatus) DeepCopyInto(out *TestTypeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeStatus. +func (in *TestTypeStatus) DeepCopy() *TestTypeStatus { + if in == nil { + return nil + } + out := new(TestTypeStatus) + in.DeepCopyInto(out) + return out +} diff --git a/cmd/code-generator/_examples/MixedCase/apis/example/v1/zz_generated.defaults.go b/cmd/code-generator/_examples/MixedCase/apis/example/v1/zz_generated.defaults.go new file mode 100644 index 0000000..cce2e60 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/apis/example/v1/zz_generated.defaults.go @@ -0,0 +1,32 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + return nil +} diff --git a/cmd/code-generator/_examples/MixedCase/clientset/versioned/clientset.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/clientset.go new file mode 100644 index 0000000..768dfed --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/clientset.go @@ -0,0 +1,97 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" + examplev1 "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + ExampleV1() examplev1.ExampleV1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + exampleV1 *examplev1.ExampleV1Client +} + +// ExampleV1 retrieves the ExampleV1Client +func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface { + return c.exampleV1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + 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. +func NewForConfig(c *rest.Config) (*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.exampleV1, err = examplev1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + 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 { + var cs Clientset + cs.exampleV1 = examplev1.NewForConfigOrDie(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) + return &cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.exampleV1 = examplev1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/cmd/code-generator/_examples/MixedCase/clientset/versioned/doc.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/doc.go new file mode 100644 index 0000000..41721ca --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/cmd/code-generator/_examples/MixedCase/clientset/versioned/fake/clientset_generated.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000..d52d4be --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,82 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" + clientset "k8s.io/code-generator/_examples/MixedCase/clientset/versioned" + examplev1 "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1" + fakeexamplev1 "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake" +) + +// 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 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) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + 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.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var _ clientset.Interface = &Clientset{} + +// ExampleV1 retrieves the ExampleV1Client +func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface { + return &fakeexamplev1.FakeExampleV1{Fake: &c.Fake} +} diff --git a/cmd/code-generator/_examples/MixedCase/clientset/versioned/fake/doc.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/fake/doc.go new file mode 100644 index 0000000..9b99e71 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/cmd/code-generator/_examples/MixedCase/clientset/versioned/fake/register.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/fake/register.go new file mode 100644 index 0000000..88fa1be --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/fake/register.go @@ -0,0 +1,56 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + 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" + examplev1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + examplev1.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/cmd/code-generator/_examples/MixedCase/clientset/versioned/scheme/doc.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/scheme/doc.go new file mode 100644 index 0000000..7dc3756 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/scheme/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/cmd/code-generator/_examples/MixedCase/clientset/versioned/scheme/register.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/scheme/register.go new file mode 100644 index 0000000..2cf84f8 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/scheme/register.go @@ -0,0 +1,56 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + 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" + examplev1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + examplev1.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/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go new file mode 100644 index 0000000..824501d --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/clustertesttype.go @@ -0,0 +1,215 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + autoscalingv1 "k8s.io/api/autoscaling/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" + scheme "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/scheme" +) + +// ClusterTestTypesGetter has a method to return a ClusterTestTypeInterface. +// A group's client should implement this interface. +type ClusterTestTypesGetter interface { + ClusterTestTypes() ClusterTestTypeInterface +} + +// ClusterTestTypeInterface has methods to work with ClusterTestType resources. +type ClusterTestTypeInterface interface { + Create(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.CreateOptions) (*v1.ClusterTestType, error) + Update(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (*v1.ClusterTestType, error) + UpdateStatus(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (*v1.ClusterTestType, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterTestType, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterTestTypeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterTestType, err error) + GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) + UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) + + ClusterTestTypeExpansion +} + +// clusterTestTypes implements ClusterTestTypeInterface +type clusterTestTypes struct { + client rest.Interface +} + +// newClusterTestTypes returns a ClusterTestTypes +func newClusterTestTypes(c *ExampleV1Client) *clusterTestTypes { + return &clusterTestTypes{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterTestType, and returns the corresponding clusterTestType object, and an error if there is any. +func (c *clusterTestTypes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Get(). + Resource("clustertesttypes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterTestTypes that match those selectors. +func (c *clusterTestTypes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterTestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ClusterTestTypeList{} + err = c.client.Get(). + Resource("clustertesttypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterTestTypes. +func (c *clusterTestTypes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("clustertesttypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterTestType and creates it. Returns the server's representation of the clusterTestType, and an error, if there is any. +func (c *clusterTestTypes) Create(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.CreateOptions) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Post(). + Resource("clustertesttypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTestType). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterTestType and updates it. Returns the server's representation of the clusterTestType, and an error, if there is any. +func (c *clusterTestTypes) Update(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Put(). + Resource("clustertesttypes"). + Name(clusterTestType.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTestType). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *clusterTestTypes) UpdateStatus(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Put(). + Resource("clustertesttypes"). + Name(clusterTestType.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTestType). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. +func (c *clusterTestTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("clustertesttypes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterTestTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clustertesttypes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterTestType. +func (c *clusterTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Patch(pt). + Resource("clustertesttypes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// GetScale takes name of the clusterTestType, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. +func (c *clusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { + result = &autoscalingv1.Scale{} + err = c.client.Get(). + Resource("clustertesttypes"). + Name(clusterTestTypeName). + SubResource("scale"). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. +func (c *clusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { + result = &autoscalingv1.Scale{} + err = c.client.Put(). + Resource("clustertesttypes"). + Name(clusterTestTypeName). + SubResource("scale"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(scale). + Do(ctx). + Into(result) + return +} diff --git a/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/doc.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/doc.go new file mode 100644 index 0000000..3af5d05 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/example_client.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/example_client.go new file mode 100644 index 0000000..e9ba435 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/example_client.go @@ -0,0 +1,94 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" + "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/scheme" +) + +type ExampleV1Interface interface { + RESTClient() rest.Interface + ClusterTestTypesGetter + TestTypesGetter +} + +// ExampleV1Client is used to interact with features provided by the example.crd.code-generator.k8s.io group. +type ExampleV1Client struct { + restClient rest.Interface +} + +func (c *ExampleV1Client) ClusterTestTypes() ClusterTestTypeInterface { + return newClusterTestTypes(c) +} + +func (c *ExampleV1Client) TestTypes(namespace string) TestTypeInterface { + return newTestTypes(c, namespace) +} + +// NewForConfig creates a new ExampleV1Client for the given config. +func NewForConfig(c *rest.Config) (*ExampleV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &ExampleV1Client{client}, nil +} + +// NewForConfigOrDie creates a new ExampleV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ExampleV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ExampleV1Client for the given RESTClient. +func New(c rest.Interface) *ExampleV1Client { + return &ExampleV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ExampleV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/doc.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/doc.go new file mode 100644 index 0000000..16f4439 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go new file mode 100644 index 0000000..669c97c --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go @@ -0,0 +1,154 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + autoscalingv1 "k8s.io/api/autoscaling/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + examplev1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" +) + +// FakeClusterTestTypes implements ClusterTestTypeInterface +type FakeClusterTestTypes struct { + Fake *FakeExampleV1 +} + +var clustertesttypesResource = schema.GroupVersionResource{Group: "example.crd.code-generator.k8s.io", Version: "v1", Resource: "clustertesttypes"} + +var clustertesttypesKind = schema.GroupVersionKind{Group: "example.crd.code-generator.k8s.io", Version: "v1", Kind: "ClusterTestType"} + +// Get takes name of the clusterTestType, and returns the corresponding clusterTestType object, and an error if there is any. +func (c *FakeClusterTestTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *examplev1.ClusterTestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clustertesttypesResource, name), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// List takes label and field selectors, and returns the list of ClusterTestTypes that match those selectors. +func (c *FakeClusterTestTypes) List(ctx context.Context, opts v1.ListOptions) (result *examplev1.ClusterTestTypeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clustertesttypesResource, clustertesttypesKind, opts), &examplev1.ClusterTestTypeList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &examplev1.ClusterTestTypeList{ListMeta: obj.(*examplev1.ClusterTestTypeList).ListMeta} + for _, item := range obj.(*examplev1.ClusterTestTypeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested clusterTestTypes. +func (c *FakeClusterTestTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clustertesttypesResource, opts)) +} + +// Create takes the representation of a clusterTestType and creates it. Returns the server's representation of the clusterTestType, and an error, if there is any. +func (c *FakeClusterTestTypes) Create(ctx context.Context, clusterTestType *examplev1.ClusterTestType, opts v1.CreateOptions) (result *examplev1.ClusterTestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clustertesttypesResource, clusterTestType), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// Update takes the representation of a clusterTestType and updates it. Returns the server's representation of the clusterTestType, and an error, if there is any. +func (c *FakeClusterTestTypes) Update(ctx context.Context, clusterTestType *examplev1.ClusterTestType, opts v1.UpdateOptions) (result *examplev1.ClusterTestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clustertesttypesResource, clusterTestType), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterTestTypes) UpdateStatus(ctx context.Context, clusterTestType *examplev1.ClusterTestType, opts v1.UpdateOptions) (*examplev1.ClusterTestType, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "status", clusterTestType), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. +func (c *FakeClusterTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(clustertesttypesResource, name), &examplev1.ClusterTestType{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clustertesttypesResource, listOpts) + + _, err := c.Fake.Invokes(action, &examplev1.ClusterTestTypeList{}) + return err +} + +// Patch applies the patch and returns the patched clusterTestType. +func (c *FakeClusterTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *examplev1.ClusterTestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clustertesttypesResource, name, pt, data, subresources...), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// GetScale takes name of the clusterTestType, and returns the corresponding scale object, and an error if there is any. +func (c *FakeClusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetSubresourceAction(clustertesttypesResource, "scale", clusterTestTypeName), &autoscalingv1.Scale{}) + if obj == nil { + return nil, err + } + return obj.(*autoscalingv1.Scale), err +} + +// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. +func (c *FakeClusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts v1.UpdateOptions) (result *autoscalingv1.Scale, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "scale", scale), &autoscalingv1.Scale{}) + if obj == nil { + return nil, err + } + return obj.(*autoscalingv1.Scale), err +} diff --git a/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_example_client.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_example_client.go new file mode 100644 index 0000000..265930a --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_example_client.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1 "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1" +) + +type FakeExampleV1 struct { + *testing.Fake +} + +func (c *FakeExampleV1) ClusterTestTypes() v1.ClusterTestTypeInterface { + return &FakeClusterTestTypes{c} +} + +func (c *FakeExampleV1) TestTypes(namespace string) v1.TestTypeInterface { + return &FakeTestTypes{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeExampleV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_testtype.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_testtype.go new file mode 100644 index 0000000..c1b550b --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/fake/fake_testtype.go @@ -0,0 +1,142 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + examplev1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" +) + +// FakeTestTypes implements TestTypeInterface +type FakeTestTypes struct { + Fake *FakeExampleV1 + ns string +} + +var testtypesResource = schema.GroupVersionResource{Group: "example.crd.code-generator.k8s.io", Version: "v1", Resource: "testtypes"} + +var testtypesKind = schema.GroupVersionKind{Group: "example.crd.code-generator.k8s.io", Version: "v1", Kind: "TestType"} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *FakeTestTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *FakeTestTypes) List(ctx context.Context, opts v1.ListOptions) (result *examplev1.TestTypeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &examplev1.TestTypeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &examplev1.TestTypeList{ListMeta: obj.(*examplev1.TestTypeList).ListMeta} + for _, item := range obj.(*examplev1.TestTypeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *FakeTestTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(testtypesResource, c.ns, opts)) + +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Create(ctx context.Context, testType *examplev1.TestType, opts v1.CreateOptions) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Update(ctx context.Context, testType *examplev1.TestType, opts v1.UpdateOptions) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *examplev1.TestType, opts v1.UpdateOptions) (*examplev1.TestType, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &examplev1.TestType{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &examplev1.TestTypeList{}) + return err +} + +// Patch applies the patch and returns the patched testType. +func (c *FakeTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} diff --git a/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/generated_expansion.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/generated_expansion.go new file mode 100644 index 0000000..3059734 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/generated_expansion.go @@ -0,0 +1,23 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type ClusterTestTypeExpansion interface{} + +type TestTypeExpansion interface{} diff --git a/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go new file mode 100644 index 0000000..56c201a --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/clientset/versioned/typed/example/v1/testtype.go @@ -0,0 +1,195 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" + scheme "k8s.io/code-generator/_examples/MixedCase/clientset/versioned/scheme" +) + +// TestTypesGetter has a method to return a TestTypeInterface. +// A group's client should implement this interface. +type TestTypesGetter interface { + TestTypes(namespace string) TestTypeInterface +} + +// TestTypeInterface has methods to work with TestType resources. +type TestTypeInterface interface { + Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (*v1.TestType, error) + Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) + UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TestType, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TestTypeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TestType, err error) + TestTypeExpansion +} + +// testTypes implements TestTypeInterface +type testTypes struct { + client rest.Interface + ns string +} + +// newTestTypes returns a TestTypes +func newTestTypes(c *ExampleV1Client, namespace string) *testTypes { + return &testTypes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *testTypes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *testTypes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.TestTypeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *testTypes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Post(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *testTypes) UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *testTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *testTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched testType. +func (c *testTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cmd/code-generator/_examples/MixedCase/informers/externalversions/example/interface.go b/cmd/code-generator/_examples/MixedCase/informers/externalversions/example/interface.go new file mode 100644 index 0000000..a874fdc --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/informers/externalversions/example/interface.go @@ -0,0 +1,46 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package example + +import ( + v1 "k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example/v1" + internalinterfaces "k8s.io/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/MixedCase/informers/externalversions/example/v1/clustertesttype.go b/cmd/code-generator/_examples/MixedCase/informers/externalversions/example/v1/clustertesttype.go new file mode 100644 index 0000000..c02987a --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/informers/externalversions/example/v1/clustertesttype.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + examplev1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" + versioned "k8s.io/code-generator/_examples/MixedCase/clientset/versioned" + internalinterfaces "k8s.io/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces" + v1 "k8s.io/code-generator/_examples/MixedCase/listers/example/v1" +) + +// ClusterTestTypeInformer provides access to a shared informer and lister for +// ClusterTestTypes. +type ClusterTestTypeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ClusterTestTypeLister +} + +type clusterTestTypeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewClusterTestTypeInformer constructs a new informer for ClusterTestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewClusterTestTypeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterTestTypeInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredClusterTestTypeInformer constructs a new informer for ClusterTestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredClusterTestTypeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExampleV1().ClusterTestTypes().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExampleV1().ClusterTestTypes().Watch(context.TODO(), options) + }, + }, + &examplev1.ClusterTestType{}, + resyncPeriod, + indexers, + ) +} + +func (f *clusterTestTypeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterTestTypeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *clusterTestTypeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&examplev1.ClusterTestType{}, f.defaultInformer) +} + +func (f *clusterTestTypeInformer) Lister() v1.ClusterTestTypeLister { + return v1.NewClusterTestTypeLister(f.Informer().GetIndexer()) +} diff --git a/cmd/code-generator/_examples/MixedCase/informers/externalversions/example/v1/interface.go b/cmd/code-generator/_examples/MixedCase/informers/externalversions/example/v1/interface.go new file mode 100644 index 0000000..5389d07 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/informers/externalversions/example/v1/interface.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "k8s.io/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // ClusterTestTypes returns a ClusterTestTypeInformer. + ClusterTestTypes() ClusterTestTypeInformer + // TestTypes returns a TestTypeInformer. + TestTypes() TestTypeInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// ClusterTestTypes returns a ClusterTestTypeInformer. +func (v *version) ClusterTestTypes() ClusterTestTypeInformer { + return &clusterTestTypeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// TestTypes returns a TestTypeInformer. +func (v *version) TestTypes() TestTypeInformer { + return &testTypeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/cmd/code-generator/_examples/MixedCase/informers/externalversions/example/v1/testtype.go b/cmd/code-generator/_examples/MixedCase/informers/externalversions/example/v1/testtype.go new file mode 100644 index 0000000..c04c465 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/informers/externalversions/example/v1/testtype.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + examplev1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" + versioned "k8s.io/code-generator/_examples/MixedCase/clientset/versioned" + internalinterfaces "k8s.io/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces" + v1 "k8s.io/code-generator/_examples/MixedCase/listers/example/v1" +) + +// TestTypeInformer provides access to a shared informer and lister for +// TestTypes. +type TestTypeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.TestTypeLister +} + +type testTypeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExampleV1().TestTypes(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExampleV1().TestTypes(namespace).Watch(context.TODO(), options) + }, + }, + &examplev1.TestType{}, + resyncPeriod, + indexers, + ) +} + +func (f *testTypeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *testTypeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&examplev1.TestType{}, f.defaultInformer) +} + +func (f *testTypeInformer) Lister() v1.TestTypeLister { + return v1.NewTestTypeLister(f.Informer().GetIndexer()) +} diff --git a/cmd/code-generator/_examples/MixedCase/informers/externalversions/factory.go b/cmd/code-generator/_examples/MixedCase/informers/externalversions/factory.go new file mode 100644 index 0000000..5a2d8f7 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/informers/externalversions/factory.go @@ -0,0 +1,180 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + versioned "k8s.io/code-generator/_examples/MixedCase/clientset/versioned" + example "k8s.io/code-generator/_examples/MixedCase/informers/externalversions/example" + internalinterfaces "k8s.io/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + customResync map[reflect.Type]time.Duration + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +// Start initializes all requested informers. +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + go informer.Run(stopCh) + f.startedInformers[informerType] = true + } + } +} + +// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + Example() example.Interface +} + +func (f *sharedInformerFactory) Example() example.Interface { + return example.New(f, f.namespace, f.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/MixedCase/informers/externalversions/generic.go b/cmd/code-generator/_examples/MixedCase/informers/externalversions/generic.go new file mode 100644 index 0000000..e039c8e --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/informers/externalversions/generic.go @@ -0,0 +1,64 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + "fmt" + + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + v1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=example.crd.code-generator.k8s.io, Version=v1 + case v1.SchemeGroupVersion.WithResource("clustertesttypes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Example().V1().ClusterTestTypes().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("testtypes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Example().V1().TestTypes().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/cmd/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces/factory_interfaces.go b/cmd/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 0000000..2ed31b4 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" + versioned "k8s.io/code-generator/_examples/MixedCase/clientset/versioned" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/cmd/code-generator/_examples/MixedCase/listers/example/v1/clustertesttype.go b/cmd/code-generator/_examples/MixedCase/listers/example/v1/clustertesttype.go new file mode 100644 index 0000000..df036af --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/listers/example/v1/clustertesttype.go @@ -0,0 +1,68 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" +) + +// ClusterTestTypeLister helps list ClusterTestTypes. +// All objects returned here must be treated as read-only. +type ClusterTestTypeLister interface { + // List lists all ClusterTestTypes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ClusterTestType, err error) + // Get retrieves the ClusterTestType from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ClusterTestType, error) + ClusterTestTypeListerExpansion +} + +// clusterTestTypeLister implements the ClusterTestTypeLister interface. +type clusterTestTypeLister struct { + indexer cache.Indexer +} + +// NewClusterTestTypeLister returns a new ClusterTestTypeLister. +func NewClusterTestTypeLister(indexer cache.Indexer) ClusterTestTypeLister { + return &clusterTestTypeLister{indexer: indexer} +} + +// List lists all ClusterTestTypes in the indexer. +func (s *clusterTestTypeLister) List(selector labels.Selector) (ret []*v1.ClusterTestType, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ClusterTestType)) + }) + return ret, err +} + +// Get retrieves the ClusterTestType from the index for a given name. +func (s *clusterTestTypeLister) Get(name string) (*v1.ClusterTestType, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("clustertesttype"), name) + } + return obj.(*v1.ClusterTestType), nil +} diff --git a/cmd/code-generator/_examples/MixedCase/listers/example/v1/expansion_generated.go b/cmd/code-generator/_examples/MixedCase/listers/example/v1/expansion_generated.go new file mode 100644 index 0000000..2681a29 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/listers/example/v1/expansion_generated.go @@ -0,0 +1,31 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +// ClusterTestTypeListerExpansion allows custom methods to be added to +// ClusterTestTypeLister. +type ClusterTestTypeListerExpansion interface{} + +// TestTypeListerExpansion allows custom methods to be added to +// TestTypeLister. +type TestTypeListerExpansion interface{} + +// TestTypeNamespaceListerExpansion allows custom methods to be added to +// TestTypeNamespaceLister. +type TestTypeNamespaceListerExpansion interface{} diff --git a/cmd/code-generator/_examples/MixedCase/listers/example/v1/testtype.go b/cmd/code-generator/_examples/MixedCase/listers/example/v1/testtype.go new file mode 100644 index 0000000..4319f55 --- /dev/null +++ b/cmd/code-generator/_examples/MixedCase/listers/example/v1/testtype.go @@ -0,0 +1,99 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1 "k8s.io/code-generator/_examples/MixedCase/apis/example/v1" +) + +// TestTypeLister helps list TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeLister interface { + // List lists all TestTypes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TestType, err error) + // TestTypes returns an object that can list and get TestTypes. + TestTypes(namespace string) TestTypeNamespaceLister + TestTypeListerExpansion +} + +// testTypeLister implements the TestTypeLister interface. +type testTypeLister struct { + indexer cache.Indexer +} + +// NewTestTypeLister returns a new TestTypeLister. +func NewTestTypeLister(indexer cache.Indexer) TestTypeLister { + return &testTypeLister{indexer: indexer} +} + +// List lists all TestTypes in the indexer. +func (s *testTypeLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TestType)) + }) + return ret, err +} + +// TestTypes returns an object that can list and get TestTypes. +func (s *testTypeLister) TestTypes(namespace string) TestTypeNamespaceLister { + return testTypeNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// TestTypeNamespaceLister helps list and get TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeNamespaceLister interface { + // List lists all TestTypes in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TestType, err error) + // Get retrieves the TestType from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.TestType, error) + TestTypeNamespaceListerExpansion +} + +// testTypeNamespaceLister implements the TestTypeNamespaceLister +// interface. +type testTypeNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all TestTypes in the indexer for a given namespace. +func (s testTypeNamespaceLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TestType)) + }) + return ret, err +} + +// Get retrieves the TestType from the indexer for a given namespace and name. +func (s testTypeNamespaceLister) Get(name string) (*v1.TestType, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("testtype"), name) + } + return obj.(*v1.TestType), nil +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example/doc.go b/cmd/code-generator/_examples/apiserver/apis/example/doc.go new file mode 100644 index 0000000..3285a05 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package +// +groupName=example.apiserver.code-generator.k8s.io + +package example // import "k8s.io/code-generator/_examples/apiserver/apis/example" diff --git a/cmd/code-generator/_examples/apiserver/apis/example/install/install.go b/cmd/code-generator/_examples/apiserver/apis/example/install/install.go new file mode 100644 index 0000000..dc99fc3 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example/install/install.go @@ -0,0 +1,34 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package install installs the experimental API group, making it available as +// an option to all of the API encoding/decoding machinery. +package install + +import ( + v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/code-generator/_examples/apiserver/apis/example" + "k8s.io/code-generator/_examples/apiserver/apis/example/v1" +) + +// Install registers the API group and adds types to a scheme +func Install(scheme *runtime.Scheme) { + utilruntime.Must(example.AddToScheme(scheme)) + utilruntime.Must(v1.AddToScheme(scheme)) + utilruntime.Must(scheme.SetVersionPriority(v1.SchemeGroupVersion)) +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example/register.go b/cmd/code-generator/_examples/apiserver/apis/example/register.go new file mode 100644 index 0000000..da397b5 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example/register.go @@ -0,0 +1,45 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package example + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var SchemeGroupVersion = schema.GroupVersion{Group: "example.api.code-generator.k8s.io", Version: runtime.APIVersionInternal} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// Adds the list of known types to the given scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &TestType{}, + &TestTypeList{}, + ) + + scheme.AddKnownTypes(SchemeGroupVersion) + return nil +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example/types.go b/cmd/code-generator/_examples/apiserver/apis/example/types.go new file mode 100644 index 0000000..b4fc976 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example/types.go @@ -0,0 +1,44 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package example + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestType is a top-level type. A client is created for it. +type TestType struct { + metav1.TypeMeta + metav1.ObjectMeta + Status TestTypeStatus +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestTypeList is a top-level list type. The client methods for lists are automatically created. +// You are not supposed to create a separated client for this one. +type TestTypeList struct { + metav1.TypeMeta + metav1.ListMeta + + Items []TestType +} + +type TestTypeStatus struct { + Blah string +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example/v1/doc.go b/cmd/code-generator/_examples/apiserver/apis/example/v1/doc.go new file mode 100644 index 0000000..12d3e45 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example/v1/doc.go @@ -0,0 +1,23 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package +// +k8s:defaulter-gen=TypeMeta +// +k8s:conversion-gen=k8s.io/code-generator/_examples/apiserver/apis/example +// +groupName=example.apiserver.code-generator.k8s.io + +package v1 diff --git a/cmd/code-generator/_examples/apiserver/apis/example/v1/register.go b/cmd/code-generator/_examples/apiserver/apis/example/v1/register.go new file mode 100644 index 0000000..c99619d --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example/v1/register.go @@ -0,0 +1,59 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var SchemeGroupVersion = schema.GroupVersion{Group: "example.apiserver.code-generator.k8s.io", Version: "v1"} + +var ( + // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// Adds the list of known types to the given scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &TestType{}, + &TestTypeList{}, + ) + + scheme.AddKnownTypes(SchemeGroupVersion, + &metav1.Status{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example/v1/types.go b/cmd/code-generator/_examples/apiserver/apis/example/v1/types.go new file mode 100644 index 0000000..5c2ebc4 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example/v1/types.go @@ -0,0 +1,47 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestType is a top-level type. A client is created for it. +type TestType struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + // +optional + Status TestTypeStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestTypeList is a top-level list type. The client methods for lists are automatically created. +// You are not supposed to create a separated client for this one. +type TestTypeList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + + Items []TestType `json:"items"` +} + +type TestTypeStatus struct { + Blah string +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversion.go b/cmd/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversion.go new file mode 100644 index 0000000..ba47dbe --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example/v1/zz_generated.conversion.go @@ -0,0 +1,137 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1 + +import ( + unsafe "unsafe" + + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + example "k8s.io/code-generator/_examples/apiserver/apis/example" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*TestType)(nil), (*example.TestType)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_TestType_To_example_TestType(a.(*TestType), b.(*example.TestType), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*example.TestType)(nil), (*TestType)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_example_TestType_To_v1_TestType(a.(*example.TestType), b.(*TestType), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*TestTypeList)(nil), (*example.TestTypeList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_TestTypeList_To_example_TestTypeList(a.(*TestTypeList), b.(*example.TestTypeList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*example.TestTypeList)(nil), (*TestTypeList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_example_TestTypeList_To_v1_TestTypeList(a.(*example.TestTypeList), b.(*TestTypeList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*TestTypeStatus)(nil), (*example.TestTypeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_TestTypeStatus_To_example_TestTypeStatus(a.(*TestTypeStatus), b.(*example.TestTypeStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*example.TestTypeStatus)(nil), (*TestTypeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_example_TestTypeStatus_To_v1_TestTypeStatus(a.(*example.TestTypeStatus), b.(*TestTypeStatus), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1_TestType_To_example_TestType(in *TestType, out *example.TestType, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1_TestTypeStatus_To_example_TestTypeStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1_TestType_To_example_TestType is an autogenerated conversion function. +func Convert_v1_TestType_To_example_TestType(in *TestType, out *example.TestType, s conversion.Scope) error { + return autoConvert_v1_TestType_To_example_TestType(in, out, s) +} + +func autoConvert_example_TestType_To_v1_TestType(in *example.TestType, out *TestType, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_example_TestTypeStatus_To_v1_TestTypeStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_example_TestType_To_v1_TestType is an autogenerated conversion function. +func Convert_example_TestType_To_v1_TestType(in *example.TestType, out *TestType, s conversion.Scope) error { + return autoConvert_example_TestType_To_v1_TestType(in, out, s) +} + +func autoConvert_v1_TestTypeList_To_example_TestTypeList(in *TestTypeList, out *example.TestTypeList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]example.TestType)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1_TestTypeList_To_example_TestTypeList is an autogenerated conversion function. +func Convert_v1_TestTypeList_To_example_TestTypeList(in *TestTypeList, out *example.TestTypeList, s conversion.Scope) error { + return autoConvert_v1_TestTypeList_To_example_TestTypeList(in, out, s) +} + +func autoConvert_example_TestTypeList_To_v1_TestTypeList(in *example.TestTypeList, out *TestTypeList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]TestType)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_example_TestTypeList_To_v1_TestTypeList is an autogenerated conversion function. +func Convert_example_TestTypeList_To_v1_TestTypeList(in *example.TestTypeList, out *TestTypeList, s conversion.Scope) error { + return autoConvert_example_TestTypeList_To_v1_TestTypeList(in, out, s) +} + +func autoConvert_v1_TestTypeStatus_To_example_TestTypeStatus(in *TestTypeStatus, out *example.TestTypeStatus, s conversion.Scope) error { + out.Blah = in.Blah + return nil +} + +// Convert_v1_TestTypeStatus_To_example_TestTypeStatus is an autogenerated conversion function. +func Convert_v1_TestTypeStatus_To_example_TestTypeStatus(in *TestTypeStatus, out *example.TestTypeStatus, s conversion.Scope) error { + return autoConvert_v1_TestTypeStatus_To_example_TestTypeStatus(in, out, s) +} + +func autoConvert_example_TestTypeStatus_To_v1_TestTypeStatus(in *example.TestTypeStatus, out *TestTypeStatus, s conversion.Scope) error { + out.Blah = in.Blah + return nil +} + +// Convert_example_TestTypeStatus_To_v1_TestTypeStatus is an autogenerated conversion function. +func Convert_example_TestTypeStatus_To_v1_TestTypeStatus(in *example.TestTypeStatus, out *TestTypeStatus, s conversion.Scope) error { + return autoConvert_example_TestTypeStatus_To_v1_TestTypeStatus(in, out, s) +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example/v1/zz_generated.deepcopy.go b/cmd/code-generator/_examples/apiserver/apis/example/v1/zz_generated.deepcopy.go new file mode 100644 index 0000000..ec5a6e9 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example/v1/zz_generated.deepcopy.go @@ -0,0 +1,101 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TestType) DeepCopyInto(out *TestType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestType. +func (in *TestType) DeepCopy() *TestType { + if in == nil { + return nil + } + out := new(TestType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestType) 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 *TestTypeList) DeepCopyInto(out *TestTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TestType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeList. +func (in *TestTypeList) DeepCopy() *TestTypeList { + if in == nil { + return nil + } + out := new(TestTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestTypeList) 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 *TestTypeStatus) DeepCopyInto(out *TestTypeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeStatus. +func (in *TestTypeStatus) DeepCopy() *TestTypeStatus { + if in == nil { + return nil + } + out := new(TestTypeStatus) + in.DeepCopyInto(out) + return out +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example/v1/zz_generated.defaults.go b/cmd/code-generator/_examples/apiserver/apis/example/v1/zz_generated.defaults.go new file mode 100644 index 0000000..cce2e60 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example/v1/zz_generated.defaults.go @@ -0,0 +1,32 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + return nil +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example/zz_generated.deepcopy.go b/cmd/code-generator/_examples/apiserver/apis/example/zz_generated.deepcopy.go new file mode 100644 index 0000000..2639b92 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example/zz_generated.deepcopy.go @@ -0,0 +1,101 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package example + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TestType) DeepCopyInto(out *TestType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestType. +func (in *TestType) DeepCopy() *TestType { + if in == nil { + return nil + } + out := new(TestType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestType) 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 *TestTypeList) DeepCopyInto(out *TestTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TestType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeList. +func (in *TestTypeList) DeepCopy() *TestTypeList { + if in == nil { + return nil + } + out := new(TestTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestTypeList) 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 *TestTypeStatus) DeepCopyInto(out *TestTypeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeStatus. +func (in *TestTypeStatus) DeepCopy() *TestTypeStatus { + if in == nil { + return nil + } + out := new(TestTypeStatus) + in.DeepCopyInto(out) + return out +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example2/doc.go b/cmd/code-generator/_examples/apiserver/apis/example2/doc.go new file mode 100644 index 0000000..0edb56d --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example2/doc.go @@ -0,0 +1,21 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package +// +groupName=example.test.apiserver.code-generator.k8s.io +// +groupGoName=SecondExample + +package example2 // import "k8s.io/code-generator/_examples/apiserver/apis/example2" diff --git a/cmd/code-generator/_examples/apiserver/apis/example2/install/install.go b/cmd/code-generator/_examples/apiserver/apis/example2/install/install.go new file mode 100644 index 0000000..d949969 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example2/install/install.go @@ -0,0 +1,34 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package install installs the experimental API group, making it available as +// an option to all of the API encoding/decoding machinery. +package install + +import ( + v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/code-generator/_examples/apiserver/apis/example2" + "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" +) + +// Install registers the API group and adds types to a scheme +func Install(scheme *runtime.Scheme) { + utilruntime.Must(example2.AddToScheme(scheme)) + utilruntime.Must(v1.AddToScheme(scheme)) + utilruntime.Must(scheme.SetVersionPriority(v1.SchemeGroupVersion)) +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example2/register.go b/cmd/code-generator/_examples/apiserver/apis/example2/register.go new file mode 100644 index 0000000..508565a --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example2/register.go @@ -0,0 +1,45 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package example2 + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var SchemeGroupVersion = schema.GroupVersion{Group: "example.test.apiserver.code-generator.k8s.io", Version: runtime.APIVersionInternal} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// Adds the list of known types to the given scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &TestType{}, + &TestTypeList{}, + ) + + scheme.AddKnownTypes(SchemeGroupVersion) + return nil +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example2/types.go b/cmd/code-generator/_examples/apiserver/apis/example2/types.go new file mode 100644 index 0000000..a23ee09 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example2/types.go @@ -0,0 +1,44 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package example2 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +genclient:nonNamespaced +// TestType is a top-level type. A client is created for it. +type TestType struct { + metav1.TypeMeta + metav1.ObjectMeta + Status TestTypeStatus +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestTypeList is a top-level list type. The client methods for lists are automatically created. +// You are not supposed to create a separated client for this one. +type TestTypeList struct { + metav1.TypeMeta + metav1.ListMeta + + Items []TestType +} + +type TestTypeStatus struct { + Blah string +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example2/v1/doc.go b/cmd/code-generator/_examples/apiserver/apis/example2/v1/doc.go new file mode 100644 index 0000000..18ff7e3 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example2/v1/doc.go @@ -0,0 +1,24 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package +// +k8s:defaulter-gen=TypeMeta +// +groupName=example.test.apiserver.code-generator.k8s.io +// +k8s:conversion-gen=k8s.io/code-generator/_examples/apiserver/apis/example2 +// +groupGoName=SecondExample + +package v1 diff --git a/cmd/code-generator/_examples/apiserver/apis/example2/v1/register.go b/cmd/code-generator/_examples/apiserver/apis/example2/v1/register.go new file mode 100644 index 0000000..19dd0c3 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example2/v1/register.go @@ -0,0 +1,59 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var SchemeGroupVersion = schema.GroupVersion{Group: "example.test.apiserver.code-generator.k8s.io", Version: "v1"} + +var ( + // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &TestType{}, + &TestTypeList{}, + ) + + scheme.AddKnownTypes(SchemeGroupVersion, + &metav1.Status{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example2/v1/types.go b/cmd/code-generator/_examples/apiserver/apis/example2/v1/types.go new file mode 100644 index 0000000..5c2ebc4 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example2/v1/types.go @@ -0,0 +1,47 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestType is a top-level type. A client is created for it. +type TestType struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + // +optional + Status TestTypeStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestTypeList is a top-level list type. The client methods for lists are automatically created. +// You are not supposed to create a separated client for this one. +type TestTypeList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + + Items []TestType `json:"items"` +} + +type TestTypeStatus struct { + Blah string +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.conversion.go b/cmd/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.conversion.go new file mode 100644 index 0000000..5bf9a98 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.conversion.go @@ -0,0 +1,137 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1 + +import ( + unsafe "unsafe" + + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + example2 "k8s.io/code-generator/_examples/apiserver/apis/example2" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*TestType)(nil), (*example2.TestType)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_TestType_To_example2_TestType(a.(*TestType), b.(*example2.TestType), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*example2.TestType)(nil), (*TestType)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_example2_TestType_To_v1_TestType(a.(*example2.TestType), b.(*TestType), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*TestTypeList)(nil), (*example2.TestTypeList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_TestTypeList_To_example2_TestTypeList(a.(*TestTypeList), b.(*example2.TestTypeList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*example2.TestTypeList)(nil), (*TestTypeList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_example2_TestTypeList_To_v1_TestTypeList(a.(*example2.TestTypeList), b.(*TestTypeList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*TestTypeStatus)(nil), (*example2.TestTypeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_TestTypeStatus_To_example2_TestTypeStatus(a.(*TestTypeStatus), b.(*example2.TestTypeStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*example2.TestTypeStatus)(nil), (*TestTypeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_example2_TestTypeStatus_To_v1_TestTypeStatus(a.(*example2.TestTypeStatus), b.(*TestTypeStatus), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1_TestType_To_example2_TestType(in *TestType, out *example2.TestType, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1_TestTypeStatus_To_example2_TestTypeStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1_TestType_To_example2_TestType is an autogenerated conversion function. +func Convert_v1_TestType_To_example2_TestType(in *TestType, out *example2.TestType, s conversion.Scope) error { + return autoConvert_v1_TestType_To_example2_TestType(in, out, s) +} + +func autoConvert_example2_TestType_To_v1_TestType(in *example2.TestType, out *TestType, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_example2_TestTypeStatus_To_v1_TestTypeStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_example2_TestType_To_v1_TestType is an autogenerated conversion function. +func Convert_example2_TestType_To_v1_TestType(in *example2.TestType, out *TestType, s conversion.Scope) error { + return autoConvert_example2_TestType_To_v1_TestType(in, out, s) +} + +func autoConvert_v1_TestTypeList_To_example2_TestTypeList(in *TestTypeList, out *example2.TestTypeList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]example2.TestType)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1_TestTypeList_To_example2_TestTypeList is an autogenerated conversion function. +func Convert_v1_TestTypeList_To_example2_TestTypeList(in *TestTypeList, out *example2.TestTypeList, s conversion.Scope) error { + return autoConvert_v1_TestTypeList_To_example2_TestTypeList(in, out, s) +} + +func autoConvert_example2_TestTypeList_To_v1_TestTypeList(in *example2.TestTypeList, out *TestTypeList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]TestType)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_example2_TestTypeList_To_v1_TestTypeList is an autogenerated conversion function. +func Convert_example2_TestTypeList_To_v1_TestTypeList(in *example2.TestTypeList, out *TestTypeList, s conversion.Scope) error { + return autoConvert_example2_TestTypeList_To_v1_TestTypeList(in, out, s) +} + +func autoConvert_v1_TestTypeStatus_To_example2_TestTypeStatus(in *TestTypeStatus, out *example2.TestTypeStatus, s conversion.Scope) error { + out.Blah = in.Blah + return nil +} + +// Convert_v1_TestTypeStatus_To_example2_TestTypeStatus is an autogenerated conversion function. +func Convert_v1_TestTypeStatus_To_example2_TestTypeStatus(in *TestTypeStatus, out *example2.TestTypeStatus, s conversion.Scope) error { + return autoConvert_v1_TestTypeStatus_To_example2_TestTypeStatus(in, out, s) +} + +func autoConvert_example2_TestTypeStatus_To_v1_TestTypeStatus(in *example2.TestTypeStatus, out *TestTypeStatus, s conversion.Scope) error { + out.Blah = in.Blah + return nil +} + +// Convert_example2_TestTypeStatus_To_v1_TestTypeStatus is an autogenerated conversion function. +func Convert_example2_TestTypeStatus_To_v1_TestTypeStatus(in *example2.TestTypeStatus, out *TestTypeStatus, s conversion.Scope) error { + return autoConvert_example2_TestTypeStatus_To_v1_TestTypeStatus(in, out, s) +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.deepcopy.go b/cmd/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.deepcopy.go new file mode 100644 index 0000000..ec5a6e9 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.deepcopy.go @@ -0,0 +1,101 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TestType) DeepCopyInto(out *TestType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestType. +func (in *TestType) DeepCopy() *TestType { + if in == nil { + return nil + } + out := new(TestType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestType) 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 *TestTypeList) DeepCopyInto(out *TestTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TestType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeList. +func (in *TestTypeList) DeepCopy() *TestTypeList { + if in == nil { + return nil + } + out := new(TestTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestTypeList) 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 *TestTypeStatus) DeepCopyInto(out *TestTypeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeStatus. +func (in *TestTypeStatus) DeepCopy() *TestTypeStatus { + if in == nil { + return nil + } + out := new(TestTypeStatus) + in.DeepCopyInto(out) + return out +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.defaults.go b/cmd/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.defaults.go new file mode 100644 index 0000000..cce2e60 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example2/v1/zz_generated.defaults.go @@ -0,0 +1,32 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + return nil +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example2/zz_generated.deepcopy.go b/cmd/code-generator/_examples/apiserver/apis/example2/zz_generated.deepcopy.go new file mode 100644 index 0000000..dbb70bc --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example2/zz_generated.deepcopy.go @@ -0,0 +1,101 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package example2 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TestType) DeepCopyInto(out *TestType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestType. +func (in *TestType) DeepCopy() *TestType { + if in == nil { + return nil + } + out := new(TestType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestType) 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 *TestTypeList) DeepCopyInto(out *TestTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TestType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeList. +func (in *TestTypeList) DeepCopy() *TestTypeList { + if in == nil { + return nil + } + out := new(TestTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestTypeList) 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 *TestTypeStatus) DeepCopyInto(out *TestTypeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeStatus. +func (in *TestTypeStatus) DeepCopy() *TestTypeStatus { + if in == nil { + return nil + } + out := new(TestTypeStatus) + in.DeepCopyInto(out) + return out +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example3.io/doc.go b/cmd/code-generator/_examples/apiserver/apis/example3.io/doc.go new file mode 100644 index 0000000..4104119 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example3.io/doc.go @@ -0,0 +1,21 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package +// +groupName=example.dots.apiserver.code-generator.k8s.io +// +groupGoName=ThirdExample + +package example3 // import "k8s.io/code-generator/_examples/apiserver/apis/example3.io" diff --git a/cmd/code-generator/_examples/apiserver/apis/example3.io/install/install.go b/cmd/code-generator/_examples/apiserver/apis/example3.io/install/install.go new file mode 100644 index 0000000..f692668 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example3.io/install/install.go @@ -0,0 +1,34 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package install installs the experimental API group, making it available as +// an option to all of the API encoding/decoding machinery. +package install + +import ( + v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + example3 "k8s.io/code-generator/_examples/apiserver/apis/example3.io" + "k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1" +) + +// Install registers the API group and adds types to a scheme +func Install(scheme *runtime.Scheme) { + utilruntime.Must(example3.AddToScheme(scheme)) + utilruntime.Must(v1.AddToScheme(scheme)) + utilruntime.Must(scheme.SetVersionPriority(v1.SchemeGroupVersion)) +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example3.io/register.go b/cmd/code-generator/_examples/apiserver/apis/example3.io/register.go new file mode 100644 index 0000000..b77b2b1 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example3.io/register.go @@ -0,0 +1,45 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package example3 + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var SchemeGroupVersion = schema.GroupVersion{Group: "example.dots.apiserver.code-generator.k8s.io", Version: runtime.APIVersionInternal} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// Adds the list of known types to the given scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &TestType{}, + &TestTypeList{}, + ) + + scheme.AddKnownTypes(SchemeGroupVersion) + return nil +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example3.io/types.go b/cmd/code-generator/_examples/apiserver/apis/example3.io/types.go new file mode 100644 index 0000000..0c49b45 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example3.io/types.go @@ -0,0 +1,44 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package example3 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestType is a top-level type. A client is created for it. +type TestType struct { + metav1.TypeMeta + metav1.ObjectMeta + Status TestTypeStatus +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestTypeList is a top-level list type. The client methods for lists are automatically created. +// You are not supposed to create a separated client for this one. +type TestTypeList struct { + metav1.TypeMeta + metav1.ListMeta + + Items []TestType +} + +type TestTypeStatus struct { + Blah string +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/doc.go b/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/doc.go new file mode 100644 index 0000000..24f3f82 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/doc.go @@ -0,0 +1,24 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package +// +k8s:defaulter-gen=TypeMeta +// +groupName=example.dots.apiserver.code-generator.k8s.io +// +k8s:conversion-gen=k8s.io/code-generator/_examples/apiserver/apis/example3.io +// +groupGoName=ThirdExample + +package v1 diff --git a/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/register.go b/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/register.go new file mode 100644 index 0000000..3e0a393 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/register.go @@ -0,0 +1,59 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var SchemeGroupVersion = schema.GroupVersion{Group: "example.dots.apiserver.code-generator.k8s.io", Version: "v1"} + +var ( + // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &TestType{}, + &TestTypeList{}, + ) + + scheme.AddKnownTypes(SchemeGroupVersion, + &metav1.Status{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/types.go b/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/types.go new file mode 100644 index 0000000..5c2ebc4 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/types.go @@ -0,0 +1,47 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestType is a top-level type. A client is created for it. +type TestType struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + // +optional + Status TestTypeStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestTypeList is a top-level list type. The client methods for lists are automatically created. +// You are not supposed to create a separated client for this one. +type TestTypeList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + + Items []TestType `json:"items"` +} + +type TestTypeStatus struct { + Blah string +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/zz_generated.conversion.go b/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/zz_generated.conversion.go new file mode 100644 index 0000000..5c65ac5 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/zz_generated.conversion.go @@ -0,0 +1,137 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1 + +import ( + unsafe "unsafe" + + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + example3io "k8s.io/code-generator/_examples/apiserver/apis/example3.io" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*TestType)(nil), (*example3io.TestType)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_TestType_To_example3io_TestType(a.(*TestType), b.(*example3io.TestType), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*example3io.TestType)(nil), (*TestType)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_example3io_TestType_To_v1_TestType(a.(*example3io.TestType), b.(*TestType), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*TestTypeList)(nil), (*example3io.TestTypeList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_TestTypeList_To_example3io_TestTypeList(a.(*TestTypeList), b.(*example3io.TestTypeList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*example3io.TestTypeList)(nil), (*TestTypeList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_example3io_TestTypeList_To_v1_TestTypeList(a.(*example3io.TestTypeList), b.(*TestTypeList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*TestTypeStatus)(nil), (*example3io.TestTypeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_TestTypeStatus_To_example3io_TestTypeStatus(a.(*TestTypeStatus), b.(*example3io.TestTypeStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*example3io.TestTypeStatus)(nil), (*TestTypeStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_example3io_TestTypeStatus_To_v1_TestTypeStatus(a.(*example3io.TestTypeStatus), b.(*TestTypeStatus), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1_TestType_To_example3io_TestType(in *TestType, out *example3io.TestType, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1_TestTypeStatus_To_example3io_TestTypeStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1_TestType_To_example3io_TestType is an autogenerated conversion function. +func Convert_v1_TestType_To_example3io_TestType(in *TestType, out *example3io.TestType, s conversion.Scope) error { + return autoConvert_v1_TestType_To_example3io_TestType(in, out, s) +} + +func autoConvert_example3io_TestType_To_v1_TestType(in *example3io.TestType, out *TestType, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_example3io_TestTypeStatus_To_v1_TestTypeStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_example3io_TestType_To_v1_TestType is an autogenerated conversion function. +func Convert_example3io_TestType_To_v1_TestType(in *example3io.TestType, out *TestType, s conversion.Scope) error { + return autoConvert_example3io_TestType_To_v1_TestType(in, out, s) +} + +func autoConvert_v1_TestTypeList_To_example3io_TestTypeList(in *TestTypeList, out *example3io.TestTypeList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]example3io.TestType)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1_TestTypeList_To_example3io_TestTypeList is an autogenerated conversion function. +func Convert_v1_TestTypeList_To_example3io_TestTypeList(in *TestTypeList, out *example3io.TestTypeList, s conversion.Scope) error { + return autoConvert_v1_TestTypeList_To_example3io_TestTypeList(in, out, s) +} + +func autoConvert_example3io_TestTypeList_To_v1_TestTypeList(in *example3io.TestTypeList, out *TestTypeList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]TestType)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_example3io_TestTypeList_To_v1_TestTypeList is an autogenerated conversion function. +func Convert_example3io_TestTypeList_To_v1_TestTypeList(in *example3io.TestTypeList, out *TestTypeList, s conversion.Scope) error { + return autoConvert_example3io_TestTypeList_To_v1_TestTypeList(in, out, s) +} + +func autoConvert_v1_TestTypeStatus_To_example3io_TestTypeStatus(in *TestTypeStatus, out *example3io.TestTypeStatus, s conversion.Scope) error { + out.Blah = in.Blah + return nil +} + +// Convert_v1_TestTypeStatus_To_example3io_TestTypeStatus is an autogenerated conversion function. +func Convert_v1_TestTypeStatus_To_example3io_TestTypeStatus(in *TestTypeStatus, out *example3io.TestTypeStatus, s conversion.Scope) error { + return autoConvert_v1_TestTypeStatus_To_example3io_TestTypeStatus(in, out, s) +} + +func autoConvert_example3io_TestTypeStatus_To_v1_TestTypeStatus(in *example3io.TestTypeStatus, out *TestTypeStatus, s conversion.Scope) error { + out.Blah = in.Blah + return nil +} + +// Convert_example3io_TestTypeStatus_To_v1_TestTypeStatus is an autogenerated conversion function. +func Convert_example3io_TestTypeStatus_To_v1_TestTypeStatus(in *example3io.TestTypeStatus, out *TestTypeStatus, s conversion.Scope) error { + return autoConvert_example3io_TestTypeStatus_To_v1_TestTypeStatus(in, out, s) +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/zz_generated.deepcopy.go b/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/zz_generated.deepcopy.go new file mode 100644 index 0000000..ec5a6e9 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/zz_generated.deepcopy.go @@ -0,0 +1,101 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TestType) DeepCopyInto(out *TestType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestType. +func (in *TestType) DeepCopy() *TestType { + if in == nil { + return nil + } + out := new(TestType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestType) 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 *TestTypeList) DeepCopyInto(out *TestTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TestType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeList. +func (in *TestTypeList) DeepCopy() *TestTypeList { + if in == nil { + return nil + } + out := new(TestTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestTypeList) 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 *TestTypeStatus) DeepCopyInto(out *TestTypeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeStatus. +func (in *TestTypeStatus) DeepCopy() *TestTypeStatus { + if in == nil { + return nil + } + out := new(TestTypeStatus) + in.DeepCopyInto(out) + return out +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/zz_generated.defaults.go b/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/zz_generated.defaults.go new file mode 100644 index 0000000..cce2e60 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example3.io/v1/zz_generated.defaults.go @@ -0,0 +1,32 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + return nil +} diff --git a/cmd/code-generator/_examples/apiserver/apis/example3.io/zz_generated.deepcopy.go b/cmd/code-generator/_examples/apiserver/apis/example3.io/zz_generated.deepcopy.go new file mode 100644 index 0000000..17f1fea --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/apis/example3.io/zz_generated.deepcopy.go @@ -0,0 +1,101 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package example3 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TestType) DeepCopyInto(out *TestType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestType. +func (in *TestType) DeepCopy() *TestType { + if in == nil { + return nil + } + out := new(TestType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestType) 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 *TestTypeList) DeepCopyInto(out *TestTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TestType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeList. +func (in *TestTypeList) DeepCopy() *TestTypeList { + if in == nil { + return nil + } + out := new(TestTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestTypeList) 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 *TestTypeStatus) DeepCopyInto(out *TestTypeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeStatus. +func (in *TestTypeStatus) DeepCopy() *TestTypeStatus { + if in == nil { + return nil + } + out := new(TestTypeStatus) + in.DeepCopyInto(out) + return out +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/clientset.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/clientset.go new file mode 100644 index 0000000..0960535 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/clientset.go @@ -0,0 +1,125 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package internalversion + +import ( + "fmt" + + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" + exampleinternalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion" + secondexampleinternalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion" + thirdexampleinternalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + Example() exampleinternalversion.ExampleInterface + SecondExample() secondexampleinternalversion.SecondExampleInterface + ThirdExample() thirdexampleinternalversion.ThirdExampleInterface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + example *exampleinternalversion.ExampleClient + secondExample *secondexampleinternalversion.SecondExampleClient + thirdExample *thirdexampleinternalversion.ThirdExampleClient +} + +// Example retrieves the ExampleClient +func (c *Clientset) Example() exampleinternalversion.ExampleInterface { + return c.example +} + +// SecondExample retrieves the SecondExampleClient +func (c *Clientset) SecondExample() secondexampleinternalversion.SecondExampleInterface { + return c.secondExample +} + +// ThirdExample retrieves the ThirdExampleClient +func (c *Clientset) ThirdExample() thirdexampleinternalversion.ThirdExampleInterface { + return c.thirdExample +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + 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. +func NewForConfig(c *rest.Config) (*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.example, err = exampleinternalversion.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + cs.secondExample, err = secondexampleinternalversion.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + cs.thirdExample, err = thirdexampleinternalversion.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + 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 { + var cs Clientset + cs.example = exampleinternalversion.NewForConfigOrDie(c) + cs.secondExample = secondexampleinternalversion.NewForConfigOrDie(c) + cs.thirdExample = thirdexampleinternalversion.NewForConfigOrDie(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) + return &cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.example = exampleinternalversion.New(c) + cs.secondExample = secondexampleinternalversion.New(c) + cs.thirdExample = thirdexampleinternalversion.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/doc.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/doc.go new file mode 100644 index 0000000..6c970b0 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package internalversion diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/fake/clientset_generated.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/fake/clientset_generated.go new file mode 100644 index 0000000..1c98e7c --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/fake/clientset_generated.go @@ -0,0 +1,96 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" + clientset "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" + exampleinternalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion" + fakeexampleinternalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake" + secondexampleinternalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion" + fakesecondexampleinternalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake" + thirdexampleinternalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion" + fakethirdexampleinternalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake" +) + +// 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 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) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + 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.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var _ clientset.Interface = &Clientset{} + +// Example retrieves the ExampleClient +func (c *Clientset) Example() exampleinternalversion.ExampleInterface { + return &fakeexampleinternalversion.FakeExample{Fake: &c.Fake} +} + +// SecondExample retrieves the SecondExampleClient +func (c *Clientset) SecondExample() secondexampleinternalversion.SecondExampleInterface { + return &fakesecondexampleinternalversion.FakeSecondExample{Fake: &c.Fake} +} + +// ThirdExample retrieves the ThirdExampleClient +func (c *Clientset) ThirdExample() thirdexampleinternalversion.ThirdExampleInterface { + return &fakethirdexampleinternalversion.FakeThirdExample{Fake: &c.Fake} +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/fake/doc.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/fake/doc.go new file mode 100644 index 0000000..9b99e71 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/fake/register.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/fake/register.go new file mode 100644 index 0000000..e82a268 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/fake/register.go @@ -0,0 +1,60 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + 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" + exampleinternalversion "k8s.io/code-generator/_examples/apiserver/apis/example" + secondexampleinternalversion "k8s.io/code-generator/_examples/apiserver/apis/example2" + thirdexampleinternalversion "k8s.io/code-generator/_examples/apiserver/apis/example3.io" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + exampleinternalversion.AddToScheme, + secondexampleinternalversion.AddToScheme, + thirdexampleinternalversion.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/cmd/code-generator/_examples/apiserver/clientset/internalversion/scheme/doc.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/scheme/doc.go new file mode 100644 index 0000000..7dc3756 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/scheme/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/scheme/register.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/scheme/register.go new file mode 100644 index 0000000..933d5ed --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/scheme/register.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + 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" + example "k8s.io/code-generator/_examples/apiserver/apis/example/install" + secondexample "k8s.io/code-generator/_examples/apiserver/apis/example2/install" + thirdexample "k8s.io/code-generator/_examples/apiserver/apis/example3.io/install" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + Install(Scheme) +} + +// Install registers the API group and adds types to a scheme +func Install(scheme *runtime.Scheme) { + example.Install(scheme) + secondexample.Install(scheme) + thirdexample.Install(scheme) +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/doc.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/doc.go new file mode 100644 index 0000000..8660244 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package internalversion diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/example_client.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/example_client.go new file mode 100644 index 0000000..61d99ca --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/example_client.go @@ -0,0 +1,96 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package internalversion + +import ( + rest "k8s.io/client-go/rest" + "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme" +) + +type ExampleInterface interface { + RESTClient() rest.Interface + TestTypesGetter +} + +// ExampleClient is used to interact with features provided by the example.apiserver.code-generator.k8s.io group. +type ExampleClient struct { + restClient rest.Interface +} + +func (c *ExampleClient) TestTypes(namespace string) TestTypeInterface { + return newTestTypes(c, namespace) +} + +// NewForConfig creates a new ExampleClient for the given config. +func NewForConfig(c *rest.Config) (*ExampleClient, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &ExampleClient{client}, nil +} + +// NewForConfigOrDie creates a new ExampleClient for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ExampleClient { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ExampleClient for the given RESTClient. +func New(c rest.Interface) *ExampleClient { + return &ExampleClient{c} +} + +func setConfigDefaults(config *rest.Config) error { + config.APIPath = "/apis" + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + if config.GroupVersion == nil || config.GroupVersion.Group != scheme.Scheme.PrioritizedVersionsForGroup("example.apiserver.code-generator.k8s.io")[0].Group { + gv := scheme.Scheme.PrioritizedVersionsForGroup("example.apiserver.code-generator.k8s.io")[0] + config.GroupVersion = &gv + } + config.NegotiatedSerializer = scheme.Codecs + + if config.QPS == 0 { + config.QPS = 5 + } + if config.Burst == 0 { + config.Burst = 10 + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ExampleClient) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/doc.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/doc.go new file mode 100644 index 0000000..16f4439 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_example_client.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_example_client.go new file mode 100644 index 0000000..90564e4 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_example_client.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + internalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion" +) + +type FakeExample struct { + *testing.Fake +} + +func (c *FakeExample) TestTypes(namespace string) internalversion.TestTypeInterface { + return &FakeTestTypes{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeExample) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go new file mode 100644 index 0000000..a0d0316 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/fake/fake_testtype.go @@ -0,0 +1,142 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + example "k8s.io/code-generator/_examples/apiserver/apis/example" +) + +// FakeTestTypes implements TestTypeInterface +type FakeTestTypes struct { + Fake *FakeExample + ns string +} + +var testtypesResource = schema.GroupVersionResource{Group: "example.apiserver.code-generator.k8s.io", Version: "", Resource: "testtypes"} + +var testtypesKind = schema.GroupVersionKind{Group: "example.apiserver.code-generator.k8s.io", Version: "", Kind: "TestType"} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *FakeTestTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *example.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &example.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example.TestType), err +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *FakeTestTypes) List(ctx context.Context, opts v1.ListOptions) (result *example.TestTypeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &example.TestTypeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &example.TestTypeList{ListMeta: obj.(*example.TestTypeList).ListMeta} + for _, item := range obj.(*example.TestTypeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *FakeTestTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(testtypesResource, c.ns, opts)) + +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Create(ctx context.Context, testType *example.TestType, opts v1.CreateOptions) (result *example.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &example.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example.TestType), err +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Update(ctx context.Context, testType *example.TestType, opts v1.UpdateOptions) (result *example.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &example.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example.TestType), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *example.TestType, opts v1.UpdateOptions) (*example.TestType, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &example.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example.TestType), err +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example.TestType{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &example.TestTypeList{}) + return err +} + +// Patch applies the patch and returns the patched testType. +func (c *FakeTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *example.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &example.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example.TestType), err +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/generated_expansion.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/generated_expansion.go new file mode 100644 index 0000000..50bdbd2 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package internalversion + +type TestTypeExpansion interface{} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go new file mode 100644 index 0000000..7237bdd --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example/internalversion/testtype.go @@ -0,0 +1,195 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package internalversion + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + example "k8s.io/code-generator/_examples/apiserver/apis/example" + scheme "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme" +) + +// TestTypesGetter has a method to return a TestTypeInterface. +// A group's client should implement this interface. +type TestTypesGetter interface { + TestTypes(namespace string) TestTypeInterface +} + +// TestTypeInterface has methods to work with TestType resources. +type TestTypeInterface interface { + Create(ctx context.Context, testType *example.TestType, opts v1.CreateOptions) (*example.TestType, error) + Update(ctx context.Context, testType *example.TestType, opts v1.UpdateOptions) (*example.TestType, error) + UpdateStatus(ctx context.Context, testType *example.TestType, opts v1.UpdateOptions) (*example.TestType, 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) (*example.TestType, error) + List(ctx context.Context, opts v1.ListOptions) (*example.TestTypeList, 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 *example.TestType, err error) + TestTypeExpansion +} + +// testTypes implements TestTypeInterface +type testTypes struct { + client rest.Interface + ns string +} + +// newTestTypes returns a TestTypes +func newTestTypes(c *ExampleClient, namespace string) *testTypes { + return &testTypes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *testTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *example.TestType, err error) { + result = &example.TestType{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *testTypes) List(ctx context.Context, opts v1.ListOptions) (result *example.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &example.TestTypeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *testTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Create(ctx context.Context, testType *example.TestType, opts v1.CreateOptions) (result *example.TestType, err error) { + result = &example.TestType{} + err = c.client.Post(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Update(ctx context.Context, testType *example.TestType, opts v1.UpdateOptions) (result *example.TestType, err error) { + result = &example.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *testTypes) UpdateStatus(ctx context.Context, testType *example.TestType, opts v1.UpdateOptions) (result *example.TestType, err error) { + result = &example.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *testTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *testTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched testType. +func (c *testTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *example.TestType, err error) { + result = &example.TestType{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/doc.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/doc.go new file mode 100644 index 0000000..8660244 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package internalversion diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/example2_client.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/example2_client.go new file mode 100644 index 0000000..69f773e --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/example2_client.go @@ -0,0 +1,96 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package internalversion + +import ( + rest "k8s.io/client-go/rest" + "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme" +) + +type SecondExampleInterface interface { + RESTClient() rest.Interface + TestTypesGetter +} + +// SecondExampleClient is used to interact with features provided by the example.test.apiserver.code-generator.k8s.io group. +type SecondExampleClient struct { + restClient rest.Interface +} + +func (c *SecondExampleClient) TestTypes() TestTypeInterface { + return newTestTypes(c) +} + +// NewForConfig creates a new SecondExampleClient for the given config. +func NewForConfig(c *rest.Config) (*SecondExampleClient, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &SecondExampleClient{client}, nil +} + +// NewForConfigOrDie creates a new SecondExampleClient for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *SecondExampleClient { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new SecondExampleClient for the given RESTClient. +func New(c rest.Interface) *SecondExampleClient { + return &SecondExampleClient{c} +} + +func setConfigDefaults(config *rest.Config) error { + config.APIPath = "/apis" + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + if config.GroupVersion == nil || config.GroupVersion.Group != scheme.Scheme.PrioritizedVersionsForGroup("example.test.apiserver.code-generator.k8s.io")[0].Group { + gv := scheme.Scheme.PrioritizedVersionsForGroup("example.test.apiserver.code-generator.k8s.io")[0] + config.GroupVersion = &gv + } + config.NegotiatedSerializer = scheme.Codecs + + if config.QPS == 0 { + config.QPS = 5 + } + if config.Burst == 0 { + config.Burst = 10 + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *SecondExampleClient) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/doc.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/doc.go new file mode 100644 index 0000000..16f4439 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_example2_client.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_example2_client.go new file mode 100644 index 0000000..f11f2b5 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_example2_client.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + internalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion" +) + +type FakeSecondExample struct { + *testing.Fake +} + +func (c *FakeSecondExample) TestTypes() internalversion.TestTypeInterface { + return &FakeTestTypes{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeSecondExample) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go new file mode 100644 index 0000000..db009eb --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/fake/fake_testtype.go @@ -0,0 +1,133 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + example2 "k8s.io/code-generator/_examples/apiserver/apis/example2" +) + +// FakeTestTypes implements TestTypeInterface +type FakeTestTypes struct { + Fake *FakeSecondExample +} + +var testtypesResource = schema.GroupVersionResource{Group: "example.test.apiserver.code-generator.k8s.io", Version: "", Resource: "testtypes"} + +var testtypesKind = schema.GroupVersionKind{Group: "example.test.apiserver.code-generator.k8s.io", Version: "", Kind: "TestType"} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *FakeTestTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *example2.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(testtypesResource, name), &example2.TestType{}) + if obj == nil { + return nil, err + } + return obj.(*example2.TestType), err +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *FakeTestTypes) List(ctx context.Context, opts v1.ListOptions) (result *example2.TestTypeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(testtypesResource, testtypesKind, opts), &example2.TestTypeList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &example2.TestTypeList{ListMeta: obj.(*example2.TestTypeList).ListMeta} + for _, item := range obj.(*example2.TestTypeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *FakeTestTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(testtypesResource, opts)) +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Create(ctx context.Context, testType *example2.TestType, opts v1.CreateOptions) (result *example2.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(testtypesResource, testType), &example2.TestType{}) + if obj == nil { + return nil, err + } + return obj.(*example2.TestType), err +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Update(ctx context.Context, testType *example2.TestType, opts v1.UpdateOptions) (result *example2.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(testtypesResource, testType), &example2.TestType{}) + if obj == nil { + return nil, err + } + return obj.(*example2.TestType), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *example2.TestType, opts v1.UpdateOptions) (*example2.TestType, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(testtypesResource, "status", testType), &example2.TestType{}) + if obj == nil { + return nil, err + } + return obj.(*example2.TestType), err +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(testtypesResource, name), &example2.TestType{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(testtypesResource, listOpts) + + _, err := c.Fake.Invokes(action, &example2.TestTypeList{}) + return err +} + +// Patch applies the patch and returns the patched testType. +func (c *FakeTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *example2.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(testtypesResource, name, pt, data, subresources...), &example2.TestType{}) + if obj == nil { + return nil, err + } + return obj.(*example2.TestType), err +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/generated_expansion.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/generated_expansion.go new file mode 100644 index 0000000..50bdbd2 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package internalversion + +type TestTypeExpansion interface{} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go new file mode 100644 index 0000000..9aecdfc --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example2/internalversion/testtype.go @@ -0,0 +1,184 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package internalversion + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + example2 "k8s.io/code-generator/_examples/apiserver/apis/example2" + scheme "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme" +) + +// TestTypesGetter has a method to return a TestTypeInterface. +// A group's client should implement this interface. +type TestTypesGetter interface { + TestTypes() TestTypeInterface +} + +// TestTypeInterface has methods to work with TestType resources. +type TestTypeInterface interface { + Create(ctx context.Context, testType *example2.TestType, opts v1.CreateOptions) (*example2.TestType, error) + Update(ctx context.Context, testType *example2.TestType, opts v1.UpdateOptions) (*example2.TestType, error) + UpdateStatus(ctx context.Context, testType *example2.TestType, opts v1.UpdateOptions) (*example2.TestType, 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) (*example2.TestType, error) + List(ctx context.Context, opts v1.ListOptions) (*example2.TestTypeList, 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 *example2.TestType, err error) + TestTypeExpansion +} + +// testTypes implements TestTypeInterface +type testTypes struct { + client rest.Interface +} + +// newTestTypes returns a TestTypes +func newTestTypes(c *SecondExampleClient) *testTypes { + return &testTypes{ + client: c.RESTClient(), + } +} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *testTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *example2.TestType, err error) { + result = &example2.TestType{} + err = c.client.Get(). + Resource("testtypes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *testTypes) List(ctx context.Context, opts v1.ListOptions) (result *example2.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &example2.TestTypeList{} + err = c.client.Get(). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *testTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Create(ctx context.Context, testType *example2.TestType, opts v1.CreateOptions) (result *example2.TestType, err error) { + result = &example2.TestType{} + err = c.client.Post(). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Update(ctx context.Context, testType *example2.TestType, opts v1.UpdateOptions) (result *example2.TestType, err error) { + result = &example2.TestType{} + err = c.client.Put(). + Resource("testtypes"). + Name(testType.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *testTypes) UpdateStatus(ctx context.Context, testType *example2.TestType, opts v1.UpdateOptions) (result *example2.TestType, err error) { + result = &example2.TestType{} + err = c.client.Put(). + Resource("testtypes"). + Name(testType.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *testTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("testtypes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *testTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("testtypes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched testType. +func (c *testTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *example2.TestType, err error) { + result = &example2.TestType{} + err = c.client.Patch(pt). + Resource("testtypes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/doc.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/doc.go new file mode 100644 index 0000000..8660244 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package internalversion diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/example3.io_client.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/example3.io_client.go new file mode 100644 index 0000000..dab480b --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/example3.io_client.go @@ -0,0 +1,96 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package internalversion + +import ( + rest "k8s.io/client-go/rest" + "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme" +) + +type ThirdExampleInterface interface { + RESTClient() rest.Interface + TestTypesGetter +} + +// ThirdExampleClient is used to interact with features provided by the example.dots.apiserver.code-generator.k8s.io group. +type ThirdExampleClient struct { + restClient rest.Interface +} + +func (c *ThirdExampleClient) TestTypes(namespace string) TestTypeInterface { + return newTestTypes(c, namespace) +} + +// NewForConfig creates a new ThirdExampleClient for the given config. +func NewForConfig(c *rest.Config) (*ThirdExampleClient, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &ThirdExampleClient{client}, nil +} + +// NewForConfigOrDie creates a new ThirdExampleClient for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ThirdExampleClient { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ThirdExampleClient for the given RESTClient. +func New(c rest.Interface) *ThirdExampleClient { + return &ThirdExampleClient{c} +} + +func setConfigDefaults(config *rest.Config) error { + config.APIPath = "/apis" + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + if config.GroupVersion == nil || config.GroupVersion.Group != scheme.Scheme.PrioritizedVersionsForGroup("example.dots.apiserver.code-generator.k8s.io")[0].Group { + gv := scheme.Scheme.PrioritizedVersionsForGroup("example.dots.apiserver.code-generator.k8s.io")[0] + config.GroupVersion = &gv + } + config.NegotiatedSerializer = scheme.Codecs + + if config.QPS == 0 { + config.QPS = 5 + } + if config.Burst == 0 { + config.Burst = 10 + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ThirdExampleClient) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/doc.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/doc.go new file mode 100644 index 0000000..16f4439 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/fake_example3.io_client.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/fake_example3.io_client.go new file mode 100644 index 0000000..790fdb9 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/fake_example3.io_client.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + internalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion" +) + +type FakeThirdExample struct { + *testing.Fake +} + +func (c *FakeThirdExample) TestTypes(namespace string) internalversion.TestTypeInterface { + return &FakeTestTypes{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeThirdExample) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/fake_testtype.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/fake_testtype.go new file mode 100644 index 0000000..f7d80c1 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/fake/fake_testtype.go @@ -0,0 +1,142 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + example3io "k8s.io/code-generator/_examples/apiserver/apis/example3.io" +) + +// FakeTestTypes implements TestTypeInterface +type FakeTestTypes struct { + Fake *FakeThirdExample + ns string +} + +var testtypesResource = schema.GroupVersionResource{Group: "example.dots.apiserver.code-generator.k8s.io", Version: "", Resource: "testtypes"} + +var testtypesKind = schema.GroupVersionKind{Group: "example.dots.apiserver.code-generator.k8s.io", Version: "", Kind: "TestType"} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *FakeTestTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *example3io.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &example3io.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example3io.TestType), err +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *FakeTestTypes) List(ctx context.Context, opts v1.ListOptions) (result *example3io.TestTypeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &example3io.TestTypeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &example3io.TestTypeList{ListMeta: obj.(*example3io.TestTypeList).ListMeta} + for _, item := range obj.(*example3io.TestTypeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *FakeTestTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(testtypesResource, c.ns, opts)) + +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Create(ctx context.Context, testType *example3io.TestType, opts v1.CreateOptions) (result *example3io.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &example3io.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example3io.TestType), err +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Update(ctx context.Context, testType *example3io.TestType, opts v1.UpdateOptions) (result *example3io.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &example3io.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example3io.TestType), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *example3io.TestType, opts v1.UpdateOptions) (*example3io.TestType, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &example3io.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example3io.TestType), err +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example3io.TestType{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &example3io.TestTypeList{}) + return err +} + +// Patch applies the patch and returns the patched testType. +func (c *FakeTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *example3io.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &example3io.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example3io.TestType), err +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/generated_expansion.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/generated_expansion.go new file mode 100644 index 0000000..50bdbd2 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package internalversion + +type TestTypeExpansion interface{} diff --git a/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/testtype.go b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/testtype.go new file mode 100644 index 0000000..f82b448 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/internalversion/typed/example3.io/internalversion/testtype.go @@ -0,0 +1,195 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package internalversion + +import ( + "context" + "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + example3io "k8s.io/code-generator/_examples/apiserver/apis/example3.io" + scheme "k8s.io/code-generator/_examples/apiserver/clientset/internalversion/scheme" +) + +// TestTypesGetter has a method to return a TestTypeInterface. +// A group's client should implement this interface. +type TestTypesGetter interface { + TestTypes(namespace string) TestTypeInterface +} + +// TestTypeInterface has methods to work with TestType resources. +type TestTypeInterface interface { + Create(ctx context.Context, testType *example3io.TestType, opts v1.CreateOptions) (*example3io.TestType, error) + Update(ctx context.Context, testType *example3io.TestType, opts v1.UpdateOptions) (*example3io.TestType, error) + UpdateStatus(ctx context.Context, testType *example3io.TestType, opts v1.UpdateOptions) (*example3io.TestType, 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) (*example3io.TestType, error) + List(ctx context.Context, opts v1.ListOptions) (*example3io.TestTypeList, 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 *example3io.TestType, err error) + TestTypeExpansion +} + +// testTypes implements TestTypeInterface +type testTypes struct { + client rest.Interface + ns string +} + +// newTestTypes returns a TestTypes +func newTestTypes(c *ThirdExampleClient, namespace string) *testTypes { + return &testTypes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *testTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *example3io.TestType, err error) { + result = &example3io.TestType{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *testTypes) List(ctx context.Context, opts v1.ListOptions) (result *example3io.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &example3io.TestTypeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *testTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Create(ctx context.Context, testType *example3io.TestType, opts v1.CreateOptions) (result *example3io.TestType, err error) { + result = &example3io.TestType{} + err = c.client.Post(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Update(ctx context.Context, testType *example3io.TestType, opts v1.UpdateOptions) (result *example3io.TestType, err error) { + result = &example3io.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *testTypes) UpdateStatus(ctx context.Context, testType *example3io.TestType, opts v1.UpdateOptions) (result *example3io.TestType, err error) { + result = &example3io.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *testTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *testTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched testType. +func (c *testTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *example3io.TestType, err error) { + result = &example3io.TestType{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/clientset.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/clientset.go new file mode 100644 index 0000000..d80240c --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/clientset.go @@ -0,0 +1,125 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" + examplev1 "k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1" + secondexamplev1 "k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1" + thirdexamplev1 "k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + ExampleV1() examplev1.ExampleV1Interface + SecondExampleV1() secondexamplev1.SecondExampleV1Interface + ThirdExampleV1() thirdexamplev1.ThirdExampleV1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + exampleV1 *examplev1.ExampleV1Client + secondExampleV1 *secondexamplev1.SecondExampleV1Client + thirdExampleV1 *thirdexamplev1.ThirdExampleV1Client +} + +// ExampleV1 retrieves the ExampleV1Client +func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface { + return c.exampleV1 +} + +// SecondExampleV1 retrieves the SecondExampleV1Client +func (c *Clientset) SecondExampleV1() secondexamplev1.SecondExampleV1Interface { + return c.secondExampleV1 +} + +// ThirdExampleV1 retrieves the ThirdExampleV1Client +func (c *Clientset) ThirdExampleV1() thirdexamplev1.ThirdExampleV1Interface { + return c.thirdExampleV1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + 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. +func NewForConfig(c *rest.Config) (*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.exampleV1, err = examplev1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + cs.secondExampleV1, err = secondexamplev1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + cs.thirdExampleV1, err = thirdexamplev1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + 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 { + var cs Clientset + cs.exampleV1 = examplev1.NewForConfigOrDie(c) + cs.secondExampleV1 = secondexamplev1.NewForConfigOrDie(c) + cs.thirdExampleV1 = thirdexamplev1.NewForConfigOrDie(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) + return &cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.exampleV1 = examplev1.New(c) + cs.secondExampleV1 = secondexamplev1.New(c) + cs.thirdExampleV1 = thirdexamplev1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/doc.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/doc.go new file mode 100644 index 0000000..41721ca --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/fake/clientset_generated.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000..760b901 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,96 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" + clientset "k8s.io/code-generator/_examples/apiserver/clientset/versioned" + examplev1 "k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1" + fakeexamplev1 "k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake" + secondexamplev1 "k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1" + fakesecondexamplev1 "k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake" + thirdexamplev1 "k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1" + fakethirdexamplev1 "k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake" +) + +// 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 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) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + 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.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var _ clientset.Interface = &Clientset{} + +// ExampleV1 retrieves the ExampleV1Client +func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface { + return &fakeexamplev1.FakeExampleV1{Fake: &c.Fake} +} + +// SecondExampleV1 retrieves the SecondExampleV1Client +func (c *Clientset) SecondExampleV1() secondexamplev1.SecondExampleV1Interface { + return &fakesecondexamplev1.FakeSecondExampleV1{Fake: &c.Fake} +} + +// ThirdExampleV1 retrieves the ThirdExampleV1Client +func (c *Clientset) ThirdExampleV1() thirdexamplev1.ThirdExampleV1Interface { + return &fakethirdexamplev1.FakeThirdExampleV1{Fake: &c.Fake} +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/fake/doc.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/fake/doc.go new file mode 100644 index 0000000..9b99e71 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/fake/register.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/fake/register.go new file mode 100644 index 0000000..05e2934 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/fake/register.go @@ -0,0 +1,60 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + 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" + examplev1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" + secondexamplev1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" + thirdexamplev1 "k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + examplev1.AddToScheme, + secondexamplev1.AddToScheme, + thirdexamplev1.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/cmd/code-generator/_examples/apiserver/clientset/versioned/scheme/doc.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/scheme/doc.go new file mode 100644 index 0000000..7dc3756 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/scheme/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/scheme/register.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/scheme/register.go new file mode 100644 index 0000000..9919a8f --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/scheme/register.go @@ -0,0 +1,60 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + 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" + examplev1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" + secondexamplev1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" + thirdexamplev1 "k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + examplev1.AddToScheme, + secondexamplev1.AddToScheme, + thirdexamplev1.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/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/doc.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/doc.go new file mode 100644 index 0000000..3af5d05 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/example_client.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/example_client.go new file mode 100644 index 0000000..6fba6c1 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/example_client.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" + "k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme" +) + +type ExampleV1Interface interface { + RESTClient() rest.Interface + TestTypesGetter +} + +// ExampleV1Client is used to interact with features provided by the example.apiserver.code-generator.k8s.io group. +type ExampleV1Client struct { + restClient rest.Interface +} + +func (c *ExampleV1Client) TestTypes(namespace string) TestTypeInterface { + return newTestTypes(c, namespace) +} + +// NewForConfig creates a new ExampleV1Client for the given config. +func NewForConfig(c *rest.Config) (*ExampleV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &ExampleV1Client{client}, nil +} + +// NewForConfigOrDie creates a new ExampleV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ExampleV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ExampleV1Client for the given RESTClient. +func New(c rest.Interface) *ExampleV1Client { + return &ExampleV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ExampleV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/doc.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/doc.go new file mode 100644 index 0000000..16f4439 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_example_client.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_example_client.go new file mode 100644 index 0000000..509a5b4 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_example_client.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1 "k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1" +) + +type FakeExampleV1 struct { + *testing.Fake +} + +func (c *FakeExampleV1) TestTypes(namespace string) v1.TestTypeInterface { + return &FakeTestTypes{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeExampleV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go new file mode 100644 index 0000000..b9b1e20 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/fake/fake_testtype.go @@ -0,0 +1,142 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + examplev1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" +) + +// FakeTestTypes implements TestTypeInterface +type FakeTestTypes struct { + Fake *FakeExampleV1 + ns string +} + +var testtypesResource = schema.GroupVersionResource{Group: "example.apiserver.code-generator.k8s.io", Version: "v1", Resource: "testtypes"} + +var testtypesKind = schema.GroupVersionKind{Group: "example.apiserver.code-generator.k8s.io", Version: "v1", Kind: "TestType"} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *FakeTestTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *FakeTestTypes) List(ctx context.Context, opts v1.ListOptions) (result *examplev1.TestTypeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &examplev1.TestTypeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &examplev1.TestTypeList{ListMeta: obj.(*examplev1.TestTypeList).ListMeta} + for _, item := range obj.(*examplev1.TestTypeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *FakeTestTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(testtypesResource, c.ns, opts)) + +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Create(ctx context.Context, testType *examplev1.TestType, opts v1.CreateOptions) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Update(ctx context.Context, testType *examplev1.TestType, opts v1.UpdateOptions) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *examplev1.TestType, opts v1.UpdateOptions) (*examplev1.TestType, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &examplev1.TestType{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &examplev1.TestTypeList{}) + return err +} + +// Patch applies the patch and returns the patched testType. +func (c *FakeTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/generated_expansion.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/generated_expansion.go new file mode 100644 index 0000000..d513810 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type TestTypeExpansion interface{} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go new file mode 100644 index 0000000..d53290d --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example/v1/testtype.go @@ -0,0 +1,195 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" + scheme "k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme" +) + +// TestTypesGetter has a method to return a TestTypeInterface. +// A group's client should implement this interface. +type TestTypesGetter interface { + TestTypes(namespace string) TestTypeInterface +} + +// TestTypeInterface has methods to work with TestType resources. +type TestTypeInterface interface { + Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (*v1.TestType, error) + Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) + UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TestType, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TestTypeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TestType, err error) + TestTypeExpansion +} + +// testTypes implements TestTypeInterface +type testTypes struct { + client rest.Interface + ns string +} + +// newTestTypes returns a TestTypes +func newTestTypes(c *ExampleV1Client, namespace string) *testTypes { + return &testTypes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *testTypes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *testTypes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.TestTypeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *testTypes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Post(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *testTypes) UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *testTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *testTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched testType. +func (c *testTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/doc.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/doc.go new file mode 100644 index 0000000..3af5d05 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/example2_client.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/example2_client.go new file mode 100644 index 0000000..d169f60 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/example2_client.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" + "k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme" +) + +type SecondExampleV1Interface interface { + RESTClient() rest.Interface + TestTypesGetter +} + +// SecondExampleV1Client is used to interact with features provided by the example.test.apiserver.code-generator.k8s.io group. +type SecondExampleV1Client struct { + restClient rest.Interface +} + +func (c *SecondExampleV1Client) TestTypes(namespace string) TestTypeInterface { + return newTestTypes(c, namespace) +} + +// NewForConfig creates a new SecondExampleV1Client for the given config. +func NewForConfig(c *rest.Config) (*SecondExampleV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &SecondExampleV1Client{client}, nil +} + +// NewForConfigOrDie creates a new SecondExampleV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *SecondExampleV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new SecondExampleV1Client for the given RESTClient. +func New(c rest.Interface) *SecondExampleV1Client { + return &SecondExampleV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *SecondExampleV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/doc.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/doc.go new file mode 100644 index 0000000..16f4439 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go new file mode 100644 index 0000000..1820e18 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1 "k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1" +) + +type FakeSecondExampleV1 struct { + *testing.Fake +} + +func (c *FakeSecondExampleV1) TestTypes(namespace string) v1.TestTypeInterface { + return &FakeTestTypes{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeSecondExampleV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go new file mode 100644 index 0000000..6187002 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/fake/fake_testtype.go @@ -0,0 +1,142 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + example2v1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" +) + +// FakeTestTypes implements TestTypeInterface +type FakeTestTypes struct { + Fake *FakeSecondExampleV1 + ns string +} + +var testtypesResource = schema.GroupVersionResource{Group: "example.test.apiserver.code-generator.k8s.io", Version: "v1", Resource: "testtypes"} + +var testtypesKind = schema.GroupVersionKind{Group: "example.test.apiserver.code-generator.k8s.io", Version: "v1", Kind: "TestType"} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *FakeTestTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *example2v1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &example2v1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example2v1.TestType), err +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *FakeTestTypes) List(ctx context.Context, opts v1.ListOptions) (result *example2v1.TestTypeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &example2v1.TestTypeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &example2v1.TestTypeList{ListMeta: obj.(*example2v1.TestTypeList).ListMeta} + for _, item := range obj.(*example2v1.TestTypeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *FakeTestTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(testtypesResource, c.ns, opts)) + +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Create(ctx context.Context, testType *example2v1.TestType, opts v1.CreateOptions) (result *example2v1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &example2v1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example2v1.TestType), err +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Update(ctx context.Context, testType *example2v1.TestType, opts v1.UpdateOptions) (result *example2v1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &example2v1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example2v1.TestType), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *example2v1.TestType, opts v1.UpdateOptions) (*example2v1.TestType, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &example2v1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example2v1.TestType), err +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example2v1.TestType{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &example2v1.TestTypeList{}) + return err +} + +// Patch applies the patch and returns the patched testType. +func (c *FakeTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *example2v1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &example2v1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example2v1.TestType), err +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/generated_expansion.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/generated_expansion.go new file mode 100644 index 0000000..d513810 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type TestTypeExpansion interface{} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go new file mode 100644 index 0000000..5e23a04 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example2/v1/testtype.go @@ -0,0 +1,195 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" + scheme "k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme" +) + +// TestTypesGetter has a method to return a TestTypeInterface. +// A group's client should implement this interface. +type TestTypesGetter interface { + TestTypes(namespace string) TestTypeInterface +} + +// TestTypeInterface has methods to work with TestType resources. +type TestTypeInterface interface { + Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (*v1.TestType, error) + Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) + UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TestType, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TestTypeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TestType, err error) + TestTypeExpansion +} + +// testTypes implements TestTypeInterface +type testTypes struct { + client rest.Interface + ns string +} + +// newTestTypes returns a TestTypes +func newTestTypes(c *SecondExampleV1Client, namespace string) *testTypes { + return &testTypes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *testTypes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *testTypes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.TestTypeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *testTypes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Post(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *testTypes) UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *testTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *testTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched testType. +func (c *testTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/doc.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/doc.go new file mode 100644 index 0000000..3af5d05 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/example3.io_client.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/example3.io_client.go new file mode 100644 index 0000000..53c51b3 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/example3.io_client.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1" + "k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme" +) + +type ThirdExampleV1Interface interface { + RESTClient() rest.Interface + TestTypesGetter +} + +// ThirdExampleV1Client is used to interact with features provided by the example.dots.apiserver.code-generator.k8s.io group. +type ThirdExampleV1Client struct { + restClient rest.Interface +} + +func (c *ThirdExampleV1Client) TestTypes(namespace string) TestTypeInterface { + return newTestTypes(c, namespace) +} + +// NewForConfig creates a new ThirdExampleV1Client for the given config. +func NewForConfig(c *rest.Config) (*ThirdExampleV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &ThirdExampleV1Client{client}, nil +} + +// NewForConfigOrDie creates a new ThirdExampleV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ThirdExampleV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ThirdExampleV1Client for the given RESTClient. +func New(c rest.Interface) *ThirdExampleV1Client { + return &ThirdExampleV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ThirdExampleV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/doc.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/doc.go new file mode 100644 index 0000000..16f4439 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/fake_example3.io_client.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/fake_example3.io_client.go new file mode 100644 index 0000000..bbaf71a --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/fake_example3.io_client.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1 "k8s.io/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1" +) + +type FakeThirdExampleV1 struct { + *testing.Fake +} + +func (c *FakeThirdExampleV1) TestTypes(namespace string) v1.TestTypeInterface { + return &FakeTestTypes{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeThirdExampleV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/fake_testtype.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/fake_testtype.go new file mode 100644 index 0000000..8a67d81 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/fake/fake_testtype.go @@ -0,0 +1,142 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + example3iov1 "k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1" +) + +// FakeTestTypes implements TestTypeInterface +type FakeTestTypes struct { + Fake *FakeThirdExampleV1 + ns string +} + +var testtypesResource = schema.GroupVersionResource{Group: "example.dots.apiserver.code-generator.k8s.io", Version: "v1", Resource: "testtypes"} + +var testtypesKind = schema.GroupVersionKind{Group: "example.dots.apiserver.code-generator.k8s.io", Version: "v1", Kind: "TestType"} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *FakeTestTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *example3iov1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &example3iov1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example3iov1.TestType), err +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *FakeTestTypes) List(ctx context.Context, opts v1.ListOptions) (result *example3iov1.TestTypeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &example3iov1.TestTypeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &example3iov1.TestTypeList{ListMeta: obj.(*example3iov1.TestTypeList).ListMeta} + for _, item := range obj.(*example3iov1.TestTypeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *FakeTestTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(testtypesResource, c.ns, opts)) + +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Create(ctx context.Context, testType *example3iov1.TestType, opts v1.CreateOptions) (result *example3iov1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &example3iov1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example3iov1.TestType), err +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Update(ctx context.Context, testType *example3iov1.TestType, opts v1.UpdateOptions) (result *example3iov1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &example3iov1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example3iov1.TestType), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *example3iov1.TestType, opts v1.UpdateOptions) (*example3iov1.TestType, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &example3iov1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example3iov1.TestType), err +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example3iov1.TestType{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &example3iov1.TestTypeList{}) + return err +} + +// Patch applies the patch and returns the patched testType. +func (c *FakeTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *example3iov1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &example3iov1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example3iov1.TestType), err +} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/generated_expansion.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/generated_expansion.go new file mode 100644 index 0000000..d513810 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type TestTypeExpansion interface{} diff --git a/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/testtype.go b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/testtype.go new file mode 100644 index 0000000..f9caafa --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/clientset/versioned/typed/example3.io/v1/testtype.go @@ -0,0 +1,195 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1" + scheme "k8s.io/code-generator/_examples/apiserver/clientset/versioned/scheme" +) + +// TestTypesGetter has a method to return a TestTypeInterface. +// A group's client should implement this interface. +type TestTypesGetter interface { + TestTypes(namespace string) TestTypeInterface +} + +// TestTypeInterface has methods to work with TestType resources. +type TestTypeInterface interface { + Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (*v1.TestType, error) + Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) + UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TestType, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TestTypeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TestType, err error) + TestTypeExpansion +} + +// testTypes implements TestTypeInterface +type testTypes struct { + client rest.Interface + ns string +} + +// newTestTypes returns a TestTypes +func newTestTypes(c *ThirdExampleV1Client, namespace string) *testTypes { + return &testTypes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *testTypes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *testTypes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.TestTypeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *testTypes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Post(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *testTypes) UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *testTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *testTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched testType. +func (c *testTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cmd/code-generator/_examples/apiserver/informers/externalversions/example/interface.go b/cmd/code-generator/_examples/apiserver/informers/externalversions/example/interface.go new file mode 100644 index 0000000..9cc5d1b --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/externalversions/example/interface.go @@ -0,0 +1,46 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package example + +import ( + v1 "k8s.io/code-generator/_examples/apiserver/informers/externalversions/example/v1" + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/externalversions/example/v1/interface.go b/cmd/code-generator/_examples/apiserver/informers/externalversions/example/v1/interface.go new file mode 100644 index 0000000..1ccc8f3 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/externalversions/example/v1/interface.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // TestTypes returns a TestTypeInformer. + TestTypes() TestTypeInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// TestTypes returns a TestTypeInformer. +func (v *version) TestTypes() TestTypeInformer { + return &testTypeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/cmd/code-generator/_examples/apiserver/informers/externalversions/example/v1/testtype.go b/cmd/code-generator/_examples/apiserver/informers/externalversions/example/v1/testtype.go new file mode 100644 index 0000000..c70fac4 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/externalversions/example/v1/testtype.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + examplev1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" + versioned "k8s.io/code-generator/_examples/apiserver/clientset/versioned" + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" + v1 "k8s.io/code-generator/_examples/apiserver/listers/example/v1" +) + +// TestTypeInformer provides access to a shared informer and lister for +// TestTypes. +type TestTypeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.TestTypeLister +} + +type testTypeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExampleV1().TestTypes(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExampleV1().TestTypes(namespace).Watch(context.TODO(), options) + }, + }, + &examplev1.TestType{}, + resyncPeriod, + indexers, + ) +} + +func (f *testTypeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *testTypeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&examplev1.TestType{}, f.defaultInformer) +} + +func (f *testTypeInformer) Lister() v1.TestTypeLister { + return v1.NewTestTypeLister(f.Informer().GetIndexer()) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/externalversions/example2/interface.go b/cmd/code-generator/_examples/apiserver/informers/externalversions/example2/interface.go new file mode 100644 index 0000000..996c974 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/externalversions/example2/interface.go @@ -0,0 +1,46 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package example2 + +import ( + v1 "k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2/v1" + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/externalversions/example2/v1/interface.go b/cmd/code-generator/_examples/apiserver/informers/externalversions/example2/v1/interface.go new file mode 100644 index 0000000..1ccc8f3 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/externalversions/example2/v1/interface.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // TestTypes returns a TestTypeInformer. + TestTypes() TestTypeInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// TestTypes returns a TestTypeInformer. +func (v *version) TestTypes() TestTypeInformer { + return &testTypeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/cmd/code-generator/_examples/apiserver/informers/externalversions/example2/v1/testtype.go b/cmd/code-generator/_examples/apiserver/informers/externalversions/example2/v1/testtype.go new file mode 100644 index 0000000..5a9ddc9 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/externalversions/example2/v1/testtype.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + example2v1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" + versioned "k8s.io/code-generator/_examples/apiserver/clientset/versioned" + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" + v1 "k8s.io/code-generator/_examples/apiserver/listers/example2/v1" +) + +// TestTypeInformer provides access to a shared informer and lister for +// TestTypes. +type TestTypeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.TestTypeLister +} + +type testTypeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SecondExampleV1().TestTypes(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SecondExampleV1().TestTypes(namespace).Watch(context.TODO(), options) + }, + }, + &example2v1.TestType{}, + resyncPeriod, + indexers, + ) +} + +func (f *testTypeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *testTypeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&example2v1.TestType{}, f.defaultInformer) +} + +func (f *testTypeInformer) Lister() v1.TestTypeLister { + return v1.NewTestTypeLister(f.Informer().GetIndexer()) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/externalversions/example3.io/interface.go b/cmd/code-generator/_examples/apiserver/informers/externalversions/example3.io/interface.go new file mode 100644 index 0000000..8d80f8f --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/externalversions/example3.io/interface.go @@ -0,0 +1,46 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package example3 + +import ( + v1 "k8s.io/code-generator/_examples/apiserver/informers/externalversions/example3.io/v1" + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/externalversions/example3.io/v1/interface.go b/cmd/code-generator/_examples/apiserver/informers/externalversions/example3.io/v1/interface.go new file mode 100644 index 0000000..1ccc8f3 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/externalversions/example3.io/v1/interface.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // TestTypes returns a TestTypeInformer. + TestTypes() TestTypeInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// TestTypes returns a TestTypeInformer. +func (v *version) TestTypes() TestTypeInformer { + return &testTypeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/cmd/code-generator/_examples/apiserver/informers/externalversions/example3.io/v1/testtype.go b/cmd/code-generator/_examples/apiserver/informers/externalversions/example3.io/v1/testtype.go new file mode 100644 index 0000000..6094863 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/externalversions/example3.io/v1/testtype.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + example3iov1 "k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1" + versioned "k8s.io/code-generator/_examples/apiserver/clientset/versioned" + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" + v1 "k8s.io/code-generator/_examples/apiserver/listers/example3.io/v1" +) + +// TestTypeInformer provides access to a shared informer and lister for +// TestTypes. +type TestTypeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.TestTypeLister +} + +type testTypeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ThirdExampleV1().TestTypes(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ThirdExampleV1().TestTypes(namespace).Watch(context.TODO(), options) + }, + }, + &example3iov1.TestType{}, + resyncPeriod, + indexers, + ) +} + +func (f *testTypeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *testTypeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&example3iov1.TestType{}, f.defaultInformer) +} + +func (f *testTypeInformer) Lister() v1.TestTypeLister { + return v1.NewTestTypeLister(f.Informer().GetIndexer()) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/externalversions/factory.go b/cmd/code-generator/_examples/apiserver/informers/externalversions/factory.go new file mode 100644 index 0000000..76348cb --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/externalversions/factory.go @@ -0,0 +1,192 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + versioned "k8s.io/code-generator/_examples/apiserver/clientset/versioned" + example "k8s.io/code-generator/_examples/apiserver/informers/externalversions/example" + example2 "k8s.io/code-generator/_examples/apiserver/informers/externalversions/example2" + example3io "k8s.io/code-generator/_examples/apiserver/informers/externalversions/example3.io" + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + customResync map[reflect.Type]time.Duration + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +// Start initializes all requested informers. +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + go informer.Run(stopCh) + f.startedInformers[informerType] = true + } + } +} + +// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + Example() example.Interface + SecondExample() example2.Interface + ThirdExample() example3io.Interface +} + +func (f *sharedInformerFactory) Example() example.Interface { + return example.New(f, f.namespace, f.tweakListOptions) +} + +func (f *sharedInformerFactory) SecondExample() example2.Interface { + return example2.New(f, f.namespace, f.tweakListOptions) +} + +func (f *sharedInformerFactory) ThirdExample() example3io.Interface { + return example3io.New(f, f.namespace, f.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/externalversions/generic.go b/cmd/code-generator/_examples/apiserver/informers/externalversions/generic.go new file mode 100644 index 0000000..5745977 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/externalversions/generic.go @@ -0,0 +1,72 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + "fmt" + + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + v1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" + example2v1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" + example3iov1 "k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=example.apiserver.code-generator.k8s.io, Version=v1 + case v1.SchemeGroupVersion.WithResource("testtypes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Example().V1().TestTypes().Informer()}, nil + + // Group=example.dots.apiserver.code-generator.k8s.io, Version=v1 + case example3iov1.SchemeGroupVersion.WithResource("testtypes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.ThirdExample().V1().TestTypes().Informer()}, nil + + // Group=example.test.apiserver.code-generator.k8s.io, Version=v1 + case example2v1.SchemeGroupVersion.WithResource("testtypes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.SecondExample().V1().TestTypes().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces/factory_interfaces.go b/cmd/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 0000000..21c6669 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" + versioned "k8s.io/code-generator/_examples/apiserver/clientset/versioned" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/cmd/code-generator/_examples/apiserver/informers/internalversion/example/interface.go b/cmd/code-generator/_examples/apiserver/informers/internalversion/example/interface.go new file mode 100644 index 0000000..d2a36b3 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/internalversion/example/interface.go @@ -0,0 +1,46 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package example + +import ( + internalversion "k8s.io/code-generator/_examples/apiserver/informers/internalversion/example/internalversion" + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // InternalVersion provides access to shared informers for resources in InternalVersion. + InternalVersion() internalversion.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// InternalVersion returns a new internalversion.Interface. +func (g *group) InternalVersion() internalversion.Interface { + return internalversion.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/interface.go b/cmd/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/interface.go new file mode 100644 index 0000000..0fd5f8c --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/interface.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalversion + +import ( + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // TestTypes returns a TestTypeInformer. + TestTypes() TestTypeInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// TestTypes returns a TestTypeInformer. +func (v *version) TestTypes() TestTypeInformer { + return &testTypeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/cmd/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/testtype.go b/cmd/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/testtype.go new file mode 100644 index 0000000..1226809 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/internalversion/example/internalversion/testtype.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalversion + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + example "k8s.io/code-generator/_examples/apiserver/apis/example" + clientsetinternalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" + internalversion "k8s.io/code-generator/_examples/apiserver/listers/example/internalversion" +) + +// TestTypeInformer provides access to a shared informer and lister for +// TestTypes. +type TestTypeInformer interface { + Informer() cache.SharedIndexInformer + Lister() internalversion.TestTypeLister +} + +type testTypeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTestTypeInformer(client clientsetinternalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTestTypeInformer(client clientsetinternalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.Example().TestTypes(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.Example().TestTypes(namespace).Watch(context.TODO(), options) + }, + }, + &example.TestType{}, + resyncPeriod, + indexers, + ) +} + +func (f *testTypeInformer) defaultInformer(client clientsetinternalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *testTypeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&example.TestType{}, f.defaultInformer) +} + +func (f *testTypeInformer) Lister() internalversion.TestTypeLister { + return internalversion.NewTestTypeLister(f.Informer().GetIndexer()) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/internalversion/example2/interface.go b/cmd/code-generator/_examples/apiserver/informers/internalversion/example2/interface.go new file mode 100644 index 0000000..9440310 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/internalversion/example2/interface.go @@ -0,0 +1,46 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package example2 + +import ( + internalversion "k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion" + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // InternalVersion provides access to shared informers for resources in InternalVersion. + InternalVersion() internalversion.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// InternalVersion returns a new internalversion.Interface. +func (g *group) InternalVersion() internalversion.Interface { + return internalversion.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/interface.go b/cmd/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/interface.go new file mode 100644 index 0000000..e7cace8 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/interface.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalversion + +import ( + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // TestTypes returns a TestTypeInformer. + TestTypes() TestTypeInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// TestTypes returns a TestTypeInformer. +func (v *version) TestTypes() TestTypeInformer { + return &testTypeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/cmd/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/testtype.go b/cmd/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/testtype.go new file mode 100644 index 0000000..6357398 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/internalversion/example2/internalversion/testtype.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalversion + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + example2 "k8s.io/code-generator/_examples/apiserver/apis/example2" + clientsetinternalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" + internalversion "k8s.io/code-generator/_examples/apiserver/listers/example2/internalversion" +) + +// TestTypeInformer provides access to a shared informer and lister for +// TestTypes. +type TestTypeInformer interface { + Informer() cache.SharedIndexInformer + Lister() internalversion.TestTypeLister +} + +type testTypeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTestTypeInformer(client clientsetinternalversion.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTestTypeInformer(client clientsetinternalversion.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SecondExample().TestTypes().List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SecondExample().TestTypes().Watch(context.TODO(), options) + }, + }, + &example2.TestType{}, + resyncPeriod, + indexers, + ) +} + +func (f *testTypeInformer) defaultInformer(client clientsetinternalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *testTypeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&example2.TestType{}, f.defaultInformer) +} + +func (f *testTypeInformer) Lister() internalversion.TestTypeLister { + return internalversion.NewTestTypeLister(f.Informer().GetIndexer()) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/internalversion/example3.io/interface.go b/cmd/code-generator/_examples/apiserver/informers/internalversion/example3.io/interface.go new file mode 100644 index 0000000..3e469b2 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/internalversion/example3.io/interface.go @@ -0,0 +1,46 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package example3 + +import ( + internalversion "k8s.io/code-generator/_examples/apiserver/informers/internalversion/example3.io/internalversion" + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // InternalVersion provides access to shared informers for resources in InternalVersion. + InternalVersion() internalversion.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// InternalVersion returns a new internalversion.Interface. +func (g *group) InternalVersion() internalversion.Interface { + return internalversion.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/internalversion/example3.io/internalversion/interface.go b/cmd/code-generator/_examples/apiserver/informers/internalversion/example3.io/internalversion/interface.go new file mode 100644 index 0000000..0fd5f8c --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/internalversion/example3.io/internalversion/interface.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalversion + +import ( + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // TestTypes returns a TestTypeInformer. + TestTypes() TestTypeInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// TestTypes returns a TestTypeInformer. +func (v *version) TestTypes() TestTypeInformer { + return &testTypeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/cmd/code-generator/_examples/apiserver/informers/internalversion/example3.io/internalversion/testtype.go b/cmd/code-generator/_examples/apiserver/informers/internalversion/example3.io/internalversion/testtype.go new file mode 100644 index 0000000..1d30f4f --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/internalversion/example3.io/internalversion/testtype.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalversion + +import ( + "context" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + example3io "k8s.io/code-generator/_examples/apiserver/apis/example3.io" + clientsetinternalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" + internalversion "k8s.io/code-generator/_examples/apiserver/listers/example3.io/internalversion" +) + +// TestTypeInformer provides access to a shared informer and lister for +// TestTypes. +type TestTypeInformer interface { + Informer() cache.SharedIndexInformer + Lister() internalversion.TestTypeLister +} + +type testTypeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTestTypeInformer(client clientsetinternalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTestTypeInformer(client clientsetinternalversion.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ThirdExample().TestTypes(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ThirdExample().TestTypes(namespace).Watch(context.TODO(), options) + }, + }, + &example3io.TestType{}, + resyncPeriod, + indexers, + ) +} + +func (f *testTypeInformer) defaultInformer(client clientsetinternalversion.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *testTypeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&example3io.TestType{}, f.defaultInformer) +} + +func (f *testTypeInformer) Lister() internalversion.TestTypeLister { + return internalversion.NewTestTypeLister(f.Informer().GetIndexer()) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/internalversion/factory.go b/cmd/code-generator/_examples/apiserver/informers/internalversion/factory.go new file mode 100644 index 0000000..08fc96a --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/internalversion/factory.go @@ -0,0 +1,192 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalversion + +import ( + reflect "reflect" + sync "sync" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + internalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" + example "k8s.io/code-generator/_examples/apiserver/informers/internalversion/example" + example2 "k8s.io/code-generator/_examples/apiserver/informers/internalversion/example2" + example3io "k8s.io/code-generator/_examples/apiserver/informers/internalversion/example3.io" + internalinterfaces "k8s.io/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client internalversion.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + customResync map[reflect.Type]time.Duration + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client internalversion.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client internalversion.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client internalversion.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +// Start initializes all requested informers. +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + go informer.Run(stopCh) + f.startedInformers[informerType] = true + } + } +} + +// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + Example() example.Interface + SecondExample() example2.Interface + ThirdExample() example3io.Interface +} + +func (f *sharedInformerFactory) Example() example.Interface { + return example.New(f, f.namespace, f.tweakListOptions) +} + +func (f *sharedInformerFactory) SecondExample() example2.Interface { + return example2.New(f, f.namespace, f.tweakListOptions) +} + +func (f *sharedInformerFactory) ThirdExample() example3io.Interface { + return example3io.New(f, f.namespace, f.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/internalversion/generic.go b/cmd/code-generator/_examples/apiserver/informers/internalversion/generic.go new file mode 100644 index 0000000..9e9eddb --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/internalversion/generic.go @@ -0,0 +1,72 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalversion + +import ( + "fmt" + + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + example "k8s.io/code-generator/_examples/apiserver/apis/example" + example2 "k8s.io/code-generator/_examples/apiserver/apis/example2" + example3io "k8s.io/code-generator/_examples/apiserver/apis/example3.io" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=example.apiserver.code-generator.k8s.io, Version=internalVersion + case example.SchemeGroupVersion.WithResource("testtypes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Example().InternalVersion().TestTypes().Informer()}, nil + + // Group=example.dots.apiserver.code-generator.k8s.io, Version=internalVersion + case example3io.SchemeGroupVersion.WithResource("testtypes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.ThirdExample().InternalVersion().TestTypes().Informer()}, nil + + // Group=example.test.apiserver.code-generator.k8s.io, Version=internalVersion + case example2.SchemeGroupVersion.WithResource("testtypes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.SecondExample().InternalVersion().TestTypes().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/cmd/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces/factory_interfaces.go b/cmd/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces/factory_interfaces.go new file mode 100644 index 0000000..5d01820 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/informers/internalversion/internalinterfaces/factory_interfaces.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" + internalversion "k8s.io/code-generator/_examples/apiserver/clientset/internalversion" +) + +// NewInformerFunc takes internalversion.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(internalversion.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/cmd/code-generator/_examples/apiserver/listers/example/internalversion/expansion_generated.go b/cmd/code-generator/_examples/apiserver/listers/example/internalversion/expansion_generated.go new file mode 100644 index 0000000..4bb8715 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/listers/example/internalversion/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package internalversion + +// TestTypeListerExpansion allows custom methods to be added to +// TestTypeLister. +type TestTypeListerExpansion interface{} + +// TestTypeNamespaceListerExpansion allows custom methods to be added to +// TestTypeNamespaceLister. +type TestTypeNamespaceListerExpansion interface{} diff --git a/cmd/code-generator/_examples/apiserver/listers/example/internalversion/testtype.go b/cmd/code-generator/_examples/apiserver/listers/example/internalversion/testtype.go new file mode 100644 index 0000000..7d72e3c --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/listers/example/internalversion/testtype.go @@ -0,0 +1,99 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package internalversion + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + example "k8s.io/code-generator/_examples/apiserver/apis/example" +) + +// TestTypeLister helps list TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeLister interface { + // List lists all TestTypes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*example.TestType, err error) + // TestTypes returns an object that can list and get TestTypes. + TestTypes(namespace string) TestTypeNamespaceLister + TestTypeListerExpansion +} + +// testTypeLister implements the TestTypeLister interface. +type testTypeLister struct { + indexer cache.Indexer +} + +// NewTestTypeLister returns a new TestTypeLister. +func NewTestTypeLister(indexer cache.Indexer) TestTypeLister { + return &testTypeLister{indexer: indexer} +} + +// List lists all TestTypes in the indexer. +func (s *testTypeLister) List(selector labels.Selector) (ret []*example.TestType, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*example.TestType)) + }) + return ret, err +} + +// TestTypes returns an object that can list and get TestTypes. +func (s *testTypeLister) TestTypes(namespace string) TestTypeNamespaceLister { + return testTypeNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// TestTypeNamespaceLister helps list and get TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeNamespaceLister interface { + // List lists all TestTypes in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*example.TestType, err error) + // Get retrieves the TestType from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*example.TestType, error) + TestTypeNamespaceListerExpansion +} + +// testTypeNamespaceLister implements the TestTypeNamespaceLister +// interface. +type testTypeNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all TestTypes in the indexer for a given namespace. +func (s testTypeNamespaceLister) List(selector labels.Selector) (ret []*example.TestType, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*example.TestType)) + }) + return ret, err +} + +// Get retrieves the TestType from the indexer for a given namespace and name. +func (s testTypeNamespaceLister) Get(name string) (*example.TestType, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(example.Resource("testtype"), name) + } + return obj.(*example.TestType), nil +} diff --git a/cmd/code-generator/_examples/apiserver/listers/example/v1/expansion_generated.go b/cmd/code-generator/_examples/apiserver/listers/example/v1/expansion_generated.go new file mode 100644 index 0000000..0192e05 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/listers/example/v1/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +// TestTypeListerExpansion allows custom methods to be added to +// TestTypeLister. +type TestTypeListerExpansion interface{} + +// TestTypeNamespaceListerExpansion allows custom methods to be added to +// TestTypeNamespaceLister. +type TestTypeNamespaceListerExpansion interface{} diff --git a/cmd/code-generator/_examples/apiserver/listers/example/v1/testtype.go b/cmd/code-generator/_examples/apiserver/listers/example/v1/testtype.go new file mode 100644 index 0000000..015ce53 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/listers/example/v1/testtype.go @@ -0,0 +1,99 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1 "k8s.io/code-generator/_examples/apiserver/apis/example/v1" +) + +// TestTypeLister helps list TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeLister interface { + // List lists all TestTypes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TestType, err error) + // TestTypes returns an object that can list and get TestTypes. + TestTypes(namespace string) TestTypeNamespaceLister + TestTypeListerExpansion +} + +// testTypeLister implements the TestTypeLister interface. +type testTypeLister struct { + indexer cache.Indexer +} + +// NewTestTypeLister returns a new TestTypeLister. +func NewTestTypeLister(indexer cache.Indexer) TestTypeLister { + return &testTypeLister{indexer: indexer} +} + +// List lists all TestTypes in the indexer. +func (s *testTypeLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TestType)) + }) + return ret, err +} + +// TestTypes returns an object that can list and get TestTypes. +func (s *testTypeLister) TestTypes(namespace string) TestTypeNamespaceLister { + return testTypeNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// TestTypeNamespaceLister helps list and get TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeNamespaceLister interface { + // List lists all TestTypes in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TestType, err error) + // Get retrieves the TestType from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.TestType, error) + TestTypeNamespaceListerExpansion +} + +// testTypeNamespaceLister implements the TestTypeNamespaceLister +// interface. +type testTypeNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all TestTypes in the indexer for a given namespace. +func (s testTypeNamespaceLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TestType)) + }) + return ret, err +} + +// Get retrieves the TestType from the indexer for a given namespace and name. +func (s testTypeNamespaceLister) Get(name string) (*v1.TestType, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("testtype"), name) + } + return obj.(*v1.TestType), nil +} diff --git a/cmd/code-generator/_examples/apiserver/listers/example2/internalversion/expansion_generated.go b/cmd/code-generator/_examples/apiserver/listers/example2/internalversion/expansion_generated.go new file mode 100644 index 0000000..4c4e99e --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/listers/example2/internalversion/expansion_generated.go @@ -0,0 +1,23 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package internalversion + +// TestTypeListerExpansion allows custom methods to be added to +// TestTypeLister. +type TestTypeListerExpansion interface{} diff --git a/cmd/code-generator/_examples/apiserver/listers/example2/internalversion/testtype.go b/cmd/code-generator/_examples/apiserver/listers/example2/internalversion/testtype.go new file mode 100644 index 0000000..03d8940 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/listers/example2/internalversion/testtype.go @@ -0,0 +1,68 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package internalversion + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + example2 "k8s.io/code-generator/_examples/apiserver/apis/example2" +) + +// TestTypeLister helps list TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeLister interface { + // List lists all TestTypes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*example2.TestType, err error) + // Get retrieves the TestType from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*example2.TestType, error) + TestTypeListerExpansion +} + +// testTypeLister implements the TestTypeLister interface. +type testTypeLister struct { + indexer cache.Indexer +} + +// NewTestTypeLister returns a new TestTypeLister. +func NewTestTypeLister(indexer cache.Indexer) TestTypeLister { + return &testTypeLister{indexer: indexer} +} + +// List lists all TestTypes in the indexer. +func (s *testTypeLister) List(selector labels.Selector) (ret []*example2.TestType, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*example2.TestType)) + }) + return ret, err +} + +// Get retrieves the TestType from the index for a given name. +func (s *testTypeLister) Get(name string) (*example2.TestType, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(example2.Resource("testtype"), name) + } + return obj.(*example2.TestType), nil +} diff --git a/cmd/code-generator/_examples/apiserver/listers/example2/v1/expansion_generated.go b/cmd/code-generator/_examples/apiserver/listers/example2/v1/expansion_generated.go new file mode 100644 index 0000000..0192e05 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/listers/example2/v1/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +// TestTypeListerExpansion allows custom methods to be added to +// TestTypeLister. +type TestTypeListerExpansion interface{} + +// TestTypeNamespaceListerExpansion allows custom methods to be added to +// TestTypeNamespaceLister. +type TestTypeNamespaceListerExpansion interface{} diff --git a/cmd/code-generator/_examples/apiserver/listers/example2/v1/testtype.go b/cmd/code-generator/_examples/apiserver/listers/example2/v1/testtype.go new file mode 100644 index 0000000..a74964e --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/listers/example2/v1/testtype.go @@ -0,0 +1,99 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1 "k8s.io/code-generator/_examples/apiserver/apis/example2/v1" +) + +// TestTypeLister helps list TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeLister interface { + // List lists all TestTypes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TestType, err error) + // TestTypes returns an object that can list and get TestTypes. + TestTypes(namespace string) TestTypeNamespaceLister + TestTypeListerExpansion +} + +// testTypeLister implements the TestTypeLister interface. +type testTypeLister struct { + indexer cache.Indexer +} + +// NewTestTypeLister returns a new TestTypeLister. +func NewTestTypeLister(indexer cache.Indexer) TestTypeLister { + return &testTypeLister{indexer: indexer} +} + +// List lists all TestTypes in the indexer. +func (s *testTypeLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TestType)) + }) + return ret, err +} + +// TestTypes returns an object that can list and get TestTypes. +func (s *testTypeLister) TestTypes(namespace string) TestTypeNamespaceLister { + return testTypeNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// TestTypeNamespaceLister helps list and get TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeNamespaceLister interface { + // List lists all TestTypes in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TestType, err error) + // Get retrieves the TestType from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.TestType, error) + TestTypeNamespaceListerExpansion +} + +// testTypeNamespaceLister implements the TestTypeNamespaceLister +// interface. +type testTypeNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all TestTypes in the indexer for a given namespace. +func (s testTypeNamespaceLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TestType)) + }) + return ret, err +} + +// Get retrieves the TestType from the indexer for a given namespace and name. +func (s testTypeNamespaceLister) Get(name string) (*v1.TestType, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("testtype"), name) + } + return obj.(*v1.TestType), nil +} diff --git a/cmd/code-generator/_examples/apiserver/listers/example3.io/internalversion/expansion_generated.go b/cmd/code-generator/_examples/apiserver/listers/example3.io/internalversion/expansion_generated.go new file mode 100644 index 0000000..4bb8715 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/listers/example3.io/internalversion/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package internalversion + +// TestTypeListerExpansion allows custom methods to be added to +// TestTypeLister. +type TestTypeListerExpansion interface{} + +// TestTypeNamespaceListerExpansion allows custom methods to be added to +// TestTypeNamespaceLister. +type TestTypeNamespaceListerExpansion interface{} diff --git a/cmd/code-generator/_examples/apiserver/listers/example3.io/internalversion/testtype.go b/cmd/code-generator/_examples/apiserver/listers/example3.io/internalversion/testtype.go new file mode 100644 index 0000000..bbb3340 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/listers/example3.io/internalversion/testtype.go @@ -0,0 +1,99 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package internalversion + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + example3io "k8s.io/code-generator/_examples/apiserver/apis/example3.io" +) + +// TestTypeLister helps list TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeLister interface { + // List lists all TestTypes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*example3io.TestType, err error) + // TestTypes returns an object that can list and get TestTypes. + TestTypes(namespace string) TestTypeNamespaceLister + TestTypeListerExpansion +} + +// testTypeLister implements the TestTypeLister interface. +type testTypeLister struct { + indexer cache.Indexer +} + +// NewTestTypeLister returns a new TestTypeLister. +func NewTestTypeLister(indexer cache.Indexer) TestTypeLister { + return &testTypeLister{indexer: indexer} +} + +// List lists all TestTypes in the indexer. +func (s *testTypeLister) List(selector labels.Selector) (ret []*example3io.TestType, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*example3io.TestType)) + }) + return ret, err +} + +// TestTypes returns an object that can list and get TestTypes. +func (s *testTypeLister) TestTypes(namespace string) TestTypeNamespaceLister { + return testTypeNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// TestTypeNamespaceLister helps list and get TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeNamespaceLister interface { + // List lists all TestTypes in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*example3io.TestType, err error) + // Get retrieves the TestType from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*example3io.TestType, error) + TestTypeNamespaceListerExpansion +} + +// testTypeNamespaceLister implements the TestTypeNamespaceLister +// interface. +type testTypeNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all TestTypes in the indexer for a given namespace. +func (s testTypeNamespaceLister) List(selector labels.Selector) (ret []*example3io.TestType, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*example3io.TestType)) + }) + return ret, err +} + +// Get retrieves the TestType from the indexer for a given namespace and name. +func (s testTypeNamespaceLister) Get(name string) (*example3io.TestType, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(example3io.Resource("testtype"), name) + } + return obj.(*example3io.TestType), nil +} diff --git a/cmd/code-generator/_examples/apiserver/listers/example3.io/v1/expansion_generated.go b/cmd/code-generator/_examples/apiserver/listers/example3.io/v1/expansion_generated.go new file mode 100644 index 0000000..0192e05 --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/listers/example3.io/v1/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +// TestTypeListerExpansion allows custom methods to be added to +// TestTypeLister. +type TestTypeListerExpansion interface{} + +// TestTypeNamespaceListerExpansion allows custom methods to be added to +// TestTypeNamespaceLister. +type TestTypeNamespaceListerExpansion interface{} diff --git a/cmd/code-generator/_examples/apiserver/listers/example3.io/v1/testtype.go b/cmd/code-generator/_examples/apiserver/listers/example3.io/v1/testtype.go new file mode 100644 index 0000000..698b50a --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/listers/example3.io/v1/testtype.go @@ -0,0 +1,99 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1 "k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1" +) + +// TestTypeLister helps list TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeLister interface { + // List lists all TestTypes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TestType, err error) + // TestTypes returns an object that can list and get TestTypes. + TestTypes(namespace string) TestTypeNamespaceLister + TestTypeListerExpansion +} + +// testTypeLister implements the TestTypeLister interface. +type testTypeLister struct { + indexer cache.Indexer +} + +// NewTestTypeLister returns a new TestTypeLister. +func NewTestTypeLister(indexer cache.Indexer) TestTypeLister { + return &testTypeLister{indexer: indexer} +} + +// List lists all TestTypes in the indexer. +func (s *testTypeLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TestType)) + }) + return ret, err +} + +// TestTypes returns an object that can list and get TestTypes. +func (s *testTypeLister) TestTypes(namespace string) TestTypeNamespaceLister { + return testTypeNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// TestTypeNamespaceLister helps list and get TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeNamespaceLister interface { + // List lists all TestTypes in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TestType, err error) + // Get retrieves the TestType from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.TestType, error) + TestTypeNamespaceListerExpansion +} + +// testTypeNamespaceLister implements the TestTypeNamespaceLister +// interface. +type testTypeNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all TestTypes in the indexer for a given namespace. +func (s testTypeNamespaceLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TestType)) + }) + return ret, err +} + +// Get retrieves the TestType from the indexer for a given namespace and name. +func (s testTypeNamespaceLister) Get(name string) (*v1.TestType, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("testtype"), name) + } + return obj.(*v1.TestType), nil +} diff --git a/cmd/code-generator/_examples/apiserver/openapi/zz_generated.openapi.go b/cmd/code-generator/_examples/apiserver/openapi/zz_generated.openapi.go new file mode 100644 index 0000000..82f108e --- /dev/null +++ b/cmd/code-generator/_examples/apiserver/openapi/zz_generated.openapi.go @@ -0,0 +1,2700 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by openapi-gen. DO NOT EDIT. + +// This file was autogenerated by openapi-gen. Do not edit it manually! + +package openapi + +import ( + spec "github.com/go-openapi/spec" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + common "k8s.io/kube-openapi/pkg/common" +) + +func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { + return map[string]common.OpenAPIDefinition{ + "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Condition": schema_pkg_apis_meta_v1_Condition(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.CreateOptions": schema_pkg_apis_meta_v1_CreateOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.DeleteOptions": schema_pkg_apis_meta_v1_DeleteOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Duration": schema_pkg_apis_meta_v1_Duration(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ExportOptions": schema_pkg_apis_meta_v1_ExportOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry": schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata": schema_pkg_apis_meta_v1_PartialObjectMetadata(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadataList": schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.PatchOptions": schema_pkg_apis_meta_v1_PatchOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Table": schema_pkg_apis_meta_v1_Table(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition": schema_pkg_apis_meta_v1_TableColumnDefinition(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TableOptions": schema_pkg_apis_meta_v1_TableOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow": schema_pkg_apis_meta_v1_TableRow(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition": schema_pkg_apis_meta_v1_TableRowCondition(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.UpdateOptions": schema_pkg_apis_meta_v1_UpdateOptions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref), + "k8s.io/apimachinery/pkg/runtime.RawExtension": schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref), + "k8s.io/apimachinery/pkg/runtime.TypeMeta": schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref), + "k8s.io/apimachinery/pkg/runtime.Unknown": schema_k8sio_apimachinery_pkg_runtime_Unknown(ref), + "k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(ref), + "k8s.io/code-generator/_examples/apiserver/apis/example/v1.TestType": schema_apiserver_apis_example_v1_TestType(ref), + "k8s.io/code-generator/_examples/apiserver/apis/example/v1.TestTypeList": schema_apiserver_apis_example_v1_TestTypeList(ref), + "k8s.io/code-generator/_examples/apiserver/apis/example/v1.TestTypeStatus": schema_apiserver_apis_example_v1_TestTypeStatus(ref), + "k8s.io/code-generator/_examples/apiserver/apis/example2/v1.TestType": schema_apiserver_apis_example2_v1_TestType(ref), + "k8s.io/code-generator/_examples/apiserver/apis/example2/v1.TestTypeList": schema_apiserver_apis_example2_v1_TestTypeList(ref), + "k8s.io/code-generator/_examples/apiserver/apis/example2/v1.TestTypeStatus": schema_apiserver_apis_example2_v1_TestTypeStatus(ref), + "k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1.TestType": schema_apiserver_apis_example3io_v1_TestType(ref), + "k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1.TestTypeList": schema_apiserver_apis_example3io_v1_TestTypeList(ref), + "k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1.TestTypeStatus": schema_apiserver_apis_example3io_v1_TestTypeStatus(ref), + } +} + +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.", + Type: []string{"string"}, + Format: "", + }, + }, + "versions": { + 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("k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery"), + }, + }, + }, + }, + }, + "preferredVersion": { + SchemaProps: spec.SchemaProps{ + Description: "preferredVersion is the version preferred by the API server, which probably is the storage version.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery"), + }, + }, + "serverAddressByClientCIDRs": { + 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("k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"), + }, + }, + }, + }, + }, + }, + Required: []string{"name", "versions"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery", "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"}, + } +} + +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": { + SchemaProps: spec.SchemaProps{ + Description: "groups is a list of APIGroup.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup"), + }, + }, + }, + }, + }, + }, + Required: []string{"groups"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup"}, + } +} + +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.", + 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.", + Type: []string{"string"}, + Format: "", + }, + }, + "namespaced": { + SchemaProps: spec.SchemaProps{ + Description: "namespaced indicates if a resource is namespaced or not.", + 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')", + 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": { + 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": { + 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.", + Type: []string{"string"}, + Format: "", + }, + }, + "resources": { + 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("k8s.io/apimachinery/pkg/apis/meta/v1.APIResource"), + }, + }, + }, + }, + }, + }, + Required: []string{"groupVersion", "resources"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource"}, + } +} + +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": { + 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": { + 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("k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"), + }, + }, + }, + }, + }, + }, + Required: []string{"versions", "serverAddressByClientCIDRs"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"}, + } +} + +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.", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status of the condition, one of True, False, Unknown.", + 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("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "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.", + 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.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"type", "status", "lastTransitionTime", "reason", "message"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +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": { + 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: "", + }, + }, + }, + }, + }, + } +} + +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("k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions"), + }, + }, + "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": { + 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: "", + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions"}, + } +} + +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_ExportOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ExportOptions is the query options to the standard REST get call. Deprecated. Planned for removal in 1.18.", + 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: "", + }, + }, + "export": { + SchemaProps: spec.SchemaProps{ + Description: "Should this value be exported. Export strips fields that a user can not specify. Deprecated. Planned for removal in 1.18.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "exact": { + SchemaProps: spec.SchemaProps{ + Description: "Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. Deprecated. Planned for removal in 1.18.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"export", "exact"}, + }, + }, + } +} + +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{ + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + 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{ + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + 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{ + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + 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\"", + 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.", + 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 coersion. It doesn't use a GroupVersion to avoid custom marshalling", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + 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 coersion. It doesn't use a GroupVersion to avoid custom marshalling", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + 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{ + 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.", + Ref: ref("k8s.io/apimachinery/pkg/runtime.Object"), + }, + }, + }, + Required: []string{"Type", "Object"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/runtime.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": { + 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("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"}, + } +} + +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": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-patch-merge-key": "key", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "key is the label key that the selector applies to.", + 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.", + Type: []string{"string"}, + Format: "", + }, + }, + "values": { + 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", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "List of objects", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + } +} + +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: "selfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.", + 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", + }, + }, + }, + }, + }, + } +} + +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. If the feature gate WatchBookmarks is not enabled in apiserver, 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: "", + }, + }, + }, + }, + }, + } +} + +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 timestamp of when these fields were set. It should always be empty if Operation is 'Apply'", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "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("k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +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: http://kubernetes.io/docs/user-guide/identifiers#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 NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\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: http://kubernetes.io/docs/user-guide/namespaces", + Type: []string{"string"}, + Format: "", + }, + }, + "selfLink": { + SchemaProps: spec.SchemaProps{ + Description: "SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.", + 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: http://kubernetes.io/docs/user-guide/identifiers#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("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "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("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "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: http://kubernetes.io/docs/user-guide/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: http://kubernetes.io/docs/user-guide/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-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("k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference"), + }, + }, + }, + }, + }, + "finalizers": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "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: "", + }, + }, + }, + }, + }, + "clusterName": { + SchemaProps: spec.SchemaProps{ + Description: "The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.", + Type: []string{"string"}, + Format: "", + }, + }, + "managedFields": { + 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("k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry", "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +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.", + 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", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names", + Type: []string{"string"}, + Format: "", + }, + }, + "uid": { + SchemaProps: spec.SchemaProps{ + Description: "UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids", + 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. 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"}, + }, + }, + } +} + +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", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +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", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "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("k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata"}, + } +} + +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": { + 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: "", + }, + }, + }, + }, + }, + } +} + +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": { + 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.", + 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.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"clientCIDR", "serverAddress"}, + }, + }, + } +} + +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", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "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("k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails"), + }, + }, + "code": { + SchemaProps: spec.SchemaProps{ + Description: "Suggested HTTP return code for this status, 0 if not set.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails"}, + } +} + +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: http://kubernetes.io/docs/user-guide/identifiers#uids", + Type: []string{"string"}, + Format: "", + }, + }, + "causes": { + 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("k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause"), + }, + }, + }, + }, + }, + "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{ + "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause"}, + } +} + +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", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "columnDefinitions": { + 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("k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition"), + }, + }, + }, + }, + }, + "rows": { + 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("k8s.io/apimachinery/pkg/apis/meta/v1.TableRow"), + }, + }, + }, + }, + }, + }, + Required: []string{"columnDefinitions", "rows"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition", "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow"}, + } +} + +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.", + 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.", + 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.", + Type: []string{"string"}, + Format: "", + }, + }, + "description": { + SchemaProps: spec.SchemaProps{ + Description: "description is a human readable description of this column.", + 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.", + 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": { + 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": { + 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("k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition"), + }, + }, + }, + }, + }, + "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("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + }, + Required: []string{"cells"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + } +} + +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.", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Status of the condition, one of True, False, Unknown.", + 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.", + 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.", + 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": { + 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: "", + }, + }, + }, + }, + }, + } +} + +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{ + 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("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + }, + Required: []string{"type", "object"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + } +} + +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: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.Object `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// External package: type MyAPIObject struct {\n\truntime.TypeMeta `json:\",inline\"`\n\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n} type PluginA struct {\n\tAOption string `json:\"aOption\"`\n}\n\n// On the wire, the JSON will look something like this: {\n\t\"kind\":\"MyAPIObject\",\n\t\"apiVersion\":\"v1\",\n\t\"myPlugin\": {\n\t\t\"kind\":\"PluginA\",\n\t\t\"aOption\":\"foo\",\n\t},\n}\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: type MyAwesomeAPIObject struct {\n runtime.TypeMeta `json:\",inline\"`\n ... // other fields\n} func (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: "", + }, + }, + "Raw": { + SchemaProps: spec.SchemaProps{ + Description: "Raw will hold the complete serialized object which couldn't be matched with a registered type. Most likely, nothing should be done with this except for passing it through the system.", + Type: []string{"string"}, + Format: "byte", + }, + }, + "ContentEncoding": { + SchemaProps: spec.SchemaProps{ + Description: "ContentEncoding is encoding used to encode 'Raw' data. Unspecified means no encoding.", + Type: []string{"string"}, + Format: "", + }, + }, + "ContentType": { + SchemaProps: spec.SchemaProps{ + Description: "ContentType is serialization method used to serialize 'Raw'. Unspecified means ContentTypeJSON.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"Raw", "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{ + Type: []string{"string"}, + Format: "", + }, + }, + "minor": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "gitVersion": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "gitCommit": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "gitTreeState": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "buildDate": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "goVersion": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "compiler": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "platform": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"major", "minor", "gitVersion", "gitCommit", "gitTreeState", "buildDate", "goVersion", "compiler", "platform"}, + }, + }, + } +} + +func schema_apiserver_apis_example_v1_TestType(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TestType is a top-level type. A client is created for it.", + 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{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/code-generator/_examples/apiserver/apis/example/v1.TestTypeStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/code-generator/_examples/apiserver/apis/example/v1.TestTypeStatus"}, + } +} + +func schema_apiserver_apis_example_v1_TestTypeList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TestTypeList is a top-level list type. The client methods for lists are automatically created. You are not supposed to create a separated client for this one.", + 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{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/code-generator/_examples/apiserver/apis/example/v1.TestType"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/code-generator/_examples/apiserver/apis/example/v1.TestType"}, + } +} + +func schema_apiserver_apis_example_v1_TestTypeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "Blah": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"Blah"}, + }, + }, + } +} + +func schema_apiserver_apis_example2_v1_TestType(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TestType is a top-level type. A client is created for it.", + 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{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/code-generator/_examples/apiserver/apis/example2/v1.TestTypeStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/code-generator/_examples/apiserver/apis/example2/v1.TestTypeStatus"}, + } +} + +func schema_apiserver_apis_example2_v1_TestTypeList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TestTypeList is a top-level list type. The client methods for lists are automatically created. You are not supposed to create a separated client for this one.", + 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{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/code-generator/_examples/apiserver/apis/example2/v1.TestType"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/code-generator/_examples/apiserver/apis/example2/v1.TestType"}, + } +} + +func schema_apiserver_apis_example2_v1_TestTypeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "Blah": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"Blah"}, + }, + }, + } +} + +func schema_apiserver_apis_example3io_v1_TestType(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TestType is a top-level type. A client is created for it.", + 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{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1.TestTypeStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1.TestTypeStatus"}, + } +} + +func schema_apiserver_apis_example3io_v1_TestTypeList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TestTypeList is a top-level list type. The client methods for lists are automatically created. You are not supposed to create a separated client for this one.", + 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{ + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1.TestType"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/code-generator/_examples/apiserver/apis/example3.io/v1.TestType"}, + } +} + +func schema_apiserver_apis_example3io_v1_TestTypeStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "Blah": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"Blah"}, + }, + }, + } +} diff --git a/cmd/code-generator/_examples/crd/apis/example/v1/doc.go b/cmd/code-generator/_examples/crd/apis/example/v1/doc.go new file mode 100644 index 0000000..673ac55 --- /dev/null +++ b/cmd/code-generator/_examples/crd/apis/example/v1/doc.go @@ -0,0 +1,21 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package +// +k8s:defaulter-gen=TypeMeta +// +groupName=example.crd.code-generator.k8s.io + +package v1 diff --git a/cmd/code-generator/_examples/crd/apis/example/v1/register.go b/cmd/code-generator/_examples/crd/apis/example/v1/register.go new file mode 100644 index 0000000..58371e0 --- /dev/null +++ b/cmd/code-generator/_examples/crd/apis/example/v1/register.go @@ -0,0 +1,59 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var SchemeGroupVersion = schema.GroupVersion{Group: "example.crd.code-generator.k8s.io", Version: "v1"} + +var ( + // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// Adds the list of known types to the given scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &TestType{}, + &TestTypeList{}, + ) + + scheme.AddKnownTypes(SchemeGroupVersion, + &metav1.Status{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/cmd/code-generator/_examples/crd/apis/example/v1/types.go b/cmd/code-generator/_examples/crd/apis/example/v1/types.go new file mode 100644 index 0000000..8543ad2 --- /dev/null +++ b/cmd/code-generator/_examples/crd/apis/example/v1/types.go @@ -0,0 +1,74 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestType is a top-level type. A client is created for it. +type TestType struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + // +optional + Status TestTypeStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestTypeList is a top-level list type. The client methods for lists are automatically created. +// You are not supposed to create a separated client for this one. +type TestTypeList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + + Items []TestType `json:"items"` +} + +type TestTypeStatus struct { + Blah string +} + +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type ClusterTestTypeList struct { + metav1.TypeMeta + metav1.ListMeta + Items []ClusterTestType +} + +// +genclient +// +genclient:nonNamespaced +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +genclient:method=GetScale,verb=get,subresource=scale,result=k8s.io/api/autoscaling/v1.Scale +// +genclient:method=UpdateScale,verb=update,subresource=scale,input=k8s.io/api/autoscaling/v1.Scale,result=k8s.io/api/autoscaling/v1.Scale + +type ClusterTestType struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + // +optional + Status ClusterTestTypeStatus `json:"status,omitempty"` +} + +type ClusterTestTypeStatus struct { + Blah string +} diff --git a/cmd/code-generator/_examples/crd/apis/example/v1/zz_generated.deepcopy.go b/cmd/code-generator/_examples/crd/apis/example/v1/zz_generated.deepcopy.go new file mode 100644 index 0000000..9f55a39 --- /dev/null +++ b/cmd/code-generator/_examples/crd/apis/example/v1/zz_generated.deepcopy.go @@ -0,0 +1,177 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterTestType) DeepCopyInto(out *ClusterTestType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTestType. +func (in *ClusterTestType) DeepCopy() *ClusterTestType { + if in == nil { + return nil + } + out := new(ClusterTestType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterTestType) 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 *ClusterTestTypeList) DeepCopyInto(out *ClusterTestTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterTestType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTestTypeList. +func (in *ClusterTestTypeList) DeepCopy() *ClusterTestTypeList { + if in == nil { + return nil + } + out := new(ClusterTestTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterTestTypeList) 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 *ClusterTestTypeStatus) DeepCopyInto(out *ClusterTestTypeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterTestTypeStatus. +func (in *ClusterTestTypeStatus) DeepCopy() *ClusterTestTypeStatus { + if in == nil { + return nil + } + out := new(ClusterTestTypeStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TestType) DeepCopyInto(out *TestType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestType. +func (in *TestType) DeepCopy() *TestType { + if in == nil { + return nil + } + out := new(TestType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestType) 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 *TestTypeList) DeepCopyInto(out *TestTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TestType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeList. +func (in *TestTypeList) DeepCopy() *TestTypeList { + if in == nil { + return nil + } + out := new(TestTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestTypeList) 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 *TestTypeStatus) DeepCopyInto(out *TestTypeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeStatus. +func (in *TestTypeStatus) DeepCopy() *TestTypeStatus { + if in == nil { + return nil + } + out := new(TestTypeStatus) + in.DeepCopyInto(out) + return out +} diff --git a/cmd/code-generator/_examples/crd/apis/example/v1/zz_generated.defaults.go b/cmd/code-generator/_examples/crd/apis/example/v1/zz_generated.defaults.go new file mode 100644 index 0000000..cce2e60 --- /dev/null +++ b/cmd/code-generator/_examples/crd/apis/example/v1/zz_generated.defaults.go @@ -0,0 +1,32 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + return nil +} diff --git a/cmd/code-generator/_examples/crd/apis/example2/v1/doc.go b/cmd/code-generator/_examples/crd/apis/example2/v1/doc.go new file mode 100644 index 0000000..5d1cbec --- /dev/null +++ b/cmd/code-generator/_examples/crd/apis/example2/v1/doc.go @@ -0,0 +1,22 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// +k8s:deepcopy-gen=package +// +k8s:defaulter-gen=TypeMeta +// +groupName=example.test.crd.code-generator.k8s.io +// +groupGoName=SecondExample + +package v1 diff --git a/cmd/code-generator/_examples/crd/apis/example2/v1/register.go b/cmd/code-generator/_examples/crd/apis/example2/v1/register.go new file mode 100644 index 0000000..d0a852a --- /dev/null +++ b/cmd/code-generator/_examples/crd/apis/example2/v1/register.go @@ -0,0 +1,59 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var SchemeGroupVersion = schema.GroupVersion{Group: "example.test.crd.code-generator.k8s.io", Version: "v1"} + +var ( + // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + AddToScheme = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// Adds the list of known types to api.Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &TestType{}, + &TestTypeList{}, + ) + + scheme.AddKnownTypes(SchemeGroupVersion, + &metav1.Status{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/cmd/code-generator/_examples/crd/apis/example2/v1/types.go b/cmd/code-generator/_examples/crd/apis/example2/v1/types.go new file mode 100644 index 0000000..5c2ebc4 --- /dev/null +++ b/cmd/code-generator/_examples/crd/apis/example2/v1/types.go @@ -0,0 +1,47 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1 + +import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestType is a top-level type. A client is created for it. +type TestType struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + // +optional + Status TestTypeStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// TestTypeList is a top-level list type. The client methods for lists are automatically created. +// You are not supposed to create a separated client for this one. +type TestTypeList struct { + metav1.TypeMeta `json:",inline"` + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + + Items []TestType `json:"items"` +} + +type TestTypeStatus struct { + Blah string +} diff --git a/cmd/code-generator/_examples/crd/apis/example2/v1/zz_generated.deepcopy.go b/cmd/code-generator/_examples/crd/apis/example2/v1/zz_generated.deepcopy.go new file mode 100644 index 0000000..ec5a6e9 --- /dev/null +++ b/cmd/code-generator/_examples/crd/apis/example2/v1/zz_generated.deepcopy.go @@ -0,0 +1,101 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TestType) DeepCopyInto(out *TestType) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestType. +func (in *TestType) DeepCopy() *TestType { + if in == nil { + return nil + } + out := new(TestType) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestType) 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 *TestTypeList) DeepCopyInto(out *TestTypeList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]TestType, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeList. +func (in *TestTypeList) DeepCopy() *TestTypeList { + if in == nil { + return nil + } + out := new(TestTypeList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *TestTypeList) 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 *TestTypeStatus) DeepCopyInto(out *TestTypeStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestTypeStatus. +func (in *TestTypeStatus) DeepCopy() *TestTypeStatus { + if in == nil { + return nil + } + out := new(TestTypeStatus) + in.DeepCopyInto(out) + return out +} diff --git a/cmd/code-generator/_examples/crd/apis/example2/v1/zz_generated.defaults.go b/cmd/code-generator/_examples/crd/apis/example2/v1/zz_generated.defaults.go new file mode 100644 index 0000000..cce2e60 --- /dev/null +++ b/cmd/code-generator/_examples/crd/apis/example2/v1/zz_generated.defaults.go @@ -0,0 +1,32 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by defaulter-gen. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + return nil +} diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/clientset.go b/cmd/code-generator/_examples/crd/clientset/versioned/clientset.go new file mode 100644 index 0000000..253222c --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/clientset.go @@ -0,0 +1,111 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" + examplev1 "k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1" + secondexamplev1 "k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + ExampleV1() examplev1.ExampleV1Interface + SecondExampleV1() secondexamplev1.SecondExampleV1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + exampleV1 *examplev1.ExampleV1Client + secondExampleV1 *secondexamplev1.SecondExampleV1Client +} + +// ExampleV1 retrieves the ExampleV1Client +func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface { + return c.exampleV1 +} + +// SecondExampleV1 retrieves the SecondExampleV1Client +func (c *Clientset) SecondExampleV1() secondexamplev1.SecondExampleV1Interface { + return c.secondExampleV1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + 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. +func NewForConfig(c *rest.Config) (*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.exampleV1, err = examplev1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + cs.secondExampleV1, err = secondexamplev1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) + 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 { + var cs Clientset + cs.exampleV1 = examplev1.NewForConfigOrDie(c) + cs.secondExampleV1 = secondexamplev1.NewForConfigOrDie(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) + return &cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.exampleV1 = examplev1.New(c) + cs.secondExampleV1 = secondexamplev1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/doc.go b/cmd/code-generator/_examples/crd/clientset/versioned/doc.go new file mode 100644 index 0000000..41721ca --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/fake/clientset_generated.go b/cmd/code-generator/_examples/crd/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 0000000..0c95092 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" + clientset "k8s.io/code-generator/_examples/crd/clientset/versioned" + examplev1 "k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1" + fakeexamplev1 "k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake" + secondexamplev1 "k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1" + fakesecondexamplev1 "k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake" +) + +// 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 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) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + 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.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var _ clientset.Interface = &Clientset{} + +// ExampleV1 retrieves the ExampleV1Client +func (c *Clientset) ExampleV1() examplev1.ExampleV1Interface { + return &fakeexamplev1.FakeExampleV1{Fake: &c.Fake} +} + +// SecondExampleV1 retrieves the SecondExampleV1Client +func (c *Clientset) SecondExampleV1() secondexamplev1.SecondExampleV1Interface { + return &fakesecondexamplev1.FakeSecondExampleV1{Fake: &c.Fake} +} diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/fake/doc.go b/cmd/code-generator/_examples/crd/clientset/versioned/fake/doc.go new file mode 100644 index 0000000..9b99e71 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/fake/register.go b/cmd/code-generator/_examples/crd/clientset/versioned/fake/register.go new file mode 100644 index 0000000..685c49d --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/fake/register.go @@ -0,0 +1,58 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + 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" + examplev1 "k8s.io/code-generator/_examples/crd/apis/example/v1" + secondexamplev1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + examplev1.AddToScheme, + secondexamplev1.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/cmd/code-generator/_examples/crd/clientset/versioned/scheme/doc.go b/cmd/code-generator/_examples/crd/clientset/versioned/scheme/doc.go new file mode 100644 index 0000000..7dc3756 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/scheme/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/scheme/register.go b/cmd/code-generator/_examples/crd/clientset/versioned/scheme/register.go new file mode 100644 index 0000000..a98fc7e --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/scheme/register.go @@ -0,0 +1,58 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + 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" + examplev1 "k8s.io/code-generator/_examples/crd/apis/example/v1" + secondexamplev1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" +) + +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + examplev1.AddToScheme, + secondexamplev1.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/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go new file mode 100644 index 0000000..72af4f0 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/clustertesttype.go @@ -0,0 +1,215 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + autoscalingv1 "k8s.io/api/autoscaling/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/crd/apis/example/v1" + scheme "k8s.io/code-generator/_examples/crd/clientset/versioned/scheme" +) + +// ClusterTestTypesGetter has a method to return a ClusterTestTypeInterface. +// A group's client should implement this interface. +type ClusterTestTypesGetter interface { + ClusterTestTypes() ClusterTestTypeInterface +} + +// ClusterTestTypeInterface has methods to work with ClusterTestType resources. +type ClusterTestTypeInterface interface { + Create(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.CreateOptions) (*v1.ClusterTestType, error) + Update(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (*v1.ClusterTestType, error) + UpdateStatus(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (*v1.ClusterTestType, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterTestType, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterTestTypeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterTestType, err error) + GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) + UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) + + ClusterTestTypeExpansion +} + +// clusterTestTypes implements ClusterTestTypeInterface +type clusterTestTypes struct { + client rest.Interface +} + +// newClusterTestTypes returns a ClusterTestTypes +func newClusterTestTypes(c *ExampleV1Client) *clusterTestTypes { + return &clusterTestTypes{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterTestType, and returns the corresponding clusterTestType object, and an error if there is any. +func (c *clusterTestTypes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Get(). + Resource("clustertesttypes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterTestTypes that match those selectors. +func (c *clusterTestTypes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterTestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ClusterTestTypeList{} + err = c.client.Get(). + Resource("clustertesttypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterTestTypes. +func (c *clusterTestTypes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("clustertesttypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterTestType and creates it. Returns the server's representation of the clusterTestType, and an error, if there is any. +func (c *clusterTestTypes) Create(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.CreateOptions) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Post(). + Resource("clustertesttypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTestType). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterTestType and updates it. Returns the server's representation of the clusterTestType, and an error, if there is any. +func (c *clusterTestTypes) Update(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Put(). + Resource("clustertesttypes"). + Name(clusterTestType.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTestType). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *clusterTestTypes) UpdateStatus(ctx context.Context, clusterTestType *v1.ClusterTestType, opts metav1.UpdateOptions) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Put(). + Resource("clustertesttypes"). + Name(clusterTestType.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTestType). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. +func (c *clusterTestTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("clustertesttypes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterTestTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clustertesttypes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterTestType. +func (c *clusterTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterTestType, err error) { + result = &v1.ClusterTestType{} + err = c.client.Patch(pt). + Resource("clustertesttypes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// GetScale takes name of the clusterTestType, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. +func (c *clusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { + result = &autoscalingv1.Scale{} + err = c.client.Get(). + Resource("clustertesttypes"). + Name(clusterTestTypeName). + SubResource("scale"). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. +func (c *clusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { + result = &autoscalingv1.Scale{} + err = c.client.Put(). + Resource("clustertesttypes"). + Name(clusterTestTypeName). + SubResource("scale"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(scale). + Do(ctx). + Into(result) + return +} diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/doc.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/doc.go new file mode 100644 index 0000000..3af5d05 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/example_client.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/example_client.go new file mode 100644 index 0000000..358d7d9 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/example_client.go @@ -0,0 +1,94 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/crd/apis/example/v1" + "k8s.io/code-generator/_examples/crd/clientset/versioned/scheme" +) + +type ExampleV1Interface interface { + RESTClient() rest.Interface + ClusterTestTypesGetter + TestTypesGetter +} + +// ExampleV1Client is used to interact with features provided by the example.crd.code-generator.k8s.io group. +type ExampleV1Client struct { + restClient rest.Interface +} + +func (c *ExampleV1Client) ClusterTestTypes() ClusterTestTypeInterface { + return newClusterTestTypes(c) +} + +func (c *ExampleV1Client) TestTypes(namespace string) TestTypeInterface { + return newTestTypes(c, namespace) +} + +// NewForConfig creates a new ExampleV1Client for the given config. +func NewForConfig(c *rest.Config) (*ExampleV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &ExampleV1Client{client}, nil +} + +// NewForConfigOrDie creates a new ExampleV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ExampleV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ExampleV1Client for the given RESTClient. +func New(c rest.Interface) *ExampleV1Client { + return &ExampleV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *ExampleV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/doc.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/doc.go new file mode 100644 index 0000000..16f4439 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go new file mode 100644 index 0000000..8adf090 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_clustertesttype.go @@ -0,0 +1,154 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + autoscalingv1 "k8s.io/api/autoscaling/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + examplev1 "k8s.io/code-generator/_examples/crd/apis/example/v1" +) + +// FakeClusterTestTypes implements ClusterTestTypeInterface +type FakeClusterTestTypes struct { + Fake *FakeExampleV1 +} + +var clustertesttypesResource = schema.GroupVersionResource{Group: "example.crd.code-generator.k8s.io", Version: "v1", Resource: "clustertesttypes"} + +var clustertesttypesKind = schema.GroupVersionKind{Group: "example.crd.code-generator.k8s.io", Version: "v1", Kind: "ClusterTestType"} + +// Get takes name of the clusterTestType, and returns the corresponding clusterTestType object, and an error if there is any. +func (c *FakeClusterTestTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *examplev1.ClusterTestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clustertesttypesResource, name), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// List takes label and field selectors, and returns the list of ClusterTestTypes that match those selectors. +func (c *FakeClusterTestTypes) List(ctx context.Context, opts v1.ListOptions) (result *examplev1.ClusterTestTypeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clustertesttypesResource, clustertesttypesKind, opts), &examplev1.ClusterTestTypeList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &examplev1.ClusterTestTypeList{ListMeta: obj.(*examplev1.ClusterTestTypeList).ListMeta} + for _, item := range obj.(*examplev1.ClusterTestTypeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested clusterTestTypes. +func (c *FakeClusterTestTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clustertesttypesResource, opts)) +} + +// Create takes the representation of a clusterTestType and creates it. Returns the server's representation of the clusterTestType, and an error, if there is any. +func (c *FakeClusterTestTypes) Create(ctx context.Context, clusterTestType *examplev1.ClusterTestType, opts v1.CreateOptions) (result *examplev1.ClusterTestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clustertesttypesResource, clusterTestType), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// Update takes the representation of a clusterTestType and updates it. Returns the server's representation of the clusterTestType, and an error, if there is any. +func (c *FakeClusterTestTypes) Update(ctx context.Context, clusterTestType *examplev1.ClusterTestType, opts v1.UpdateOptions) (result *examplev1.ClusterTestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clustertesttypesResource, clusterTestType), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterTestTypes) UpdateStatus(ctx context.Context, clusterTestType *examplev1.ClusterTestType, opts v1.UpdateOptions) (*examplev1.ClusterTestType, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "status", clusterTestType), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// Delete takes name of the clusterTestType and deletes it. Returns an error if one occurs. +func (c *FakeClusterTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(clustertesttypesResource, name), &examplev1.ClusterTestType{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clustertesttypesResource, listOpts) + + _, err := c.Fake.Invokes(action, &examplev1.ClusterTestTypeList{}) + return err +} + +// Patch applies the patch and returns the patched clusterTestType. +func (c *FakeClusterTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *examplev1.ClusterTestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clustertesttypesResource, name, pt, data, subresources...), &examplev1.ClusterTestType{}) + if obj == nil { + return nil, err + } + return obj.(*examplev1.ClusterTestType), err +} + +// GetScale takes name of the clusterTestType, and returns the corresponding scale object, and an error if there is any. +func (c *FakeClusterTestTypes) GetScale(ctx context.Context, clusterTestTypeName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetSubresourceAction(clustertesttypesResource, "scale", clusterTestTypeName), &autoscalingv1.Scale{}) + if obj == nil { + return nil, err + } + return obj.(*autoscalingv1.Scale), err +} + +// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. +func (c *FakeClusterTestTypes) UpdateScale(ctx context.Context, clusterTestTypeName string, scale *autoscalingv1.Scale, opts v1.UpdateOptions) (result *autoscalingv1.Scale, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(clustertesttypesResource, "scale", scale), &autoscalingv1.Scale{}) + if obj == nil { + return nil, err + } + return obj.(*autoscalingv1.Scale), err +} diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_example_client.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_example_client.go new file mode 100644 index 0000000..e6aa999 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_example_client.go @@ -0,0 +1,44 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1 "k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example/v1" +) + +type FakeExampleV1 struct { + *testing.Fake +} + +func (c *FakeExampleV1) ClusterTestTypes() v1.ClusterTestTypeInterface { + return &FakeClusterTestTypes{c} +} + +func (c *FakeExampleV1) TestTypes(namespace string) v1.TestTypeInterface { + return &FakeTestTypes{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeExampleV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go new file mode 100644 index 0000000..8bfa33e --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/fake/fake_testtype.go @@ -0,0 +1,142 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + examplev1 "k8s.io/code-generator/_examples/crd/apis/example/v1" +) + +// FakeTestTypes implements TestTypeInterface +type FakeTestTypes struct { + Fake *FakeExampleV1 + ns string +} + +var testtypesResource = schema.GroupVersionResource{Group: "example.crd.code-generator.k8s.io", Version: "v1", Resource: "testtypes"} + +var testtypesKind = schema.GroupVersionKind{Group: "example.crd.code-generator.k8s.io", Version: "v1", Kind: "TestType"} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *FakeTestTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *FakeTestTypes) List(ctx context.Context, opts v1.ListOptions) (result *examplev1.TestTypeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &examplev1.TestTypeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &examplev1.TestTypeList{ListMeta: obj.(*examplev1.TestTypeList).ListMeta} + for _, item := range obj.(*examplev1.TestTypeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *FakeTestTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(testtypesResource, c.ns, opts)) + +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Create(ctx context.Context, testType *examplev1.TestType, opts v1.CreateOptions) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Update(ctx context.Context, testType *examplev1.TestType, opts v1.UpdateOptions) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *examplev1.TestType, opts v1.UpdateOptions) (*examplev1.TestType, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &examplev1.TestType{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &examplev1.TestTypeList{}) + return err +} + +// Patch applies the patch and returns the patched testType. +func (c *FakeTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *examplev1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &examplev1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*examplev1.TestType), err +} diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/generated_expansion.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/generated_expansion.go new file mode 100644 index 0000000..3059734 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/generated_expansion.go @@ -0,0 +1,23 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type ClusterTestTypeExpansion interface{} + +type TestTypeExpansion interface{} diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go new file mode 100644 index 0000000..862154a --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example/v1/testtype.go @@ -0,0 +1,195 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/crd/apis/example/v1" + scheme "k8s.io/code-generator/_examples/crd/clientset/versioned/scheme" +) + +// TestTypesGetter has a method to return a TestTypeInterface. +// A group's client should implement this interface. +type TestTypesGetter interface { + TestTypes(namespace string) TestTypeInterface +} + +// TestTypeInterface has methods to work with TestType resources. +type TestTypeInterface interface { + Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (*v1.TestType, error) + Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) + UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TestType, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TestTypeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TestType, err error) + TestTypeExpansion +} + +// testTypes implements TestTypeInterface +type testTypes struct { + client rest.Interface + ns string +} + +// newTestTypes returns a TestTypes +func newTestTypes(c *ExampleV1Client, namespace string) *testTypes { + return &testTypes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *testTypes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *testTypes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.TestTypeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *testTypes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Post(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *testTypes) UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *testTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *testTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched testType. +func (c *testTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/doc.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/doc.go new file mode 100644 index 0000000..3af5d05 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/example2_client.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/example2_client.go new file mode 100644 index 0000000..20ef564 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/example2_client.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" + "k8s.io/code-generator/_examples/crd/clientset/versioned/scheme" +) + +type SecondExampleV1Interface interface { + RESTClient() rest.Interface + TestTypesGetter +} + +// SecondExampleV1Client is used to interact with features provided by the example.test.crd.code-generator.k8s.io group. +type SecondExampleV1Client struct { + restClient rest.Interface +} + +func (c *SecondExampleV1Client) TestTypes(namespace string) TestTypeInterface { + return newTestTypes(c, namespace) +} + +// NewForConfig creates a new SecondExampleV1Client for the given config. +func NewForConfig(c *rest.Config) (*SecondExampleV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &SecondExampleV1Client{client}, nil +} + +// NewForConfigOrDie creates a new SecondExampleV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *SecondExampleV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new SecondExampleV1Client for the given RESTClient. +func New(c rest.Interface) *SecondExampleV1Client { + return &SecondExampleV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *SecondExampleV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/doc.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/doc.go new file mode 100644 index 0000000..16f4439 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go new file mode 100644 index 0000000..0d55a6b --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_example2_client.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1 "k8s.io/code-generator/_examples/crd/clientset/versioned/typed/example2/v1" +) + +type FakeSecondExampleV1 struct { + *testing.Fake +} + +func (c *FakeSecondExampleV1) TestTypes(namespace string) v1.TestTypeInterface { + return &FakeTestTypes{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeSecondExampleV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go new file mode 100644 index 0000000..8a01670 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/fake/fake_testtype.go @@ -0,0 +1,142 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + example2v1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" +) + +// FakeTestTypes implements TestTypeInterface +type FakeTestTypes struct { + Fake *FakeSecondExampleV1 + ns string +} + +var testtypesResource = schema.GroupVersionResource{Group: "example.test.crd.code-generator.k8s.io", Version: "v1", Resource: "testtypes"} + +var testtypesKind = schema.GroupVersionKind{Group: "example.test.crd.code-generator.k8s.io", Version: "v1", Kind: "TestType"} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *FakeTestTypes) Get(ctx context.Context, name string, options v1.GetOptions) (result *example2v1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(testtypesResource, c.ns, name), &example2v1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example2v1.TestType), err +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *FakeTestTypes) List(ctx context.Context, opts v1.ListOptions) (result *example2v1.TestTypeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(testtypesResource, testtypesKind, c.ns, opts), &example2v1.TestTypeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &example2v1.TestTypeList{ListMeta: obj.(*example2v1.TestTypeList).ListMeta} + for _, item := range obj.(*example2v1.TestTypeList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *FakeTestTypes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(testtypesResource, c.ns, opts)) + +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Create(ctx context.Context, testType *example2v1.TestType, opts v1.CreateOptions) (result *example2v1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(testtypesResource, c.ns, testType), &example2v1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example2v1.TestType), err +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *FakeTestTypes) Update(ctx context.Context, testType *example2v1.TestType, opts v1.UpdateOptions) (result *example2v1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(testtypesResource, c.ns, testType), &example2v1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example2v1.TestType), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeTestTypes) UpdateStatus(ctx context.Context, testType *example2v1.TestType, opts v1.UpdateOptions) (*example2v1.TestType, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(testtypesResource, "status", c.ns, testType), &example2v1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example2v1.TestType), err +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *FakeTestTypes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(testtypesResource, c.ns, name), &example2v1.TestType{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTestTypes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(testtypesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &example2v1.TestTypeList{}) + return err +} + +// Patch applies the patch and returns the patched testType. +func (c *FakeTestTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *example2v1.TestType, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(testtypesResource, c.ns, name, pt, data, subresources...), &example2v1.TestType{}) + + if obj == nil { + return nil, err + } + return obj.(*example2v1.TestType), err +} diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/generated_expansion.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/generated_expansion.go new file mode 100644 index 0000000..d513810 --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type TestTypeExpansion interface{} diff --git a/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go new file mode 100644 index 0000000..8a33b1c --- /dev/null +++ b/cmd/code-generator/_examples/crd/clientset/versioned/typed/example2/v1/testtype.go @@ -0,0 +1,195 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" + scheme "k8s.io/code-generator/_examples/crd/clientset/versioned/scheme" +) + +// TestTypesGetter has a method to return a TestTypeInterface. +// A group's client should implement this interface. +type TestTypesGetter interface { + TestTypes(namespace string) TestTypeInterface +} + +// TestTypeInterface has methods to work with TestType resources. +type TestTypeInterface interface { + Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (*v1.TestType, error) + Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) + UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (*v1.TestType, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TestType, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.TestTypeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TestType, err error) + TestTypeExpansion +} + +// testTypes implements TestTypeInterface +type testTypes struct { + client rest.Interface + ns string +} + +// newTestTypes returns a TestTypes +func newTestTypes(c *SecondExampleV1Client, namespace string) *testTypes { + return &testTypes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the testType, and returns the corresponding testType object, and an error if there is any. +func (c *testTypes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TestTypes that match those selectors. +func (c *testTypes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TestTypeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.TestTypeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested testTypes. +func (c *testTypes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a testType and creates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Create(ctx context.Context, testType *v1.TestType, opts metav1.CreateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Post(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a testType and updates it. Returns the server's representation of the testType, and an error, if there is any. +func (c *testTypes) Update(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *testTypes) UpdateStatus(ctx context.Context, testType *v1.TestType, opts metav1.UpdateOptions) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Put(). + Namespace(c.ns). + Resource("testtypes"). + Name(testType.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(testType). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the testType and deletes it. Returns an error if one occurs. +func (c *testTypes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *testTypes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("testtypes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched testType. +func (c *testTypes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TestType, err error) { + result = &v1.TestType{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("testtypes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/cmd/code-generator/_examples/crd/informers/externalversions/example/interface.go b/cmd/code-generator/_examples/crd/informers/externalversions/example/interface.go new file mode 100644 index 0000000..10c1894 --- /dev/null +++ b/cmd/code-generator/_examples/crd/informers/externalversions/example/interface.go @@ -0,0 +1,46 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package example + +import ( + v1 "k8s.io/code-generator/_examples/crd/informers/externalversions/example/v1" + internalinterfaces "k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/crd/informers/externalversions/example/v1/clustertesttype.go b/cmd/code-generator/_examples/crd/informers/externalversions/example/v1/clustertesttype.go new file mode 100644 index 0000000..ae0a3ea --- /dev/null +++ b/cmd/code-generator/_examples/crd/informers/externalversions/example/v1/clustertesttype.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + examplev1 "k8s.io/code-generator/_examples/crd/apis/example/v1" + versioned "k8s.io/code-generator/_examples/crd/clientset/versioned" + internalinterfaces "k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces" + v1 "k8s.io/code-generator/_examples/crd/listers/example/v1" +) + +// ClusterTestTypeInformer provides access to a shared informer and lister for +// ClusterTestTypes. +type ClusterTestTypeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.ClusterTestTypeLister +} + +type clusterTestTypeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewClusterTestTypeInformer constructs a new informer for ClusterTestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewClusterTestTypeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterTestTypeInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredClusterTestTypeInformer constructs a new informer for ClusterTestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredClusterTestTypeInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExampleV1().ClusterTestTypes().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExampleV1().ClusterTestTypes().Watch(context.TODO(), options) + }, + }, + &examplev1.ClusterTestType{}, + resyncPeriod, + indexers, + ) +} + +func (f *clusterTestTypeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterTestTypeInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *clusterTestTypeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&examplev1.ClusterTestType{}, f.defaultInformer) +} + +func (f *clusterTestTypeInformer) Lister() v1.ClusterTestTypeLister { + return v1.NewClusterTestTypeLister(f.Informer().GetIndexer()) +} diff --git a/cmd/code-generator/_examples/crd/informers/externalversions/example/v1/interface.go b/cmd/code-generator/_examples/crd/informers/externalversions/example/v1/interface.go new file mode 100644 index 0000000..1e17b13 --- /dev/null +++ b/cmd/code-generator/_examples/crd/informers/externalversions/example/v1/interface.go @@ -0,0 +1,52 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // ClusterTestTypes returns a ClusterTestTypeInformer. + ClusterTestTypes() ClusterTestTypeInformer + // TestTypes returns a TestTypeInformer. + TestTypes() TestTypeInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// ClusterTestTypes returns a ClusterTestTypeInformer. +func (v *version) ClusterTestTypes() ClusterTestTypeInformer { + return &clusterTestTypeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// TestTypes returns a TestTypeInformer. +func (v *version) TestTypes() TestTypeInformer { + return &testTypeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/cmd/code-generator/_examples/crd/informers/externalversions/example/v1/testtype.go b/cmd/code-generator/_examples/crd/informers/externalversions/example/v1/testtype.go new file mode 100644 index 0000000..90713a1 --- /dev/null +++ b/cmd/code-generator/_examples/crd/informers/externalversions/example/v1/testtype.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + examplev1 "k8s.io/code-generator/_examples/crd/apis/example/v1" + versioned "k8s.io/code-generator/_examples/crd/clientset/versioned" + internalinterfaces "k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces" + v1 "k8s.io/code-generator/_examples/crd/listers/example/v1" +) + +// TestTypeInformer provides access to a shared informer and lister for +// TestTypes. +type TestTypeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.TestTypeLister +} + +type testTypeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExampleV1().TestTypes(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ExampleV1().TestTypes(namespace).Watch(context.TODO(), options) + }, + }, + &examplev1.TestType{}, + resyncPeriod, + indexers, + ) +} + +func (f *testTypeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *testTypeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&examplev1.TestType{}, f.defaultInformer) +} + +func (f *testTypeInformer) Lister() v1.TestTypeLister { + return v1.NewTestTypeLister(f.Informer().GetIndexer()) +} diff --git a/cmd/code-generator/_examples/crd/informers/externalversions/example2/interface.go b/cmd/code-generator/_examples/crd/informers/externalversions/example2/interface.go new file mode 100644 index 0000000..0ea8f03 --- /dev/null +++ b/cmd/code-generator/_examples/crd/informers/externalversions/example2/interface.go @@ -0,0 +1,46 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package example2 + +import ( + v1 "k8s.io/code-generator/_examples/crd/informers/externalversions/example2/v1" + internalinterfaces "k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1 provides access to shared informers for resources in V1. + V1() v1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1 returns a new v1.Interface. +func (g *group) V1() v1.Interface { + return v1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/crd/informers/externalversions/example2/v1/interface.go b/cmd/code-generator/_examples/crd/informers/externalversions/example2/v1/interface.go new file mode 100644 index 0000000..0243522 --- /dev/null +++ b/cmd/code-generator/_examples/crd/informers/externalversions/example2/v1/interface.go @@ -0,0 +1,45 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // TestTypes returns a TestTypeInformer. + TestTypes() TestTypeInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// TestTypes returns a TestTypeInformer. +func (v *version) TestTypes() TestTypeInformer { + return &testTypeInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/cmd/code-generator/_examples/crd/informers/externalversions/example2/v1/testtype.go b/cmd/code-generator/_examples/crd/informers/externalversions/example2/v1/testtype.go new file mode 100644 index 0000000..e078a6d --- /dev/null +++ b/cmd/code-generator/_examples/crd/informers/externalversions/example2/v1/testtype.go @@ -0,0 +1,90 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + example2v1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" + versioned "k8s.io/code-generator/_examples/crd/clientset/versioned" + internalinterfaces "k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces" + v1 "k8s.io/code-generator/_examples/crd/listers/example2/v1" +) + +// TestTypeInformer provides access to a shared informer and lister for +// TestTypes. +type TestTypeInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.TestTypeLister +} + +type testTypeInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredTestTypeInformer constructs a new informer for TestType type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredTestTypeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SecondExampleV1().TestTypes(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SecondExampleV1().TestTypes(namespace).Watch(context.TODO(), options) + }, + }, + &example2v1.TestType{}, + resyncPeriod, + indexers, + ) +} + +func (f *testTypeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredTestTypeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *testTypeInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&example2v1.TestType{}, f.defaultInformer) +} + +func (f *testTypeInformer) Lister() v1.TestTypeLister { + return v1.NewTestTypeLister(f.Informer().GetIndexer()) +} diff --git a/cmd/code-generator/_examples/crd/informers/externalversions/factory.go b/cmd/code-generator/_examples/crd/informers/externalversions/factory.go new file mode 100644 index 0000000..7d6d1f9 --- /dev/null +++ b/cmd/code-generator/_examples/crd/informers/externalversions/factory.go @@ -0,0 +1,186 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + versioned "k8s.io/code-generator/_examples/crd/clientset/versioned" + example "k8s.io/code-generator/_examples/crd/informers/externalversions/example" + example2 "k8s.io/code-generator/_examples/crd/informers/externalversions/example2" + internalinterfaces "k8s.io/code-generator/_examples/crd/informers/externalversions/internalinterfaces" +) + +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client versioned.Interface + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc + lock sync.Mutex + defaultResync time.Duration + customResync map[reflect.Type]time.Duration + + informers map[reflect.Type]cache.SharedIndexInformer + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[reflect.Type]cache.SharedIndexInformer), + startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +// Start initializes all requested informers. +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + go informer.Run(stopCh) + f.startedInformers[informerType] = true + } + } +} + +// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + Example() example.Interface + SecondExample() example2.Interface +} + +func (f *sharedInformerFactory) Example() example.Interface { + return example.New(f, f.namespace, f.tweakListOptions) +} + +func (f *sharedInformerFactory) SecondExample() example2.Interface { + return example2.New(f, f.namespace, f.tweakListOptions) +} diff --git a/cmd/code-generator/_examples/crd/informers/externalversions/generic.go b/cmd/code-generator/_examples/crd/informers/externalversions/generic.go new file mode 100644 index 0000000..f6b1174 --- /dev/null +++ b/cmd/code-generator/_examples/crd/informers/externalversions/generic.go @@ -0,0 +1,69 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + "fmt" + + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" + v1 "k8s.io/code-generator/_examples/crd/apis/example/v1" + example2v1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=example.crd.code-generator.k8s.io, Version=v1 + case v1.SchemeGroupVersion.WithResource("clustertesttypes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Example().V1().ClusterTestTypes().Informer()}, nil + case v1.SchemeGroupVersion.WithResource("testtypes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Example().V1().TestTypes().Informer()}, nil + + // Group=example.test.crd.code-generator.k8s.io, Version=v1 + case example2v1.SchemeGroupVersion.WithResource("testtypes"): + return &genericInformer{resource: resource.GroupResource(), informer: f.SecondExample().V1().TestTypes().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/cmd/code-generator/_examples/crd/informers/externalversions/internalinterfaces/factory_interfaces.go b/cmd/code-generator/_examples/crd/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 0000000..86d63f3 --- /dev/null +++ b/cmd/code-generator/_examples/crd/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,40 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" + versioned "k8s.io/code-generator/_examples/crd/clientset/versioned" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/cmd/code-generator/_examples/crd/listers/example/v1/clustertesttype.go b/cmd/code-generator/_examples/crd/listers/example/v1/clustertesttype.go new file mode 100644 index 0000000..4be18ac --- /dev/null +++ b/cmd/code-generator/_examples/crd/listers/example/v1/clustertesttype.go @@ -0,0 +1,68 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1 "k8s.io/code-generator/_examples/crd/apis/example/v1" +) + +// ClusterTestTypeLister helps list ClusterTestTypes. +// All objects returned here must be treated as read-only. +type ClusterTestTypeLister interface { + // List lists all ClusterTestTypes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.ClusterTestType, err error) + // Get retrieves the ClusterTestType from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.ClusterTestType, error) + ClusterTestTypeListerExpansion +} + +// clusterTestTypeLister implements the ClusterTestTypeLister interface. +type clusterTestTypeLister struct { + indexer cache.Indexer +} + +// NewClusterTestTypeLister returns a new ClusterTestTypeLister. +func NewClusterTestTypeLister(indexer cache.Indexer) ClusterTestTypeLister { + return &clusterTestTypeLister{indexer: indexer} +} + +// List lists all ClusterTestTypes in the indexer. +func (s *clusterTestTypeLister) List(selector labels.Selector) (ret []*v1.ClusterTestType, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.ClusterTestType)) + }) + return ret, err +} + +// Get retrieves the ClusterTestType from the index for a given name. +func (s *clusterTestTypeLister) Get(name string) (*v1.ClusterTestType, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("clustertesttype"), name) + } + return obj.(*v1.ClusterTestType), nil +} diff --git a/cmd/code-generator/_examples/crd/listers/example/v1/expansion_generated.go b/cmd/code-generator/_examples/crd/listers/example/v1/expansion_generated.go new file mode 100644 index 0000000..2681a29 --- /dev/null +++ b/cmd/code-generator/_examples/crd/listers/example/v1/expansion_generated.go @@ -0,0 +1,31 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +// ClusterTestTypeListerExpansion allows custom methods to be added to +// ClusterTestTypeLister. +type ClusterTestTypeListerExpansion interface{} + +// TestTypeListerExpansion allows custom methods to be added to +// TestTypeLister. +type TestTypeListerExpansion interface{} + +// TestTypeNamespaceListerExpansion allows custom methods to be added to +// TestTypeNamespaceLister. +type TestTypeNamespaceListerExpansion interface{} diff --git a/cmd/code-generator/_examples/crd/listers/example/v1/testtype.go b/cmd/code-generator/_examples/crd/listers/example/v1/testtype.go new file mode 100644 index 0000000..6c3a8c2 --- /dev/null +++ b/cmd/code-generator/_examples/crd/listers/example/v1/testtype.go @@ -0,0 +1,99 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1 "k8s.io/code-generator/_examples/crd/apis/example/v1" +) + +// TestTypeLister helps list TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeLister interface { + // List lists all TestTypes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TestType, err error) + // TestTypes returns an object that can list and get TestTypes. + TestTypes(namespace string) TestTypeNamespaceLister + TestTypeListerExpansion +} + +// testTypeLister implements the TestTypeLister interface. +type testTypeLister struct { + indexer cache.Indexer +} + +// NewTestTypeLister returns a new TestTypeLister. +func NewTestTypeLister(indexer cache.Indexer) TestTypeLister { + return &testTypeLister{indexer: indexer} +} + +// List lists all TestTypes in the indexer. +func (s *testTypeLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TestType)) + }) + return ret, err +} + +// TestTypes returns an object that can list and get TestTypes. +func (s *testTypeLister) TestTypes(namespace string) TestTypeNamespaceLister { + return testTypeNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// TestTypeNamespaceLister helps list and get TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeNamespaceLister interface { + // List lists all TestTypes in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TestType, err error) + // Get retrieves the TestType from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.TestType, error) + TestTypeNamespaceListerExpansion +} + +// testTypeNamespaceLister implements the TestTypeNamespaceLister +// interface. +type testTypeNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all TestTypes in the indexer for a given namespace. +func (s testTypeNamespaceLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TestType)) + }) + return ret, err +} + +// Get retrieves the TestType from the indexer for a given namespace and name. +func (s testTypeNamespaceLister) Get(name string) (*v1.TestType, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("testtype"), name) + } + return obj.(*v1.TestType), nil +} diff --git a/cmd/code-generator/_examples/crd/listers/example2/v1/expansion_generated.go b/cmd/code-generator/_examples/crd/listers/example2/v1/expansion_generated.go new file mode 100644 index 0000000..0192e05 --- /dev/null +++ b/cmd/code-generator/_examples/crd/listers/example2/v1/expansion_generated.go @@ -0,0 +1,27 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +// TestTypeListerExpansion allows custom methods to be added to +// TestTypeLister. +type TestTypeListerExpansion interface{} + +// TestTypeNamespaceListerExpansion allows custom methods to be added to +// TestTypeNamespaceLister. +type TestTypeNamespaceListerExpansion interface{} diff --git a/cmd/code-generator/_examples/crd/listers/example2/v1/testtype.go b/cmd/code-generator/_examples/crd/listers/example2/v1/testtype.go new file mode 100644 index 0000000..15cdc22 --- /dev/null +++ b/cmd/code-generator/_examples/crd/listers/example2/v1/testtype.go @@ -0,0 +1,99 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1 "k8s.io/code-generator/_examples/crd/apis/example2/v1" +) + +// TestTypeLister helps list TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeLister interface { + // List lists all TestTypes in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TestType, err error) + // TestTypes returns an object that can list and get TestTypes. + TestTypes(namespace string) TestTypeNamespaceLister + TestTypeListerExpansion +} + +// testTypeLister implements the TestTypeLister interface. +type testTypeLister struct { + indexer cache.Indexer +} + +// NewTestTypeLister returns a new TestTypeLister. +func NewTestTypeLister(indexer cache.Indexer) TestTypeLister { + return &testTypeLister{indexer: indexer} +} + +// List lists all TestTypes in the indexer. +func (s *testTypeLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TestType)) + }) + return ret, err +} + +// TestTypes returns an object that can list and get TestTypes. +func (s *testTypeLister) TestTypes(namespace string) TestTypeNamespaceLister { + return testTypeNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// TestTypeNamespaceLister helps list and get TestTypes. +// All objects returned here must be treated as read-only. +type TestTypeNamespaceLister interface { + // List lists all TestTypes in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.TestType, err error) + // Get retrieves the TestType from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.TestType, error) + TestTypeNamespaceListerExpansion +} + +// testTypeNamespaceLister implements the TestTypeNamespaceLister +// interface. +type testTypeNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all TestTypes in the indexer for a given namespace. +func (s testTypeNamespaceLister) List(selector labels.Selector) (ret []*v1.TestType, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.TestType)) + }) + return ret, err +} + +// Get retrieves the TestType from the indexer for a given namespace and name. +func (s testTypeNamespaceLister) Get(name string) (*v1.TestType, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("testtype"), name) + } + return obj.(*v1.TestType), nil +} diff --git a/cmd/code-generator/cmd/client-gen/OWNERS b/cmd/code-generator/cmd/client-gen/OWNERS new file mode 100644 index 0000000..62866d0 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/OWNERS @@ -0,0 +1,10 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: +- lavalamp +- wojtek-t +- caesarxuchao +reviewers: +- lavalamp +- wojtek-t +- caesarxuchao diff --git a/cmd/code-generator/cmd/client-gen/README.md b/cmd/code-generator/cmd/client-gen/README.md new file mode 100644 index 0000000..092a611 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/README.md @@ -0,0 +1,4 @@ +See [generating-clientset.md](https://git.k8s.io/community/contributors/devel/sig-api-machinery/generating-clientset.md) + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/staging/src/k8s.io/code-generator/client-gen/README.md?pixel)]() diff --git a/cmd/code-generator/cmd/client-gen/args/args.go b/cmd/code-generator/cmd/client-gen/args/args.go new file mode 100644 index 0000000..949369c --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/args/args.go @@ -0,0 +1,126 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + "path" + + "github.com/spf13/pflag" + "k8s.io/gengo/args" + + "k8s.io/code-generator/cmd/client-gen/types" + codegenutil "k8s.io/code-generator/pkg/util" +) + +var DefaultInputDirs = []string{} + +// ClientGenArgs is a wrapper for arguments to client-gen. +type CustomArgs struct { + // A sorted list of group versions to generate. For each of them the package path is found + // in GroupVersionToInputPath. + Groups []types.GroupVersions + + // Overrides for which types should be included in the client. + IncludedTypesOverrides map[types.GroupVersion][]string + + // ClientsetName is the name of the clientset to be generated. It's + // populated from command-line arguments. + ClientsetName string + // ClientsetAPIPath is the default API HTTP path for generated clients. + ClientsetAPIPath string + // ClientsetOnly determines if we should generate the clients for groups and + // types along with the clientset. It's populated from command-line + // arguments. + ClientsetOnly bool + // FakeClient determines if client-gen generates the fake clients. + FakeClient bool + // PluralExceptions specify list of exceptions used when pluralizing certain types. + // For example 'Endpoints:Endpoints', otherwise the pluralizer will generate 'Endpointes'. + PluralExceptions []string +} + +func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { + genericArgs := args.Default().WithoutDefaultFlagParsing() + customArgs := &CustomArgs{ + ClientsetName: "internalclientset", + ClientsetAPIPath: "/apis", + ClientsetOnly: false, + FakeClient: true, + PluralExceptions: []string{"Endpoints:Endpoints"}, + } + genericArgs.CustomArgs = customArgs + genericArgs.InputDirs = DefaultInputDirs + + if pkg := codegenutil.CurrentPackage(); len(pkg) != 0 { + genericArgs.OutputPackagePath = path.Join(pkg, "pkg/client/clientset") + } + + return genericArgs, customArgs +} + +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet, inputBase string) { + gvsBuilder := NewGroupVersionsBuilder(&ca.Groups) + pflag.Var(NewGVPackagesValue(gvsBuilder, nil), "input", "group/versions that client-gen will generate clients for. At most one version per group is allowed. Specified in the format \"group1/version1,group2/version2...\".") + pflag.Var(NewGVTypesValue(&ca.IncludedTypesOverrides, []string{}), "included-types-overrides", "list of group/version/type for which client should be generated. By default, client is generated for all types which have genclient in types.go. This overrides that. For each groupVersion in this list, only the types mentioned here will be included. The default check of genclient will be used for other group versions.") + pflag.Var(NewInputBasePathValue(gvsBuilder, inputBase), "input-base", "base path to look for the api group.") + pflag.StringVarP(&ca.ClientsetName, "clientset-name", "n", ca.ClientsetName, "the name of the generated clientset package.") + pflag.StringVarP(&ca.ClientsetAPIPath, "clientset-api-path", "", ca.ClientsetAPIPath, "the value of default API HTTP path, starting with / and without trailing /.") + pflag.BoolVar(&ca.ClientsetOnly, "clientset-only", ca.ClientsetOnly, "when set, client-gen only generates the clientset shell, without generating the individual typed clients") + pflag.BoolVar(&ca.FakeClient, "fake-clientset", ca.FakeClient, "when set, client-gen will generate the fake clientset that can be used in tests") + + fs.StringSliceVar(&ca.PluralExceptions, "plural-exceptions", ca.PluralExceptions, "list of comma separated plural exception definitions in Type:PluralizedType form") + + // support old flags + fs.SetNormalizeFunc(mapFlagName("clientset-path", "output-package", fs.GetNormalizeFunc())) +} + +func Validate(genericArgs *args.GeneratorArgs) error { + customArgs := genericArgs.CustomArgs.(*CustomArgs) + + if len(genericArgs.OutputPackagePath) == 0 { + return fmt.Errorf("output package cannot be empty") + } + if len(customArgs.ClientsetName) == 0 { + return fmt.Errorf("clientset name cannot be empty") + } + if len(customArgs.ClientsetAPIPath) == 0 { + return fmt.Errorf("clientset API path cannot be empty") + } + + return nil +} + +// GroupVersionPackages returns a map from GroupVersion to the package with the types.go. +func (ca *CustomArgs) GroupVersionPackages() map[types.GroupVersion]string { + res := map[types.GroupVersion]string{} + for _, pkg := range ca.Groups { + for _, v := range pkg.Versions { + res[types.GroupVersion{Group: pkg.Group, Version: v.Version}] = v.Package + } + } + return res +} + +func mapFlagName(from, to string, old func(fs *pflag.FlagSet, name string) pflag.NormalizedName) func(fs *pflag.FlagSet, name string) pflag.NormalizedName { + return func(fs *pflag.FlagSet, name string) pflag.NormalizedName { + if name == from { + name = to + } + return old(fs, name) + } +} diff --git a/cmd/code-generator/cmd/client-gen/args/gvpackages.go b/cmd/code-generator/cmd/client-gen/args/gvpackages.go new file mode 100644 index 0000000..8da71d6 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/args/gvpackages.go @@ -0,0 +1,183 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "bytes" + "encoding/csv" + "flag" + "path" + "sort" + "strings" + + "k8s.io/code-generator/cmd/client-gen/types" +) + +type inputBasePathValue struct { + builder *groupVersionsBuilder +} + +var _ flag.Value = &inputBasePathValue{} + +func NewInputBasePathValue(builder *groupVersionsBuilder, def string) *inputBasePathValue { + v := &inputBasePathValue{ + builder: builder, + } + v.Set(def) + return v +} + +func (s *inputBasePathValue) Set(val string) error { + s.builder.importBasePath = val + return s.builder.update() +} + +func (s *inputBasePathValue) Type() string { + return "string" +} + +func (s *inputBasePathValue) String() string { + return s.builder.importBasePath +} + +type gvPackagesValue struct { + builder *groupVersionsBuilder + groups []string + changed bool +} + +func NewGVPackagesValue(builder *groupVersionsBuilder, def []string) *gvPackagesValue { + gvp := new(gvPackagesValue) + gvp.builder = builder + if def != nil { + if err := gvp.set(def); err != nil { + panic(err) + } + } + return gvp +} + +var _ flag.Value = &gvPackagesValue{} + +func (s *gvPackagesValue) set(vs []string) error { + if s.changed { + s.groups = append(s.groups, vs...) + } else { + s.groups = append([]string(nil), vs...) + } + + s.builder.groups = s.groups + return s.builder.update() +} + +func (s *gvPackagesValue) Set(val string) error { + vs, err := readAsCSV(val) + if err != nil { + return err + } + if err := s.set(vs); err != nil { + return err + } + s.changed = true + return nil +} + +func (s *gvPackagesValue) Type() string { + return "stringSlice" +} + +func (s *gvPackagesValue) String() string { + str, _ := writeAsCSV(s.groups) + return "[" + str + "]" +} + +type groupVersionsBuilder struct { + value *[]types.GroupVersions + groups []string + importBasePath string +} + +func NewGroupVersionsBuilder(groups *[]types.GroupVersions) *groupVersionsBuilder { + return &groupVersionsBuilder{ + value: groups, + } +} + +func (p *groupVersionsBuilder) update() error { + var seenGroups = make(map[types.Group]*types.GroupVersions) + for _, v := range p.groups { + pth, gvString := parsePathGroupVersion(v) + gv, err := types.ToGroupVersion(gvString) + if err != nil { + return err + } + + versionPkg := types.PackageVersion{Package: path.Join(p.importBasePath, pth, gv.Group.NonEmpty(), gv.Version.String()), Version: gv.Version} + if group, ok := seenGroups[gv.Group]; ok { + seenGroups[gv.Group].Versions = append(group.Versions, versionPkg) + } else { + seenGroups[gv.Group] = &types.GroupVersions{ + PackageName: gv.Group.NonEmpty(), + Group: gv.Group, + Versions: []types.PackageVersion{versionPkg}, + } + } + } + + var groupNames []string + for groupName := range seenGroups { + groupNames = append(groupNames, groupName.String()) + } + sort.Strings(groupNames) + *p.value = []types.GroupVersions{} + for _, groupName := range groupNames { + *p.value = append(*p.value, *seenGroups[types.Group(groupName)]) + } + + return nil +} + +func parsePathGroupVersion(pgvString string) (gvPath string, gvString string) { + subs := strings.Split(pgvString, "/") + length := len(subs) + switch length { + case 0, 1, 2: + return "", pgvString + default: + return strings.Join(subs[:length-2], "/"), strings.Join(subs[length-2:], "/") + } +} + +func readAsCSV(val string) ([]string, error) { + if val == "" { + return []string{}, nil + } + stringReader := strings.NewReader(val) + csvReader := csv.NewReader(stringReader) + return csvReader.Read() +} + +func writeAsCSV(vals []string) (string, error) { + b := &bytes.Buffer{} + w := csv.NewWriter(b) + err := w.Write(vals) + if err != nil { + return "", err + } + w.Flush() + return strings.TrimSuffix(b.String(), "\n"), nil +} diff --git a/cmd/code-generator/cmd/client-gen/args/gvpackages_test.go b/cmd/code-generator/cmd/client-gen/args/gvpackages_test.go new file mode 100644 index 0000000..f8891be --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/args/gvpackages_test.go @@ -0,0 +1,116 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + "reflect" + "strings" + "testing" + + "github.com/spf13/pflag" + + "k8s.io/code-generator/cmd/client-gen/types" +) + +func TestGVPackageFlag(t *testing.T) { + tests := []struct { + args []string + def []string + importBasePath string + expected map[types.GroupVersion]string + expectedGroups []types.GroupVersions + parseError string + }{ + { + args: []string{}, + expected: map[types.GroupVersion]string{}, + expectedGroups: []types.GroupVersions{}, + }, + { + args: []string{"foo/bar/v1", "foo/bar/v2", "foo/bar/", "foo/v1"}, + expectedGroups: []types.GroupVersions{ + {PackageName: "bar", Group: types.Group("bar"), Versions: []types.PackageVersion{ + {Version: "v1", Package: "foo/bar/v1"}, + {Version: "v2", Package: "foo/bar/v2"}, + {Version: "", Package: "foo/bar"}, + }}, + {PackageName: "foo", Group: types.Group("foo"), Versions: []types.PackageVersion{ + {Version: "v1", Package: "foo/v1"}, + }}, + }, + }, + { + args: []string{"foo/bar/v1", "foo/bar/v2", "foo/bar/", "foo/v1"}, + def: []string{"foo/bar/v1alpha1", "foo/v1"}, + expectedGroups: []types.GroupVersions{ + {PackageName: "bar", Group: types.Group("bar"), Versions: []types.PackageVersion{ + {Version: "v1", Package: "foo/bar/v1"}, + {Version: "v2", Package: "foo/bar/v2"}, + {Version: "", Package: "foo/bar"}, + }}, + {PackageName: "foo", Group: types.Group("foo"), Versions: []types.PackageVersion{ + {Version: "v1", Package: "foo/v1"}, + }}, + }, + }, + { + args: []string{"api/v1", "api"}, + expectedGroups: []types.GroupVersions{ + {PackageName: "core", Group: types.Group("api"), Versions: []types.PackageVersion{ + {Version: "v1", Package: "core/v1"}, + {Version: "", Package: "core"}, + }}, + }, + }, + { + args: []string{"foo/v1"}, + importBasePath: "k8s.io/api", + expectedGroups: []types.GroupVersions{ + {PackageName: "foo", Group: types.Group("foo"), Versions: []types.PackageVersion{ + {Version: "v1", Package: "k8s.io/api/foo/v1"}, + }}, + }, + }, + } + for i, test := range tests { + fs := pflag.NewFlagSet("testGVPackage", pflag.ContinueOnError) + groups := []types.GroupVersions{} + builder := NewGroupVersionsBuilder(&groups) + fs.Var(NewGVPackagesValue(builder, test.def), "input", "usage") + fs.Var(NewInputBasePathValue(builder, test.importBasePath), "input-base-path", "usage") + + args := []string{} + for _, a := range test.args { + args = append(args, fmt.Sprintf("--input=%s", a)) + } + + err := fs.Parse(args) + if test.parseError != "" { + if err == nil { + t.Errorf("%d: expected error %q, got nil", i, test.parseError) + } else if !strings.Contains(err.Error(), test.parseError) { + t.Errorf("%d: expected error %q, got %q", i, test.parseError, err) + } + } else if err != nil { + t.Errorf("%d: expected nil error, got %v", i, err) + } + if !reflect.DeepEqual(groups, test.expectedGroups) { + t.Errorf("%d: expected groups %+v, got groups %+v", i, test.expectedGroups, groups) + } + } +} diff --git a/cmd/code-generator/cmd/client-gen/args/gvtype.go b/cmd/code-generator/cmd/client-gen/args/gvtype.go new file mode 100644 index 0000000..e4e3ccb --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/args/gvtype.go @@ -0,0 +1,110 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "flag" + "fmt" + "strings" + + "k8s.io/code-generator/cmd/client-gen/types" +) + +type gvTypeValue struct { + gvToTypes *map[types.GroupVersion][]string + changed bool +} + +func NewGVTypesValue(gvToTypes *map[types.GroupVersion][]string, def []string) *gvTypeValue { + gvt := new(gvTypeValue) + gvt.gvToTypes = gvToTypes + if def != nil { + if err := gvt.set(def); err != nil { + panic(err) + } + } + return gvt +} + +var _ flag.Value = &gvTypeValue{} + +func (s *gvTypeValue) set(vs []string) error { + if !s.changed { + *s.gvToTypes = map[types.GroupVersion][]string{} + } + + for _, input := range vs { + gvString, typeStr, err := parseGroupVersionType(input) + if err != nil { + return err + } + gv, err := types.ToGroupVersion(gvString) + if err != nil { + return err + } + types, ok := (*s.gvToTypes)[gv] + if !ok { + types = []string{} + } + types = append(types, typeStr) + (*s.gvToTypes)[gv] = types + } + + return nil +} + +func (s *gvTypeValue) Set(val string) error { + vs, err := readAsCSV(val) + if err != nil { + return err + } + if err := s.set(vs); err != nil { + return err + } + s.changed = true + return nil +} + +func (s *gvTypeValue) Type() string { + return "stringSlice" +} + +func (s *gvTypeValue) String() string { + strs := make([]string, 0, len(*s.gvToTypes)) + for gv, ts := range *s.gvToTypes { + for _, t := range ts { + strs = append(strs, gv.Group.String()+"/"+gv.Version.String()+"/"+t) + } + } + str, _ := writeAsCSV(strs) + return "[" + str + "]" +} + +func parseGroupVersionType(gvtString string) (gvString string, typeStr string, err error) { + invalidFormatErr := fmt.Errorf("invalid value: %s, should be of the form group/version/type", gvtString) + subs := strings.Split(gvtString, "/") + length := len(subs) + switch length { + case 2: + // gvtString of the form group/type, e.g. api/Service,extensions/ReplicaSet + return subs[0] + "/", subs[1], nil + case 3: + return strings.Join(subs[:length-1], "/"), subs[length-1], nil + default: + return "", "", invalidFormatErr + } +} diff --git a/cmd/code-generator/cmd/client-gen/generators/client_generator.go b/cmd/code-generator/cmd/client-gen/generators/client_generator.go new file mode 100644 index 0000000..1f1c3b4 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/generators/client_generator.go @@ -0,0 +1,401 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package generators has the generators for the client-gen utility. +package generators + +import ( + "path/filepath" + "strings" + + clientgenargs "k8s.io/code-generator/cmd/client-gen/args" + "k8s.io/code-generator/cmd/client-gen/generators/fake" + "k8s.io/code-generator/cmd/client-gen/generators/scheme" + "k8s.io/code-generator/cmd/client-gen/generators/util" + "k8s.io/code-generator/cmd/client-gen/path" + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" + codegennamer "k8s.io/code-generator/pkg/namer" + genutil "k8s.io/code-generator/pkg/util" + "k8s.io/gengo/args" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/klog/v2" +) + +// NameSystems returns the name system used by the generators in this package. +func NameSystems(pluralExceptions map[string]string) namer.NameSystems { + lowercaseNamer := namer.NewAllLowercasePluralNamer(pluralExceptions) + + publicNamer := &ExceptionNamer{ + Exceptions: map[string]string{ + // these exceptions are used to deconflict the generated code + // you can put your fully qualified package like + // to generate a name that doesn't conflict with your group. + // "k8s.io/apis/events/v1beta1.Event": "EventResource" + }, + KeyFunc: func(t *types.Type) string { + return t.Name.Package + "." + t.Name.Name + }, + Delegate: namer.NewPublicNamer(0), + } + privateNamer := &ExceptionNamer{ + Exceptions: map[string]string{ + // these exceptions are used to deconflict the generated code + // you can put your fully qualified package like + // to generate a name that doesn't conflict with your group. + // "k8s.io/apis/events/v1beta1.Event": "eventResource" + }, + KeyFunc: func(t *types.Type) string { + return t.Name.Package + "." + t.Name.Name + }, + Delegate: namer.NewPrivateNamer(0), + } + publicPluralNamer := &ExceptionNamer{ + Exceptions: map[string]string{ + // these exceptions are used to deconflict the generated code + // you can put your fully qualified package like + // to generate a name that doesn't conflict with your group. + // "k8s.io/apis/events/v1beta1.Event": "EventResource" + }, + KeyFunc: func(t *types.Type) string { + return t.Name.Package + "." + t.Name.Name + }, + Delegate: namer.NewPublicPluralNamer(pluralExceptions), + } + privatePluralNamer := &ExceptionNamer{ + Exceptions: map[string]string{ + // you can put your fully qualified package like + // to generate a name that doesn't conflict with your group. + // "k8s.io/apis/events/v1beta1.Event": "eventResource" + // these exceptions are used to deconflict the generated code + "k8s.io/apis/events/v1beta1.Event": "eventResources", + "k8s.io/kubernetes/pkg/apis/events.Event": "eventResources", + }, + KeyFunc: func(t *types.Type) string { + return t.Name.Package + "." + t.Name.Name + }, + Delegate: namer.NewPrivatePluralNamer(pluralExceptions), + } + + return namer.NameSystems{ + "singularKind": namer.NewPublicNamer(0), + "public": publicNamer, + "private": privateNamer, + "raw": namer.NewRawNamer("", nil), + "publicPlural": publicPluralNamer, + "privatePlural": privatePluralNamer, + "allLowercasePlural": lowercaseNamer, + "resource": codegennamer.NewTagOverrideNamer("resourceName", lowercaseNamer), + } +} + +// ExceptionNamer allows you specify exceptional cases with exact names. This allows you to have control +// for handling various conflicts, like group and resource names for instance. +type ExceptionNamer struct { + Exceptions map[string]string + KeyFunc func(*types.Type) string + + Delegate namer.Namer +} + +// Name provides the requested name for a type. +func (n *ExceptionNamer) Name(t *types.Type) string { + key := n.KeyFunc(t) + if exception, ok := n.Exceptions[key]; ok { + return exception + } + return n.Delegate.Name(t) +} + +// DefaultNameSystem returns the default name system for ordering the types to be +// processed by the generators in this package. +func DefaultNameSystem() string { + return "public" +} + +func packageForGroup(gv clientgentypes.GroupVersion, typeList []*types.Type, clientsetPackage string, groupPackageName string, groupGoName string, apiPath string, srcTreePath string, inputPackage string, boilerplate []byte) generator.Package { + groupVersionClientPackage := filepath.Join(clientsetPackage, "typed", strings.ToLower(groupPackageName), strings.ToLower(gv.Version.NonEmpty())) + return &generator.DefaultPackage{ + PackageName: strings.ToLower(gv.Version.NonEmpty()), + PackagePath: groupVersionClientPackage, + HeaderText: boilerplate, + PackageDocumentation: []byte( + `// This package has the automatically generated typed clients. +`), + // GeneratorFunc returns a list of generators. Each generator makes a + // single file. + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + generators = []generator.Generator{ + // Always generate a "doc.go" file. + generator.DefaultGen{OptionalName: "doc"}, + } + // Since we want a file per type that we generate a client for, we + // have to provide a function for this. + for _, t := range typeList { + generators = append(generators, &genClientForType{ + DefaultGen: generator.DefaultGen{ + OptionalName: strings.ToLower(c.Namers["private"].Name(t)), + }, + outputPackage: groupVersionClientPackage, + clientsetPackage: clientsetPackage, + group: gv.Group.NonEmpty(), + version: gv.Version.String(), + groupGoName: groupGoName, + typeToMatch: t, + imports: generator.NewImportTracker(), + }) + } + + generators = append(generators, &genGroup{ + DefaultGen: generator.DefaultGen{ + OptionalName: groupPackageName + "_client", + }, + outputPackage: groupVersionClientPackage, + inputPackage: inputPackage, + clientsetPackage: clientsetPackage, + group: gv.Group.NonEmpty(), + version: gv.Version.String(), + groupGoName: groupGoName, + apiPath: apiPath, + types: typeList, + imports: generator.NewImportTracker(), + }) + + expansionFileName := "generated_expansion" + generators = append(generators, &genExpansion{ + groupPackagePath: filepath.Join(srcTreePath, groupVersionClientPackage), + DefaultGen: generator.DefaultGen{ + OptionalName: expansionFileName, + }, + types: typeList, + }) + + return generators + }, + FilterFunc: func(c *generator.Context, t *types.Type) bool { + return util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).GenerateClient + }, + } +} + +func packageForClientset(customArgs *clientgenargs.CustomArgs, clientsetPackage string, groupGoNames map[clientgentypes.GroupVersion]string, boilerplate []byte) generator.Package { + return &generator.DefaultPackage{ + PackageName: customArgs.ClientsetName, + PackagePath: clientsetPackage, + HeaderText: boilerplate, + PackageDocumentation: []byte( + `// This package has the automatically generated clientset. +`), + // GeneratorFunc returns a list of generators. Each generator generates a + // single file. + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + generators = []generator.Generator{ + // Always generate a "doc.go" file. + generator.DefaultGen{OptionalName: "doc"}, + + &genClientset{ + DefaultGen: generator.DefaultGen{ + OptionalName: "clientset", + }, + groups: customArgs.Groups, + groupGoNames: groupGoNames, + clientsetPackage: clientsetPackage, + outputPackage: customArgs.ClientsetName, + imports: generator.NewImportTracker(), + }, + } + return generators + }, + } +} + +func packageForScheme(customArgs *clientgenargs.CustomArgs, clientsetPackage string, srcTreePath string, groupGoNames map[clientgentypes.GroupVersion]string, boilerplate []byte) generator.Package { + schemePackage := filepath.Join(clientsetPackage, "scheme") + + // create runtime.Registry for internal client because it has to know about group versions + internalClient := false +NextGroup: + for _, group := range customArgs.Groups { + for _, v := range group.Versions { + if v.String() == "" { + internalClient = true + break NextGroup + } + } + } + + return &generator.DefaultPackage{ + PackageName: "scheme", + PackagePath: schemePackage, + HeaderText: boilerplate, + PackageDocumentation: []byte( + `// This package contains the scheme of the automatically generated clientset. +`), + // GeneratorFunc returns a list of generators. Each generator generates a + // single file. + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + generators = []generator.Generator{ + // Always generate a "doc.go" file. + generator.DefaultGen{OptionalName: "doc"}, + + &scheme.GenScheme{ + DefaultGen: generator.DefaultGen{ + OptionalName: "register", + }, + InputPackages: customArgs.GroupVersionPackages(), + OutputPackage: schemePackage, + OutputPath: filepath.Join(srcTreePath, schemePackage), + Groups: customArgs.Groups, + GroupGoNames: groupGoNames, + ImportTracker: generator.NewImportTracker(), + CreateRegistry: internalClient, + }, + } + return generators + }, + } +} + +// applyGroupOverrides applies group name overrides to each package, if applicable. If there is a +// comment of the form "// +groupName=somegroup" or "// +groupName=somegroup.foo.bar.io", use the +// first field (somegroup) as the name of the group in Go code, e.g. as the func name in a clientset. +// +// If the first field of the groupName is not unique within the clientset, use "// +groupName=unique +func applyGroupOverrides(universe types.Universe, customArgs *clientgenargs.CustomArgs) { + // Create a map from "old GV" to "new GV" so we know what changes we need to make. + changes := make(map[clientgentypes.GroupVersion]clientgentypes.GroupVersion) + for gv, inputDir := range customArgs.GroupVersionPackages() { + p := universe.Package(genutil.Vendorless(inputDir)) + if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { + newGV := clientgentypes.GroupVersion{ + Group: clientgentypes.Group(override[0]), + Version: gv.Version, + } + changes[gv] = newGV + } + } + + // Modify customArgs.Groups based on the groupName overrides. + newGroups := make([]clientgentypes.GroupVersions, 0, len(customArgs.Groups)) + for _, gvs := range customArgs.Groups { + gv := clientgentypes.GroupVersion{ + Group: gvs.Group, + Version: gvs.Versions[0].Version, // we only need a version, and the first will do + } + if newGV, ok := changes[gv]; ok { + // There's an override, so use it. + newGVS := clientgentypes.GroupVersions{ + PackageName: gvs.PackageName, + Group: newGV.Group, + Versions: gvs.Versions, + } + newGroups = append(newGroups, newGVS) + } else { + // No override. + newGroups = append(newGroups, gvs) + } + } + customArgs.Groups = newGroups +} + +// Packages makes the client package definition. +func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { + boilerplate, err := arguments.LoadGoBoilerplate() + if err != nil { + klog.Fatalf("Failed loading boilerplate: %v", err) + } + + customArgs, ok := arguments.CustomArgs.(*clientgenargs.CustomArgs) + if !ok { + klog.Fatalf("cannot convert arguments.CustomArgs to clientgenargs.CustomArgs") + } + includedTypesOverrides := customArgs.IncludedTypesOverrides + + applyGroupOverrides(context.Universe, customArgs) + + gvToTypes := map[clientgentypes.GroupVersion][]*types.Type{} + groupGoNames := make(map[clientgentypes.GroupVersion]string) + for gv, inputDir := range customArgs.GroupVersionPackages() { + p := context.Universe.Package(path.Vendorless(inputDir)) + + // If there's a comment of the form "// +groupGoName=SomeUniqueShortName", use that as + // the Go group identifier in CamelCase. It defaults + groupGoNames[gv] = namer.IC(strings.Split(gv.Group.NonEmpty(), ".")[0]) + if override := types.ExtractCommentTags("+", p.Comments)["groupGoName"]; override != nil { + groupGoNames[gv] = namer.IC(override[0]) + } + + // Package are indexed with the vendor prefix stripped + for n, t := range p.Types { + // filter out types which are not included in user specified overrides. + typesOverride, ok := includedTypesOverrides[gv] + if ok { + found := false + for _, typeStr := range typesOverride { + if typeStr == n { + found = true + break + } + } + if !found { + continue + } + } else { + // User has not specified any override for this group version. + // filter out types which dont have genclient. + if tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)); !tags.GenerateClient { + continue + } + } + if _, found := gvToTypes[gv]; !found { + gvToTypes[gv] = []*types.Type{} + } + gvToTypes[gv] = append(gvToTypes[gv], t) + } + } + + var packageList []generator.Package + clientsetPackage := filepath.Join(arguments.OutputPackagePath, customArgs.ClientsetName) + + packageList = append(packageList, packageForClientset(customArgs, clientsetPackage, groupGoNames, boilerplate)) + packageList = append(packageList, packageForScheme(customArgs, clientsetPackage, arguments.OutputBase, groupGoNames, boilerplate)) + if customArgs.FakeClient { + packageList = append(packageList, fake.PackageForClientset(customArgs, clientsetPackage, groupGoNames, boilerplate)) + } + + // If --clientset-only=true, we don't regenerate the individual typed clients. + if customArgs.ClientsetOnly { + return generator.Packages(packageList) + } + + orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} + gvPackages := customArgs.GroupVersionPackages() + for _, group := range customArgs.Groups { + for _, version := range group.Versions { + gv := clientgentypes.GroupVersion{Group: group.Group, Version: version.Version} + types := gvToTypes[gv] + inputPath := gvPackages[gv] + packageList = append(packageList, packageForGroup(gv, orderer.OrderTypes(types), clientsetPackage, group.PackageName, groupGoNames[gv], customArgs.ClientsetAPIPath, arguments.OutputBase, inputPath, boilerplate)) + if customArgs.FakeClient { + packageList = append(packageList, fake.PackageForGroup(gv, orderer.OrderTypes(types), clientsetPackage, group.PackageName, groupGoNames[gv], inputPath, boilerplate)) + } + } + } + + return generator.Packages(packageList) +} diff --git a/cmd/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go b/cmd/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go new file mode 100644 index 0000000..4b3854b --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go @@ -0,0 +1,130 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fake + +import ( + "path/filepath" + "strings" + + "k8s.io/gengo/generator" + "k8s.io/gengo/types" + + clientgenargs "k8s.io/code-generator/cmd/client-gen/args" + scheme "k8s.io/code-generator/cmd/client-gen/generators/scheme" + "k8s.io/code-generator/cmd/client-gen/generators/util" + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" +) + +func PackageForGroup(gv clientgentypes.GroupVersion, typeList []*types.Type, clientsetPackage string, groupPackageName string, groupGoName string, inputPackage string, boilerplate []byte) generator.Package { + outputPackage := filepath.Join(clientsetPackage, "typed", strings.ToLower(groupPackageName), strings.ToLower(gv.Version.NonEmpty()), "fake") + // TODO: should make this a function, called by here and in client-generator.go + realClientPackage := filepath.Join(clientsetPackage, "typed", strings.ToLower(groupPackageName), strings.ToLower(gv.Version.NonEmpty())) + return &generator.DefaultPackage{ + PackageName: "fake", + PackagePath: outputPackage, + HeaderText: boilerplate, + PackageDocumentation: []byte( + `// Package fake has the automatically generated clients. +`), + // GeneratorFunc returns a list of generators. Each generator makes a + // single file. + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + generators = []generator.Generator{ + // Always generate a "doc.go" file. + generator.DefaultGen{OptionalName: "doc"}, + } + // Since we want a file per type that we generate a client for, we + // have to provide a function for this. + for _, t := range typeList { + generators = append(generators, &genFakeForType{ + DefaultGen: generator.DefaultGen{ + OptionalName: "fake_" + strings.ToLower(c.Namers["private"].Name(t)), + }, + outputPackage: outputPackage, + inputPackage: inputPackage, + group: gv.Group.NonEmpty(), + version: gv.Version.String(), + groupGoName: groupGoName, + typeToMatch: t, + imports: generator.NewImportTracker(), + }) + } + + generators = append(generators, &genFakeForGroup{ + DefaultGen: generator.DefaultGen{ + OptionalName: "fake_" + groupPackageName + "_client", + }, + outputPackage: outputPackage, + realClientPackage: realClientPackage, + group: gv.Group.NonEmpty(), + version: gv.Version.String(), + groupGoName: groupGoName, + types: typeList, + imports: generator.NewImportTracker(), + }) + return generators + }, + FilterFunc: func(c *generator.Context, t *types.Type) bool { + return util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).GenerateClient + }, + } +} + +func PackageForClientset(customArgs *clientgenargs.CustomArgs, clientsetPackage string, groupGoNames map[clientgentypes.GroupVersion]string, boilerplate []byte) generator.Package { + return &generator.DefaultPackage{ + // TODO: we'll generate fake clientset for different release in the future. + // Package name and path are hard coded for now. + PackageName: "fake", + PackagePath: filepath.Join(clientsetPackage, "fake"), + HeaderText: boilerplate, + PackageDocumentation: []byte( + `// This package has the automatically generated fake clientset. +`), + // GeneratorFunc returns a list of generators. Each generator generates a + // single file. + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + generators = []generator.Generator{ + // Always generate a "doc.go" file. + generator.DefaultGen{OptionalName: "doc"}, + + &genClientset{ + DefaultGen: generator.DefaultGen{ + OptionalName: "clientset_generated", + }, + groups: customArgs.Groups, + groupGoNames: groupGoNames, + fakeClientsetPackage: clientsetPackage, + outputPackage: "fake", + imports: generator.NewImportTracker(), + realClientsetPackage: clientsetPackage, + }, + &scheme.GenScheme{ + DefaultGen: generator.DefaultGen{ + OptionalName: "register", + }, + InputPackages: customArgs.GroupVersionPackages(), + OutputPackage: clientsetPackage, + Groups: customArgs.Groups, + GroupGoNames: groupGoNames, + ImportTracker: generator.NewImportTracker(), + PrivateScheme: true, + }, + } + return generators + }, + } +} diff --git a/cmd/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go b/cmd/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go new file mode 100644 index 0000000..d23b800 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go @@ -0,0 +1,167 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fake + +import ( + "fmt" + "io" + "path/filepath" + "strings" + + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" +) + +// genClientset generates a package for a clientset. +type genClientset struct { + generator.DefaultGen + groups []clientgentypes.GroupVersions + groupGoNames map[clientgentypes.GroupVersion]string + fakeClientsetPackage string + outputPackage string + imports namer.ImportTracker + clientsetGenerated bool + // the import path of the generated real clientset. + realClientsetPackage string +} + +var _ generator.Generator = &genClientset{} + +func (g *genClientset) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + } +} + +// We only want to call GenerateType() once. +func (g *genClientset) Filter(c *generator.Context, t *types.Type) bool { + ret := !g.clientsetGenerated + g.clientsetGenerated = true + return ret +} + +func (g *genClientset) Imports(c *generator.Context) (imports []string) { + imports = append(imports, g.imports.ImportLines()...) + for _, group := range g.groups { + for _, version := range group.Versions { + groupClientPackage := filepath.Join(g.fakeClientsetPackage, "typed", strings.ToLower(group.PackageName), strings.ToLower(version.NonEmpty())) + fakeGroupClientPackage := filepath.Join(groupClientPackage, "fake") + + groupAlias := strings.ToLower(g.groupGoNames[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}]) + imports = append(imports, fmt.Sprintf("%s%s \"%s\"", groupAlias, strings.ToLower(version.NonEmpty()), groupClientPackage)) + imports = append(imports, fmt.Sprintf("fake%s%s \"%s\"", groupAlias, strings.ToLower(version.NonEmpty()), fakeGroupClientPackage)) + } + } + // the package that has the clientset Interface + imports = append(imports, fmt.Sprintf("clientset \"%s\"", g.realClientsetPackage)) + // imports for the code in commonTemplate + imports = append(imports, + "k8s.io/client-go/testing", + "k8s.io/client-go/discovery", + "fakediscovery \"k8s.io/client-go/discovery/fake\"", + "k8s.io/apimachinery/pkg/runtime", + "k8s.io/apimachinery/pkg/watch", + ) + + return +} + +func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + // TODO: We actually don't need any type information to generate the clientset, + // perhaps we can adapt the go2ild framework to this kind of usage. + sw := generator.NewSnippetWriter(w, c, "$", "$") + + allGroups := clientgentypes.ToGroupVersionInfo(g.groups, g.groupGoNames) + + sw.Do(common, nil) + sw.Do(checkImpl, nil) + + for _, group := range allGroups { + m := map[string]interface{}{ + "group": group.Group, + "version": group.Version, + "PackageAlias": group.PackageAlias, + "GroupGoName": group.GroupGoName, + "Version": namer.IC(group.Version.String()), + } + + sw.Do(clientsetInterfaceImplTemplate, m) + } + + return sw.Error() +} + +// This part of code is version-independent, unchanging. +var common = ` +// 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 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) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + 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.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} +` + +var checkImpl = ` +var _ clientset.Interface = &Clientset{} +` + +var clientsetInterfaceImplTemplate = ` +// $.GroupGoName$$.Version$ retrieves the $.GroupGoName$$.Version$Client +func (c *Clientset) $.GroupGoName$$.Version$() $.PackageAlias$.$.GroupGoName$$.Version$Interface { + return &fake$.PackageAlias$.Fake$.GroupGoName$$.Version${Fake: &c.Fake} +} +` diff --git a/cmd/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go b/cmd/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go new file mode 100644 index 0000000..8f4d578 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/generators/fake/generator_fake_for_group.go @@ -0,0 +1,130 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fake + +import ( + "fmt" + "io" + "path/filepath" + "strings" + + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/code-generator/cmd/client-gen/generators/util" +) + +// genFakeForGroup produces a file for a group client, e.g. ExtensionsClient for the extension group. +type genFakeForGroup struct { + generator.DefaultGen + outputPackage string + realClientPackage string + group string + version string + groupGoName string + // types in this group + types []*types.Type + imports namer.ImportTracker + // If the genGroup has been called. This generator should only execute once. + called bool +} + +var _ generator.Generator = &genFakeForGroup{} + +// We only want to call GenerateType() once per group. +func (g *genFakeForGroup) Filter(c *generator.Context, t *types.Type) bool { + if !g.called { + g.called = true + return true + } + return false +} + +func (g *genFakeForGroup) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + } +} + +func (g *genFakeForGroup) Imports(c *generator.Context) (imports []string) { + imports = g.imports.ImportLines() + if len(g.types) != 0 { + imports = append(imports, fmt.Sprintf("%s \"%s\"", strings.ToLower(filepath.Base(g.realClientPackage)), g.realClientPackage)) + } + return imports +} + +func (g *genFakeForGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "$", "$") + + m := map[string]interface{}{ + "GroupGoName": g.groupGoName, + "Version": namer.IC(g.version), + "Fake": c.Universe.Type(types.Name{Package: "k8s.io/client-go/testing", Name: "Fake"}), + "RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), + "RESTClient": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "RESTClient"}), + } + + sw.Do(groupClientTemplate, m) + for _, t := range g.types { + tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) + if err != nil { + return err + } + wrapper := map[string]interface{}{ + "type": t, + "GroupGoName": g.groupGoName, + "Version": namer.IC(g.version), + "realClientPackage": strings.ToLower(filepath.Base(g.realClientPackage)), + } + if tags.NonNamespaced { + sw.Do(getterImplNonNamespaced, wrapper) + continue + } + sw.Do(getterImplNamespaced, wrapper) + } + sw.Do(getRESTClient, m) + return sw.Error() +} + +var groupClientTemplate = ` +type Fake$.GroupGoName$$.Version$ struct { + *$.Fake|raw$ +} +` + +var getterImplNamespaced = ` +func (c *Fake$.GroupGoName$$.Version$) $.type|publicPlural$(namespace string) $.realClientPackage$.$.type|public$Interface { + return &Fake$.type|publicPlural${c, namespace} +} +` + +var getterImplNonNamespaced = ` +func (c *Fake$.GroupGoName$$.Version$) $.type|publicPlural$() $.realClientPackage$.$.type|public$Interface { + return &Fake$.type|publicPlural${c} +} +` + +var getRESTClient = ` +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *Fake$.GroupGoName$$.Version$) RESTClient() $.RESTClientInterface|raw$ { + var ret *$.RESTClient|raw$ + return ret +} +` diff --git a/cmd/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go b/cmd/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go new file mode 100644 index 0000000..ebd8506 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go @@ -0,0 +1,482 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fake + +import ( + "io" + "path/filepath" + "strings" + + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/code-generator/cmd/client-gen/generators/util" + "k8s.io/code-generator/cmd/client-gen/path" +) + +// genFakeForType produces a file for each top-level type. +type genFakeForType struct { + generator.DefaultGen + outputPackage string + group string + version string + groupGoName string + inputPackage string + typeToMatch *types.Type + imports namer.ImportTracker +} + +var _ generator.Generator = &genFakeForType{} + +// Filter ignores all but one type because we're making a single file per type. +func (g *genFakeForType) Filter(c *generator.Context, t *types.Type) bool { return t == g.typeToMatch } + +func (g *genFakeForType) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + } +} + +func (g *genFakeForType) Imports(c *generator.Context) (imports []string) { + return g.imports.ImportLines() +} + +// Ideally, we'd like genStatus to return true if there is a subresource path +// registered for "status" in the API server, but we do not have that +// information, so genStatus returns true if the type has a status field. +func genStatus(t *types.Type) bool { + // Default to true if we have a Status member + hasStatus := false + for _, m := range t.Members { + if m.Name == "Status" { + hasStatus = true + break + } + } + + tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) + return hasStatus && !tags.NoStatus +} + +// hasObjectMeta returns true if the type has a ObjectMeta field. +func hasObjectMeta(t *types.Type) bool { + for _, m := range t.Members { + if m.Embedded == true && m.Name == "ObjectMeta" { + return true + } + } + return false +} + +// GenerateType makes the body of a file implementing the individual typed client for type t. +func (g *genFakeForType) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "$", "$") + pkg := filepath.Base(t.Name.Package) + tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) + if err != nil { + return err + } + canonicalGroup := g.group + if canonicalGroup == "core" { + canonicalGroup = "" + } + + groupName := g.group + if g.group == "core" { + groupName = "" + } + + // allow user to define a group name that's different from the one parsed from the directory. + p := c.Universe.Package(path.Vendorless(g.inputPackage)) + if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { + groupName = override[0] + } + + const pkgClientGoTesting = "k8s.io/client-go/testing" + m := map[string]interface{}{ + "type": t, + "inputType": t, + "resultType": t, + "subresourcePath": "", + "package": pkg, + "Package": namer.IC(pkg), + "namespaced": !tags.NonNamespaced, + "Group": namer.IC(g.group), + "GroupGoName": g.groupGoName, + "Version": namer.IC(g.version), + "group": canonicalGroup, + "groupName": groupName, + "version": g.version, + "CreateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "CreateOptions"}), + "DeleteOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "DeleteOptions"}), + "GetOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GetOptions"}), + "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), + "PatchOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "PatchOptions"}), + "UpdateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "UpdateOptions"}), + "Everything": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/labels", Name: "Everything"}), + "GroupVersionResource": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersionResource"}), + "GroupVersionKind": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersionKind"}), + "PatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "PatchType"}), + "watchInterface": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/watch", Name: "Interface"}), + + "NewRootListAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootListAction"}), + "NewListAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewListAction"}), + "NewRootGetAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootGetAction"}), + "NewGetAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewGetAction"}), + "NewRootDeleteAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootDeleteAction"}), + "NewDeleteAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewDeleteAction"}), + "NewRootDeleteCollectionAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootDeleteCollectionAction"}), + "NewDeleteCollectionAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewDeleteCollectionAction"}), + "NewRootUpdateAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootUpdateAction"}), + "NewUpdateAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewUpdateAction"}), + "NewRootCreateAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootCreateAction"}), + "NewCreateAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewCreateAction"}), + "NewRootWatchAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootWatchAction"}), + "NewWatchAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewWatchAction"}), + "NewCreateSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewCreateSubresourceAction"}), + "NewRootCreateSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootCreateSubresourceAction"}), + "NewUpdateSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewUpdateSubresourceAction"}), + "NewGetSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewGetSubresourceAction"}), + "NewRootGetSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootGetSubresourceAction"}), + "NewRootUpdateSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootUpdateSubresourceAction"}), + "NewRootPatchAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootPatchAction"}), + "NewPatchAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewPatchAction"}), + "NewRootPatchSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootPatchSubresourceAction"}), + "NewPatchSubresourceAction": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewPatchSubresourceAction"}), + "ExtractFromListOptions": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "ExtractFromListOptions"}), + } + + if tags.NonNamespaced { + sw.Do(structNonNamespaced, m) + } else { + sw.Do(structNamespaced, m) + } + + if tags.NoVerbs { + return sw.Error() + } + sw.Do(resource, m) + sw.Do(kind, m) + + if tags.HasVerb("get") { + sw.Do(getTemplate, m) + } + if tags.HasVerb("list") { + if hasObjectMeta(t) { + sw.Do(listUsingOptionsTemplate, m) + } else { + sw.Do(listTemplate, m) + } + } + if tags.HasVerb("watch") { + sw.Do(watchTemplate, m) + } + + if tags.HasVerb("create") { + sw.Do(createTemplate, m) + } + if tags.HasVerb("update") { + sw.Do(updateTemplate, m) + } + if tags.HasVerb("updateStatus") && genStatus(t) { + sw.Do(updateStatusTemplate, m) + } + if tags.HasVerb("delete") { + sw.Do(deleteTemplate, m) + } + if tags.HasVerb("deleteCollection") { + sw.Do(deleteCollectionTemplate, m) + } + if tags.HasVerb("patch") { + sw.Do(patchTemplate, m) + } + + // generate extended client methods + for _, e := range tags.Extensions { + inputType := *t + resultType := *t + if len(e.InputTypeOverride) > 0 { + if name, pkg := e.Input(); len(pkg) > 0 { + newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) + inputType = *newType + } else { + inputType.Name.Name = e.InputTypeOverride + } + } + if len(e.ResultTypeOverride) > 0 { + if name, pkg := e.Result(); len(pkg) > 0 { + newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) + resultType = *newType + } else { + resultType.Name.Name = e.ResultTypeOverride + } + } + m["inputType"] = &inputType + m["resultType"] = &resultType + m["subresourcePath"] = e.SubResourcePath + + if e.HasVerb("get") { + if e.IsSubresource() { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, getSubresourceTemplate), m) + } else { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, getTemplate), m) + } + } + + if e.HasVerb("list") { + + sw.Do(adjustTemplate(e.VerbName, e.VerbType, listTemplate), m) + } + + // TODO: Figure out schemantic for watching a sub-resource. + if e.HasVerb("watch") { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, watchTemplate), m) + } + + if e.HasVerb("create") { + if e.IsSubresource() { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, createSubresourceTemplate), m) + } else { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, createTemplate), m) + } + } + + if e.HasVerb("update") { + if e.IsSubresource() { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, updateSubresourceTemplate), m) + } else { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, updateTemplate), m) + } + } + + // TODO: Figure out schemantic for deleting a sub-resource (what arguments + // are passed, does it need two names? etc. + if e.HasVerb("delete") { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, deleteTemplate), m) + } + + if e.HasVerb("patch") { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, patchTemplate), m) + } + } + + return sw.Error() +} + +// adjustTemplate adjust the origin verb template using the expansion name. +// TODO: Make the verbs in templates parametrized so the strings.Replace() is +// not needed. +func adjustTemplate(name, verbType, template string) string { + return strings.Replace(template, " "+strings.Title(verbType), " "+name, -1) +} + +// template for the struct that implements the type's interface +var structNamespaced = ` +// Fake$.type|publicPlural$ implements $.type|public$Interface +type Fake$.type|publicPlural$ struct { + Fake *Fake$.GroupGoName$$.Version$ + ns string +} +` + +// template for the struct that implements the type's interface +var structNonNamespaced = ` +// Fake$.type|publicPlural$ implements $.type|public$Interface +type Fake$.type|publicPlural$ struct { + Fake *Fake$.GroupGoName$$.Version$ +} +` + +var resource = ` +var $.type|allLowercasePlural$Resource = $.GroupVersionResource|raw${Group: "$.groupName$", Version: "$.version$", Resource: "$.type|resource$"} +` + +var kind = ` +var $.type|allLowercasePlural$Kind = $.GroupVersionKind|raw${Group: "$.groupName$", Version: "$.version$", Kind: "$.type|singularKind$"} +` + +var listTemplate = ` +// List takes label and field selectors, and returns the list of $.type|publicPlural$ that match those selectors. +func (c *Fake$.type|publicPlural$) List(ctx context.Context, opts $.ListOptions|raw$) (result *$.type|raw$List, err error) { + obj, err := c.Fake. + $if .namespaced$Invokes($.NewListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, c.ns, opts), &$.type|raw$List{}) + $else$Invokes($.NewRootListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, opts), &$.type|raw$List{})$end$ + if obj == nil { + return nil, err + } + return obj.(*$.type|raw$List), err +} +` + +var listUsingOptionsTemplate = ` +// List takes label and field selectors, and returns the list of $.type|publicPlural$ that match those selectors. +func (c *Fake$.type|publicPlural$) List(ctx context.Context, opts $.ListOptions|raw$) (result *$.type|raw$List, err error) { + obj, err := c.Fake. + $if .namespaced$Invokes($.NewListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, c.ns, opts), &$.type|raw$List{}) + $else$Invokes($.NewRootListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, opts), &$.type|raw$List{})$end$ + if obj == nil { + return nil, err + } + + label, _, _ := $.ExtractFromListOptions|raw$(opts) + if label == nil { + label = $.Everything|raw$() + } + list := &$.type|raw$List{ListMeta: obj.(*$.type|raw$List).ListMeta} + for _, item := range obj.(*$.type|raw$List).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} +` + +var getTemplate = ` +// Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. +func (c *Fake$.type|publicPlural$) Get(ctx context.Context, name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { + obj, err := c.Fake. + $if .namespaced$Invokes($.NewGetAction|raw$($.type|allLowercasePlural$Resource, c.ns, name), &$.resultType|raw${}) + $else$Invokes($.NewRootGetAction|raw$($.type|allLowercasePlural$Resource, name), &$.resultType|raw${})$end$ + if obj == nil { + return nil, err + } + return obj.(*$.resultType|raw$), err +} +` + +var getSubresourceTemplate = ` +// Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. +func (c *Fake$.type|publicPlural$) Get(ctx context.Context, $.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { + obj, err := c.Fake. + $if .namespaced$Invokes($.NewGetSubresourceAction|raw$($.type|allLowercasePlural$Resource, c.ns, "$.subresourcePath$", $.type|private$Name), &$.resultType|raw${}) + $else$Invokes($.NewRootGetSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", $.type|private$Name), &$.resultType|raw${})$end$ + if obj == nil { + return nil, err + } + return obj.(*$.resultType|raw$), err +} +` + +var deleteTemplate = ` +// Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs. +func (c *Fake$.type|publicPlural$) Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error { + _, err := c.Fake. + $if .namespaced$Invokes($.NewDeleteAction|raw$($.type|allLowercasePlural$Resource, c.ns, name), &$.type|raw${}) + $else$Invokes($.NewRootDeleteAction|raw$($.type|allLowercasePlural$Resource, name), &$.type|raw${})$end$ + return err +} +` + +var deleteCollectionTemplate = ` +// DeleteCollection deletes a collection of objects. +func (c *Fake$.type|publicPlural$) DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error { + $if .namespaced$action := $.NewDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, c.ns, listOpts) + $else$action := $.NewRootDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, listOpts) + $end$ + _, err := c.Fake.Invokes(action, &$.type|raw$List{}) + return err +} +` +var createTemplate = ` +// Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. +func (c *Fake$.type|publicPlural$) Create(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { + obj, err := c.Fake. + $if .namespaced$Invokes($.NewCreateAction|raw$($.inputType|allLowercasePlural$Resource, c.ns, $.inputType|private$), &$.resultType|raw${}) + $else$Invokes($.NewRootCreateAction|raw$($.inputType|allLowercasePlural$Resource, $.inputType|private$), &$.resultType|raw${})$end$ + if obj == nil { + return nil, err + } + return obj.(*$.resultType|raw$), err +} +` + +var createSubresourceTemplate = ` +// Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. +func (c *Fake$.type|publicPlural$) Create(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { + obj, err := c.Fake. + $if .namespaced$Invokes($.NewCreateSubresourceAction|raw$($.type|allLowercasePlural$Resource, $.type|private$Name, "$.subresourcePath$", c.ns, $.inputType|private$), &$.resultType|raw${}) + $else$Invokes($.NewRootCreateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", $.inputType|private$), &$.resultType|raw${})$end$ + if obj == nil { + return nil, err + } + return obj.(*$.resultType|raw$), err +} +` + +var updateTemplate = ` +// Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. +func (c *Fake$.type|publicPlural$) Update(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { + obj, err := c.Fake. + $if .namespaced$Invokes($.NewUpdateAction|raw$($.inputType|allLowercasePlural$Resource, c.ns, $.inputType|private$), &$.resultType|raw${}) + $else$Invokes($.NewRootUpdateAction|raw$($.inputType|allLowercasePlural$Resource, $.inputType|private$), &$.resultType|raw${})$end$ + if obj == nil { + return nil, err + } + return obj.(*$.resultType|raw$), err +} +` + +var updateSubresourceTemplate = ` +// Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. +func (c *Fake$.type|publicPlural$) Update(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { + obj, err := c.Fake. + $if .namespaced$Invokes($.NewUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", c.ns, $.inputType|private$), &$.inputType|raw${}) + $else$Invokes($.NewRootUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", $.inputType|private$), &$.resultType|raw${})$end$ + if obj == nil { + return nil, err + } + return obj.(*$.resultType|raw$), err +} +` + +var updateStatusTemplate = ` +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *Fake$.type|publicPlural$) UpdateStatus(ctx context.Context, $.type|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (*$.type|raw$, error) { + obj, err := c.Fake. + $if .namespaced$Invokes($.NewUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "status", c.ns, $.type|private$), &$.type|raw${}) + $else$Invokes($.NewRootUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "status", $.type|private$), &$.type|raw${})$end$ + if obj == nil { + return nil, err + } + return obj.(*$.type|raw$), err +} +` + +var watchTemplate = ` +// Watch returns a $.watchInterface|raw$ that watches the requested $.type|privatePlural$. +func (c *Fake$.type|publicPlural$) Watch(ctx context.Context, opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { + return c.Fake. + $if .namespaced$InvokesWatch($.NewWatchAction|raw$($.type|allLowercasePlural$Resource, c.ns, opts)) + $else$InvokesWatch($.NewRootWatchAction|raw$($.type|allLowercasePlural$Resource, opts))$end$ +} +` + +var patchTemplate = ` +// Patch applies the patch and returns the patched $.resultType|private$. +func (c *Fake$.type|publicPlural$) Patch(ctx context.Context, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error) { + obj, err := c.Fake. + $if .namespaced$Invokes($.NewPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, c.ns, name, pt, data, subresources... ), &$.resultType|raw${}) + $else$Invokes($.NewRootPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, name, pt, data, subresources...), &$.resultType|raw${})$end$ + if obj == nil { + return nil, err + } + return obj.(*$.resultType|raw$), err +} +` diff --git a/cmd/code-generator/cmd/client-gen/generators/generator_for_clientset.go b/cmd/code-generator/cmd/client-gen/generators/generator_for_clientset.go new file mode 100644 index 0000000..20e8796 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/generators/generator_for_clientset.go @@ -0,0 +1,183 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "fmt" + "io" + "path/filepath" + "strings" + + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" +) + +// genClientset generates a package for a clientset. +type genClientset struct { + generator.DefaultGen + groups []clientgentypes.GroupVersions + groupGoNames map[clientgentypes.GroupVersion]string + clientsetPackage string + outputPackage string + imports namer.ImportTracker + clientsetGenerated bool +} + +var _ generator.Generator = &genClientset{} + +func (g *genClientset) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + } +} + +// We only want to call GenerateType() once. +func (g *genClientset) Filter(c *generator.Context, t *types.Type) bool { + ret := !g.clientsetGenerated + g.clientsetGenerated = true + return ret +} + +func (g *genClientset) Imports(c *generator.Context) (imports []string) { + imports = append(imports, g.imports.ImportLines()...) + for _, group := range g.groups { + for _, version := range group.Versions { + typedClientPath := filepath.Join(g.clientsetPackage, "typed", strings.ToLower(group.PackageName), strings.ToLower(version.NonEmpty())) + groupAlias := strings.ToLower(g.groupGoNames[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}]) + imports = append(imports, fmt.Sprintf("%s%s \"%s\"", groupAlias, strings.ToLower(version.NonEmpty()), typedClientPath)) + } + } + return +} + +func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + // TODO: We actually don't need any type information to generate the clientset, + // perhaps we can adapt the go2ild framework to this kind of usage. + sw := generator.NewSnippetWriter(w, c, "$", "$") + + allGroups := clientgentypes.ToGroupVersionInfo(g.groups, g.groupGoNames) + m := map[string]interface{}{ + "allGroups": allGroups, + "Config": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Config"}), + "DefaultKubernetesUserAgent": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "DefaultKubernetesUserAgent"}), + "RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), + "DiscoveryInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/discovery", Name: "DiscoveryInterface"}), + "DiscoveryClient": c.Universe.Type(types.Name{Package: "k8s.io/client-go/discovery", Name: "DiscoveryClient"}), + "NewDiscoveryClientForConfig": c.Universe.Function(types.Name{Package: "k8s.io/client-go/discovery", Name: "NewDiscoveryClientForConfig"}), + "NewDiscoveryClientForConfigOrDie": c.Universe.Function(types.Name{Package: "k8s.io/client-go/discovery", Name: "NewDiscoveryClientForConfigOrDie"}), + "NewDiscoveryClient": c.Universe.Function(types.Name{Package: "k8s.io/client-go/discovery", Name: "NewDiscoveryClient"}), + "flowcontrolNewTokenBucketRateLimiter": c.Universe.Function(types.Name{Package: "k8s.io/client-go/util/flowcontrol", Name: "NewTokenBucketRateLimiter"}), + } + sw.Do(clientsetInterface, m) + sw.Do(clientsetTemplate, m) + for _, g := range allGroups { + sw.Do(clientsetInterfaceImplTemplate, g) + } + sw.Do(getDiscoveryTemplate, m) + sw.Do(newClientsetForConfigTemplate, m) + sw.Do(newClientsetForConfigOrDieTemplate, m) + sw.Do(newClientsetForRESTClientTemplate, m) + + return sw.Error() +} + +var clientsetInterface = ` +type Interface interface { + Discovery() $.DiscoveryInterface|raw$ + $range .allGroups$$.GroupGoName$$.Version$() $.PackageAlias$.$.GroupGoName$$.Version$Interface + $end$ +} +` + +var clientsetTemplate = ` +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *$.DiscoveryClient|raw$ + $range .allGroups$$.LowerCaseGroupGoName$$.Version$ *$.PackageAlias$.$.GroupGoName$$.Version$Client + $end$ +} +` + +var clientsetInterfaceImplTemplate = ` +// $.GroupGoName$$.Version$ retrieves the $.GroupGoName$$.Version$Client +func (c *Clientset) $.GroupGoName$$.Version$() $.PackageAlias$.$.GroupGoName$$.Version$Interface { + return c.$.LowerCaseGroupGoName$$.Version$ +} +` + +var getDiscoveryTemplate = ` +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() $.DiscoveryInterface|raw$ { + if c == nil { + return nil + } + return c.DiscoveryClient +} +` + +var newClientsetForConfigTemplate = ` +// 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. +func NewForConfig(c *$.Config|raw$) (*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 = $.flowcontrolNewTokenBucketRateLimiter|raw$(configShallowCopy.QPS, configShallowCopy.Burst) + } + var cs Clientset + var err error +$range .allGroups$ cs.$.LowerCaseGroupGoName$$.Version$, err =$.PackageAlias$.NewForConfig(&configShallowCopy) + if err!=nil { + return nil, err + } +$end$ + cs.DiscoveryClient, err = $.NewDiscoveryClientForConfig|raw$(&configShallowCopy) + if err!=nil { + return nil, err + } + return &cs, nil +} +` + +var newClientsetForConfigOrDieTemplate = ` +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *$.Config|raw$) *Clientset { + var cs Clientset +$range .allGroups$ cs.$.LowerCaseGroupGoName$$.Version$ =$.PackageAlias$.NewForConfigOrDie(c) +$end$ + cs.DiscoveryClient = $.NewDiscoveryClientForConfigOrDie|raw$(c) + return &cs +} +` + +var newClientsetForRESTClientTemplate = ` +// New creates a new Clientset for the given RESTClient. +func New(c $.RESTClientInterface|raw$) *Clientset { + var cs Clientset +$range .allGroups$ cs.$.LowerCaseGroupGoName$$.Version$ =$.PackageAlias$.New(c) +$end$ + cs.DiscoveryClient = $.NewDiscoveryClient|raw$(c) + return &cs +} +` diff --git a/cmd/code-generator/cmd/client-gen/generators/generator_for_expansion.go b/cmd/code-generator/cmd/client-gen/generators/generator_for_expansion.go new file mode 100644 index 0000000..f47c079 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/generators/generator_for_expansion.go @@ -0,0 +1,54 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "io" + "os" + "path/filepath" + "strings" + + "k8s.io/gengo/generator" + "k8s.io/gengo/types" +) + +// genExpansion produces a file for a group client, e.g. ExtensionsClient for the extension group. +type genExpansion struct { + generator.DefaultGen + groupPackagePath string + // types in a group + types []*types.Type +} + +// We only want to call GenerateType() once per group. +func (g *genExpansion) Filter(c *generator.Context, t *types.Type) bool { + return len(g.types) == 0 || t == g.types[0] +} + +func (g *genExpansion) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "$", "$") + for _, t := range g.types { + if _, err := os.Stat(filepath.Join(g.groupPackagePath, strings.ToLower(t.Name.Name+"_expansion.go"))); os.IsNotExist(err) { + sw.Do(expansionInterfaceTemplate, t) + } + } + return sw.Error() +} + +var expansionInterfaceTemplate = ` +type $.|public$Expansion interface {} +` diff --git a/cmd/code-generator/cmd/client-gen/generators/generator_for_group.go b/cmd/code-generator/cmd/client-gen/generators/generator_for_group.go new file mode 100644 index 0000000..215a017 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/generators/generator_for_group.go @@ -0,0 +1,246 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "io" + "path/filepath" + + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/code-generator/cmd/client-gen/generators/util" + "k8s.io/code-generator/cmd/client-gen/path" +) + +// genGroup produces a file for a group client, e.g. ExtensionsClient for the extension group. +type genGroup struct { + generator.DefaultGen + outputPackage string + group string + version string + groupGoName string + apiPath string + // types in this group + types []*types.Type + imports namer.ImportTracker + inputPackage string + clientsetPackage string + // If the genGroup has been called. This generator should only execute once. + called bool +} + +var _ generator.Generator = &genGroup{} + +// We only want to call GenerateType() once per group. +func (g *genGroup) Filter(c *generator.Context, t *types.Type) bool { + if !g.called { + g.called = true + return true + } + return false +} + +func (g *genGroup) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + } +} + +func (g *genGroup) Imports(c *generator.Context) (imports []string) { + imports = append(imports, g.imports.ImportLines()...) + imports = append(imports, filepath.Join(g.clientsetPackage, "scheme")) + return +} + +func (g *genGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "$", "$") + + apiPath := func(group string) string { + if group == "core" { + return `"/api"` + } + return `"` + g.apiPath + `"` + } + + groupName := g.group + if g.group == "core" { + groupName = "" + } + // allow user to define a group name that's different from the one parsed from the directory. + p := c.Universe.Package(path.Vendorless(g.inputPackage)) + if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { + groupName = override[0] + } + + m := map[string]interface{}{ + "group": g.group, + "version": g.version, + "groupName": groupName, + "GroupGoName": g.groupGoName, + "Version": namer.IC(g.version), + "types": g.types, + "apiPath": apiPath(g.group), + "schemaGroupVersion": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersion"}), + "runtimeAPIVersionInternal": c.Universe.Variable(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "APIVersionInternal"}), + "restConfig": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Config"}), + "restDefaultKubernetesUserAgent": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "DefaultKubernetesUserAgent"}), + "restRESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), + "restRESTClientFor": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "RESTClientFor"}), + "SchemeGroupVersion": c.Universe.Variable(types.Name{Package: path.Vendorless(g.inputPackage), Name: "SchemeGroupVersion"}), + } + sw.Do(groupInterfaceTemplate, m) + sw.Do(groupClientTemplate, m) + for _, t := range g.types { + tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) + if err != nil { + return err + } + wrapper := map[string]interface{}{ + "type": t, + "GroupGoName": g.groupGoName, + "Version": namer.IC(g.version), + } + if tags.NonNamespaced { + sw.Do(getterImplNonNamespaced, wrapper) + } else { + sw.Do(getterImplNamespaced, wrapper) + } + } + sw.Do(newClientForConfigTemplate, m) + sw.Do(newClientForConfigOrDieTemplate, m) + sw.Do(newClientForRESTClientTemplate, m) + if g.version == "" { + sw.Do(setInternalVersionClientDefaultsTemplate, m) + } else { + sw.Do(setClientDefaultsTemplate, m) + } + sw.Do(getRESTClient, m) + + return sw.Error() +} + +var groupInterfaceTemplate = ` +type $.GroupGoName$$.Version$Interface interface { + RESTClient() $.restRESTClientInterface|raw$ + $range .types$ $.|publicPlural$Getter + $end$ +} +` + +var groupClientTemplate = ` +// $.GroupGoName$$.Version$Client is used to interact with features provided by the $.groupName$ group. +type $.GroupGoName$$.Version$Client struct { + restClient $.restRESTClientInterface|raw$ +} +` + +var getterImplNamespaced = ` +func (c *$.GroupGoName$$.Version$Client) $.type|publicPlural$(namespace string) $.type|public$Interface { + return new$.type|publicPlural$(c, namespace) +} +` + +var getterImplNonNamespaced = ` +func (c *$.GroupGoName$$.Version$Client) $.type|publicPlural$() $.type|public$Interface { + return new$.type|publicPlural$(c) +} +` + +var newClientForConfigTemplate = ` +// NewForConfig creates a new $.GroupGoName$$.Version$Client for the given config. +func NewForConfig(c *$.restConfig|raw$) (*$.GroupGoName$$.Version$Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := $.restRESTClientFor|raw$(&config) + if err != nil { + return nil, err + } + return &$.GroupGoName$$.Version$Client{client}, nil +} +` + +var newClientForConfigOrDieTemplate = ` +// NewForConfigOrDie creates a new $.GroupGoName$$.Version$Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *$.restConfig|raw$) *$.GroupGoName$$.Version$Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} +` + +var getRESTClient = ` +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *$.GroupGoName$$.Version$Client) RESTClient() $.restRESTClientInterface|raw$ { + if c == nil { + return nil + } + return c.restClient +} +` + +var newClientForRESTClientTemplate = ` +// New creates a new $.GroupGoName$$.Version$Client for the given RESTClient. +func New(c $.restRESTClientInterface|raw$) *$.GroupGoName$$.Version$Client { + return &$.GroupGoName$$.Version$Client{c} +} +` + +var setInternalVersionClientDefaultsTemplate = ` +func setConfigDefaults(config *$.restConfig|raw$) error { + config.APIPath = $.apiPath$ + if config.UserAgent == "" { + config.UserAgent = $.restDefaultKubernetesUserAgent|raw$() + } + if config.GroupVersion == nil || config.GroupVersion.Group != scheme.Scheme.PrioritizedVersionsForGroup("$.groupName$")[0].Group { + gv := scheme.Scheme.PrioritizedVersionsForGroup("$.groupName$")[0] + config.GroupVersion = &gv + } + config.NegotiatedSerializer = scheme.Codecs + + if config.QPS == 0 { + config.QPS = 5 + } + if config.Burst == 0 { + config.Burst = 10 + } + + return nil +} +` + +var setClientDefaultsTemplate = ` +func setConfigDefaults(config *$.restConfig|raw$) error { + gv := $.SchemeGroupVersion|raw$ + config.GroupVersion = &gv + config.APIPath = $.apiPath$ + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = $.restDefaultKubernetesUserAgent|raw$() + } + + return nil +} +` diff --git a/cmd/code-generator/cmd/client-gen/generators/generator_for_type.go b/cmd/code-generator/cmd/client-gen/generators/generator_for_type.go new file mode 100644 index 0000000..13664d0 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/generators/generator_for_type.go @@ -0,0 +1,610 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "io" + "path/filepath" + "strings" + + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/code-generator/cmd/client-gen/generators/util" +) + +// genClientForType produces a file for each top-level type. +type genClientForType struct { + generator.DefaultGen + outputPackage string + clientsetPackage string + group string + version string + groupGoName string + typeToMatch *types.Type + imports namer.ImportTracker +} + +var _ generator.Generator = &genClientForType{} + +// Filter ignores all but one type because we're making a single file per type. +func (g *genClientForType) Filter(c *generator.Context, t *types.Type) bool { + return t == g.typeToMatch +} + +func (g *genClientForType) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + } +} + +func (g *genClientForType) Imports(c *generator.Context) (imports []string) { + return g.imports.ImportLines() +} + +// Ideally, we'd like genStatus to return true if there is a subresource path +// registered for "status" in the API server, but we do not have that +// information, so genStatus returns true if the type has a status field. +func genStatus(t *types.Type) bool { + // Default to true if we have a Status member + hasStatus := false + for _, m := range t.Members { + if m.Name == "Status" { + hasStatus = true + break + } + } + return hasStatus && !util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).NoStatus +} + +// GenerateType makes the body of a file implementing the individual typed client for type t. +func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "$", "$") + pkg := filepath.Base(t.Name.Package) + tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) + if err != nil { + return err + } + type extendedInterfaceMethod struct { + template string + args map[string]interface{} + } + extendedMethods := []extendedInterfaceMethod{} + for _, e := range tags.Extensions { + inputType := *t + resultType := *t + // TODO: Extract this to some helper method as this code is copied into + // 2 other places. + if len(e.InputTypeOverride) > 0 { + if name, pkg := e.Input(); len(pkg) > 0 { + newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) + inputType = *newType + } else { + inputType.Name.Name = e.InputTypeOverride + } + } + if len(e.ResultTypeOverride) > 0 { + if name, pkg := e.Result(); len(pkg) > 0 { + newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) + resultType = *newType + } else { + resultType.Name.Name = e.ResultTypeOverride + } + } + var updatedVerbtemplate string + if _, exists := subresourceDefaultVerbTemplates[e.VerbType]; e.IsSubresource() && exists { + updatedVerbtemplate = e.VerbName + "(" + strings.TrimPrefix(subresourceDefaultVerbTemplates[e.VerbType], strings.Title(e.VerbType)+"(") + } else { + updatedVerbtemplate = e.VerbName + "(" + strings.TrimPrefix(defaultVerbTemplates[e.VerbType], strings.Title(e.VerbType)+"(") + } + extendedMethods = append(extendedMethods, extendedInterfaceMethod{ + template: updatedVerbtemplate, + args: map[string]interface{}{ + "type": t, + "inputType": &inputType, + "resultType": &resultType, + "CreateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "CreateOptions"}), + "GetOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GetOptions"}), + "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), + "UpdateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "UpdateOptions"}), + "PatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "PatchType"}), + }, + }) + } + m := map[string]interface{}{ + "type": t, + "inputType": t, + "resultType": t, + "package": pkg, + "Package": namer.IC(pkg), + "namespaced": !tags.NonNamespaced, + "Group": namer.IC(g.group), + "subresource": false, + "subresourcePath": "", + "GroupGoName": g.groupGoName, + "Version": namer.IC(g.version), + "CreateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "CreateOptions"}), + "DeleteOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "DeleteOptions"}), + "GetOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GetOptions"}), + "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), + "PatchOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "PatchOptions"}), + "UpdateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "UpdateOptions"}), + "PatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "PatchType"}), + "watchInterface": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/watch", Name: "Interface"}), + "RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), + "schemeParameterCodec": c.Universe.Variable(types.Name{Package: filepath.Join(g.clientsetPackage, "scheme"), Name: "ParameterCodec"}), + } + + sw.Do(getterComment, m) + if tags.NonNamespaced { + sw.Do(getterNonNamespaced, m) + } else { + sw.Do(getterNamespaced, m) + } + + sw.Do(interfaceTemplate1, m) + if !tags.NoVerbs { + if !genStatus(t) { + tags.SkipVerbs = append(tags.SkipVerbs, "updateStatus") + } + interfaceSuffix := "" + if len(extendedMethods) > 0 { + interfaceSuffix = "\n" + } + sw.Do("\n"+generateInterface(tags)+interfaceSuffix, m) + // add extended verbs into interface + for _, v := range extendedMethods { + sw.Do(v.template+interfaceSuffix, v.args) + } + + } + sw.Do(interfaceTemplate4, m) + + if tags.NonNamespaced { + sw.Do(structNonNamespaced, m) + sw.Do(newStructNonNamespaced, m) + } else { + sw.Do(structNamespaced, m) + sw.Do(newStructNamespaced, m) + } + + if tags.NoVerbs { + return sw.Error() + } + + if tags.HasVerb("get") { + sw.Do(getTemplate, m) + } + if tags.HasVerb("list") { + sw.Do(listTemplate, m) + } + if tags.HasVerb("watch") { + sw.Do(watchTemplate, m) + } + + if tags.HasVerb("create") { + sw.Do(createTemplate, m) + } + if tags.HasVerb("update") { + sw.Do(updateTemplate, m) + } + if tags.HasVerb("updateStatus") { + sw.Do(updateStatusTemplate, m) + } + if tags.HasVerb("delete") { + sw.Do(deleteTemplate, m) + } + if tags.HasVerb("deleteCollection") { + sw.Do(deleteCollectionTemplate, m) + } + if tags.HasVerb("patch") { + sw.Do(patchTemplate, m) + } + + // generate expansion methods + for _, e := range tags.Extensions { + inputType := *t + resultType := *t + if len(e.InputTypeOverride) > 0 { + if name, pkg := e.Input(); len(pkg) > 0 { + newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) + inputType = *newType + } else { + inputType.Name.Name = e.InputTypeOverride + } + } + if len(e.ResultTypeOverride) > 0 { + if name, pkg := e.Result(); len(pkg) > 0 { + newType := c.Universe.Type(types.Name{Package: pkg, Name: name}) + resultType = *newType + } else { + resultType.Name.Name = e.ResultTypeOverride + } + } + m["inputType"] = &inputType + m["resultType"] = &resultType + m["subresourcePath"] = e.SubResourcePath + + if e.HasVerb("get") { + if e.IsSubresource() { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, getSubresourceTemplate), m) + } else { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, getTemplate), m) + } + } + + if e.HasVerb("list") { + if e.IsSubresource() { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, listSubresourceTemplate), m) + } else { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, listTemplate), m) + } + } + + // TODO: Figure out schemantic for watching a sub-resource. + if e.HasVerb("watch") { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, watchTemplate), m) + } + + if e.HasVerb("create") { + if e.IsSubresource() { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, createSubresourceTemplate), m) + } else { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, createTemplate), m) + } + } + + if e.HasVerb("update") { + if e.IsSubresource() { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, updateSubresourceTemplate), m) + } else { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, updateTemplate), m) + } + } + + // TODO: Figure out schemantic for deleting a sub-resource (what arguments + // are passed, does it need two names? etc. + if e.HasVerb("delete") { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, deleteTemplate), m) + } + + if e.HasVerb("patch") { + sw.Do(adjustTemplate(e.VerbName, e.VerbType, patchTemplate), m) + } + } + + return sw.Error() +} + +// adjustTemplate adjust the origin verb template using the expansion name. +// TODO: Make the verbs in templates parametrized so the strings.Replace() is +// not needed. +func adjustTemplate(name, verbType, template string) string { + return strings.Replace(template, " "+strings.Title(verbType), " "+name, -1) +} + +func generateInterface(tags util.Tags) string { + // need an ordered list here to guarantee order of generated methods. + out := []string{} + for _, m := range util.SupportedVerbs { + if tags.HasVerb(m) { + out = append(out, defaultVerbTemplates[m]) + } + } + return strings.Join(out, "\n") +} + +var subresourceDefaultVerbTemplates = map[string]string{ + "create": `Create(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (*$.resultType|raw$, error)`, + "list": `List(ctx context.Context, $.type|private$Name string, opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, + "update": `Update(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (*$.resultType|raw$, error)`, + "get": `Get(ctx context.Context, $.type|private$Name string, options $.GetOptions|raw$) (*$.resultType|raw$, error)`, +} + +var defaultVerbTemplates = map[string]string{ + "create": `Create(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (*$.resultType|raw$, error)`, + "update": `Update(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (*$.resultType|raw$, error)`, + "updateStatus": `UpdateStatus(ctx context.Context, $.inputType|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (*$.type|raw$, error)`, + "delete": `Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error`, + "deleteCollection": `DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error`, + "get": `Get(ctx context.Context, name string, opts $.GetOptions|raw$) (*$.resultType|raw$, error)`, + "list": `List(ctx context.Context, opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, + "watch": `Watch(ctx context.Context, opts $.ListOptions|raw$) ($.watchInterface|raw$, error)`, + "patch": `Patch(ctx context.Context, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error)`, +} + +// group client will implement this interface. +var getterComment = ` +// $.type|publicPlural$Getter has a method to return a $.type|public$Interface. +// A group's client should implement this interface.` + +var getterNamespaced = ` +type $.type|publicPlural$Getter interface { + $.type|publicPlural$(namespace string) $.type|public$Interface +} +` + +var getterNonNamespaced = ` +type $.type|publicPlural$Getter interface { + $.type|publicPlural$() $.type|public$Interface +} +` + +// this type's interface, typed client will implement this interface. +var interfaceTemplate1 = ` +// $.type|public$Interface has methods to work with $.type|public$ resources. +type $.type|public$Interface interface {` + +var interfaceTemplate4 = ` + $.type|public$Expansion +} +` + +// template for the struct that implements the type's interface +var structNamespaced = ` +// $.type|privatePlural$ implements $.type|public$Interface +type $.type|privatePlural$ struct { + client $.RESTClientInterface|raw$ + ns string +} +` + +// template for the struct that implements the type's interface +var structNonNamespaced = ` +// $.type|privatePlural$ implements $.type|public$Interface +type $.type|privatePlural$ struct { + client $.RESTClientInterface|raw$ +} +` + +var newStructNamespaced = ` +// new$.type|publicPlural$ returns a $.type|publicPlural$ +func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client, namespace string) *$.type|privatePlural$ { + return &$.type|privatePlural${ + client: c.RESTClient(), + ns: namespace, + } +} +` + +var newStructNonNamespaced = ` +// new$.type|publicPlural$ returns a $.type|publicPlural$ +func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client) *$.type|privatePlural$ { + return &$.type|privatePlural${ + client: c.RESTClient(), + } +} +` +var listTemplate = ` +// List takes label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. +func (c *$.type|privatePlural$) List(ctx context.Context, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil{ + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &$.resultType|raw$List{} + err = c.client.Get(). + $if .namespaced$Namespace(c.ns).$end$ + Resource("$.type|resource$"). + VersionedParams(&opts, $.schemeParameterCodec|raw$). + Timeout(timeout). + Do(ctx). + Into(result) + return +} +` + +var listSubresourceTemplate = ` +// List takes $.type|raw$ name, label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. +func (c *$.type|privatePlural$) List(ctx context.Context, $.type|private$Name string, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil{ + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &$.resultType|raw$List{} + err = c.client.Get(). + $if .namespaced$Namespace(c.ns).$end$ + Resource("$.type|resource$"). + Name($.type|private$Name). + SubResource("$.subresourcePath$"). + VersionedParams(&opts, $.schemeParameterCodec|raw$). + Timeout(timeout). + Do(ctx). + Into(result) + return +} +` + +var getTemplate = ` +// Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. +func (c *$.type|privatePlural$) Get(ctx context.Context, name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { + result = &$.resultType|raw${} + err = c.client.Get(). + $if .namespaced$Namespace(c.ns).$end$ + Resource("$.type|resource$"). + Name(name). + VersionedParams(&options, $.schemeParameterCodec|raw$). + Do(ctx). + Into(result) + return +} +` + +var getSubresourceTemplate = ` +// Get takes name of the $.type|private$, and returns the corresponding $.resultType|raw$ object, and an error if there is any. +func (c *$.type|privatePlural$) Get(ctx context.Context, $.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { + result = &$.resultType|raw${} + err = c.client.Get(). + $if .namespaced$Namespace(c.ns).$end$ + Resource("$.type|resource$"). + Name($.type|private$Name). + SubResource("$.subresourcePath$"). + VersionedParams(&options, $.schemeParameterCodec|raw$). + Do(ctx). + Into(result) + return +} +` + +var deleteTemplate = ` +// Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs. +func (c *$.type|privatePlural$) Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error { + return c.client.Delete(). + $if .namespaced$Namespace(c.ns).$end$ + Resource("$.type|resource$"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} +` + +var deleteCollectionTemplate = ` +// DeleteCollection deletes a collection of objects. +func (c *$.type|privatePlural$) DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil{ + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + $if .namespaced$Namespace(c.ns).$end$ + Resource("$.type|resource$"). + VersionedParams(&listOpts, $.schemeParameterCodec|raw$). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} +` + +var createSubresourceTemplate = ` +// Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. +func (c *$.type|privatePlural$) Create(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { + result = &$.resultType|raw${} + err = c.client.Post(). + $if .namespaced$Namespace(c.ns).$end$ + Resource("$.type|resource$"). + Name($.type|private$Name). + SubResource("$.subresourcePath$"). + VersionedParams(&opts, $.schemeParameterCodec|raw$). + Body($.inputType|private$). + Do(ctx). + Into(result) + return +} +` + +var createTemplate = ` +// Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. +func (c *$.type|privatePlural$) Create(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { + result = &$.resultType|raw${} + err = c.client.Post(). + $if .namespaced$Namespace(c.ns).$end$ + Resource("$.type|resource$"). + VersionedParams(&opts, $.schemeParameterCodec|raw$). + Body($.inputType|private$). + Do(ctx). + Into(result) + return +} +` + +var updateSubresourceTemplate = ` +// Update takes the top resource name and the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. +func (c *$.type|privatePlural$) Update(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { + result = &$.resultType|raw${} + err = c.client.Put(). + $if .namespaced$Namespace(c.ns).$end$ + Resource("$.type|resource$"). + Name($.type|private$Name). + SubResource("$.subresourcePath$"). + VersionedParams(&opts, $.schemeParameterCodec|raw$). + Body($.inputType|private$). + Do(ctx). + Into(result) + return +} +` + +var updateTemplate = ` +// Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. +func (c *$.type|privatePlural$) Update(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { + result = &$.resultType|raw${} + err = c.client.Put(). + $if .namespaced$Namespace(c.ns).$end$ + Resource("$.type|resource$"). + Name($.inputType|private$.Name). + VersionedParams(&opts, $.schemeParameterCodec|raw$). + Body($.inputType|private$). + Do(ctx). + Into(result) + return +} +` + +var updateStatusTemplate = ` +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *$.type|privatePlural$) UpdateStatus(ctx context.Context, $.type|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (result *$.type|raw$, err error) { + result = &$.type|raw${} + err = c.client.Put(). + $if .namespaced$Namespace(c.ns).$end$ + Resource("$.type|resource$"). + Name($.type|private$.Name). + SubResource("status"). + VersionedParams(&opts, $.schemeParameterCodec|raw$). + Body($.type|private$). + Do(ctx). + Into(result) + return +} +` + +var watchTemplate = ` +// Watch returns a $.watchInterface|raw$ that watches the requested $.type|privatePlural$. +func (c *$.type|privatePlural$) Watch(ctx context.Context, opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil{ + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + $if .namespaced$Namespace(c.ns).$end$ + Resource("$.type|resource$"). + VersionedParams(&opts, $.schemeParameterCodec|raw$). + Timeout(timeout). + Watch(ctx) +} +` + +var patchTemplate = ` +// Patch applies the patch and returns the patched $.resultType|private$. +func (c *$.type|privatePlural$) Patch(ctx context.Context, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error) { + result = &$.resultType|raw${} + err = c.client.Patch(pt). + $if .namespaced$Namespace(c.ns).$end$ + Resource("$.type|resource$"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, $.schemeParameterCodec|raw$). + Body(data). + Do(ctx). + Into(result) + return +} +` diff --git a/cmd/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go b/cmd/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go new file mode 100644 index 0000000..a87d757 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/generators/scheme/generator_for_scheme.go @@ -0,0 +1,187 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package scheme + +import ( + "fmt" + "io" + "os" + "path/filepath" + "strings" + + "k8s.io/code-generator/cmd/client-gen/path" + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" +) + +// GenScheme produces a package for a clientset with the scheme, codecs and parameter codecs. +type GenScheme struct { + generator.DefaultGen + OutputPackage string + Groups []clientgentypes.GroupVersions + GroupGoNames map[clientgentypes.GroupVersion]string + InputPackages map[clientgentypes.GroupVersion]string + OutputPath string + ImportTracker namer.ImportTracker + PrivateScheme bool + CreateRegistry bool + schemeGenerated bool +} + +func (g *GenScheme) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.OutputPackage, g.ImportTracker), + } +} + +// We only want to call GenerateType() once. +func (g *GenScheme) Filter(c *generator.Context, t *types.Type) bool { + ret := !g.schemeGenerated + g.schemeGenerated = true + return ret +} + +func (g *GenScheme) Imports(c *generator.Context) (imports []string) { + imports = append(imports, g.ImportTracker.ImportLines()...) + for _, group := range g.Groups { + for _, version := range group.Versions { + packagePath := g.InputPackages[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}] + groupAlias := strings.ToLower(g.GroupGoNames[clientgentypes.GroupVersion{Group: group.Group, Version: version.Version}]) + if g.CreateRegistry { + // import the install package for internal clientsets instead of the type package with register.go + if version.Version != "" { + packagePath = filepath.Dir(packagePath) + } + packagePath = filepath.Join(packagePath, "install") + + imports = append(imports, fmt.Sprintf("%s \"%s\"", groupAlias, path.Vendorless(packagePath))) + break + } else { + imports = append(imports, fmt.Sprintf("%s%s \"%s\"", groupAlias, strings.ToLower(version.Version.NonEmpty()), path.Vendorless(packagePath))) + } + } + } + return +} + +func (g *GenScheme) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "$", "$") + + allGroupVersions := clientgentypes.ToGroupVersionInfo(g.Groups, g.GroupGoNames) + allInstallGroups := clientgentypes.ToGroupInstallPackages(g.Groups, g.GroupGoNames) + + m := map[string]interface{}{ + "publicScheme": !g.PrivateScheme, + "allGroupVersions": allGroupVersions, + "allInstallGroups": allInstallGroups, + "customRegister": false, + "runtimeNewParameterCodec": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "NewParameterCodec"}), + "runtimeNewScheme": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "NewScheme"}), + "serializerNewCodecFactory": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/serializer", Name: "NewCodecFactory"}), + "runtimeScheme": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "Scheme"}), + "runtimeSchemeBuilder": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "SchemeBuilder"}), + "runtimeUtilMust": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/util/runtime", Name: "Must"}), + "schemaGroupVersion": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersion"}), + "metav1AddToGroupVersion": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "AddToGroupVersion"}), + } + globals := map[string]string{ + "Scheme": "Scheme", + "Codecs": "Codecs", + "ParameterCodec": "ParameterCodec", + "Registry": "Registry", + } + for k, v := range globals { + if g.PrivateScheme { + m[k] = strings.ToLower(v[0:1]) + v[1:] + } else { + m[k] = v + } + } + + sw.Do(globalsTemplate, m) + + if g.OutputPath != "" { + if _, err := os.Stat(filepath.Join(g.OutputPath, strings.ToLower("register_custom.go"))); err == nil { + m["customRegister"] = true + } + } + + if g.CreateRegistry { + sw.Do(registryRegistration, m) + } else { + sw.Do(simpleRegistration, m) + } + + return sw.Error() +} + +var globalsTemplate = ` +var $.Scheme$ = $.runtimeNewScheme|raw$() +var $.Codecs$ = $.serializerNewCodecFactory|raw$($.Scheme$) +$if .publicScheme$var $.ParameterCodec$ = $.runtimeNewParameterCodec|raw$($.Scheme$)$end -$` + +var registryRegistration = ` + +func init() { + $.metav1AddToGroupVersion|raw$($.Scheme$, $.schemaGroupVersion|raw${Version: "v1"}) + Install($.Scheme$) +} + +// Install registers the API group and adds types to a scheme +func Install(scheme *$.runtimeScheme|raw$) { + $- range .allInstallGroups$ + $.InstallPackageAlias$.Install(scheme) + $- end$ + $if .customRegister$ + ExtraInstall(scheme) + $end -$ +} +` + +var simpleRegistration = ` +var localSchemeBuilder = $.runtimeSchemeBuilder|raw${ + $- range .allGroupVersions$ + $.PackageAlias$.AddToScheme, + $- end$ + $if .customRegister$ + ExtraAddToScheme, + $end -$ +} + +// 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() { + $.metav1AddToGroupVersion|raw$($.Scheme$, $.schemaGroupVersion|raw${Version: "v1"}) + $.runtimeUtilMust|raw$(AddToScheme($.Scheme$)) +} +` diff --git a/cmd/code-generator/cmd/client-gen/generators/util/tags.go b/cmd/code-generator/cmd/client-gen/generators/util/tags.go new file mode 100644 index 0000000..426b392 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/generators/util/tags.go @@ -0,0 +1,341 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package util + +import ( + "errors" + "fmt" + "strings" + + "k8s.io/gengo/types" +) + +var supportedTags = []string{ + "genclient", + "genclient:nonNamespaced", + "genclient:noVerbs", + "genclient:onlyVerbs", + "genclient:skipVerbs", + "genclient:noStatus", + "genclient:readonly", + "genclient:method", +} + +// SupportedVerbs is a list of supported verbs for +onlyVerbs and +skipVerbs. +var SupportedVerbs = []string{ + "create", + "update", + "updateStatus", + "delete", + "deleteCollection", + "get", + "list", + "watch", + "patch", +} + +// ReadonlyVerbs represents a list of read-only verbs. +var ReadonlyVerbs = []string{ + "get", + "list", + "watch", +} + +// genClientPrefix is the default prefix for all genclient tags. +const genClientPrefix = "genclient:" + +// unsupportedExtensionVerbs is a list of verbs we don't support generating +// extension client functions for. +var unsupportedExtensionVerbs = []string{ + "updateStatus", + "deleteCollection", + "watch", + "delete", +} + +// inputTypeSupportedVerbs is a list of verb types that supports overriding the +// input argument type. +var inputTypeSupportedVerbs = []string{ + "create", + "update", +} + +// resultTypeSupportedVerbs is a list of verb types that supports overriding the +// resulting type. +var resultTypeSupportedVerbs = []string{ + "create", + "update", + "get", + "list", + "patch", +} + +// Extensions allows to extend the default set of client verbs +// (CRUD+watch+patch+list+deleteCollection) for a given type with custom defined +// verbs. Custom verbs can have custom input and result types and also allow to +// use a sub-resource in a request instead of top-level resource type. +// +// Example: +// +// +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale +// +// type ReplicaSet struct { ... } +// +// The 'method=UpdateScale' is the name of the client function. +// The 'verb=update' here means the client function will use 'PUT' action. +// The 'subresource=scale' means we will use SubResource template to generate this client function. +// The 'input' is the input type used for creation (function argument). +// The 'result' (not needed in this case) is the result type returned from the +// client function. +// +type extension struct { + // VerbName is the name of the custom verb (Scale, Instantiate, etc..) + VerbName string + // VerbType is the type of the verb (only verbs from SupportedVerbs are + // supported) + VerbType string + // SubResourcePath defines a path to a sub-resource to use in the request. + // (optional) + SubResourcePath string + // InputTypeOverride overrides the input parameter type for the verb. By + // default the original type is used. Overriding the input type only works for + // "create" and "update" verb types. The given type must exists in the same + // package as the original type. + // (optional) + InputTypeOverride string + // ResultTypeOverride overrides the resulting object type for the verb. By + // default the original type is used. Overriding the result type works. + // (optional) + ResultTypeOverride string +} + +// IsSubresource indicates if this extension should generate the sub-resource. +func (e *extension) IsSubresource() bool { + return len(e.SubResourcePath) > 0 +} + +// HasVerb checks if the extension matches the given verb. +func (e *extension) HasVerb(verb string) bool { + return e.VerbType == verb +} + +// Input returns the input override package path and the type. +func (e *extension) Input() (string, string) { + parts := strings.Split(e.InputTypeOverride, ".") + return parts[len(parts)-1], strings.Join(parts[0:len(parts)-1], ".") +} + +// Result returns the result override package path and the type. +func (e *extension) Result() (string, string) { + parts := strings.Split(e.ResultTypeOverride, ".") + return parts[len(parts)-1], strings.Join(parts[0:len(parts)-1], ".") +} + +// Tags represents a genclient configuration for a single type. +type Tags struct { + // +genclient + GenerateClient bool + // +genclient:nonNamespaced + NonNamespaced bool + // +genclient:noStatus + NoStatus bool + // +genclient:noVerbs + NoVerbs bool + // +genclient:skipVerbs=get,update + // +genclient:onlyVerbs=create,delete + SkipVerbs []string + // +genclient:method=UpdateScale,verb=update,subresource=scale,input=Scale,result=Scale + Extensions []extension +} + +// HasVerb returns true if we should include the given verb in final client interface and +// generate the function for it. +func (t Tags) HasVerb(verb string) bool { + if len(t.SkipVerbs) == 0 { + return true + } + for _, s := range t.SkipVerbs { + if verb == s { + return false + } + } + return true +} + +// MustParseClientGenTags calls ParseClientGenTags but instead of returning error it panics. +func MustParseClientGenTags(lines []string) Tags { + tags, err := ParseClientGenTags(lines) + if err != nil { + panic(err.Error()) + } + return tags +} + +// ParseClientGenTags parse the provided genclient tags and validates that no unknown +// tags are provided. +func ParseClientGenTags(lines []string) (Tags, error) { + ret := Tags{} + values := types.ExtractCommentTags("+", lines) + var value []string + value, ret.GenerateClient = values["genclient"] + // Check the old format and error when used to avoid generating client when //+genclient=false + if len(value) > 0 && len(value[0]) > 0 { + return ret, fmt.Errorf("+genclient=%s is invalid, use //+genclient if you want to generate client or omit it when you want to disable generation", value) + } + _, ret.NonNamespaced = values[genClientPrefix+"nonNamespaced"] + // Check the old format and error when used + if value := values["nonNamespaced"]; len(value) > 0 && len(value[0]) > 0 { + return ret, fmt.Errorf("+nonNamespaced=%s is invalid, use //+genclient:nonNamespaced instead", value[0]) + } + _, ret.NoVerbs = values[genClientPrefix+"noVerbs"] + _, ret.NoStatus = values[genClientPrefix+"noStatus"] + onlyVerbs := []string{} + if _, isReadonly := values[genClientPrefix+"readonly"]; isReadonly { + onlyVerbs = ReadonlyVerbs + } + // Check the old format and error when used + if value := values["readonly"]; len(value) > 0 && len(value[0]) > 0 { + return ret, fmt.Errorf("+readonly=%s is invalid, use //+genclient:readonly instead", value[0]) + } + if v, exists := values[genClientPrefix+"skipVerbs"]; exists { + ret.SkipVerbs = strings.Split(v[0], ",") + } + if v, exists := values[genClientPrefix+"onlyVerbs"]; exists || len(onlyVerbs) > 0 { + if len(v) > 0 { + onlyVerbs = append(onlyVerbs, strings.Split(v[0], ",")...) + } + skipVerbs := []string{} + for _, m := range SupportedVerbs { + skip := true + for _, o := range onlyVerbs { + if o == m { + skip = false + break + } + } + // Check for conflicts + for _, v := range skipVerbs { + if v == m { + return ret, fmt.Errorf("verb %q used both in genclient:skipVerbs and genclient:onlyVerbs", v) + } + } + if skip { + skipVerbs = append(skipVerbs, m) + } + } + ret.SkipVerbs = skipVerbs + } + var err error + if ret.Extensions, err = parseClientExtensions(values); err != nil { + return ret, err + } + return ret, validateClientGenTags(values) +} + +func parseClientExtensions(tags map[string][]string) ([]extension, error) { + var ret []extension + for name, values := range tags { + if !strings.HasPrefix(name, genClientPrefix+"method") { + continue + } + for _, value := range values { + // the value comes in this form: "Foo,verb=create" + ext := extension{} + parts := strings.Split(value, ",") + if len(parts) == 0 { + return nil, fmt.Errorf("invalid of empty extension verb name: %q", value) + } + // The first part represents the name of the extension + ext.VerbName = parts[0] + if len(ext.VerbName) == 0 { + return nil, fmt.Errorf("must specify a verb name (// +genclient:method=Foo,verb=create)") + } + // Parse rest of the arguments + params := parts[1:] + for _, p := range params { + parts := strings.Split(p, "=") + if len(parts) != 2 { + return nil, fmt.Errorf("invalid extension tag specification %q", p) + } + key, val := strings.TrimSpace(parts[0]), strings.TrimSpace(parts[1]) + if len(val) == 0 { + return nil, fmt.Errorf("empty value of %q for %q extension", key, ext.VerbName) + } + switch key { + case "verb": + ext.VerbType = val + case "subresource": + ext.SubResourcePath = val + case "input": + ext.InputTypeOverride = val + case "result": + ext.ResultTypeOverride = val + default: + return nil, fmt.Errorf("unknown extension configuration key %q", key) + } + } + // Validate resulting extension configuration + if len(ext.VerbType) == 0 { + return nil, fmt.Errorf("verb type must be specified (use '// +genclient:method=%s,verb=create')", ext.VerbName) + } + if len(ext.ResultTypeOverride) > 0 { + supported := false + for _, v := range resultTypeSupportedVerbs { + if ext.VerbType == v { + supported = true + break + } + } + if !supported { + return nil, fmt.Errorf("%s: result type is not supported for %q verbs (supported verbs: %#v)", ext.VerbName, ext.VerbType, resultTypeSupportedVerbs) + } + } + if len(ext.InputTypeOverride) > 0 { + supported := false + for _, v := range inputTypeSupportedVerbs { + if ext.VerbType == v { + supported = true + break + } + } + if !supported { + return nil, fmt.Errorf("%s: input type is not supported for %q verbs (supported verbs: %#v)", ext.VerbName, ext.VerbType, inputTypeSupportedVerbs) + } + } + for _, t := range unsupportedExtensionVerbs { + if ext.VerbType == t { + return nil, fmt.Errorf("verb %q is not supported by extension generator", ext.VerbType) + } + } + ret = append(ret, ext) + } + } + return ret, nil +} + +// validateTags validates that only supported genclient tags were provided. +func validateClientGenTags(values map[string][]string) error { + for _, k := range supportedTags { + delete(values, k) + } + for key := range values { + if strings.HasPrefix(key, strings.TrimSuffix(genClientPrefix, ":")) { + return errors.New("unknown tag detected: " + key) + } + } + return nil +} diff --git a/cmd/code-generator/cmd/client-gen/generators/util/tags_test.go b/cmd/code-generator/cmd/client-gen/generators/util/tags_test.go new file mode 100644 index 0000000..a5c9387 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/generators/util/tags_test.go @@ -0,0 +1,148 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package util + +import ( + "reflect" + "testing" +) + +func TestParseTags(t *testing.T) { + testCases := map[string]struct { + lines []string + expectTags Tags + expectError bool + }{ + "genclient": { + lines: []string{`+genclient`}, + expectTags: Tags{GenerateClient: true}, + }, + "genclient=true": { + lines: []string{`+genclient=true`}, + expectError: true, + }, + "nonNamespaced=true": { + lines: []string{`+genclient=true`, `+nonNamespaced=true`}, + expectError: true, + }, + "readonly=true": { + lines: []string{`+genclient=true`, `+readonly=true`}, + expectError: true, + }, + "genclient:nonNamespaced": { + lines: []string{`+genclient`, `+genclient:nonNamespaced`}, + expectTags: Tags{GenerateClient: true, NonNamespaced: true}, + }, + "genclient:noVerbs": { + lines: []string{`+genclient`, `+genclient:noVerbs`}, + expectTags: Tags{GenerateClient: true, NoVerbs: true}, + }, + "genclient:noStatus": { + lines: []string{`+genclient`, `+genclient:noStatus`}, + expectTags: Tags{GenerateClient: true, NoStatus: true}, + }, + "genclient:onlyVerbs": { + lines: []string{`+genclient`, `+genclient:onlyVerbs=create,delete`}, + expectTags: Tags{GenerateClient: true, SkipVerbs: []string{"update", "updateStatus", "deleteCollection", "get", "list", "watch", "patch"}}, + }, + "genclient:readonly": { + lines: []string{`+genclient`, `+genclient:readonly`}, + expectTags: Tags{GenerateClient: true, SkipVerbs: []string{"create", "update", "updateStatus", "delete", "deleteCollection", "patch"}}, + }, + "genclient:conflict": { + lines: []string{`+genclient`, `+genclient:onlyVerbs=create`, `+genclient:skipVerbs=create`}, + expectError: true, + }, + "genclient:invalid": { + lines: []string{`+genclient`, `+genclient:invalid`}, + expectError: true, + }, + } + for key, c := range testCases { + result, err := ParseClientGenTags(c.lines) + if err != nil && !c.expectError { + t.Fatalf("unexpected error: %v", err) + } + if !c.expectError && !reflect.DeepEqual(result, c.expectTags) { + t.Errorf("[%s] expected %#v to be %#v", key, result, c.expectTags) + } + } +} + +func TestParseTagsExtension(t *testing.T) { + testCases := map[string]struct { + lines []string + expectedExtensions []extension + expectError bool + }{ + "simplest extension": { + lines: []string{`+genclient:method=Foo,verb=create`}, + expectedExtensions: []extension{{VerbName: "Foo", VerbType: "create"}}, + }, + "multiple extensions": { + lines: []string{`+genclient:method=Foo,verb=create`, `+genclient:method=Bar,verb=get`}, + expectedExtensions: []extension{{VerbName: "Foo", VerbType: "create"}, {VerbName: "Bar", VerbType: "get"}}, + }, + "extension without verb": { + lines: []string{`+genclient:method`}, + expectError: true, + }, + "extension without verb type": { + lines: []string{`+genclient:method=Foo`}, + expectError: true, + }, + "sub-resource extension": { + lines: []string{`+genclient:method=Foo,verb=create,subresource=bar`}, + expectedExtensions: []extension{{VerbName: "Foo", VerbType: "create", SubResourcePath: "bar"}}, + }, + "output type extension": { + lines: []string{`+genclient:method=Foos,verb=list,result=Bars`}, + expectedExtensions: []extension{{VerbName: "Foos", VerbType: "list", ResultTypeOverride: "Bars"}}, + }, + "input type extension": { + lines: []string{`+genclient:method=Foo,verb=update,input=Bar`}, + expectedExtensions: []extension{{VerbName: "Foo", VerbType: "update", InputTypeOverride: "Bar"}}, + }, + "unknown verb type extension": { + lines: []string{`+genclient:method=Foo,verb=explode`}, + expectedExtensions: nil, + expectError: true, + }, + "invalid verb extension": { + lines: []string{`+genclient:method=Foo,unknown=bar`}, + expectedExtensions: nil, + expectError: true, + }, + "empty verb extension subresource": { + lines: []string{`+genclient:method=Foo,verb=get,subresource=`}, + expectedExtensions: nil, + expectError: true, + }, + } + for key, c := range testCases { + result, err := ParseClientGenTags(c.lines) + if err != nil && !c.expectError { + t.Fatalf("[%s] unexpected error: %v", key, err) + } + if err != nil && c.expectError { + t.Logf("[%s] got expected error: %+v", key, err) + } + if !c.expectError && !reflect.DeepEqual(result.Extensions, c.expectedExtensions) { + t.Errorf("[%s] expected %#+v to be %#+v", key, result.Extensions, c.expectedExtensions) + } + } +} diff --git a/cmd/code-generator/cmd/client-gen/main.go b/cmd/code-generator/cmd/client-gen/main.go new file mode 100644 index 0000000..cc0f72a --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/main.go @@ -0,0 +1,66 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// client-gen makes the individual typed clients using gengo. +package main + +import ( + "flag" + "path/filepath" + + "github.com/spf13/pflag" + "k8s.io/gengo/args" + "k8s.io/klog/v2" + + generatorargs "k8s.io/code-generator/cmd/client-gen/args" + "k8s.io/code-generator/cmd/client-gen/generators" + "k8s.io/code-generator/pkg/util" +) + +func main() { + klog.InitFlags(nil) + genericArgs, customArgs := generatorargs.NewDefaults() + + // Override defaults. + // TODO: move this out of client-gen + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + genericArgs.OutputPackagePath = "k8s.io/kubernetes/pkg/client/clientset_generated/" + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine, "k8s.io/kubernetes/pkg/apis") // TODO: move this input path out of client-gen + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + // add group version package as input dirs for gengo + for _, pkg := range customArgs.Groups { + for _, v := range pkg.Versions { + genericArgs.InputDirs = append(genericArgs.InputDirs, v.Package) + } + } + + if err := generatorargs.Validate(genericArgs); err != nil { + klog.Fatalf("Error: %v", err) + } + + if err := genericArgs.Execute( + generators.NameSystems(util.PluralExceptionListToMapOrDie(customArgs.PluralExceptions)), + generators.DefaultNameSystem(), + generators.Packages, + ); err != nil { + klog.Fatalf("Error: %v", err) + } +} diff --git a/cmd/code-generator/cmd/client-gen/path/path.go b/cmd/code-generator/cmd/client-gen/path/path.go new file mode 100644 index 0000000..19b269b --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/path/path.go @@ -0,0 +1,31 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package path + +import "strings" + +// Vendorless removes the longest match of "*/vendor/" from the front of p. +// It is useful if a package locates in vendor/, e.g., +// k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1, because gengo +// indexes the package with its import path, e.g., +// k8s.io/apimachinery/pkg/apis/meta/v1, +func Vendorless(p string) string { + if pos := strings.LastIndex(p, "/vendor/"); pos != -1 { + return p[pos+len("/vendor/"):] + } + return p +} diff --git a/cmd/code-generator/cmd/client-gen/types/helpers.go b/cmd/code-generator/cmd/client-gen/types/helpers.go new file mode 100644 index 0000000..59f2fd4 --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/types/helpers.go @@ -0,0 +1,121 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +import ( + "fmt" + "regexp" + "sort" + "strings" + + "k8s.io/gengo/namer" +) + +// ToGroupVersion turns "group/version" string into a GroupVersion struct. It reports error +// if it cannot parse the string. +func ToGroupVersion(gv string) (GroupVersion, error) { + // this can be the internal version for the legacy kube types + // TODO once we've cleared the last uses as strings, this special case should be removed. + if (len(gv) == 0) || (gv == "/") { + return GroupVersion{}, nil + } + + switch strings.Count(gv, "/") { + case 0: + return GroupVersion{Group(gv), ""}, nil + case 1: + i := strings.Index(gv, "/") + return GroupVersion{Group(gv[:i]), Version(gv[i+1:])}, nil + default: + return GroupVersion{}, fmt.Errorf("unexpected GroupVersion string: %v", gv) + } +} + +type sortableSliceOfVersions []string + +func (a sortableSliceOfVersions) Len() int { return len(a) } +func (a sortableSliceOfVersions) Swap(i, j int) { a[i], a[j] = a[j], a[i] } +func (a sortableSliceOfVersions) Less(i, j int) bool { + vi, vj := strings.TrimLeft(a[i], "v"), strings.TrimLeft(a[j], "v") + major := regexp.MustCompile("^[0-9]+") + viMajor, vjMajor := major.FindString(vi), major.FindString(vj) + viRemaining, vjRemaining := strings.TrimLeft(vi, viMajor), strings.TrimLeft(vj, vjMajor) + switch { + case len(viRemaining) == 0 && len(vjRemaining) == 0: + return viMajor < vjMajor + case len(viRemaining) == 0 && len(vjRemaining) != 0: + // stable version is greater than unstable version + return false + case len(viRemaining) != 0 && len(vjRemaining) == 0: + // stable version is greater than unstable version + return true + } + // neither are stable versions + if viMajor != vjMajor { + return viMajor < vjMajor + } + // assuming at most we have one alpha or one beta version, so if vi contains "alpha", it's the lesser one. + return strings.Contains(viRemaining, "alpha") +} + +// Determine the default version among versions. If a user calls a group client +// without specifying the version (e.g., c.CoreV1(), instead of c.CoreV1()), the +// default version will be returned. +func defaultVersion(versions []PackageVersion) Version { + var versionStrings []string + for _, version := range versions { + versionStrings = append(versionStrings, version.Version.String()) + } + sort.Sort(sortableSliceOfVersions(versionStrings)) + return Version(versionStrings[len(versionStrings)-1]) +} + +// ToGroupVersionInfo is a helper function used by generators for groups. +func ToGroupVersionInfo(groups []GroupVersions, groupGoNames map[GroupVersion]string) []GroupVersionInfo { + var groupVersionPackages []GroupVersionInfo + for _, group := range groups { + for _, version := range group.Versions { + groupGoName := groupGoNames[GroupVersion{Group: group.Group, Version: version.Version}] + groupVersionPackages = append(groupVersionPackages, GroupVersionInfo{ + Group: Group(namer.IC(group.Group.NonEmpty())), + Version: Version(namer.IC(version.Version.String())), + PackageAlias: strings.ToLower(groupGoName + version.Version.NonEmpty()), + GroupGoName: groupGoName, + LowerCaseGroupGoName: namer.IL(groupGoName), + }) + } + } + return groupVersionPackages +} + +func ToGroupInstallPackages(groups []GroupVersions, groupGoNames map[GroupVersion]string) []GroupInstallPackage { + var groupInstallPackages []GroupInstallPackage + for _, group := range groups { + defaultVersion := defaultVersion(group.Versions) + groupGoName := groupGoNames[GroupVersion{Group: group.Group, Version: defaultVersion}] + groupInstallPackages = append(groupInstallPackages, GroupInstallPackage{ + Group: Group(namer.IC(group.Group.NonEmpty())), + InstallPackageAlias: strings.ToLower(groupGoName), + }) + } + return groupInstallPackages +} + +// NormalizeGroupVersion calls normalizes the GroupVersion. +//func NormalizeGroupVersion(gv GroupVersion) GroupVersion { +// return GroupVersion{Group: gv.Group.NonEmpty(), Version: gv.Version, NonEmptyVersion: normalization.Version(gv.Version)} +//} diff --git a/cmd/code-generator/cmd/client-gen/types/helpers_test.go b/cmd/code-generator/cmd/client-gen/types/helpers_test.go new file mode 100644 index 0000000..dec62df --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/types/helpers_test.go @@ -0,0 +1,32 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +import ( + "reflect" + "sort" + "testing" +) + +func TestVersionSort(t *testing.T) { + unsortedVersions := []string{"v4beta1", "v2beta1", "v2alpha1", "v3", "v1"} + expected := []string{"v2alpha1", "v2beta1", "v4beta1", "v1", "v3"} + sort.Sort(sortableSliceOfVersions(unsortedVersions)) + if !reflect.DeepEqual(unsortedVersions, expected) { + t.Errorf("expected %#v\ngot %#v", expected, unsortedVersions) + } +} diff --git a/cmd/code-generator/cmd/client-gen/types/types.go b/cmd/code-generator/cmd/client-gen/types/types.go new file mode 100644 index 0000000..7d1606c --- /dev/null +++ b/cmd/code-generator/cmd/client-gen/types/types.go @@ -0,0 +1,75 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +type Version string + +func (v Version) String() string { + return string(v) +} + +func (v Version) NonEmpty() string { + if v == "" { + return "internalVersion" + } + return v.String() +} + +type Group string + +func (g Group) String() string { + return string(g) +} + +func (g Group) NonEmpty() string { + if g == "api" { + return "core" + } + return string(g) +} + +type PackageVersion struct { + Version + // The fully qualified package, e.g. k8s.io/kubernetes/pkg/apis/apps, where the types.go is found. + Package string +} + +type GroupVersion struct { + Group Group + Version Version +} + +type GroupVersions struct { + // The name of the package for this group, e.g. apps. + PackageName string + Group Group + Versions []PackageVersion +} + +// GroupVersionInfo contains all the info around a group version. +type GroupVersionInfo struct { + Group Group + Version Version + PackageAlias string + GroupGoName string + LowerCaseGroupGoName string +} + +type GroupInstallPackage struct { + Group Group + InstallPackageAlias string +} diff --git a/cmd/code-generator/cmd/conversion-gen/args/args.go b/cmd/code-generator/cmd/conversion-gen/args/args.go new file mode 100644 index 0000000..07ce6e7 --- /dev/null +++ b/cmd/code-generator/cmd/conversion-gen/args/args.go @@ -0,0 +1,83 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + + "github.com/spf13/pflag" + "k8s.io/gengo/args" +) + +// DefaultBasePeerDirs are the peer-dirs nearly everybody will use, i.e. those coming from +// apimachinery. +var DefaultBasePeerDirs = []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1", + "k8s.io/apimachinery/pkg/conversion", + "k8s.io/apimachinery/pkg/runtime", +} + +// CustomArgs is used by the gengo framework to pass args specific to this generator. +type CustomArgs struct { + // Base peer dirs which nearly everybody will use, i.e. outside of Kubernetes core. Peer dirs + // are declared to make the generator pick up manually written conversion funcs from external + // packages. + BasePeerDirs []string + + // Custom peer dirs which are application specific. Peer dirs are declared to make the + // generator pick up manually written conversion funcs from external packages. + ExtraPeerDirs []string + + // SkipUnsafe indicates whether to generate unsafe conversions to improve the efficiency + // of these operations. The unsafe operation is a direct pointer assignment via unsafe + // (within the allowed uses of unsafe) and is equivalent to a proposed Golang change to + // allow structs that are identical to be assigned to each other. + SkipUnsafe bool +} + +// NewDefaults returns default arguments for the generator. +func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { + genericArgs := args.Default().WithoutDefaultFlagParsing() + customArgs := &CustomArgs{ + BasePeerDirs: DefaultBasePeerDirs, + SkipUnsafe: false, + } + genericArgs.CustomArgs = customArgs + genericArgs.OutputFileBaseName = "conversion_generated" + return genericArgs, customArgs +} + +// AddFlags add the generator flags to the flag set. +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { + pflag.CommandLine.StringSliceVar(&ca.BasePeerDirs, "base-peer-dirs", ca.BasePeerDirs, + "Comma-separated list of apimachinery import paths which are considered, after tag-specified peers, for conversions. Only change these if you have very good reasons.") + pflag.CommandLine.StringSliceVar(&ca.ExtraPeerDirs, "extra-peer-dirs", ca.ExtraPeerDirs, + "Application specific comma-separated list of import paths which are considered, after tag-specified peers and base-peer-dirs, for conversions.") + pflag.CommandLine.BoolVar(&ca.SkipUnsafe, "skip-unsafe", ca.SkipUnsafe, + "If true, will not generate code using unsafe pointer conversions; resulting code may be slower.") +} + +// Validate checks the given arguments. +func Validate(genericArgs *args.GeneratorArgs) error { + _ = genericArgs.CustomArgs.(*CustomArgs) + + if len(genericArgs.OutputFileBaseName) == 0 { + return fmt.Errorf("output file base name cannot be empty") + } + + return nil +} diff --git a/cmd/code-generator/cmd/conversion-gen/generators/conversion.go b/cmd/code-generator/cmd/conversion-gen/generators/conversion.go new file mode 100644 index 0000000..e725b5c --- /dev/null +++ b/cmd/code-generator/cmd/conversion-gen/generators/conversion.go @@ -0,0 +1,1190 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "bytes" + "fmt" + "io" + "path/filepath" + "reflect" + "sort" + "strings" + + "k8s.io/gengo/args" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/klog/v2" + + conversionargs "k8s.io/code-generator/cmd/conversion-gen/args" + genutil "k8s.io/code-generator/pkg/util" +) + +// These are the comment tags that carry parameters for conversion generation. +const ( + // e.g., "+k8s:conversion-gen=" in doc.go, where is the + // import path of the package the peer types are defined in. + // e.g., "+k8s:conversion-gen=false" in a type's comment will let + // conversion-gen skip that type. + tagName = "k8s:conversion-gen" + // e.g. "+k8s:conversion-gen:explicit-from=net/url.Values" in the type comment + // will result in generating conversion from net/url.Values. + explicitFromTagName = "k8s:conversion-gen:explicit-from" + // e.g., "+k8s:conversion-gen-external-types=" in doc.go, where + // is the relative path to the package the types are defined in. + externalTypesTagName = "k8s:conversion-gen-external-types" +) + +func extractTag(comments []string) []string { + return types.ExtractCommentTags("+", comments)[tagName] +} + +func extractExplicitFromTag(comments []string) []string { + return types.ExtractCommentTags("+", comments)[explicitFromTagName] +} + +func extractExternalTypesTag(comments []string) []string { + return types.ExtractCommentTags("+", comments)[externalTypesTagName] +} + +func isCopyOnly(comments []string) bool { + values := types.ExtractCommentTags("+", comments)["k8s:conversion-fn"] + return len(values) == 1 && values[0] == "copy-only" +} + +func isDrop(comments []string) bool { + values := types.ExtractCommentTags("+", comments)["k8s:conversion-fn"] + return len(values) == 1 && values[0] == "drop" +} + +// TODO: This is created only to reduce number of changes in a single PR. +// Remove it and use PublicNamer instead. +func conversionNamer() *namer.NameStrategy { + return &namer.NameStrategy{ + Join: func(pre string, in []string, post string) string { + return strings.Join(in, "_") + }, + PrependPackageNames: 1, + } +} + +func defaultFnNamer() *namer.NameStrategy { + return &namer.NameStrategy{ + Prefix: "SetDefaults_", + Join: func(pre string, in []string, post string) string { + return pre + strings.Join(in, "_") + post + }, + } +} + +// NameSystems returns the name system used by the generators in this package. +func NameSystems() namer.NameSystems { + return namer.NameSystems{ + "public": conversionNamer(), + "raw": namer.NewRawNamer("", nil), + "defaultfn": defaultFnNamer(), + } +} + +// DefaultNameSystem returns the default name system for ordering the types to be +// processed by the generators in this package. +func DefaultNameSystem() string { + return "public" +} + +func getPeerTypeFor(context *generator.Context, t *types.Type, potenialPeerPkgs []string) *types.Type { + for _, ppp := range potenialPeerPkgs { + p := context.Universe.Package(ppp) + if p == nil { + continue + } + if p.Has(t.Name.Name) { + return p.Type(t.Name.Name) + } + } + return nil +} + +type conversionPair struct { + inType *types.Type + outType *types.Type +} + +// All of the types in conversions map are of type "DeclarationOf" with +// the underlying type being "Func". +type conversionFuncMap map[conversionPair]*types.Type + +// Returns all manually-defined conversion functions in the package. +func getManualConversionFunctions(context *generator.Context, pkg *types.Package, manualMap conversionFuncMap) { + if pkg == nil { + klog.Warningf("Skipping nil package passed to getManualConversionFunctions") + return + } + klog.V(5).Infof("Scanning for conversion functions in %v", pkg.Name) + + scopeName := types.Ref(conversionPackagePath, "Scope").Name + errorName := types.Ref("", "error").Name + buffer := &bytes.Buffer{} + sw := generator.NewSnippetWriter(buffer, context, "$", "$") + + for _, f := range pkg.Functions { + if f.Underlying == nil || f.Underlying.Kind != types.Func { + klog.Errorf("Malformed function: %#v", f) + continue + } + if f.Underlying.Signature == nil { + klog.Errorf("Function without signature: %#v", f) + continue + } + klog.V(8).Infof("Considering function %s", f.Name) + signature := f.Underlying.Signature + // Check whether the function is conversion function. + // Note that all of them have signature: + // func Convert_inType_To_outType(inType, outType, conversion.Scope) error + if signature.Receiver != nil { + klog.V(8).Infof("%s has a receiver", f.Name) + continue + } + if len(signature.Parameters) != 3 || signature.Parameters[2].Name != scopeName { + klog.V(8).Infof("%s has wrong parameters", f.Name) + continue + } + if len(signature.Results) != 1 || signature.Results[0].Name != errorName { + klog.V(8).Infof("%s has wrong results", f.Name) + continue + } + inType := signature.Parameters[0] + outType := signature.Parameters[1] + if inType.Kind != types.Pointer || outType.Kind != types.Pointer { + klog.V(8).Infof("%s has wrong parameter types", f.Name) + continue + } + // Now check if the name satisfies the convention. + // TODO: This should call the Namer directly. + args := argsFromType(inType.Elem, outType.Elem) + sw.Do("Convert_$.inType|public$_To_$.outType|public$", args) + if f.Name.Name == buffer.String() { + klog.V(4).Infof("Found conversion function %s", f.Name) + key := conversionPair{inType.Elem, outType.Elem} + // We might scan the same package twice, and that's OK. + if v, ok := manualMap[key]; ok && v != nil && v.Name.Package != pkg.Path { + panic(fmt.Sprintf("duplicate static conversion defined: %s -> %s from:\n%s.%s\n%s.%s", key.inType, key.outType, v.Name.Package, v.Name.Name, f.Name.Package, f.Name.Name)) + } + manualMap[key] = f + } else { + // prevent user error when they don't get the correct conversion signature + if strings.HasPrefix(f.Name.Name, "Convert_") { + klog.Errorf("Rename function %s %s -> %s to match expected conversion signature", f.Name.Package, f.Name.Name, buffer.String()) + } + klog.V(8).Infof("%s has wrong name", f.Name) + } + buffer.Reset() + } +} + +func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { + boilerplate, err := arguments.LoadGoBoilerplate() + if err != nil { + klog.Fatalf("Failed loading boilerplate: %v", err) + } + + packages := generator.Packages{} + header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...) + + // Accumulate pre-existing conversion functions. + // TODO: This is too ad-hoc. We need a better way. + manualConversions := conversionFuncMap{} + + // Record types that are memory equivalent. A type is memory equivalent + // if it has the same memory layout and no nested manual conversion is + // defined. + // TODO: in the future, relax the nested manual conversion requirement + // if we can show that a large enough types are memory identical but + // have non-trivial conversion + memoryEquivalentTypes := equalMemoryTypes{} + + // We are generating conversions only for packages that are explicitly + // passed as InputDir. + processed := map[string]bool{} + for _, i := range context.Inputs { + // skip duplicates + if processed[i] { + continue + } + processed[i] = true + + klog.V(5).Infof("considering pkg %q", i) + pkg := context.Universe[i] + // typesPkg is where the versioned types are defined. Sometimes it is + // different from pkg. For example, kubernetes core/v1 types are defined + // in vendor/k8s.io/api/core/v1, while pkg is at pkg/api/v1. + typesPkg := pkg + if pkg == nil { + // If the input had no Go files, for example. + continue + } + + // Add conversion and defaulting functions. + getManualConversionFunctions(context, pkg, manualConversions) + + // Only generate conversions for packages which explicitly request it + // by specifying one or more "+k8s:conversion-gen=" + // in their doc.go file. + peerPkgs := extractTag(pkg.Comments) + if peerPkgs != nil { + klog.V(5).Infof(" tags: %q", peerPkgs) + if len(peerPkgs) == 1 && peerPkgs[0] == "false" { + // If a single +k8s:conversion-gen=false tag is defined, we still want + // the generator to fire for this package for explicit conversions, but + // we are clearing the peerPkgs to not generate any standard conversions. + peerPkgs = nil + } + } else { + klog.V(5).Infof(" no tag") + continue + } + skipUnsafe := false + if customArgs, ok := arguments.CustomArgs.(*conversionargs.CustomArgs); ok { + if len(peerPkgs) > 0 { + peerPkgs = append(peerPkgs, customArgs.BasePeerDirs...) + peerPkgs = append(peerPkgs, customArgs.ExtraPeerDirs...) + } + skipUnsafe = customArgs.SkipUnsafe + } + + // if the external types are not in the same package where the conversion functions to be generated + externalTypesValues := extractExternalTypesTag(pkg.Comments) + if externalTypesValues != nil { + if len(externalTypesValues) != 1 { + klog.Fatalf(" expect only one value for %q tag, got: %q", externalTypesTagName, externalTypesValues) + } + externalTypes := externalTypesValues[0] + klog.V(5).Infof(" external types tags: %q", externalTypes) + var err error + typesPkg, err = context.AddDirectory(externalTypes) + if err != nil { + klog.Fatalf("cannot import package %s", externalTypes) + } + // update context.Order to the latest context.Universe + orderer := namer.Orderer{Namer: namer.NewPublicNamer(1)} + context.Order = orderer.OrderUniverse(context.Universe) + } + + // if the source path is within a /vendor/ directory (for example, + // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow + // generation to output to the proper relative path (under vendor). + // Otherwise, the generator will create the file in the wrong location + // in the output directory. + // TODO: build a more fundamental concept in gengo for dealing with modifications + // to vendored packages. + for i := range peerPkgs { + peerPkgs[i] = genutil.Vendorless(peerPkgs[i]) + } + + // Make sure our peer-packages are added and fully parsed. + for _, pp := range peerPkgs { + context.AddDir(pp) + p := context.Universe[pp] + if nil == p { + klog.Fatalf("failed to find pkg: %s", pp) + } + getManualConversionFunctions(context, p, manualConversions) + } + + unsafeEquality := TypesEqual(memoryEquivalentTypes) + if skipUnsafe { + unsafeEquality = noEquality{} + } + + path := pkg.Path + // if the source path is within a /vendor/ directory (for example, + // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow + // generation to output to the proper relative path (under vendor). + // Otherwise, the generator will create the file in the wrong location + // in the output directory. + // TODO: build a more fundamental concept in gengo for dealing with modifications + // to vendored packages. + if strings.HasPrefix(pkg.SourcePath, arguments.OutputBase) { + expandedPath := strings.TrimPrefix(pkg.SourcePath, arguments.OutputBase) + if strings.Contains(expandedPath, "/vendor/") { + path = expandedPath + } + } + packages = append(packages, + &generator.DefaultPackage{ + PackageName: filepath.Base(pkg.Path), + PackagePath: path, + HeaderText: header, + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + return []generator.Generator{ + NewGenConversion(arguments.OutputFileBaseName, typesPkg.Path, pkg.Path, manualConversions, peerPkgs, unsafeEquality), + } + }, + FilterFunc: func(c *generator.Context, t *types.Type) bool { + return t.Name.Package == typesPkg.Path + }, + }) + } + + // If there is a manual conversion defined between two types, exclude it + // from being a candidate for unsafe conversion + for k, v := range manualConversions { + if isCopyOnly(v.CommentLines) { + klog.V(5).Infof("Conversion function %s will not block memory copy because it is copy-only", v.Name) + continue + } + // this type should be excluded from all equivalence, because the converter must be called. + memoryEquivalentTypes.Skip(k.inType, k.outType) + } + + return packages +} + +type equalMemoryTypes map[conversionPair]bool + +func (e equalMemoryTypes) Skip(a, b *types.Type) { + e[conversionPair{a, b}] = false + e[conversionPair{b, a}] = false +} + +func (e equalMemoryTypes) Equal(a, b *types.Type) bool { + // alreadyVisitedTypes holds all the types that have already been checked in the structural type recursion. + alreadyVisitedTypes := make(map[*types.Type]bool) + return e.cachingEqual(a, b, alreadyVisitedTypes) +} + +func (e equalMemoryTypes) cachingEqual(a, b *types.Type, alreadyVisitedTypes map[*types.Type]bool) bool { + if a == b { + return true + } + if equal, ok := e[conversionPair{a, b}]; ok { + return equal + } + if equal, ok := e[conversionPair{b, a}]; ok { + return equal + } + result := e.equal(a, b, alreadyVisitedTypes) + e[conversionPair{a, b}] = result + e[conversionPair{b, a}] = result + return result +} + +func (e equalMemoryTypes) equal(a, b *types.Type, alreadyVisitedTypes map[*types.Type]bool) bool { + in, out := unwrapAlias(a), unwrapAlias(b) + switch { + case in == out: + return true + case in.Kind == out.Kind: + // if the type exists already, return early to avoid recursion + if alreadyVisitedTypes[in] { + return true + } + alreadyVisitedTypes[in] = true + + switch in.Kind { + case types.Struct: + if len(in.Members) != len(out.Members) { + return false + } + for i, inMember := range in.Members { + outMember := out.Members[i] + if !e.cachingEqual(inMember.Type, outMember.Type, alreadyVisitedTypes) { + return false + } + } + return true + case types.Pointer: + return e.cachingEqual(in.Elem, out.Elem, alreadyVisitedTypes) + case types.Map: + return e.cachingEqual(in.Key, out.Key, alreadyVisitedTypes) && e.cachingEqual(in.Elem, out.Elem, alreadyVisitedTypes) + case types.Slice: + return e.cachingEqual(in.Elem, out.Elem, alreadyVisitedTypes) + case types.Interface: + // TODO: determine whether the interfaces are actually equivalent - for now, they must have the + // same type. + return false + case types.Builtin: + return in.Name.Name == out.Name.Name + } + } + return false +} + +func findMember(t *types.Type, name string) (types.Member, bool) { + if t.Kind != types.Struct { + return types.Member{}, false + } + for _, member := range t.Members { + if member.Name == name { + return member, true + } + } + return types.Member{}, false +} + +// unwrapAlias recurses down aliased types to find the bedrock type. +func unwrapAlias(in *types.Type) *types.Type { + for in.Kind == types.Alias { + in = in.Underlying + } + return in +} + +const ( + runtimePackagePath = "k8s.io/apimachinery/pkg/runtime" + conversionPackagePath = "k8s.io/apimachinery/pkg/conversion" +) + +type noEquality struct{} + +func (noEquality) Equal(_, _ *types.Type) bool { return false } + +type TypesEqual interface { + Equal(a, b *types.Type) bool +} + +// genConversion produces a file with a autogenerated conversions. +type genConversion struct { + generator.DefaultGen + // the package that contains the types that conversion func are going to be + // generated for + typesPackage string + // the package that the conversion funcs are going to be output to + outputPackage string + // packages that contain the peer of types in typesPacakge + peerPackages []string + manualConversions conversionFuncMap + imports namer.ImportTracker + types []*types.Type + explicitConversions []conversionPair + skippedFields map[*types.Type][]string + useUnsafe TypesEqual +} + +func NewGenConversion(sanitizedName, typesPackage, outputPackage string, manualConversions conversionFuncMap, peerPkgs []string, useUnsafe TypesEqual) generator.Generator { + return &genConversion{ + DefaultGen: generator.DefaultGen{ + OptionalName: sanitizedName, + }, + typesPackage: typesPackage, + outputPackage: outputPackage, + peerPackages: peerPkgs, + manualConversions: manualConversions, + imports: generator.NewImportTracker(), + types: []*types.Type{}, + explicitConversions: []conversionPair{}, + skippedFields: map[*types.Type][]string{}, + useUnsafe: useUnsafe, + } +} + +func (g *genConversion) Namers(c *generator.Context) namer.NameSystems { + // Have the raw namer for this file track what it imports. + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + "publicIT": &namerPlusImportTracking{ + delegate: conversionNamer(), + tracker: g.imports, + }, + } +} + +type namerPlusImportTracking struct { + delegate namer.Namer + tracker namer.ImportTracker +} + +func (n *namerPlusImportTracking) Name(t *types.Type) string { + n.tracker.AddType(t) + return n.delegate.Name(t) +} + +func (g *genConversion) convertibleOnlyWithinPackage(inType, outType *types.Type) bool { + var t *types.Type + var other *types.Type + if inType.Name.Package == g.typesPackage { + t, other = inType, outType + } else { + t, other = outType, inType + } + + if t.Name.Package != g.typesPackage { + return false + } + // If the type has opted out, skip it. + tagvals := extractTag(t.CommentLines) + if tagvals != nil { + if tagvals[0] != "false" { + klog.Fatalf("Type %v: unsupported %s value: %q", t, tagName, tagvals[0]) + } + klog.V(5).Infof("type %v requests no conversion generation, skipping", t) + return false + } + // TODO: Consider generating functions for other kinds too. + if t.Kind != types.Struct { + return false + } + // Also, filter out private types. + if namer.IsPrivateGoName(other.Name.Name) { + return false + } + return true +} + +func getExplicitFromTypes(t *types.Type) []types.Name { + comments := append(t.SecondClosestCommentLines, t.CommentLines...) + paths := extractExplicitFromTag(comments) + result := []types.Name{} + for _, path := range paths { + items := strings.Split(path, ".") + if len(items) != 2 { + klog.Errorf("Unexpected k8s:conversion-gen:explicit-from tag: %s", path) + continue + } + switch { + case items[0] == "net/url" && items[1] == "Values": + default: + klog.Fatalf("Not supported k8s:conversion-gen:explicit-from tag: %s", path) + } + result = append(result, types.Name{Package: items[0], Name: items[1]}) + } + return result +} + +func (g *genConversion) Filter(c *generator.Context, t *types.Type) bool { + convertibleWithPeer := func() bool { + peerType := getPeerTypeFor(c, t, g.peerPackages) + if peerType == nil { + return false + } + if !g.convertibleOnlyWithinPackage(t, peerType) { + return false + } + g.types = append(g.types, t) + return true + }() + + explicitlyConvertible := func() bool { + inTypes := getExplicitFromTypes(t) + if len(inTypes) == 0 { + return false + } + for i := range inTypes { + pair := conversionPair{ + inType: &types.Type{Name: inTypes[i]}, + outType: t, + } + g.explicitConversions = append(g.explicitConversions, pair) + } + return true + }() + + return convertibleWithPeer || explicitlyConvertible +} + +func (g *genConversion) isOtherPackage(pkg string) bool { + if pkg == g.outputPackage { + return false + } + if strings.HasSuffix(pkg, `"`+g.outputPackage+`"`) { + return false + } + return true +} + +func (g *genConversion) Imports(c *generator.Context) (imports []string) { + var importLines []string + for _, singleImport := range g.imports.ImportLines() { + if g.isOtherPackage(singleImport) { + importLines = append(importLines, singleImport) + } + } + return importLines +} + +func argsFromType(inType, outType *types.Type) generator.Args { + return generator.Args{ + "inType": inType, + "outType": outType, + } +} + +const nameTmpl = "Convert_$.inType|publicIT$_To_$.outType|publicIT$" + +func (g *genConversion) preexists(inType, outType *types.Type) (*types.Type, bool) { + function, ok := g.manualConversions[conversionPair{inType, outType}] + return function, ok +} + +func (g *genConversion) Init(c *generator.Context, w io.Writer) error { + if klog.V(5).Enabled() { + if m, ok := g.useUnsafe.(equalMemoryTypes); ok { + var result []string + klog.Infof("All objects without identical memory layout:") + for k, v := range m { + if v { + continue + } + result = append(result, fmt.Sprintf(" %s -> %s = %t", k.inType, k.outType, v)) + } + sort.Strings(result) + for _, s := range result { + klog.Infof(s) + } + } + } + sw := generator.NewSnippetWriter(w, c, "$", "$") + sw.Do("func init() {\n", nil) + sw.Do("localSchemeBuilder.Register(RegisterConversions)\n", nil) + sw.Do("}\n", nil) + + scheme := c.Universe.Type(types.Name{Package: runtimePackagePath, Name: "Scheme"}) + schemePtr := &types.Type{ + Kind: types.Pointer, + Elem: scheme, + } + sw.Do("// RegisterConversions adds conversion functions to the given scheme.\n", nil) + sw.Do("// Public to allow building arbitrary schemes.\n", nil) + sw.Do("func RegisterConversions(s $.|raw$) error {\n", schemePtr) + for _, t := range g.types { + peerType := getPeerTypeFor(c, t, g.peerPackages) + if _, found := g.preexists(t, peerType); !found { + args := argsFromType(t, peerType).With("Scope", types.Ref(conversionPackagePath, "Scope")) + sw.Do("if err := s.AddGeneratedConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return "+nameTmpl+"(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) + } + if _, found := g.preexists(peerType, t); !found { + args := argsFromType(peerType, t).With("Scope", types.Ref(conversionPackagePath, "Scope")) + sw.Do("if err := s.AddGeneratedConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return "+nameTmpl+"(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) + } + } + + for i := range g.explicitConversions { + args := argsFromType(g.explicitConversions[i].inType, g.explicitConversions[i].outType).With("Scope", types.Ref(conversionPackagePath, "Scope")) + sw.Do("if err := s.AddGeneratedConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return "+nameTmpl+"(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) + } + + var pairs []conversionPair + for pair, t := range g.manualConversions { + if t.Name.Package != g.outputPackage { + continue + } + pairs = append(pairs, pair) + } + // sort by name of the conversion function + sort.Slice(pairs, func(i, j int) bool { + if g.manualConversions[pairs[i]].Name.Name < g.manualConversions[pairs[j]].Name.Name { + return true + } + return false + }) + for _, pair := range pairs { + args := argsFromType(pair.inType, pair.outType).With("Scope", types.Ref(conversionPackagePath, "Scope")).With("fn", g.manualConversions[pair]) + sw.Do("if err := s.AddConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return $.fn|raw$(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) + } + + sw.Do("return nil\n", nil) + sw.Do("}\n\n", nil) + return sw.Error() +} + +func (g *genConversion) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + klog.V(5).Infof("generating for type %v", t) + sw := generator.NewSnippetWriter(w, c, "$", "$") + + if peerType := getPeerTypeFor(c, t, g.peerPackages); peerType != nil { + g.generateConversion(t, peerType, sw) + g.generateConversion(peerType, t, sw) + } + + for _, inTypeName := range getExplicitFromTypes(t) { + inPkg, ok := c.Universe[inTypeName.Package] + if !ok { + klog.Errorf("Unrecognized package: %s", inTypeName.Package) + continue + } + inType, ok := inPkg.Types[inTypeName.Name] + if !ok { + klog.Errorf("Unrecognized type in package %s: %s", inTypeName.Package, inTypeName.Name) + continue + } + switch { + case inType.Name.Package == "net/url" && inType.Name.Name == "Values": + g.generateFromUrlValues(inType, t, sw) + default: + klog.Errorf("Not supported input type: %#v", inType.Name) + } + } + + return sw.Error() +} + +func (g *genConversion) generateConversion(inType, outType *types.Type, sw *generator.SnippetWriter) { + args := argsFromType(inType, outType). + With("Scope", types.Ref(conversionPackagePath, "Scope")) + + sw.Do("func auto"+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) + g.generateFor(inType, outType, sw) + sw.Do("return nil\n", nil) + sw.Do("}\n\n", nil) + + if _, found := g.preexists(inType, outType); found { + // There is a public manual Conversion method: use it. + } else if skipped := g.skippedFields[inType]; len(skipped) != 0 { + // The inType had some fields we could not generate. + klog.Errorf("Warning: could not find nor generate a final Conversion function for %v -> %v", inType, outType) + klog.Errorf(" the following fields need manual conversion:") + for _, f := range skipped { + klog.Errorf(" - %v", f) + } + } else { + // Emit a public conversion function. + sw.Do("// "+nameTmpl+" is an autogenerated conversion function.\n", args) + sw.Do("func "+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) + sw.Do("return auto"+nameTmpl+"(in, out, s)\n", args) + sw.Do("}\n\n", nil) + } +} + +// we use the system of shadowing 'in' and 'out' so that the same code is valid +// at any nesting level. This makes the autogenerator easy to understand, and +// the compiler shouldn't care. +func (g *genConversion) generateFor(inType, outType *types.Type, sw *generator.SnippetWriter) { + klog.V(5).Infof("generating %v -> %v", inType, outType) + var f func(*types.Type, *types.Type, *generator.SnippetWriter) + + switch inType.Kind { + case types.Builtin: + f = g.doBuiltin + case types.Map: + f = g.doMap + case types.Slice: + f = g.doSlice + case types.Struct: + f = g.doStruct + case types.Pointer: + f = g.doPointer + case types.Alias: + f = g.doAlias + default: + f = g.doUnknown + } + + f(inType, outType, sw) +} + +func (g *genConversion) doBuiltin(inType, outType *types.Type, sw *generator.SnippetWriter) { + if inType == outType { + sw.Do("*out = *in\n", nil) + } else { + sw.Do("*out = $.|raw$(*in)\n", outType) + } +} + +func (g *genConversion) doMap(inType, outType *types.Type, sw *generator.SnippetWriter) { + sw.Do("*out = make($.|raw$, len(*in))\n", outType) + if isDirectlyAssignable(inType.Key, outType.Key) { + sw.Do("for key, val := range *in {\n", nil) + if isDirectlyAssignable(inType.Elem, outType.Elem) { + if inType.Key == outType.Key { + sw.Do("(*out)[key] = ", nil) + } else { + sw.Do("(*out)[$.|raw$(key)] = ", outType.Key) + } + if inType.Elem == outType.Elem { + sw.Do("val\n", nil) + } else { + sw.Do("$.|raw$(val)\n", outType.Elem) + } + } else { + sw.Do("newVal := new($.|raw$)\n", outType.Elem) + if function, ok := g.preexists(inType.Elem, outType.Elem); ok { + sw.Do("if err := $.|raw$(&val, newVal, s); err != nil {\n", function) + } else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) { + sw.Do("if err := "+nameTmpl+"(&val, newVal, s); err != nil {\n", argsFromType(inType.Elem, outType.Elem)) + } else { + sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil) + sw.Do("if err := s.Convert(&val, newVal, 0); err != nil {\n", nil) + } + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + if inType.Key == outType.Key { + sw.Do("(*out)[key] = *newVal\n", nil) + } else { + sw.Do("(*out)[$.|raw$(key)] = *newVal\n", outType.Key) + } + } + } else { + // TODO: Implement it when necessary. + sw.Do("for range *in {\n", nil) + sw.Do("// FIXME: Converting unassignable keys unsupported $.|raw$\n", inType.Key) + } + sw.Do("}\n", nil) +} + +func (g *genConversion) doSlice(inType, outType *types.Type, sw *generator.SnippetWriter) { + sw.Do("*out = make($.|raw$, len(*in))\n", outType) + if inType.Elem == outType.Elem && inType.Elem.Kind == types.Builtin { + sw.Do("copy(*out, *in)\n", nil) + } else { + sw.Do("for i := range *in {\n", nil) + if isDirectlyAssignable(inType.Elem, outType.Elem) { + if inType.Elem == outType.Elem { + sw.Do("(*out)[i] = (*in)[i]\n", nil) + } else { + sw.Do("(*out)[i] = $.|raw$((*in)[i])\n", outType.Elem) + } + } else { + if function, ok := g.preexists(inType.Elem, outType.Elem); ok { + sw.Do("if err := $.|raw$(&(*in)[i], &(*out)[i], s); err != nil {\n", function) + } else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) { + sw.Do("if err := "+nameTmpl+"(&(*in)[i], &(*out)[i], s); err != nil {\n", argsFromType(inType.Elem, outType.Elem)) + } else { + // TODO: This triggers on metav1.ObjectMeta <-> metav1.ObjectMeta and + // similar because neither package is the target package, and + // we really don't know which package will have the conversion + // function defined. This fires on basically every object + // conversion outside of pkg/api/v1. + sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil) + sw.Do("if err := s.Convert(&(*in)[i], &(*out)[i], 0); err != nil {\n", nil) + } + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + } + sw.Do("}\n", nil) + } +} + +func (g *genConversion) doStruct(inType, outType *types.Type, sw *generator.SnippetWriter) { + for _, inMember := range inType.Members { + if tagvals := extractTag(inMember.CommentLines); tagvals != nil && tagvals[0] == "false" { + // This field is excluded from conversion. + sw.Do("// INFO: in."+inMember.Name+" opted out of conversion generation\n", nil) + continue + } + outMember, found := findMember(outType, inMember.Name) + if !found { + // This field doesn't exist in the peer. + sw.Do("// WARNING: in."+inMember.Name+" requires manual conversion: does not exist in peer-type\n", nil) + g.skippedFields[inType] = append(g.skippedFields[inType], inMember.Name) + continue + } + + inMemberType, outMemberType := inMember.Type, outMember.Type + // create a copy of both underlying types but give them the top level alias name (since aliases + // are assignable) + if underlying := unwrapAlias(inMemberType); underlying != inMemberType { + copied := *underlying + copied.Name = inMemberType.Name + inMemberType = &copied + } + if underlying := unwrapAlias(outMemberType); underlying != outMemberType { + copied := *underlying + copied.Name = outMemberType.Name + outMemberType = &copied + } + + args := argsFromType(inMemberType, outMemberType).With("name", inMember.Name) + + // try a direct memory copy for any type that has exactly equivalent values + if g.useUnsafe.Equal(inMemberType, outMemberType) { + args = args. + With("Pointer", types.Ref("unsafe", "Pointer")). + With("SliceHeader", types.Ref("reflect", "SliceHeader")) + switch inMemberType.Kind { + case types.Pointer: + sw.Do("out.$.name$ = ($.outType|raw$)($.Pointer|raw$(in.$.name$))\n", args) + continue + case types.Map: + sw.Do("out.$.name$ = *(*$.outType|raw$)($.Pointer|raw$(&in.$.name$))\n", args) + continue + case types.Slice: + sw.Do("out.$.name$ = *(*$.outType|raw$)($.Pointer|raw$(&in.$.name$))\n", args) + continue + } + } + + // check based on the top level name, not the underlying names + if function, ok := g.preexists(inMember.Type, outMember.Type); ok { + if isDrop(function.CommentLines) { + continue + } + // copy-only functions that are directly assignable can be inlined instead of invoked. + // As an example, conversion functions exist that allow types with private fields to be + // correctly copied between types. These functions are equivalent to a memory assignment, + // and are necessary for the reflection path, but should not block memory conversion. + // Convert_unversioned_Time_to_unversioned_Time is an example of this logic. + if !isCopyOnly(function.CommentLines) || !g.isFastConversion(inMemberType, outMemberType) { + args["function"] = function + sw.Do("if err := $.function|raw$(&in.$.name$, &out.$.name$, s); err != nil {\n", args) + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + continue + } + klog.V(5).Infof("Skipped function %s because it is copy-only and we can use direct assignment", function.Name) + } + + // If we can't auto-convert, punt before we emit any code. + if inMemberType.Kind != outMemberType.Kind { + sw.Do("// WARNING: in."+inMember.Name+" requires manual conversion: inconvertible types ("+ + inMemberType.String()+" vs "+outMemberType.String()+")\n", nil) + g.skippedFields[inType] = append(g.skippedFields[inType], inMember.Name) + continue + } + + switch inMemberType.Kind { + case types.Builtin: + if inMemberType == outMemberType { + sw.Do("out.$.name$ = in.$.name$\n", args) + } else { + sw.Do("out.$.name$ = $.outType|raw$(in.$.name$)\n", args) + } + case types.Map, types.Slice, types.Pointer: + if g.isDirectlyAssignable(inMemberType, outMemberType) { + sw.Do("out.$.name$ = in.$.name$\n", args) + continue + } + + sw.Do("if in.$.name$ != nil {\n", args) + sw.Do("in, out := &in.$.name$, &out.$.name$\n", args) + g.generateFor(inMemberType, outMemberType, sw) + sw.Do("} else {\n", nil) + sw.Do("out.$.name$ = nil\n", args) + sw.Do("}\n", nil) + case types.Struct: + if g.isDirectlyAssignable(inMemberType, outMemberType) { + sw.Do("out.$.name$ = in.$.name$\n", args) + continue + } + if g.convertibleOnlyWithinPackage(inMemberType, outMemberType) { + sw.Do("if err := "+nameTmpl+"(&in.$.name$, &out.$.name$, s); err != nil {\n", args) + } else { + sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil) + sw.Do("if err := s.Convert(&in.$.name$, &out.$.name$, 0); err != nil {\n", args) + } + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + case types.Alias: + if isDirectlyAssignable(inMemberType, outMemberType) { + if inMemberType == outMemberType { + sw.Do("out.$.name$ = in.$.name$\n", args) + } else { + sw.Do("out.$.name$ = $.outType|raw$(in.$.name$)\n", args) + } + } else { + if g.convertibleOnlyWithinPackage(inMemberType, outMemberType) { + sw.Do("if err := "+nameTmpl+"(&in.$.name$, &out.$.name$, s); err != nil {\n", args) + } else { + sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil) + sw.Do("if err := s.Convert(&in.$.name$, &out.$.name$, 0); err != nil {\n", args) + } + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + } + default: + if g.convertibleOnlyWithinPackage(inMemberType, outMemberType) { + sw.Do("if err := "+nameTmpl+"(&in.$.name$, &out.$.name$, s); err != nil {\n", args) + } else { + sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil) + sw.Do("if err := s.Convert(&in.$.name$, &out.$.name$, 0); err != nil {\n", args) + } + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + } + } +} + +func (g *genConversion) isFastConversion(inType, outType *types.Type) bool { + switch inType.Kind { + case types.Builtin: + return true + case types.Map, types.Slice, types.Pointer, types.Struct, types.Alias: + return g.isDirectlyAssignable(inType, outType) + default: + return false + } +} + +func (g *genConversion) isDirectlyAssignable(inType, outType *types.Type) bool { + return unwrapAlias(inType) == unwrapAlias(outType) +} + +func (g *genConversion) doPointer(inType, outType *types.Type, sw *generator.SnippetWriter) { + sw.Do("*out = new($.Elem|raw$)\n", outType) + if isDirectlyAssignable(inType.Elem, outType.Elem) { + if inType.Elem == outType.Elem { + sw.Do("**out = **in\n", nil) + } else { + sw.Do("**out = $.|raw$(**in)\n", outType.Elem) + } + } else { + if function, ok := g.preexists(inType.Elem, outType.Elem); ok { + sw.Do("if err := $.|raw$(*in, *out, s); err != nil {\n", function) + } else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) { + sw.Do("if err := "+nameTmpl+"(*in, *out, s); err != nil {\n", argsFromType(inType.Elem, outType.Elem)) + } else { + sw.Do("// TODO: Inefficient conversion - can we improve it?\n", nil) + sw.Do("if err := s.Convert(*in, *out, 0); err != nil {\n", nil) + } + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + } +} + +func (g *genConversion) doAlias(inType, outType *types.Type, sw *generator.SnippetWriter) { + // TODO: Add support for aliases. + g.doUnknown(inType, outType, sw) +} + +func (g *genConversion) doUnknown(inType, outType *types.Type, sw *generator.SnippetWriter) { + sw.Do("// FIXME: Type $.|raw$ is unsupported.\n", inType) +} + +func (g *genConversion) generateFromUrlValues(inType, outType *types.Type, sw *generator.SnippetWriter) { + args := generator.Args{ + "inType": inType, + "outType": outType, + "Scope": types.Ref(conversionPackagePath, "Scope"), + } + sw.Do("func auto"+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) + for _, outMember := range outType.Members { + if tagvals := extractTag(outMember.CommentLines); tagvals != nil && tagvals[0] == "false" { + // This field is excluded from conversion. + sw.Do("// INFO: in."+outMember.Name+" opted out of conversion generation\n", nil) + continue + } + jsonTag := reflect.StructTag(outMember.Tags).Get("json") + index := strings.Index(jsonTag, ",") + if index == -1 { + index = len(jsonTag) + } + if index == 0 { + memberArgs := generator.Args{ + "name": outMember.Name, + } + sw.Do("// WARNING: Field $.name$ does not have json tag, skipping.\n\n", memberArgs) + continue + } + memberArgs := generator.Args{ + "name": outMember.Name, + "tag": jsonTag[:index], + } + sw.Do("if values, ok := map[string][]string(*in)[\"$.tag$\"]; ok && len(values) > 0 {\n", memberArgs) + g.fromValuesEntry(inType.Underlying.Elem, outMember, sw) + sw.Do("} else {\n", nil) + g.setZeroValue(outMember, sw) + sw.Do("}\n", nil) + } + sw.Do("return nil\n", nil) + sw.Do("}\n\n", nil) + + if _, found := g.preexists(inType, outType); found { + // There is a public manual Conversion method: use it. + } else { + // Emit a public conversion function. + sw.Do("// "+nameTmpl+" is an autogenerated conversion function.\n", args) + sw.Do("func "+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) + sw.Do("return auto"+nameTmpl+"(in, out, s)\n", args) + sw.Do("}\n\n", nil) + } +} + +func (g *genConversion) fromValuesEntry(inType *types.Type, outMember types.Member, sw *generator.SnippetWriter) { + memberArgs := generator.Args{ + "name": outMember.Name, + "type": outMember.Type, + } + if function, ok := g.preexists(inType, outMember.Type); ok { + args := memberArgs.With("function", function) + sw.Do("if err := $.function|raw$(&values, &out.$.name$, s); err != nil {\n", args) + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + return + } + switch { + case outMember.Type == types.String: + sw.Do("out.$.name$ = values[0]\n", memberArgs) + case g.useUnsafe.Equal(inType, outMember.Type): + args := memberArgs.With("Pointer", types.Ref("unsafe", "Pointer")) + switch inType.Kind { + case types.Pointer: + sw.Do("out.$.name$ = ($.type|raw$)($.Pointer|raw$(&values))\n", args) + case types.Map, types.Slice: + sw.Do("out.$.name$ = *(*$.type|raw$)($.Pointer|raw$(&values))\n", args) + default: + // TODO: Support other types to allow more auto-conversions. + sw.Do("// FIXME: out.$.name$ is of not yet supported type and requires manual conversion\n", memberArgs) + } + default: + // TODO: Support other types to allow more auto-conversions. + sw.Do("// FIXME: out.$.name$ is of not yet supported type and requires manual conversion\n", memberArgs) + } +} + +func (g *genConversion) setZeroValue(outMember types.Member, sw *generator.SnippetWriter) { + outMemberType := unwrapAlias(outMember.Type) + memberArgs := generator.Args{ + "name": outMember.Name, + "alias": outMember.Type, + "type": outMemberType, + } + + switch outMemberType.Kind { + case types.Builtin: + switch outMemberType { + case types.String: + sw.Do("out.$.name$ = \"\"\n", memberArgs) + case types.Int64, types.Int32, types.Int16, types.Int, types.Uint64, types.Uint32, types.Uint16, types.Uint: + sw.Do("out.$.name$ = 0\n", memberArgs) + case types.Uintptr, types.Byte: + sw.Do("out.$.name$ = 0\n", memberArgs) + case types.Float64, types.Float32, types.Float: + sw.Do("out.$.name$ = 0\n", memberArgs) + case types.Bool: + sw.Do("out.$.name$ = false\n", memberArgs) + default: + sw.Do("// FIXME: out.$.name$ is of unsupported type and requires manual conversion\n", memberArgs) + } + case types.Struct: + if outMemberType == outMember.Type { + sw.Do("out.$.name$ = $.type|raw${}\n", memberArgs) + } else { + sw.Do("out.$.name$ = $.alias|raw$($.type|raw${})\n", memberArgs) + } + case types.Map, types.Slice, types.Pointer: + sw.Do("out.$.name$ = nil\n", memberArgs) + case types.Alias: + // outMemberType was already unwrapped from aliases - so that should never happen. + sw.Do("// FIXME: unexpected error for out.$.name$\n", memberArgs) + case types.Interface, types.Array: + sw.Do("out.$.name$ = nil\n", memberArgs) + default: + sw.Do("// FIXME: out.$.name$ is of unsupported type and requires manual conversion\n", memberArgs) + } +} + +func isDirectlyAssignable(inType, outType *types.Type) bool { + // TODO: This should maybe check for actual assignability between the two + // types, rather than superficial traits that happen to indicate it is + // assignable in the ways we currently use this code. + return inType.IsAssignable() && (inType.IsPrimitive() || isSamePackage(inType, outType)) +} + +func isSamePackage(inType, outType *types.Type) bool { + return inType.Name.Package == outType.Name.Package +} diff --git a/cmd/code-generator/cmd/conversion-gen/main.go b/cmd/code-generator/cmd/conversion-gen/main.go new file mode 100644 index 0000000..09c4513 --- /dev/null +++ b/cmd/code-generator/cmd/conversion-gen/main.go @@ -0,0 +1,125 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// conversion-gen is a tool for auto-generating functions that convert +// between internal and external types. A general conversion code +// generation task involves three sets of packages: (1) a set of +// packages containing internal types, (2) a single package containing +// the external types, and (3) a single destination package (i.e., +// where the generated conversion functions go, and where the +// developer-authored conversion functions are). The packages +// containing the internal types play the role known as "peer +// packages" in the general code-generation framework of Kubernetes. +// +// For each conversion task, `conversion-gen` will generate functions +// that efficiently convert between same-name types in the two +// (internal, external) packages. The generated functions include +// ones named +// autoConvert___To__ +// for each such pair of types --- both with (pkg1,pkg2) = +// (internal,external) and (pkg1,pkg2) = (external,internal). +// Additionally: if the destination package does not contain one in a +// non-generated file then a function named +// Convert___To__ +// is also generated and it simply calls the `autoConvert...` +// function. The generated conversion functions use standard value +// assignment wherever possible. For compound types, the generated +// conversion functions call the `Convert...` functions for the +// subsidiary types. Thus developers can override the behavior for +// selected types. For a top-level object type (i.e., the type of an +// object that will be input to an apiserver), for such an override to +// be used by the apiserver the developer-maintained conversion +// functions must also be registered by invoking the +// `AddConversionFunc`/`AddGeneratedConversionFunc` method of the +// relevant `Scheme` object from k8s.io/apimachinery/pkg/runtime. +// +// `conversion-gen` will scan its `--input-dirs`, looking at the +// package defined in each of those directories for comment tags that +// define a conversion code generation task. A package requests +// conversion code generation by including one or more comment in the +// package's `doc.go` file (currently anywhere in that file is +// acceptable, but the recommended location is above the `package` +// statement), of the form: +// // +k8s:conversion-gen= +// This introduces a conversion task, for which the destination +// package is the one containing the file with the tag and the tag +// identifies a package containing internal types. If there is also a +// tag of the form +// // +k8s:conversion-gen-external-types= +// then it identifies the package containing the external types; +// otherwise they are in the destination package. +// +// For each conversion code generation task, the full set of internal +// packages (AKA peer packages) consists of the ones specified in the +// `k8s:conversion-gen` tags PLUS any specified in the +// `--base-peer-dirs` and `--extra-peer-dirs` flags on the command +// line. +// +// When generating for a package, individual types or fields of structs may opt +// out of Conversion generation by specifying a comment on the of the form: +// // +k8s:conversion-gen=false +package main + +import ( + "flag" + "path/filepath" + + "github.com/spf13/pflag" + "k8s.io/gengo/args" + "k8s.io/klog/v2" + + generatorargs "k8s.io/code-generator/cmd/conversion-gen/args" + "k8s.io/code-generator/cmd/conversion-gen/generators" + "k8s.io/code-generator/pkg/util" +) + +func main() { + klog.InitFlags(nil) + genericArgs, customArgs := generatorargs.NewDefaults() + + // Override defaults. + // TODO: move this out of conversion-gen + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + // k8s.io/apimachinery/pkg/runtime contains a number of manual conversions, + // that we need to generate conversions. + // Packages being dependencies of explicitly requested packages are only + // partially scanned - only types explicitly used are being traversed. + // Not used functions or types are omitted. + // Adding this explicitly to InputDirs ensures that the package is fully + // scanned and all functions are parsed and processed. + genericArgs.InputDirs = append(genericArgs.InputDirs, "k8s.io/apimachinery/pkg/runtime") + + if err := generatorargs.Validate(genericArgs); err != nil { + klog.Fatalf("Error: %v", err) + } + + // Run it. + if err := genericArgs.Execute( + generators.NameSystems(), + generators.DefaultNameSystem(), + generators.Packages, + ); err != nil { + klog.Fatalf("Error: %v", err) + } + klog.V(2).Info("Completed successfully.") +} diff --git a/cmd/code-generator/cmd/deepcopy-gen/args/args.go b/cmd/code-generator/cmd/deepcopy-gen/args/args.go new file mode 100644 index 0000000..7897130 --- /dev/null +++ b/cmd/code-generator/cmd/deepcopy-gen/args/args.go @@ -0,0 +1,54 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + + "github.com/spf13/pflag" + "k8s.io/gengo/args" + "k8s.io/gengo/examples/deepcopy-gen/generators" +) + +// CustomArgs is used by the gengo framework to pass args specific to this generator. +type CustomArgs generators.CustomArgs + +// NewDefaults returns default arguments for the generator. +func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { + genericArgs := args.Default().WithoutDefaultFlagParsing() + customArgs := &CustomArgs{} + genericArgs.CustomArgs = (*generators.CustomArgs)(customArgs) // convert to upstream type to make type-casts work there + genericArgs.OutputFileBaseName = "deepcopy_generated" + return genericArgs, customArgs +} + +// AddFlags add the generator flags to the flag set. +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { + pflag.CommandLine.StringSliceVar(&ca.BoundingDirs, "bounding-dirs", ca.BoundingDirs, + "Comma-separated list of import paths which bound the types for which deep-copies will be generated.") +} + +// Validate checks the given arguments. +func Validate(genericArgs *args.GeneratorArgs) error { + _ = genericArgs.CustomArgs.(*generators.CustomArgs) + + if len(genericArgs.OutputFileBaseName) == 0 { + return fmt.Errorf("output file base name cannot be empty") + } + + return nil +} diff --git a/cmd/code-generator/cmd/deepcopy-gen/main.go b/cmd/code-generator/cmd/deepcopy-gen/main.go new file mode 100644 index 0000000..31a4824 --- /dev/null +++ b/cmd/code-generator/cmd/deepcopy-gen/main.go @@ -0,0 +1,85 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// deepcopy-gen is a tool for auto-generating DeepCopy functions. +// +// Given a list of input directories, it will generate functions that +// efficiently perform a full deep-copy of each type. For any type that +// offers a `.DeepCopy()` method, it will simply call that. Otherwise it will +// use standard value assignment whenever possible. If that is not possible it +// will try to call its own generated copy function for the type, if the type is +// within the allowed root packages. Failing that, it will fall back on +// `conversion.Cloner.DeepCopy(val)` to make the copy. The resulting file will +// be stored in the same directory as the processed source package. +// +// Generation is governed by comment tags in the source. Any package may +// request DeepCopy generation by including a comment in the file-comments of +// one file, of the form: +// // +k8s:deepcopy-gen=package +// +// DeepCopy functions can be generated for individual types, rather than the +// entire package by specifying a comment on the type definion of the form: +// // +k8s:deepcopy-gen=true +// +// When generating for a whole package, individual types may opt out of +// DeepCopy generation by specifying a comment on the of the form: +// // +k8s:deepcopy-gen=false +// +// Note that registration is a whole-package option, and is not available for +// individual types. +package main + +import ( + "flag" + "path/filepath" + + "github.com/spf13/pflag" + "k8s.io/gengo/args" + "k8s.io/gengo/examples/deepcopy-gen/generators" + "k8s.io/klog/v2" + + generatorargs "k8s.io/code-generator/cmd/deepcopy-gen/args" + "k8s.io/code-generator/pkg/util" +) + +func main() { + klog.InitFlags(nil) + genericArgs, customArgs := generatorargs.NewDefaults() + + // Override defaults. + // TODO: move this out of deepcopy-gen + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + if err := generatorargs.Validate(genericArgs); err != nil { + klog.Fatalf("Error: %v", err) + } + + // Run it. + if err := genericArgs.Execute( + generators.NameSystems(), + generators.DefaultNameSystem(), + generators.Packages, + ); err != nil { + klog.Fatalf("Error: %v", err) + } + klog.V(2).Info("Completed successfully.") +} diff --git a/cmd/code-generator/cmd/defaulter-gen/args/args.go b/cmd/code-generator/cmd/defaulter-gen/args/args.go new file mode 100644 index 0000000..3c5a042 --- /dev/null +++ b/cmd/code-generator/cmd/defaulter-gen/args/args.go @@ -0,0 +1,54 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + + "github.com/spf13/pflag" + "k8s.io/gengo/args" + "k8s.io/gengo/examples/defaulter-gen/generators" +) + +// CustomArgs is used by the gengo framework to pass args specific to this generator. +type CustomArgs generators.CustomArgs + +// NewDefaults returns default arguments for the generator. +func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { + genericArgs := args.Default().WithoutDefaultFlagParsing() + customArgs := &CustomArgs{} + genericArgs.CustomArgs = (*generators.CustomArgs)(customArgs) // convert to upstream type to make type-casts work there + genericArgs.OutputFileBaseName = "zz_generated.defaults" + return genericArgs, customArgs +} + +// AddFlags add the generator flags to the flag set. +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { + pflag.CommandLine.StringSliceVar(&ca.ExtraPeerDirs, "extra-peer-dirs", ca.ExtraPeerDirs, + "Comma-separated list of import paths which are considered, after tag-specified peers, for conversions.") +} + +// Validate checks the given arguments. +func Validate(genericArgs *args.GeneratorArgs) error { + _ = genericArgs.CustomArgs.(*generators.CustomArgs) + + if len(genericArgs.OutputFileBaseName) == 0 { + return fmt.Errorf("output file base name cannot be empty") + } + + return nil +} diff --git a/cmd/code-generator/cmd/defaulter-gen/main.go b/cmd/code-generator/cmd/defaulter-gen/main.go new file mode 100644 index 0000000..e9aef8d --- /dev/null +++ b/cmd/code-generator/cmd/defaulter-gen/main.go @@ -0,0 +1,84 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// defaulter-gen is a tool for auto-generating Defaulter functions. +// +// Given a list of input directories, it will scan for top level types +// and generate efficient defaulters for an entire object from the sum +// of the SetDefault_* methods contained in the object tree. +// +// Generation is governed by comment tags in the source. Any package may +// request defaulter generation by including one or more comment tags at +// the package comment level: +// +// // +k8s:defaulter-gen= +// +// which will create defaulters for any type that contains the provided +// field name (if the type has defaulters). Any type may request explicit +// defaulting by providing the comment tag: +// +// // +k8s:defaulter-gen=true|false +// +// An existing defaulter method (`SetDefaults_TYPE`) can provide the +// comment tag: +// +// // +k8s:defaulter-gen=covers +// +// to indicate that the defaulter does not or should not call any nested +// defaulters. +package main + +import ( + "flag" + "path/filepath" + + "github.com/spf13/pflag" + "k8s.io/gengo/args" + "k8s.io/gengo/examples/defaulter-gen/generators" + "k8s.io/klog/v2" + + generatorargs "k8s.io/code-generator/cmd/defaulter-gen/args" + "k8s.io/code-generator/pkg/util" +) + +func main() { + klog.InitFlags(nil) + genericArgs, customArgs := generatorargs.NewDefaults() + + // Override defaults. + // TODO: move this out of defaulter-gen + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + if err := generatorargs.Validate(genericArgs); err != nil { + klog.Fatalf("Error: %v", err) + } + + // Run it. + if err := genericArgs.Execute( + generators.NameSystems(), + generators.DefaultNameSystem(), + generators.Packages, + ); err != nil { + klog.Fatalf("Error: %v", err) + } + klog.V(2).Info("Completed successfully.") +} diff --git a/cmd/code-generator/cmd/go-to-protobuf/.gitignore b/cmd/code-generator/cmd/go-to-protobuf/.gitignore new file mode 100644 index 0000000..0e9aa46 --- /dev/null +++ b/cmd/code-generator/cmd/go-to-protobuf/.gitignore @@ -0,0 +1 @@ +go-to-protobuf diff --git a/cmd/code-generator/cmd/go-to-protobuf/OWNERS b/cmd/code-generator/cmd/go-to-protobuf/OWNERS new file mode 100644 index 0000000..6136591 --- /dev/null +++ b/cmd/code-generator/cmd/go-to-protobuf/OWNERS @@ -0,0 +1,6 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: +- smarterclayton +reviewers: +- smarterclayton diff --git a/cmd/code-generator/cmd/go-to-protobuf/main.go b/cmd/code-generator/cmd/go-to-protobuf/main.go new file mode 100644 index 0000000..847a6a5 --- /dev/null +++ b/cmd/code-generator/cmd/go-to-protobuf/main.go @@ -0,0 +1,39 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// go-to-protobuf generates a Protobuf IDL from a Go struct, respecting any +// existing IDL tags on the Go struct. +package main + +import ( + goflag "flag" + + flag "github.com/spf13/pflag" + "k8s.io/code-generator/cmd/go-to-protobuf/protobuf" +) + +var g = protobuf.New() + +func init() { + g.BindFlags(flag.CommandLine) + goflag.Set("logtostderr", "true") + flag.CommandLine.AddGoFlagSet(goflag.CommandLine) +} + +func main() { + flag.Parse() + protobuf.Run(g) +} diff --git a/cmd/code-generator/cmd/go-to-protobuf/protobuf/cmd.go b/cmd/code-generator/cmd/go-to-protobuf/protobuf/cmd.go new file mode 100644 index 0000000..de782e9 --- /dev/null +++ b/cmd/code-generator/cmd/go-to-protobuf/protobuf/cmd.go @@ -0,0 +1,460 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// go-to-protobuf generates a Protobuf IDL from a Go struct, respecting any +// existing IDL tags on the Go struct. +package protobuf + +import ( + "bytes" + "fmt" + "log" + "os" + "os/exec" + "path/filepath" + "sort" + "strings" + + flag "github.com/spf13/pflag" + + "k8s.io/code-generator/pkg/util" + "k8s.io/gengo/args" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/parser" + "k8s.io/gengo/types" +) + +type Generator struct { + Common args.GeneratorArgs + APIMachineryPackages string + Packages string + OutputBase string + VendorOutputBase string + ProtoImport []string + Conditional string + Clean bool + OnlyIDL bool + KeepGogoproto bool + SkipGeneratedRewrite bool + DropEmbeddedFields string +} + +func New() *Generator { + sourceTree := args.DefaultSourceTree() + common := args.GeneratorArgs{ + OutputBase: sourceTree, + GoHeaderFilePath: filepath.Join(sourceTree, util.BoilerplatePath()), + } + defaultProtoImport := filepath.Join(sourceTree, "k8s.io", "kubernetes", "vendor", "github.com", "gogo", "protobuf", "protobuf") + cwd, err := os.Getwd() + if err != nil { + log.Fatalf("Cannot get current directory.") + } + return &Generator{ + Common: common, + OutputBase: sourceTree, + VendorOutputBase: filepath.Join(cwd, "vendor"), + ProtoImport: []string{defaultProtoImport}, + APIMachineryPackages: strings.Join([]string{ + `+k8s.io/apimachinery/pkg/util/intstr`, + `+k8s.io/apimachinery/pkg/api/resource`, + `+k8s.io/apimachinery/pkg/runtime/schema`, + `+k8s.io/apimachinery/pkg/runtime`, + `k8s.io/apimachinery/pkg/apis/meta/v1`, + `k8s.io/apimachinery/pkg/apis/meta/v1beta1`, + `k8s.io/apimachinery/pkg/apis/testapigroup/v1`, + }, ","), + Packages: "", + DropEmbeddedFields: "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta", + } +} + +func (g *Generator) BindFlags(flag *flag.FlagSet) { + flag.StringVarP(&g.Common.GoHeaderFilePath, "go-header-file", "h", g.Common.GoHeaderFilePath, "File containing boilerplate header text. The string YEAR will be replaced with the current 4-digit year.") + flag.BoolVar(&g.Common.VerifyOnly, "verify-only", g.Common.VerifyOnly, "If true, only verify existing output, do not write anything.") + flag.StringVarP(&g.Packages, "packages", "p", g.Packages, "comma-separated list of directories to get input types from. Directories prefixed with '-' are not generated, directories prefixed with '+' only create types with explicit IDL instructions.") + flag.StringVar(&g.APIMachineryPackages, "apimachinery-packages", g.APIMachineryPackages, "comma-separated list of directories to get apimachinery input types from which are needed by any API. Directories prefixed with '-' are not generated, directories prefixed with '+' only create types with explicit IDL instructions.") + flag.StringVarP(&g.OutputBase, "output-base", "o", g.OutputBase, "Output base; defaults to $GOPATH/src/") + flag.StringVar(&g.VendorOutputBase, "vendor-output-base", g.VendorOutputBase, "The vendor/ directory to look for packages in; defaults to $PWD/vendor/.") + flag.StringSliceVar(&g.ProtoImport, "proto-import", g.ProtoImport, "The search path for the core protobuf .protos, required; defaults $GOPATH/src/k8s.io/kubernetes/vendor/github.com/gogo/protobuf/protobuf.") + flag.StringVar(&g.Conditional, "conditional", g.Conditional, "An optional Golang build tag condition to add to the generated Go code") + flag.BoolVar(&g.Clean, "clean", g.Clean, "If true, remove all generated files for the specified Packages.") + flag.BoolVar(&g.OnlyIDL, "only-idl", g.OnlyIDL, "If true, only generate the IDL for each package.") + flag.BoolVar(&g.KeepGogoproto, "keep-gogoproto", g.KeepGogoproto, "If true, the generated IDL will contain gogoprotobuf extensions which are normally removed") + flag.BoolVar(&g.SkipGeneratedRewrite, "skip-generated-rewrite", g.SkipGeneratedRewrite, "If true, skip fixing up the generated.pb.go file (debugging only).") + flag.StringVar(&g.DropEmbeddedFields, "drop-embedded-fields", g.DropEmbeddedFields, "Comma-delimited list of embedded Go types to omit from generated protobufs") +} + +func Run(g *Generator) { + if g.Common.VerifyOnly { + g.OnlyIDL = true + g.Clean = false + } + + b := parser.New() + b.AddBuildTags("proto") + + omitTypes := map[types.Name]struct{}{} + for _, t := range strings.Split(g.DropEmbeddedFields, ",") { + name := types.Name{} + if i := strings.LastIndex(t, "."); i != -1 { + name.Package, name.Name = t[:i], t[i+1:] + } else { + name.Name = t + } + if len(name.Name) == 0 { + log.Fatalf("--drop-embedded-types requires names in the form of [GOPACKAGE.]TYPENAME: %v", t) + } + omitTypes[name] = struct{}{} + } + + boilerplate, err := g.Common.LoadGoBoilerplate() + if err != nil { + log.Fatalf("Failed loading boilerplate (consider using the go-header-file flag): %v", err) + } + + protobufNames := NewProtobufNamer() + outputPackages := generator.Packages{} + nonOutputPackages := map[string]struct{}{} + + var packages []string + if len(g.APIMachineryPackages) != 0 { + packages = append(packages, strings.Split(g.APIMachineryPackages, ",")...) + } + if len(g.Packages) != 0 { + packages = append(packages, strings.Split(g.Packages, ",")...) + } + if len(packages) == 0 { + log.Fatalf("Both apimachinery-packages and packages are empty. At least one package must be specified.") + } + + for _, d := range packages { + generateAllTypes, outputPackage := true, true + switch { + case strings.HasPrefix(d, "+"): + d = d[1:] + generateAllTypes = false + case strings.HasPrefix(d, "-"): + d = d[1:] + outputPackage = false + } + name := protoSafePackage(d) + parts := strings.SplitN(d, "=", 2) + if len(parts) > 1 { + d = parts[0] + name = parts[1] + } + p := newProtobufPackage(d, name, generateAllTypes, omitTypes) + header := append([]byte{}, boilerplate...) + header = append(header, p.HeaderText...) + p.HeaderText = header + protobufNames.Add(p) + if outputPackage { + outputPackages = append(outputPackages, p) + } else { + nonOutputPackages[name] = struct{}{} + } + } + + if !g.Common.VerifyOnly { + for _, p := range outputPackages { + if err := p.(*protobufPackage).Clean(g.OutputBase); err != nil { + log.Fatalf("Unable to clean package %s: %v", p.Name(), err) + } + } + } + + if g.Clean { + return + } + + for _, p := range protobufNames.List() { + if err := b.AddDir(p.Path()); err != nil { + log.Fatalf("Unable to add directory %q: %v", p.Path(), err) + } + } + + c, err := generator.NewContext( + b, + namer.NameSystems{ + "public": namer.NewPublicNamer(3), + "proto": protobufNames, + }, + "public", + ) + if err != nil { + log.Fatalf("Failed making a context: %v", err) + } + + c.Verify = g.Common.VerifyOnly + c.FileTypes["protoidl"] = NewProtoFile() + + // order package by imports, importees first + deps := deps(c, protobufNames.packages) + order, err := importOrder(deps) + if err != nil { + log.Fatalf("Failed to order packages by imports: %v", err) + } + topologicalPos := map[string]int{} + for i, p := range order { + topologicalPos[p] = i + } + sort.Sort(positionOrder{topologicalPos, protobufNames.packages}) + + var vendoredOutputPackages, localOutputPackages generator.Packages + for _, p := range protobufNames.packages { + if _, ok := nonOutputPackages[p.Name()]; ok { + // if we're not outputting the package, don't include it in either package list + continue + } + p.Vendored = strings.Contains(c.Universe[p.PackagePath].SourcePath, "/vendor/") + if p.Vendored { + vendoredOutputPackages = append(vendoredOutputPackages, p) + } else { + localOutputPackages = append(localOutputPackages, p) + } + } + + if err := protobufNames.AssignTypesToPackages(c); err != nil { + log.Fatalf("Failed to identify Common types: %v", err) + } + + if err := c.ExecutePackages(g.VendorOutputBase, vendoredOutputPackages); err != nil { + log.Fatalf("Failed executing vendor generator: %v", err) + } + if err := c.ExecutePackages(g.OutputBase, localOutputPackages); err != nil { + log.Fatalf("Failed executing local generator: %v", err) + } + + if g.OnlyIDL { + return + } + + if _, err := exec.LookPath("protoc"); err != nil { + log.Fatalf("Unable to find 'protoc': %v", err) + } + + searchArgs := []string{"-I", ".", "-I", g.OutputBase} + if len(g.ProtoImport) != 0 { + for _, s := range g.ProtoImport { + searchArgs = append(searchArgs, "-I", s) + } + } + args := append(searchArgs, fmt.Sprintf("--gogo_out=%s", g.OutputBase)) + + buf := &bytes.Buffer{} + if len(g.Conditional) > 0 { + fmt.Fprintf(buf, "// +build %s\n\n", g.Conditional) + } + buf.Write(boilerplate) + + for _, outputPackage := range outputPackages { + p := outputPackage.(*protobufPackage) + + path := filepath.Join(g.OutputBase, p.ImportPath()) + outputPath := filepath.Join(g.OutputBase, p.OutputPath()) + if p.Vendored { + path = filepath.Join(g.VendorOutputBase, p.ImportPath()) + outputPath = filepath.Join(g.VendorOutputBase, p.OutputPath()) + } + + // generate the gogoprotobuf protoc + cmd := exec.Command("protoc", append(args, path)...) + out, err := cmd.CombinedOutput() + if len(out) > 0 { + log.Print(string(out)) + } + if err != nil { + log.Println(strings.Join(cmd.Args, " ")) + log.Fatalf("Unable to generate protoc on %s: %v", p.PackageName, err) + } + + if g.SkipGeneratedRewrite { + continue + } + + // alter the generated protobuf file to remove the generated types (but leave the serializers) and rewrite the + // package statement to match the desired package name + if err := RewriteGeneratedGogoProtobufFile(outputPath, p.ExtractGeneratedType, p.OptionalTypeName, buf.Bytes()); err != nil { + log.Fatalf("Unable to rewrite generated %s: %v", outputPath, err) + } + + // sort imports + cmd = exec.Command("goimports", "-w", outputPath) + out, err = cmd.CombinedOutput() + if len(out) > 0 { + log.Print(string(out)) + } + if err != nil { + log.Println(strings.Join(cmd.Args, " ")) + log.Fatalf("Unable to rewrite imports for %s: %v", p.PackageName, err) + } + + // format and simplify the generated file + cmd = exec.Command("gofmt", "-s", "-w", outputPath) + out, err = cmd.CombinedOutput() + if len(out) > 0 { + log.Print(string(out)) + } + if err != nil { + log.Println(strings.Join(cmd.Args, " ")) + log.Fatalf("Unable to apply gofmt for %s: %v", p.PackageName, err) + } + } + + if g.SkipGeneratedRewrite { + return + } + + if !g.KeepGogoproto { + // generate, but do so without gogoprotobuf extensions + for _, outputPackage := range outputPackages { + p := outputPackage.(*protobufPackage) + p.OmitGogo = true + } + if err := c.ExecutePackages(g.VendorOutputBase, vendoredOutputPackages); err != nil { + log.Fatalf("Failed executing vendor generator: %v", err) + } + if err := c.ExecutePackages(g.OutputBase, localOutputPackages); err != nil { + log.Fatalf("Failed executing local generator: %v", err) + } + } + + for _, outputPackage := range outputPackages { + p := outputPackage.(*protobufPackage) + + if len(p.StructTags) == 0 { + continue + } + + pattern := filepath.Join(g.OutputBase, p.PackagePath, "*.go") + if p.Vendored { + pattern = filepath.Join(g.VendorOutputBase, p.PackagePath, "*.go") + } + files, err := filepath.Glob(pattern) + if err != nil { + log.Fatalf("Can't glob pattern %q: %v", pattern, err) + } + + for _, s := range files { + if strings.HasSuffix(s, "_test.go") { + continue + } + if err := RewriteTypesWithProtobufStructTags(s, p.StructTags); err != nil { + log.Fatalf("Unable to rewrite with struct tags %s: %v", s, err) + } + } + } +} + +func deps(c *generator.Context, pkgs []*protobufPackage) map[string][]string { + ret := map[string][]string{} + for _, p := range pkgs { + for _, d := range c.Universe[p.PackagePath].Imports { + ret[p.PackagePath] = append(ret[p.PackagePath], d.Path) + } + } + return ret +} + +// given a set of pkg->[]deps, return the order that ensures all deps are processed before the things that depend on them +func importOrder(deps map[string][]string) ([]string, error) { + // add all nodes and edges + var remainingNodes = map[string]struct{}{} + var graph = map[edge]struct{}{} + for to, froms := range deps { + remainingNodes[to] = struct{}{} + for _, from := range froms { + remainingNodes[from] = struct{}{} + graph[edge{from: from, to: to}] = struct{}{} + } + } + + // find initial nodes without any dependencies + sorted := findAndRemoveNodesWithoutDependencies(remainingNodes, graph) + for i := 0; i < len(sorted); i++ { + node := sorted[i] + removeEdgesFrom(node, graph) + sorted = append(sorted, findAndRemoveNodesWithoutDependencies(remainingNodes, graph)...) + } + if len(remainingNodes) > 0 { + return nil, fmt.Errorf("cycle: remaining nodes: %#v, remaining edges: %#v", remainingNodes, graph) + } + for _, n := range sorted { + fmt.Println("topological order", n) + } + return sorted, nil +} + +// edge describes a from->to relationship in a graph +type edge struct { + from string + to string +} + +// findAndRemoveNodesWithoutDependencies finds nodes in the given set which are not pointed to by any edges in the graph, +// removes them from the set of nodes, and returns them in sorted order +func findAndRemoveNodesWithoutDependencies(nodes map[string]struct{}, graph map[edge]struct{}) []string { + roots := []string{} + // iterate over all nodes as potential "to" nodes + for node := range nodes { + incoming := false + // iterate over all remaining edges + for edge := range graph { + // if there's any edge to the node we care about, it's not a root + if edge.to == node { + incoming = true + break + } + } + // if there are no incoming edges, remove from the set of remaining nodes and add to our results + if !incoming { + delete(nodes, node) + roots = append(roots, node) + } + } + sort.Strings(roots) + return roots +} + +// removeEdgesFrom removes any edges from the graph where edge.from == node +func removeEdgesFrom(node string, graph map[edge]struct{}) { + for edge := range graph { + if edge.from == node { + delete(graph, edge) + } + } +} + +type positionOrder struct { + pos map[string]int + elements []*protobufPackage +} + +func (o positionOrder) Len() int { + return len(o.elements) +} + +func (o positionOrder) Less(i, j int) bool { + return o.pos[o.elements[i].PackagePath] < o.pos[o.elements[j].PackagePath] +} + +func (o positionOrder) Swap(i, j int) { + x := o.elements[i] + o.elements[i] = o.elements[j] + o.elements[j] = x +} diff --git a/cmd/code-generator/cmd/go-to-protobuf/protobuf/cmd_test.go b/cmd/code-generator/cmd/go-to-protobuf/protobuf/cmd_test.go new file mode 100644 index 0000000..c6b6717 --- /dev/null +++ b/cmd/code-generator/cmd/go-to-protobuf/protobuf/cmd_test.go @@ -0,0 +1,65 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package protobuf + +import ( + "reflect" + "testing" +) + +func TestImportOrder(t *testing.T) { + testcases := []struct { + Name string + Input map[string][]string + Expect []string + ExpectErr bool + }{ + { + Name: "empty", + Input: nil, + Expect: []string{}, + }, + { + Name: "simple", + Input: map[string][]string{"apps": {"core", "extensions", "meta"}, "extensions": {"core", "meta"}, "core": {"meta"}}, + Expect: []string{"meta", "core", "extensions", "apps"}, + }, + { + Name: "cycle", + Input: map[string][]string{"apps": {"core", "extensions", "meta"}, "extensions": {"core", "meta"}, "core": {"meta", "apps"}}, + ExpectErr: true, + }, + } + + for _, tc := range testcases { + t.Run(tc.Name, func(t *testing.T) { + order, err := importOrder(tc.Input) + if err != nil { + if !tc.ExpectErr { + t.Fatalf("unexpected error: %v", err) + } + return + } + if tc.ExpectErr { + t.Fatalf("expected error, got none") + } + if !reflect.DeepEqual(order, tc.Expect) { + t.Fatalf("expected %v, got %v", tc.Expect, order) + } + }) + } +} diff --git a/cmd/code-generator/cmd/go-to-protobuf/protobuf/generator.go b/cmd/code-generator/cmd/go-to-protobuf/protobuf/generator.go new file mode 100644 index 0000000..6eff86b --- /dev/null +++ b/cmd/code-generator/cmd/go-to-protobuf/protobuf/generator.go @@ -0,0 +1,773 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package protobuf + +import ( + "fmt" + "io" + "log" + "reflect" + "sort" + "strconv" + "strings" + + "k8s.io/klog/v2" + + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" +) + +// genProtoIDL produces a .proto IDL. +type genProtoIDL struct { + generator.DefaultGen + localPackage types.Name + localGoPackage types.Name + imports namer.ImportTracker + + generateAll bool + omitGogo bool + omitFieldTypes map[types.Name]struct{} +} + +func (g *genProtoIDL) PackageVars(c *generator.Context) []string { + if g.omitGogo { + return []string{ + fmt.Sprintf("option go_package = %q;", g.localGoPackage.Name), + } + } + return []string{ + "option (gogoproto.marshaler_all) = true;", + "option (gogoproto.stable_marshaler_all) = true;", + "option (gogoproto.sizer_all) = true;", + "option (gogoproto.goproto_stringer_all) = false;", + "option (gogoproto.stringer_all) = true;", + "option (gogoproto.unmarshaler_all) = true;", + "option (gogoproto.goproto_unrecognized_all) = false;", + "option (gogoproto.goproto_enum_prefix_all) = false;", + "option (gogoproto.goproto_getters_all) = false;", + fmt.Sprintf("option go_package = %q;", g.localGoPackage.Name), + } +} +func (g *genProtoIDL) Filename() string { return g.OptionalName + ".proto" } +func (g *genProtoIDL) FileType() string { return "protoidl" } +func (g *genProtoIDL) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + // The local namer returns the correct protobuf name for a proto type + // in the context of a package + "local": localNamer{g.localPackage}, + } +} + +// Filter ignores types that are identified as not exportable. +func (g *genProtoIDL) Filter(c *generator.Context, t *types.Type) bool { + tagVals := types.ExtractCommentTags("+", t.CommentLines)["protobuf"] + if tagVals != nil { + if tagVals[0] == "false" { + // Type specified "false". + return false + } + if tagVals[0] == "true" { + // Type specified "true". + return true + } + klog.Fatalf(`Comment tag "protobuf" must be true or false, found: %q`, tagVals[0]) + } + if !g.generateAll { + // We're not generating everything. + return false + } + seen := map[*types.Type]bool{} + ok := isProtoable(seen, t) + return ok +} + +func isProtoable(seen map[*types.Type]bool, t *types.Type) bool { + if seen[t] { + // be optimistic in the case of type cycles. + return true + } + seen[t] = true + switch t.Kind { + case types.Builtin: + return true + case types.Alias: + return isProtoable(seen, t.Underlying) + case types.Slice, types.Pointer: + return isProtoable(seen, t.Elem) + case types.Map: + return isProtoable(seen, t.Key) && isProtoable(seen, t.Elem) + case types.Struct: + if len(t.Members) == 0 { + return true + } + for _, m := range t.Members { + if isProtoable(seen, m.Type) { + return true + } + } + return false + case types.Func, types.Chan: + return false + case types.DeclarationOf, types.Unknown, types.Unsupported: + return false + case types.Interface: + return false + default: + log.Printf("WARNING: type %q is not portable: %s", t.Kind, t.Name) + return false + } +} + +// isOptionalAlias should return true if the specified type has an underlying type +// (is an alias) of a map or slice and has the comment tag protobuf.nullable=true, +// indicating that the type should be nullable in protobuf. +func isOptionalAlias(t *types.Type) bool { + if t.Underlying == nil || (t.Underlying.Kind != types.Map && t.Underlying.Kind != types.Slice) { + return false + } + if extractBoolTagOrDie("protobuf.nullable", t.CommentLines) == false { + return false + } + return true +} + +func (g *genProtoIDL) Imports(c *generator.Context) (imports []string) { + lines := []string{} + // TODO: this could be expressed more cleanly + for _, line := range g.imports.ImportLines() { + if g.omitGogo && line == "github.com/gogo/protobuf/gogoproto/gogo.proto" { + continue + } + lines = append(lines, line) + } + return lines +} + +// GenerateType makes the body of a file implementing a set for type t. +func (g *genProtoIDL) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "$", "$") + b := bodyGen{ + locator: &protobufLocator{ + namer: c.Namers["proto"].(ProtobufFromGoNamer), + tracker: g.imports, + universe: c.Universe, + + localGoPackage: g.localGoPackage.Package, + }, + localPackage: g.localPackage, + + omitGogo: g.omitGogo, + omitFieldTypes: g.omitFieldTypes, + + t: t, + } + switch t.Kind { + case types.Alias: + return b.doAlias(sw) + case types.Struct: + return b.doStruct(sw) + default: + return b.unknown(sw) + } +} + +// ProtobufFromGoNamer finds the protobuf name of a type (and its package, and +// the package path) from its Go name. +type ProtobufFromGoNamer interface { + GoNameToProtoName(name types.Name) types.Name +} + +type ProtobufLocator interface { + ProtoTypeFor(t *types.Type) (*types.Type, error) + GoTypeForName(name types.Name) *types.Type + CastTypeName(name types.Name) string +} + +type protobufLocator struct { + namer ProtobufFromGoNamer + tracker namer.ImportTracker + universe types.Universe + + localGoPackage string +} + +// CastTypeName returns the cast type name of a Go type +// TODO: delegate to a new localgo namer? +func (p protobufLocator) CastTypeName(name types.Name) string { + if name.Package == p.localGoPackage { + return name.Name + } + return name.String() +} + +func (p protobufLocator) GoTypeForName(name types.Name) *types.Type { + if len(name.Package) == 0 { + name.Package = p.localGoPackage + } + return p.universe.Type(name) +} + +// ProtoTypeFor locates a Protobuf type for the provided Go type (if possible). +func (p protobufLocator) ProtoTypeFor(t *types.Type) (*types.Type, error) { + switch { + // we've already converted the type, or it's a map + case t.Kind == types.Protobuf || t.Kind == types.Map: + p.tracker.AddType(t) + return t, nil + } + // it's a fundamental type + if t, ok := isFundamentalProtoType(t); ok { + p.tracker.AddType(t) + return t, nil + } + // it's a message + if t.Kind == types.Struct || isOptionalAlias(t) { + t := &types.Type{ + Name: p.namer.GoNameToProtoName(t.Name), + Kind: types.Protobuf, + + CommentLines: t.CommentLines, + } + p.tracker.AddType(t) + return t, nil + } + return nil, errUnrecognizedType +} + +type bodyGen struct { + locator ProtobufLocator + localPackage types.Name + omitGogo bool + omitFieldTypes map[types.Name]struct{} + + t *types.Type +} + +func (b bodyGen) unknown(sw *generator.SnippetWriter) error { + return fmt.Errorf("not sure how to generate: %#v", b.t) +} + +func (b bodyGen) doAlias(sw *generator.SnippetWriter) error { + if !isOptionalAlias(b.t) { + return nil + } + + var kind string + switch b.t.Underlying.Kind { + case types.Map: + kind = "map" + default: + kind = "slice" + } + optional := &types.Type{ + Name: b.t.Name, + Kind: types.Struct, + + CommentLines: b.t.CommentLines, + SecondClosestCommentLines: b.t.SecondClosestCommentLines, + Members: []types.Member{ + { + Name: "Items", + CommentLines: []string{fmt.Sprintf("items, if empty, will result in an empty %s\n", kind)}, + Type: b.t.Underlying, + }, + }, + } + nested := b + nested.t = optional + return nested.doStruct(sw) +} + +func (b bodyGen) doStruct(sw *generator.SnippetWriter) error { + if len(b.t.Name.Name) == 0 { + return nil + } + if namer.IsPrivateGoName(b.t.Name.Name) { + return nil + } + + var alias *types.Type + var fields []protoField + options := []string{} + allOptions := types.ExtractCommentTags("+", b.t.CommentLines) + for k, v := range allOptions { + switch { + case strings.HasPrefix(k, "protobuf.options."): + key := strings.TrimPrefix(k, "protobuf.options.") + switch key { + case "marshal": + if v[0] == "false" { + if !b.omitGogo { + options = append(options, + "(gogoproto.marshaler) = false", + "(gogoproto.unmarshaler) = false", + "(gogoproto.sizer) = false", + ) + } + } + default: + if !b.omitGogo || !strings.HasPrefix(key, "(gogoproto.") { + if key == "(gogoproto.goproto_stringer)" && v[0] == "false" { + options = append(options, "(gogoproto.stringer) = false") + } + options = append(options, fmt.Sprintf("%s = %s", key, v[0])) + } + } + // protobuf.as allows a type to have the same message contents as another Go type + case k == "protobuf.as": + fields = nil + if alias = b.locator.GoTypeForName(types.Name{Name: v[0]}); alias == nil { + return fmt.Errorf("type %v references alias %q which does not exist", b.t, v[0]) + } + // protobuf.embed instructs the generator to use the named type in this package + // as an embedded message. + case k == "protobuf.embed": + fields = []protoField{ + { + Tag: 1, + Name: v[0], + Type: &types.Type{ + Name: types.Name{ + Name: v[0], + Package: b.localPackage.Package, + Path: b.localPackage.Path, + }, + }, + }, + } + } + } + if alias == nil { + alias = b.t + } + + // If we don't explicitly embed anything, generate fields by traversing fields. + if fields == nil { + memberFields, err := membersToFields(b.locator, alias, b.localPackage, b.omitFieldTypes) + if err != nil { + return fmt.Errorf("type %v cannot be converted to protobuf: %v", b.t, err) + } + fields = memberFields + } + + out := sw.Out() + genComment(out, b.t.CommentLines, "") + sw.Do(`message $.Name.Name$ { +`, b.t) + + if len(options) > 0 { + sort.Strings(options) + for _, s := range options { + fmt.Fprintf(out, " option %s;\n", s) + } + fmt.Fprintln(out) + } + + for i, field := range fields { + genComment(out, field.CommentLines, " ") + fmt.Fprintf(out, " ") + switch { + case field.Map: + case field.Repeated: + fmt.Fprintf(out, "repeated ") + case field.Required: + fmt.Fprintf(out, "required ") + default: + fmt.Fprintf(out, "optional ") + } + sw.Do(`$.Type|local$ $.Name$ = $.Tag$`, field) + if len(field.Extras) > 0 { + extras := []string{} + for k, v := range field.Extras { + if b.omitGogo && strings.HasPrefix(k, "(gogoproto.") { + continue + } + extras = append(extras, fmt.Sprintf("%s = %s", k, v)) + } + sort.Strings(extras) + if len(extras) > 0 { + fmt.Fprintf(out, " [") + fmt.Fprint(out, strings.Join(extras, ", ")) + fmt.Fprintf(out, "]") + } + } + fmt.Fprintf(out, ";\n") + if i != len(fields)-1 { + fmt.Fprintf(out, "\n") + } + } + fmt.Fprintf(out, "}\n\n") + return nil +} + +type protoField struct { + LocalPackage types.Name + + Tag int + Name string + Type *types.Type + Map bool + Repeated bool + Optional bool + Required bool + Nullable bool + Extras map[string]string + + CommentLines []string +} + +var ( + errUnrecognizedType = fmt.Errorf("did not recognize the provided type") +) + +func isFundamentalProtoType(t *types.Type) (*types.Type, bool) { + // TODO: when we enable proto3, also include other fundamental types in the google.protobuf package + // switch { + // case t.Kind == types.Struct && t.Name == types.Name{Package: "time", Name: "Time"}: + // return &types.Type{ + // Kind: types.Protobuf, + // Name: types.Name{Path: "google/protobuf/timestamp.proto", Package: "google.protobuf", Name: "Timestamp"}, + // }, true + // } + switch t.Kind { + case types.Slice: + if t.Elem.Name.Name == "byte" && len(t.Elem.Name.Package) == 0 { + return &types.Type{Name: types.Name{Name: "bytes"}, Kind: types.Protobuf}, true + } + case types.Builtin: + switch t.Name.Name { + case "string", "uint32", "int32", "uint64", "int64", "bool": + return &types.Type{Name: types.Name{Name: t.Name.Name}, Kind: types.Protobuf}, true + case "int": + return &types.Type{Name: types.Name{Name: "int64"}, Kind: types.Protobuf}, true + case "uint": + return &types.Type{Name: types.Name{Name: "uint64"}, Kind: types.Protobuf}, true + case "float64", "float": + return &types.Type{Name: types.Name{Name: "double"}, Kind: types.Protobuf}, true + case "float32": + return &types.Type{Name: types.Name{Name: "float"}, Kind: types.Protobuf}, true + case "uintptr": + return &types.Type{Name: types.Name{Name: "uint64"}, Kind: types.Protobuf}, true + } + // TODO: complex? + } + return t, false +} + +func memberTypeToProtobufField(locator ProtobufLocator, field *protoField, t *types.Type) error { + var err error + switch t.Kind { + case types.Protobuf: + field.Type, err = locator.ProtoTypeFor(t) + case types.Builtin: + field.Type, err = locator.ProtoTypeFor(t) + case types.Map: + valueField := &protoField{} + if err := memberTypeToProtobufField(locator, valueField, t.Elem); err != nil { + return err + } + keyField := &protoField{} + if err := memberTypeToProtobufField(locator, keyField, t.Key); err != nil { + return err + } + // All other protobuf types have kind types.Protobuf, so setting types.Map + // here would be very misleading. + field.Type = &types.Type{ + Kind: types.Protobuf, + Key: keyField.Type, + Elem: valueField.Type, + } + if !strings.HasPrefix(t.Name.Name, "map[") { + field.Extras["(gogoproto.casttype)"] = strconv.Quote(locator.CastTypeName(t.Name)) + } + if k, ok := keyField.Extras["(gogoproto.casttype)"]; ok { + field.Extras["(gogoproto.castkey)"] = k + } + if v, ok := valueField.Extras["(gogoproto.casttype)"]; ok { + field.Extras["(gogoproto.castvalue)"] = v + } + field.Map = true + case types.Pointer: + if err := memberTypeToProtobufField(locator, field, t.Elem); err != nil { + return err + } + field.Nullable = true + case types.Alias: + if isOptionalAlias(t) { + field.Type, err = locator.ProtoTypeFor(t) + field.Nullable = true + } else { + if err := memberTypeToProtobufField(locator, field, t.Underlying); err != nil { + log.Printf("failed to alias: %s %s: err %v", t.Name, t.Underlying.Name, err) + return err + } + // If this is not an alias to a slice, cast to the alias + if !field.Repeated { + if field.Extras == nil { + field.Extras = make(map[string]string) + } + field.Extras["(gogoproto.casttype)"] = strconv.Quote(locator.CastTypeName(t.Name)) + } + } + case types.Slice: + if t.Elem.Name.Name == "byte" && len(t.Elem.Name.Package) == 0 { + field.Type = &types.Type{Name: types.Name{Name: "bytes"}, Kind: types.Protobuf} + return nil + } + if err := memberTypeToProtobufField(locator, field, t.Elem); err != nil { + return err + } + field.Repeated = true + case types.Struct: + if len(t.Name.Name) == 0 { + return errUnrecognizedType + } + field.Type, err = locator.ProtoTypeFor(t) + field.Nullable = false + default: + return errUnrecognizedType + } + return err +} + +// protobufTagToField extracts information from an existing protobuf tag +func protobufTagToField(tag string, field *protoField, m types.Member, t *types.Type, localPackage types.Name) error { + if len(tag) == 0 || tag == "-" { + return nil + } + + // protobuf:"bytes,3,opt,name=Id,customtype=github.com/gogo/protobuf/test.Uuid" + parts := strings.Split(tag, ",") + if len(parts) < 3 { + return fmt.Errorf("member %q of %q malformed 'protobuf' tag, not enough segments\n", m.Name, t.Name) + } + protoTag, err := strconv.Atoi(parts[1]) + if err != nil { + return fmt.Errorf("member %q of %q malformed 'protobuf' tag, field ID is %q which is not an integer: %v\n", m.Name, t.Name, parts[1], err) + } + field.Tag = protoTag + + // In general there is doesn't make sense to parse the protobuf tags to get the type, + // as all auto-generated once will have wire type "bytes", "varint" or "fixed64". + // However, sometimes we explicitly set them to have a custom serialization, e.g.: + // type Time struct { + // time.Time `protobuf:"Timestamp,1,req,name=time"` + // } + // to force the generator to use a given type (that we manually wrote serialization & + // deserialization methods for). + switch parts[0] { + case "varint", "fixed32", "fixed64", "bytes", "group": + default: + name := types.Name{} + if last := strings.LastIndex(parts[0], "."); last != -1 { + prefix := parts[0][:last] + name = types.Name{ + Name: parts[0][last+1:], + Package: prefix, + Path: strings.Replace(prefix, ".", "/", -1), + } + } else { + name = types.Name{ + Name: parts[0], + Package: localPackage.Package, + Path: localPackage.Path, + } + } + field.Type = &types.Type{ + Name: name, + Kind: types.Protobuf, + } + } + + protoExtra := make(map[string]string) + for i, extra := range parts[3:] { + parts := strings.SplitN(extra, "=", 2) + if len(parts) != 2 { + return fmt.Errorf("member %q of %q malformed 'protobuf' tag, tag %d should be key=value, got %q\n", m.Name, t.Name, i+4, extra) + } + switch parts[0] { + case "name": + protoExtra[parts[0]] = parts[1] + case "casttype", "castkey", "castvalue": + parts[0] = fmt.Sprintf("(gogoproto.%s)", parts[0]) + protoExtra[parts[0]] = strconv.Quote(parts[1]) + } + } + + field.Extras = protoExtra + if name, ok := protoExtra["name"]; ok { + field.Name = name + delete(protoExtra, "name") + } + + return nil +} + +func membersToFields(locator ProtobufLocator, t *types.Type, localPackage types.Name, omitFieldTypes map[types.Name]struct{}) ([]protoField, error) { + fields := []protoField{} + + for _, m := range t.Members { + if namer.IsPrivateGoName(m.Name) { + // skip private fields + continue + } + if _, ok := omitFieldTypes[types.Name{Name: m.Type.Name.Name, Package: m.Type.Name.Package}]; ok { + continue + } + tags := reflect.StructTag(m.Tags) + field := protoField{ + LocalPackage: localPackage, + + Tag: -1, + Extras: make(map[string]string), + } + + protobufTag := tags.Get("protobuf") + if protobufTag == "-" { + continue + } + + if err := protobufTagToField(protobufTag, &field, m, t, localPackage); err != nil { + return nil, err + } + + // extract information from JSON field tag + if tag := tags.Get("json"); len(tag) > 0 { + parts := strings.Split(tag, ",") + if len(field.Name) == 0 && len(parts[0]) != 0 { + field.Name = parts[0] + } + if field.Tag == -1 && field.Name == "-" { + continue + } + } + + if field.Type == nil { + if err := memberTypeToProtobufField(locator, &field, m.Type); err != nil { + return nil, fmt.Errorf("unable to embed type %q as field %q in %q: %v", m.Type, field.Name, t.Name, err) + } + } + if len(field.Name) == 0 { + field.Name = namer.IL(m.Name) + } + + if field.Map && field.Repeated { + // maps cannot be repeated + field.Repeated = false + field.Nullable = true + } + + if !field.Nullable { + field.Extras["(gogoproto.nullable)"] = "false" + } + if (field.Type.Name.Name == "bytes" && field.Type.Name.Package == "") || (field.Repeated && field.Type.Name.Package == "" && namer.IsPrivateGoName(field.Type.Name.Name)) { + delete(field.Extras, "(gogoproto.nullable)") + } + if field.Name != m.Name { + field.Extras["(gogoproto.customname)"] = strconv.Quote(m.Name) + } + field.CommentLines = m.CommentLines + fields = append(fields, field) + } + + // assign tags + highest := 0 + byTag := make(map[int]*protoField) + // fields are in Go struct order, which we preserve + for i := range fields { + field := &fields[i] + tag := field.Tag + if tag != -1 { + if existing, ok := byTag[tag]; ok { + return nil, fmt.Errorf("field %q and %q both have tag %d", field.Name, existing.Name, tag) + } + byTag[tag] = field + } + if tag > highest { + highest = tag + } + } + // starting from the highest observed tag, assign new field tags + for i := range fields { + field := &fields[i] + if field.Tag != -1 { + continue + } + highest++ + field.Tag = highest + byTag[field.Tag] = field + } + return fields, nil +} + +func genComment(out io.Writer, lines []string, indent string) { + for { + l := len(lines) + if l == 0 || len(lines[l-1]) != 0 { + break + } + lines = lines[:l-1] + } + for _, c := range lines { + if len(c) == 0 { + fmt.Fprintf(out, "%s//\n", indent) // avoid trailing whitespace + continue + } + fmt.Fprintf(out, "%s// %s\n", indent, c) + } +} + +func formatProtoFile(source []byte) ([]byte, error) { + // TODO; Is there any protobuf formatter? + return source, nil +} + +func assembleProtoFile(w io.Writer, f *generator.File) { + w.Write(f.Header) + + fmt.Fprint(w, "syntax = \"proto2\";\n\n") + + if len(f.PackageName) > 0 { + fmt.Fprintf(w, "package %s;\n\n", f.PackageName) + } + + if len(f.Imports) > 0 { + imports := []string{} + for i := range f.Imports { + imports = append(imports, i) + } + sort.Strings(imports) + for _, s := range imports { + fmt.Fprintf(w, "import %q;\n", s) + } + fmt.Fprint(w, "\n") + } + + if f.Vars.Len() > 0 { + fmt.Fprintf(w, "%s\n", f.Vars.String()) + } + + w.Write(f.Body.Bytes()) +} + +func NewProtoFile() *generator.DefaultFileType { + return &generator.DefaultFileType{ + Format: formatProtoFile, + Assemble: assembleProtoFile, + } +} diff --git a/cmd/code-generator/cmd/go-to-protobuf/protobuf/import_tracker.go b/cmd/code-generator/cmd/go-to-protobuf/protobuf/import_tracker.go new file mode 100644 index 0000000..08a991b --- /dev/null +++ b/cmd/code-generator/cmd/go-to-protobuf/protobuf/import_tracker.go @@ -0,0 +1,50 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package protobuf + +import ( + "k8s.io/gengo/namer" + "k8s.io/gengo/types" +) + +type ImportTracker struct { + namer.DefaultImportTracker +} + +func NewImportTracker(local types.Name, typesToAdd ...*types.Type) *ImportTracker { + tracker := namer.NewDefaultImportTracker(local) + tracker.IsInvalidType = func(t *types.Type) bool { return t.Kind != types.Protobuf } + tracker.LocalName = func(name types.Name) string { return name.Package } + tracker.PrintImport = func(path, name string) string { return path } + + tracker.AddTypes(typesToAdd...) + return &ImportTracker{ + DefaultImportTracker: tracker, + } +} + +// AddNullable ensures that support for the nullable Gogo-protobuf extension is added. +func (tracker *ImportTracker) AddNullable() { + tracker.AddType(&types.Type{ + Kind: types.Protobuf, + Name: types.Name{ + Name: "nullable", + Package: "gogoproto", + Path: "github.com/gogo/protobuf/gogoproto/gogo.proto", + }, + }) +} diff --git a/cmd/code-generator/cmd/go-to-protobuf/protobuf/namer.go b/cmd/code-generator/cmd/go-to-protobuf/protobuf/namer.go new file mode 100644 index 0000000..e3b21c6 --- /dev/null +++ b/cmd/code-generator/cmd/go-to-protobuf/protobuf/namer.go @@ -0,0 +1,208 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package protobuf + +import ( + "fmt" + "reflect" + "strings" + + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" +) + +type localNamer struct { + localPackage types.Name +} + +func (n localNamer) Name(t *types.Type) string { + if t.Key != nil && t.Elem != nil { + return fmt.Sprintf("map<%s, %s>", n.Name(t.Key), n.Name(t.Elem)) + } + if len(n.localPackage.Package) != 0 && n.localPackage.Package == t.Name.Package { + return t.Name.Name + } + return t.Name.String() +} + +type protobufNamer struct { + packages []*protobufPackage + packagesByPath map[string]*protobufPackage +} + +func NewProtobufNamer() *protobufNamer { + return &protobufNamer{ + packagesByPath: make(map[string]*protobufPackage), + } +} + +func (n *protobufNamer) Name(t *types.Type) string { + if t.Kind == types.Map { + return fmt.Sprintf("map<%s, %s>", n.Name(t.Key), n.Name(t.Elem)) + } + return t.Name.String() +} + +func (n *protobufNamer) List() []generator.Package { + packages := make([]generator.Package, 0, len(n.packages)) + for i := range n.packages { + packages = append(packages, n.packages[i]) + } + return packages +} + +func (n *protobufNamer) Add(p *protobufPackage) { + if _, ok := n.packagesByPath[p.PackagePath]; !ok { + n.packagesByPath[p.PackagePath] = p + n.packages = append(n.packages, p) + } +} + +func (n *protobufNamer) GoNameToProtoName(name types.Name) types.Name { + if p, ok := n.packagesByPath[name.Package]; ok { + return types.Name{ + Name: name.Name, + Package: p.PackageName, + Path: p.ImportPath(), + } + } + for _, p := range n.packages { + if _, ok := p.FilterTypes[name]; ok { + return types.Name{ + Name: name.Name, + Package: p.PackageName, + Path: p.ImportPath(), + } + } + } + return types.Name{Name: name.Name} +} + +func protoSafePackage(name string) string { + pkg := strings.Replace(name, "/", ".", -1) + return strings.Replace(pkg, "-", "_", -1) +} + +type typeNameSet map[types.Name]*protobufPackage + +// assignGoTypeToProtoPackage looks for Go and Protobuf types that are referenced by a type in +// a package. It will not recurse into protobuf types. +func assignGoTypeToProtoPackage(p *protobufPackage, t *types.Type, local, global typeNameSet, optional map[types.Name]struct{}) { + newT, isProto := isFundamentalProtoType(t) + if isProto { + t = newT + } + if otherP, ok := global[t.Name]; ok { + if _, ok := local[t.Name]; !ok { + p.Imports.AddType(&types.Type{ + Kind: types.Protobuf, + Name: otherP.ProtoTypeName(), + }) + } + return + } + if t.Name.Package == p.PackagePath { + // Associate types only to their own package + global[t.Name] = p + } + if _, ok := local[t.Name]; ok { + return + } + // don't recurse into existing proto types + if isProto { + p.Imports.AddType(t) + return + } + + local[t.Name] = p + for _, m := range t.Members { + if namer.IsPrivateGoName(m.Name) { + continue + } + field := &protoField{} + tag := reflect.StructTag(m.Tags).Get("protobuf") + if tag == "-" { + continue + } + if err := protobufTagToField(tag, field, m, t, p.ProtoTypeName()); err == nil && field.Type != nil { + assignGoTypeToProtoPackage(p, field.Type, local, global, optional) + continue + } + assignGoTypeToProtoPackage(p, m.Type, local, global, optional) + } + // TODO: should methods be walked? + if t.Elem != nil { + assignGoTypeToProtoPackage(p, t.Elem, local, global, optional) + } + if t.Key != nil { + assignGoTypeToProtoPackage(p, t.Key, local, global, optional) + } + if t.Underlying != nil { + if t.Kind == types.Alias && isOptionalAlias(t) { + optional[t.Name] = struct{}{} + } + assignGoTypeToProtoPackage(p, t.Underlying, local, global, optional) + } +} + +// isTypeApplicableToProtobuf checks to see if a type is relevant for protobuf processing. +// Currently, it filters out functions and private types. +func isTypeApplicableToProtobuf(t *types.Type) bool { + // skip functions -- we don't care about them for protobuf + if t.Kind == types.Func || (t.Kind == types.DeclarationOf && t.Underlying.Kind == types.Func) { + return false + } + // skip private types + if namer.IsPrivateGoName(t.Name.Name) { + return false + } + + return true +} + +func (n *protobufNamer) AssignTypesToPackages(c *generator.Context) error { + global := make(typeNameSet) + for _, p := range n.packages { + local := make(typeNameSet) + optional := make(map[types.Name]struct{}) + p.Imports = NewImportTracker(p.ProtoTypeName()) + for _, t := range c.Order { + if t.Name.Package != p.PackagePath { + continue + } + if !isTypeApplicableToProtobuf(t) { + // skip types that we don't care about, like functions + continue + } + assignGoTypeToProtoPackage(p, t, local, global, optional) + } + p.FilterTypes = make(map[types.Name]struct{}) + p.LocalNames = make(map[string]struct{}) + p.OptionalTypeNames = make(map[string]struct{}) + for k, v := range local { + if v == p { + p.FilterTypes[k] = struct{}{} + p.LocalNames[k.Name] = struct{}{} + if _, ok := optional[k]; ok { + p.OptionalTypeNames[k.Name] = struct{}{} + } + } + } + } + return nil +} diff --git a/cmd/code-generator/cmd/go-to-protobuf/protobuf/namer_test.go b/cmd/code-generator/cmd/go-to-protobuf/protobuf/namer_test.go new file mode 100644 index 0000000..0ee71f8 --- /dev/null +++ b/cmd/code-generator/cmd/go-to-protobuf/protobuf/namer_test.go @@ -0,0 +1,50 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package protobuf + +import "testing" + +func TestProtoSafePackage(t *testing.T) { + tests := []struct { + pkg string + expected string + }{ + { + pkg: "foo", + expected: "foo", + }, + { + pkg: "foo/bar", + expected: "foo.bar", + }, + { + pkg: "foo/bar/baz", + expected: "foo.bar.baz", + }, + { + pkg: "foo/bar-baz/x/y-z/q", + expected: "foo.bar_baz.x.y_z.q", + }, + } + + for _, test := range tests { + actual := protoSafePackage(test.pkg) + if e, a := test.expected, actual; e != a { + t.Errorf("%s: expected %s, got %s", test.pkg, e, a) + } + } +} diff --git a/cmd/code-generator/cmd/go-to-protobuf/protobuf/package.go b/cmd/code-generator/cmd/go-to-protobuf/protobuf/package.go new file mode 100644 index 0000000..bed4c3e --- /dev/null +++ b/cmd/code-generator/cmd/go-to-protobuf/protobuf/package.go @@ -0,0 +1,215 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package protobuf + +import ( + "fmt" + "go/ast" + "log" + "os" + "path/filepath" + "reflect" + "strings" + + "k8s.io/gengo/generator" + "k8s.io/gengo/types" +) + +func newProtobufPackage(packagePath, packageName string, generateAll bool, omitFieldTypes map[types.Name]struct{}) *protobufPackage { + pkg := &protobufPackage{ + DefaultPackage: generator.DefaultPackage{ + // The protobuf package name (foo.bar.baz) + PackageName: packageName, + // A path segment relative to the GOPATH root (foo/bar/baz) + PackagePath: packagePath, + HeaderText: []byte( + ` +// This file was autogenerated by go-to-protobuf. Do not edit it manually! + +`), + PackageDocumentation: []byte(fmt.Sprintf( + `// Package %s is an autogenerated protobuf IDL. +`, packageName)), + }, + GenerateAll: generateAll, + OmitFieldTypes: omitFieldTypes, + } + pkg.FilterFunc = pkg.filterFunc + pkg.GeneratorFunc = pkg.generatorFunc + return pkg +} + +// protobufPackage contains the protobuf implementation of Package. +type protobufPackage struct { + generator.DefaultPackage + + // If true, this package has been vendored into our source tree and thus can + // only be generated by changing the vendor tree. + Vendored bool + + // If true, generate protobuf serializations for all public types. + // If false, only generate protobuf serializations for structs that + // request serialization. + GenerateAll bool + + // A list of types to filter to; if not specified all types will be included. + FilterTypes map[types.Name]struct{} + + // If true, omit any gogoprotobuf extensions not defined as types. + OmitGogo bool + + // A list of field types that will be excluded from the output struct + OmitFieldTypes map[types.Name]struct{} + + // A list of names that this package exports + LocalNames map[string]struct{} + + // A list of type names in this package that will need marshaller rewriting + // to remove synthetic protobuf fields. + OptionalTypeNames map[string]struct{} + + // A list of struct tags to generate onto named struct fields + StructTags map[string]map[string]string + + // An import tracker for this package + Imports *ImportTracker +} + +func (p *protobufPackage) Clean(outputBase string) error { + for _, s := range []string{p.ImportPath(), p.OutputPath()} { + if err := os.Remove(filepath.Join(outputBase, s)); err != nil && !os.IsNotExist(err) { + return err + } + } + return nil +} + +func (p *protobufPackage) ProtoTypeName() types.Name { + return types.Name{ + Name: p.Path(), // the go path "foo/bar/baz" + Package: p.Name(), // the protobuf package "foo.bar.baz" + Path: p.ImportPath(), // the path of the import to get the proto + } +} + +func (p *protobufPackage) filterFunc(c *generator.Context, t *types.Type) bool { + switch t.Kind { + case types.Func, types.Chan: + return false + case types.Struct: + if t.Name.Name == "struct{}" { + return false + } + case types.Builtin: + return false + case types.Alias: + if !isOptionalAlias(t) { + return false + } + case types.Slice, types.Array, types.Map: + return false + case types.Pointer: + return false + } + if _, ok := isFundamentalProtoType(t); ok { + return false + } + _, ok := p.FilterTypes[t.Name] + return ok +} + +func (p *protobufPackage) HasGoType(name string) bool { + _, ok := p.LocalNames[name] + return ok +} + +func (p *protobufPackage) OptionalTypeName(name string) bool { + _, ok := p.OptionalTypeNames[name] + return ok +} + +func (p *protobufPackage) ExtractGeneratedType(t *ast.TypeSpec) bool { + if !p.HasGoType(t.Name.Name) { + return false + } + + switch s := t.Type.(type) { + case *ast.StructType: + for i, f := range s.Fields.List { + if len(f.Tag.Value) == 0 { + continue + } + tag := strings.Trim(f.Tag.Value, "`") + protobufTag := reflect.StructTag(tag).Get("protobuf") + if len(protobufTag) == 0 { + continue + } + if len(f.Names) > 1 { + log.Printf("WARNING: struct %s field %d %s: defined multiple names but single protobuf tag", t.Name.Name, i, f.Names[0].Name) + // TODO hard error? + } + if p.StructTags == nil { + p.StructTags = make(map[string]map[string]string) + } + m := p.StructTags[t.Name.Name] + if m == nil { + m = make(map[string]string) + p.StructTags[t.Name.Name] = m + } + m[f.Names[0].Name] = tag + } + default: + log.Printf("WARNING: unexpected Go AST type definition: %#v", t) + } + + return true +} + +func (p *protobufPackage) generatorFunc(c *generator.Context) []generator.Generator { + generators := []generator.Generator{} + + p.Imports.AddNullable() + + generators = append(generators, &genProtoIDL{ + DefaultGen: generator.DefaultGen{ + OptionalName: "generated", + }, + localPackage: types.Name{Package: p.PackageName, Path: p.PackagePath}, + localGoPackage: types.Name{Package: p.PackagePath, Name: p.GoPackageName()}, + imports: p.Imports, + generateAll: p.GenerateAll, + omitGogo: p.OmitGogo, + omitFieldTypes: p.OmitFieldTypes, + }) + return generators +} + +func (p *protobufPackage) GoPackageName() string { + return filepath.Base(p.PackagePath) +} + +func (p *protobufPackage) ImportPath() string { + return filepath.Join(p.PackagePath, "generated.proto") +} + +func (p *protobufPackage) OutputPath() string { + return filepath.Join(p.PackagePath, "generated.pb.go") +} + +var ( + _ = generator.Package(&protobufPackage{}) +) diff --git a/cmd/code-generator/cmd/go-to-protobuf/protobuf/parser.go b/cmd/code-generator/cmd/go-to-protobuf/protobuf/parser.go new file mode 100644 index 0000000..b3c8d2e --- /dev/null +++ b/cmd/code-generator/cmd/go-to-protobuf/protobuf/parser.go @@ -0,0 +1,464 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package protobuf + +import ( + "bytes" + "errors" + "fmt" + "go/ast" + "go/format" + "go/parser" + "go/printer" + "go/token" + "io/ioutil" + "os" + "reflect" + "strings" + + customreflect "k8s.io/code-generator/third_party/forked/golang/reflect" +) + +func rewriteFile(name string, header []byte, rewriteFn func(*token.FileSet, *ast.File) error) error { + fset := token.NewFileSet() + src, err := ioutil.ReadFile(name) + if err != nil { + return err + } + file, err := parser.ParseFile(fset, name, src, parser.DeclarationErrors|parser.ParseComments) + if err != nil { + return err + } + + if err := rewriteFn(fset, file); err != nil { + return err + } + + b := &bytes.Buffer{} + b.Write(header) + if err := printer.Fprint(b, fset, file); err != nil { + return err + } + + body, err := format.Source(b.Bytes()) + if err != nil { + return err + } + + f, err := os.OpenFile(name, os.O_WRONLY|os.O_TRUNC, 0644) + if err != nil { + return err + } + defer f.Close() + if _, err := f.Write(body); err != nil { + return err + } + return f.Close() +} + +// ExtractFunc extracts information from the provided TypeSpec and returns true if the type should be +// removed from the destination file. +type ExtractFunc func(*ast.TypeSpec) bool + +// OptionalFunc returns true if the provided local name is a type that has protobuf.nullable=true +// and should have its marshal functions adjusted to remove the 'Items' accessor. +type OptionalFunc func(name string) bool + +func RewriteGeneratedGogoProtobufFile(name string, extractFn ExtractFunc, optionalFn OptionalFunc, header []byte) error { + return rewriteFile(name, header, func(fset *token.FileSet, file *ast.File) error { + cmap := ast.NewCommentMap(fset, file, file.Comments) + + // transform methods that point to optional maps or slices + for _, d := range file.Decls { + rewriteOptionalMethods(d, optionalFn) + } + + // remove types that are already declared + decls := []ast.Decl{} + for _, d := range file.Decls { + if dropExistingTypeDeclarations(d, extractFn) { + continue + } + if dropEmptyImportDeclarations(d) { + continue + } + decls = append(decls, d) + } + file.Decls = decls + + // remove unmapped comments + file.Comments = cmap.Filter(file).Comments() + return nil + }) +} + +// rewriteOptionalMethods makes specific mutations to marshaller methods that belong to types identified +// as being "optional" (they may be nil on the wire). This allows protobuf to serialize a map or slice and +// properly discriminate between empty and nil (which is not possible in protobuf). +// TODO: move into upstream gogo-protobuf once https://github.com/gogo/protobuf/issues/181 +// has agreement +func rewriteOptionalMethods(decl ast.Decl, isOptional OptionalFunc) { + switch t := decl.(type) { + case *ast.FuncDecl: + ident, ptr, ok := receiver(t) + if !ok { + return + } + + // correct initialization of the form `m.Field = &OptionalType{}` to + // `m.Field = OptionalType{}` + if t.Name.Name == "Unmarshal" { + ast.Walk(optionalAssignmentVisitor{fn: isOptional}, t.Body) + } + + if !isOptional(ident.Name) { + return + } + + switch t.Name.Name { + case "Unmarshal": + ast.Walk(&optionalItemsVisitor{}, t.Body) + case "MarshalTo", "Size", "String", "MarshalToSizedBuffer": + ast.Walk(&optionalItemsVisitor{}, t.Body) + fallthrough + case "Marshal": + // if the method has a pointer receiver, set it back to a normal receiver + if ptr { + t.Recv.List[0].Type = ident + } + } + } +} + +type optionalAssignmentVisitor struct { + fn OptionalFunc +} + +// Visit walks the provided node, transforming field initializations of the form +// m.Field = &OptionalType{} -> m.Field = OptionalType{} +func (v optionalAssignmentVisitor) Visit(n ast.Node) ast.Visitor { + switch t := n.(type) { + case *ast.AssignStmt: + if len(t.Lhs) == 1 && len(t.Rhs) == 1 { + if !isFieldSelector(t.Lhs[0], "m", "") { + return nil + } + unary, ok := t.Rhs[0].(*ast.UnaryExpr) + if !ok || unary.Op != token.AND { + return nil + } + composite, ok := unary.X.(*ast.CompositeLit) + if !ok || composite.Type == nil || len(composite.Elts) != 0 { + return nil + } + if ident, ok := composite.Type.(*ast.Ident); ok && v.fn(ident.Name) { + t.Rhs[0] = composite + } + } + return nil + } + return v +} + +type optionalItemsVisitor struct{} + +// Visit walks the provided node, looking for specific patterns to transform that match +// the effective outcome of turning struct{ map[x]y || []x } into map[x]y or []x. +func (v *optionalItemsVisitor) Visit(n ast.Node) ast.Visitor { + switch t := n.(type) { + case *ast.RangeStmt: + if isFieldSelector(t.X, "m", "Items") { + t.X = &ast.Ident{Name: "m"} + } + case *ast.AssignStmt: + if len(t.Lhs) == 1 && len(t.Rhs) == 1 { + switch lhs := t.Lhs[0].(type) { + case *ast.IndexExpr: + if isFieldSelector(lhs.X, "m", "Items") { + lhs.X = &ast.StarExpr{X: &ast.Ident{Name: "m"}} + } + default: + if isFieldSelector(t.Lhs[0], "m", "Items") { + t.Lhs[0] = &ast.StarExpr{X: &ast.Ident{Name: "m"}} + } + } + switch rhs := t.Rhs[0].(type) { + case *ast.CallExpr: + if ident, ok := rhs.Fun.(*ast.Ident); ok && ident.Name == "append" { + ast.Walk(v, rhs) + if len(rhs.Args) > 0 { + switch arg := rhs.Args[0].(type) { + case *ast.Ident: + if arg.Name == "m" { + rhs.Args[0] = &ast.StarExpr{X: &ast.Ident{Name: "m"}} + } + } + } + return nil + } + } + } + case *ast.IfStmt: + switch cond := t.Cond.(type) { + case *ast.BinaryExpr: + if cond.Op == token.EQL { + if isFieldSelector(cond.X, "m", "Items") && isIdent(cond.Y, "nil") { + cond.X = &ast.StarExpr{X: &ast.Ident{Name: "m"}} + } + } + } + if t.Init != nil { + // Find form: + // if err := m[len(m.Items)-1].Unmarshal(data[iNdEx:postIndex]); err != nil { + // return err + // } + switch s := t.Init.(type) { + case *ast.AssignStmt: + if call, ok := s.Rhs[0].(*ast.CallExpr); ok { + if sel, ok := call.Fun.(*ast.SelectorExpr); ok { + if x, ok := sel.X.(*ast.IndexExpr); ok { + // m[] -> (*m)[] + if sel2, ok := x.X.(*ast.SelectorExpr); ok { + if ident, ok := sel2.X.(*ast.Ident); ok && ident.Name == "m" { + x.X = &ast.StarExpr{X: &ast.Ident{Name: "m"}} + } + } + // len(m.Items) -> len(*m) + if bin, ok := x.Index.(*ast.BinaryExpr); ok { + if call2, ok := bin.X.(*ast.CallExpr); ok && len(call2.Args) == 1 { + if isFieldSelector(call2.Args[0], "m", "Items") { + call2.Args[0] = &ast.StarExpr{X: &ast.Ident{Name: "m"}} + } + } + } + } + } + } + } + } + case *ast.IndexExpr: + if isFieldSelector(t.X, "m", "Items") { + t.X = &ast.Ident{Name: "m"} + return nil + } + case *ast.CallExpr: + changed := false + for i := range t.Args { + if isFieldSelector(t.Args[i], "m", "Items") { + t.Args[i] = &ast.Ident{Name: "m"} + changed = true + } + } + if changed { + return nil + } + } + return v +} + +func isFieldSelector(n ast.Expr, name, field string) bool { + s, ok := n.(*ast.SelectorExpr) + if !ok || s.Sel == nil || (field != "" && s.Sel.Name != field) { + return false + } + return isIdent(s.X, name) +} + +func isIdent(n ast.Expr, value string) bool { + ident, ok := n.(*ast.Ident) + return ok && ident.Name == value +} + +func receiver(f *ast.FuncDecl) (ident *ast.Ident, pointer bool, ok bool) { + if f.Recv == nil || len(f.Recv.List) != 1 { + return nil, false, false + } + switch t := f.Recv.List[0].Type.(type) { + case *ast.StarExpr: + identity, ok := t.X.(*ast.Ident) + if !ok { + return nil, false, false + } + return identity, true, true + case *ast.Ident: + return t, false, true + } + return nil, false, false +} + +// dropExistingTypeDeclarations removes any type declaration for which extractFn returns true. The function +// returns true if the entire declaration should be dropped. +func dropExistingTypeDeclarations(decl ast.Decl, extractFn ExtractFunc) bool { + switch t := decl.(type) { + case *ast.GenDecl: + if t.Tok != token.TYPE { + return false + } + specs := []ast.Spec{} + for _, s := range t.Specs { + switch spec := s.(type) { + case *ast.TypeSpec: + if extractFn(spec) { + continue + } + specs = append(specs, spec) + } + } + if len(specs) == 0 { + return true + } + t.Specs = specs + } + return false +} + +// dropEmptyImportDeclarations strips any generated but no-op imports from the generated code +// to prevent generation from being able to define side-effects. The function returns true +// if the entire declaration should be dropped. +func dropEmptyImportDeclarations(decl ast.Decl) bool { + switch t := decl.(type) { + case *ast.GenDecl: + if t.Tok != token.IMPORT { + return false + } + specs := []ast.Spec{} + for _, s := range t.Specs { + switch spec := s.(type) { + case *ast.ImportSpec: + if spec.Name != nil && spec.Name.Name == "_" { + continue + } + specs = append(specs, spec) + } + } + if len(specs) == 0 { + return true + } + t.Specs = specs + } + return false +} + +func RewriteTypesWithProtobufStructTags(name string, structTags map[string]map[string]string) error { + return rewriteFile(name, []byte{}, func(fset *token.FileSet, file *ast.File) error { + allErrs := []error{} + + // set any new struct tags + for _, d := range file.Decls { + if errs := updateStructTags(d, structTags, []string{"protobuf"}); len(errs) > 0 { + allErrs = append(allErrs, errs...) + } + } + + if len(allErrs) > 0 { + var s string + for _, err := range allErrs { + s += err.Error() + "\n" + } + return errors.New(s) + } + return nil + }) +} + +func getFieldName(expr ast.Expr, structname string) (name string, err error) { + for { + switch t := expr.(type) { + case *ast.Ident: + return t.Name, nil + case *ast.SelectorExpr: + return t.Sel.Name, nil + case *ast.StarExpr: + expr = t.X + default: + return "", fmt.Errorf("unable to get name for tag from struct %q, field %#v", structname, t) + } + } +} + +func updateStructTags(decl ast.Decl, structTags map[string]map[string]string, toCopy []string) []error { + var errs []error + t, ok := decl.(*ast.GenDecl) + if !ok { + return nil + } + if t.Tok != token.TYPE { + return nil + } + + for _, s := range t.Specs { + spec, ok := s.(*ast.TypeSpec) + if !ok { + continue + } + typeName := spec.Name.Name + fieldTags, ok := structTags[typeName] + if !ok { + continue + } + st, ok := spec.Type.(*ast.StructType) + if !ok { + continue + } + + for i := range st.Fields.List { + f := st.Fields.List[i] + var name string + var err error + if len(f.Names) == 0 { + name, err = getFieldName(f.Type, spec.Name.Name) + if err != nil { + errs = append(errs, err) + continue + } + } else { + name = f.Names[0].Name + } + value, ok := fieldTags[name] + if !ok { + continue + } + var tags customreflect.StructTags + if f.Tag != nil { + oldTags, err := customreflect.ParseStructTags(strings.Trim(f.Tag.Value, "`")) + if err != nil { + errs = append(errs, fmt.Errorf("unable to read struct tag from struct %q, field %q: %v", spec.Name.Name, name, err)) + continue + } + tags = oldTags + } + for _, name := range toCopy { + // don't overwrite existing tags + if tags.Has(name) { + continue + } + // append new tags + if v := reflect.StructTag(value).Get(name); len(v) > 0 { + tags = append(tags, customreflect.StructTag{Name: name, Value: v}) + } + } + if len(tags) == 0 { + continue + } + if f.Tag == nil { + f.Tag = &ast.BasicLit{} + } + f.Tag.Value = tags.String() + } + } + return errs +} diff --git a/cmd/code-generator/cmd/go-to-protobuf/protobuf/parser_test.go b/cmd/code-generator/cmd/go-to-protobuf/protobuf/parser_test.go new file mode 100644 index 0000000..7fa6e23 --- /dev/null +++ b/cmd/code-generator/cmd/go-to-protobuf/protobuf/parser_test.go @@ -0,0 +1,121 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package protobuf + +import ( + "go/ast" + "testing" +) + +/* + struct fields in go AST: + + type Struct struct { + // fields with a direct field Name as + A X // regular fields + B *X // pointer fields + C // embedded type field + + // qualified embedded type fields use an in the AST + v1.TypeMeta // X=v1, Sel=TypeMeta + + // fields without a direct name, but + // a in the go-AST + *D // type field embedded as pointer + *v1.ListMeta // qualified type field embedded as pointer + // with pointing to + } +*/ + +func TestProtoParser(t *testing.T) { + ident := ast.NewIdent("FieldName") + tests := []struct { + expr ast.Expr + err bool + }{ + // valid struct field expressions + { + expr: ident, + err: false, + }, + { + expr: &ast.SelectorExpr{ + Sel: ident, + }, + err: false, + }, + { + expr: &ast.StarExpr{ + X: ident, + }, + err: false, + }, + { + expr: &ast.StarExpr{ + X: &ast.StarExpr{ + X: ident, + }, + }, + err: false, + }, + { + expr: &ast.StarExpr{ + X: &ast.SelectorExpr{ + Sel: ident, + }, + }, + err: false, + }, + + // something else should provide an error + { + expr: &ast.KeyValueExpr{ + Key: ident, + Colon: 0, + Value: ident, + }, + err: true, + }, + { + expr: &ast.StarExpr{ + X: &ast.KeyValueExpr{ + Key: ident, + Colon: 0, + Value: ident, + }, + }, + err: true, + }, + } + + for _, test := range tests { + actual, err := getFieldName(test.expr, "Struct") + if !test.err { + if err != nil { + t.Errorf("%s: unexpected error %s", test.expr, err) + } else { + if actual != ident.Name { + t.Errorf("%s: expected %s, got %s", test.expr, ident.Name, actual) + } + } + } else { + if err == nil { + t.Errorf("%s: expected error did not occur, got %s instead", test.expr, actual) + } + } + } +} diff --git a/cmd/code-generator/cmd/go-to-protobuf/protobuf/tags.go b/cmd/code-generator/cmd/go-to-protobuf/protobuf/tags.go new file mode 100644 index 0000000..6cfa378 --- /dev/null +++ b/cmd/code-generator/cmd/go-to-protobuf/protobuf/tags.go @@ -0,0 +1,33 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package protobuf + +import ( + "k8s.io/gengo/types" + "k8s.io/klog/v2" +) + +// extractBoolTagOrDie gets the comment-tags for the key and asserts that, if +// it exists, the value is boolean. If the tag did not exist, it returns +// false. +func extractBoolTagOrDie(key string, lines []string) bool { + val, err := types.ExtractSingleBoolCommentTag("+", key, false, lines) + if err != nil { + klog.Fatal(err) + } + return val +} diff --git a/cmd/code-generator/cmd/go-to-protobuf/protoc-gen-gogo/main.go b/cmd/code-generator/cmd/go-to-protobuf/protoc-gen-gogo/main.go new file mode 100644 index 0000000..6e5051d --- /dev/null +++ b/cmd/code-generator/cmd/go-to-protobuf/protoc-gen-gogo/main.go @@ -0,0 +1,32 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package main defines the protoc-gen-gogo binary we use to generate our proto go files, +// as well as takes dependencies on the correct gogo/protobuf packages for godeps. +package main + +import ( + "github.com/gogo/protobuf/vanity/command" + + // dependencies that are required for our packages + _ "github.com/gogo/protobuf/gogoproto" + _ "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/sortkeys" +) + +func main() { + command.Write(command.Generate(command.Read())) +} diff --git a/cmd/code-generator/cmd/import-boss/.gitignore b/cmd/code-generator/cmd/import-boss/.gitignore new file mode 100644 index 0000000..a5c47b6 --- /dev/null +++ b/cmd/code-generator/cmd/import-boss/.gitignore @@ -0,0 +1 @@ +import-boss diff --git a/cmd/code-generator/cmd/import-boss/README.md b/cmd/code-generator/cmd/import-boss/README.md new file mode 100644 index 0000000..88dc010 --- /dev/null +++ b/cmd/code-generator/cmd/import-boss/README.md @@ -0,0 +1,97 @@ +## Purpose + +- `import-boss` enforces import restrictions against all pull requests submitted to the [k/k](https://github.com/kubernetes/kubernetes) repository. There are a number of `.import-restrictions` files that in the [k/k](https://github.com/kubernetes/kubernetes) repository, all of which are defined in `YAML` (or `JSON`) format. + +## How does it work? + +- When a directory is verified, `import-boss` looks for a file called `.import-restrictions`. If this file is not found, `import-boss` will go up to the parent directory until it finds this `.import-restrictions` file. + +- Adding `.import-restrictions` files does not add them to CI runs. They need to be explicitly added to `hack/verify-import-boss.sh`. Once an `.import-restrictions` file is added, all of the sub-packages of this file's directory are added as well. + +### What are Rules? + +- If an `.import-restrictions` file is found, then all imports of the package are checked against each `rule` in the file. A `rule` consists of three parts: + - A `SelectorRegexp`, to select the import paths that the rule applies to. + - A list of `AllowedPrefixes` + - A list of `ForbiddenPrefixes` + +- An import is allowed if it matches at least one allowed prefix and does not match any forbidden prefixes. An example `.import-restrictions` file looks like this: + +```json +{ + "Rules": [ + { + "SelectorRegexp": "k8s[.]io", + "AllowedPrefixes": [ + "k8s.io/gengo/examples", + "k8s.io/kubernetes/third_party" + ], + "ForbiddenPrefixes": [ + "k8s.io/kubernetes/pkg/third_party/deprecated" + ] + }, + { + "SelectorRegexp": "^unsafe$", + "AllowedPrefixes": [ + ], + "ForbiddenPrefixes": [ + "" + ] + } + ] +} +``` +- Take note of `"SelectorRegexp": "k8s[.]io"` in the first block. This specifies that we are applying these rules to the `"k8s.io"` import path. +- The second block explicitly matches the "unsafe" package, and forbids it ("" is a prefix of everything). + +### What are Inverse Rules? + +- In contrast to non-inverse rules, which are defined in importing packages, inverse rules are defined in imported packages. + +- Inverse rules allow for fine-grained import restrictions for "private packages" where we don't want to spread use inside of [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes). + +- If an `.import-restrictions` file is found, then all imports of the package are checked against each `inverse rule` in the file. This check will continue, climbing up the directory tree, until a match is found and accepted. + +- Inverse rules also have a boolean `transitive` option. When this option is true, the import rule is also applied to `transitive` imports. + - `transitive` imports are dependencies not directly depended on by the code, but are needed to run the application. Use this option if you want to apply restrictions to those indirect dependencies. + +```yaml +rules: + - selectorRegexp: k8s[.]io + allowedPrefixes: + - k8s.io/gengo/examples + - k8s.io/kubernetes/third_party + forbiddenPrefixes: + - k8s.io/kubernetes/pkg/third_party/deprecated + - selectorRegexp: ^unsafe$ + forbiddenPrefixes: + - "" +inverseRules: + - selectorRegexp: k8s[.]io + allowedPrefixes: + - k8s.io/same-repo + - k8s.io/kubernetes/pkg/legacy + forbiddenPrefixes: + - k8s.io/kubernetes/pkg/legacy/subpkg + - selectorRegexp: k8s[.]io + transitive: true + forbiddenPrefixes: + - k8s.io/kubernetes/cmd/kubelet + - k8s.io/kubernetes/cmd/kubectl +``` + +## How do I run import-boss within the k/k repo? + +- In order to include _test.go files, make sure to pass in the `include-test-files` flag: + ```sh + hack/verify-import-boss.sh --include-test-files=true + ``` + +- To include other directories, pass in a directory or directories using the `input-dirs` flag: + ```sh + hack/verify-import-boss.sh --input-dirs="k8s.io/kubernetes/test/e2e/framework/..." + ``` + +## Reference + +- [import-boss](https://github.com/kubernetes/gengo/tree/master/examples/import-boss) \ No newline at end of file diff --git a/cmd/code-generator/cmd/import-boss/main.go b/cmd/code-generator/cmd/import-boss/main.go new file mode 100644 index 0000000..3fd0cf8 --- /dev/null +++ b/cmd/code-generator/cmd/import-boss/main.go @@ -0,0 +1,49 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// import-boss enforces import restrictions in a given repository. +package main + +import ( + "os" + "path/filepath" + + "github.com/spf13/pflag" + "k8s.io/code-generator/pkg/util" + "k8s.io/gengo/args" + "k8s.io/gengo/examples/import-boss/generators" + + "k8s.io/klog/v2" +) + +func main() { + klog.InitFlags(nil) + arguments := args.Default() + + // Override defaults. + arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + pflag.CommandLine.BoolVar(&arguments.IncludeTestFiles, "include-test-files", false, "If true, include *_test.go files.") + + if err := arguments.Execute( + generators.NameSystems(), + generators.DefaultNameSystem(), + generators.Packages, + ); err != nil { + klog.Errorf("Error: %v", err) + os.Exit(1) + } + klog.V(2).Info("Completed successfully.") +} diff --git a/cmd/code-generator/cmd/informer-gen/args/args.go b/cmd/code-generator/cmd/informer-gen/args/args.go new file mode 100644 index 0000000..ffd073a --- /dev/null +++ b/cmd/code-generator/cmd/informer-gen/args/args.go @@ -0,0 +1,83 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + "path" + + "github.com/spf13/pflag" + codegenutil "k8s.io/code-generator/pkg/util" + "k8s.io/gengo/args" +) + +// CustomArgs is used by the gengo framework to pass args specific to this generator. +type CustomArgs struct { + VersionedClientSetPackage string + InternalClientSetPackage string + ListersPackage string + SingleDirectory bool + + // PluralExceptions define a list of pluralizer exceptions in Type:PluralType format. + // The default list is "Endpoints:Endpoints" + PluralExceptions []string +} + +// NewDefaults returns default arguments for the generator. +func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { + genericArgs := args.Default().WithoutDefaultFlagParsing() + customArgs := &CustomArgs{ + SingleDirectory: false, + PluralExceptions: []string{"Endpoints:Endpoints"}, + } + genericArgs.CustomArgs = customArgs + + if pkg := codegenutil.CurrentPackage(); len(pkg) != 0 { + genericArgs.OutputPackagePath = path.Join(pkg, "pkg/client/informers") + customArgs.VersionedClientSetPackage = path.Join(pkg, "pkg/client/clientset/versioned") + customArgs.InternalClientSetPackage = path.Join(pkg, "pkg/client/clientset/internalversion") + customArgs.ListersPackage = path.Join(pkg, "pkg/client/listers") + } + + return genericArgs, customArgs +} + +// AddFlags add the generator flags to the flag set. +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { + fs.StringVar(&ca.InternalClientSetPackage, "internal-clientset-package", ca.InternalClientSetPackage, "the full package name for the internal clientset to use") + fs.StringVar(&ca.VersionedClientSetPackage, "versioned-clientset-package", ca.VersionedClientSetPackage, "the full package name for the versioned clientset to use") + fs.StringVar(&ca.ListersPackage, "listers-package", ca.ListersPackage, "the full package name for the listers to use") + fs.BoolVar(&ca.SingleDirectory, "single-directory", ca.SingleDirectory, "if true, omit the intermediate \"internalversion\" and \"externalversions\" subdirectories") + fs.StringSliceVar(&ca.PluralExceptions, "plural-exceptions", ca.PluralExceptions, "list of comma separated plural exception definitions in Type:PluralizedType format") +} + +// Validate checks the given arguments. +func Validate(genericArgs *args.GeneratorArgs) error { + customArgs := genericArgs.CustomArgs.(*CustomArgs) + + if len(genericArgs.OutputPackagePath) == 0 { + return fmt.Errorf("output package cannot be empty") + } + if len(customArgs.VersionedClientSetPackage) == 0 { + return fmt.Errorf("versioned clientset package cannot be empty") + } + if len(customArgs.ListersPackage) == 0 { + return fmt.Errorf("listers package cannot be empty") + } + + return nil +} diff --git a/cmd/code-generator/cmd/informer-gen/generators/factory.go b/cmd/code-generator/cmd/informer-gen/generators/factory.go new file mode 100644 index 0000000..1ee9fa5 --- /dev/null +++ b/cmd/code-generator/cmd/informer-gen/generators/factory.go @@ -0,0 +1,258 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "io" + "path" + + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/klog/v2" +) + +// factoryGenerator produces a file of listers for a given GroupVersion and +// type. +type factoryGenerator struct { + generator.DefaultGen + outputPackage string + imports namer.ImportTracker + groupVersions map[string]clientgentypes.GroupVersions + gvGoNames map[string]string + clientSetPackage string + internalInterfacesPackage string + filtered bool +} + +var _ generator.Generator = &factoryGenerator{} + +func (g *factoryGenerator) Filter(c *generator.Context, t *types.Type) bool { + if !g.filtered { + g.filtered = true + return true + } + return false +} + +func (g *factoryGenerator) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + } +} + +func (g *factoryGenerator) Imports(c *generator.Context) (imports []string) { + imports = append(imports, g.imports.ImportLines()...) + return +} + +func (g *factoryGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "{{", "}}") + + klog.V(5).Infof("processing type %v", t) + + gvInterfaces := make(map[string]*types.Type) + gvNewFuncs := make(map[string]*types.Type) + for groupPkgName := range g.groupVersions { + gvInterfaces[groupPkgName] = c.Universe.Type(types.Name{Package: path.Join(g.outputPackage, groupPkgName), Name: "Interface"}) + gvNewFuncs[groupPkgName] = c.Universe.Function(types.Name{Package: path.Join(g.outputPackage, groupPkgName), Name: "New"}) + } + m := map[string]interface{}{ + "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), + "groupVersions": g.groupVersions, + "gvInterfaces": gvInterfaces, + "gvNewFuncs": gvNewFuncs, + "gvGoNames": g.gvGoNames, + "interfacesNewInformerFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "NewInformerFunc"}), + "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), + "informerFactoryInterface": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "SharedInformerFactory"}), + "clientSetInterface": c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}), + "reflectType": c.Universe.Type(reflectType), + "runtimeObject": c.Universe.Type(runtimeObject), + "schemaGroupVersionResource": c.Universe.Type(schemaGroupVersionResource), + "syncMutex": c.Universe.Type(syncMutex), + "timeDuration": c.Universe.Type(timeDuration), + "namespaceAll": c.Universe.Type(metav1NamespaceAll), + "object": c.Universe.Type(metav1Object), + } + + sw.Do(sharedInformerFactoryStruct, m) + sw.Do(sharedInformerFactoryInterface, m) + + return sw.Error() +} + +var sharedInformerFactoryStruct = ` +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + +type sharedInformerFactory struct { + client {{.clientSetInterface|raw}} + namespace string + tweakListOptions {{.interfacesTweakListOptionsFunc|raw}} + lock {{.syncMutex|raw}} + defaultResync {{.timeDuration|raw}} + customResync map[{{.reflectType|raw}}]{{.timeDuration|raw}} + + informers map[{{.reflectType|raw}}]{{.cacheSharedIndexInformer|raw}} + // startedInformers is used for tracking which informers have been started. + // This allows Start() to be called multiple times safely. + startedInformers map[{{.reflectType|raw}}]bool +} + +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[{{.object|raw}}]{{.timeDuration|raw}}) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. +func NewSharedInformerFactory(client {{.clientSetInterface|raw}}, defaultResync {{.timeDuration|raw}}) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync) +} + +// NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. +// Listers obtained via this SharedInformerFactory will be subject to the same filters +// as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead +func NewFilteredSharedInformerFactory(client {{.clientSetInterface|raw}}, defaultResync {{.timeDuration|raw}}, namespace string, tweakListOptions {{.interfacesTweakListOptionsFunc|raw}}) SharedInformerFactory { + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client {{.clientSetInterface|raw}}, defaultResync {{.timeDuration|raw}}, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ + client: client, + namespace: v1.NamespaceAll, + defaultResync: defaultResync, + informers: make(map[{{.reflectType|raw}}]{{.cacheSharedIndexInformer|raw}}), + startedInformers: make(map[{{.reflectType|raw}}]bool), + customResync: make(map[{{.reflectType|raw}}]{{.timeDuration|raw}}), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) + } + + return factory +} + +// Start initializes all requested informers. +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + go informer.Run(stopCh) + f.startedInformers[informerType] = true + } + } +} + +// WaitForCacheSync waits for all started informers' cache were synced. +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func()map[reflect.Type]cache.SharedIndexInformer{ + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj {{.runtimeObject|raw}}, newFunc {{.interfacesNewInformerFunc|raw}}) {{.cacheSharedIndexInformer|raw}} { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + f.informers[informerType] = informer + + return informer +} + +` + +var sharedInformerFactoryInterface = ` +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +type SharedInformerFactory interface { + {{.informerFactoryInterface|raw}} + ForResource(resource {{.schemaGroupVersionResource|raw}}) (GenericInformer, error) + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + {{$gvInterfaces := .gvInterfaces}} + {{$gvGoNames := .gvGoNames}} + {{range $groupName, $group := .groupVersions}}{{index $gvGoNames $groupName}}() {{index $gvInterfaces $groupName|raw}} + {{end}} +} + +{{$gvNewFuncs := .gvNewFuncs}} +{{$gvGoNames := .gvGoNames}} +{{range $groupPkgName, $group := .groupVersions}} +func (f *sharedInformerFactory) {{index $gvGoNames $groupPkgName}}() {{index $gvInterfaces $groupPkgName|raw}} { + return {{index $gvNewFuncs $groupPkgName|raw}}(f, f.namespace, f.tweakListOptions) +} +{{end}} +` diff --git a/cmd/code-generator/cmd/informer-gen/generators/factoryinterface.go b/cmd/code-generator/cmd/informer-gen/generators/factoryinterface.go new file mode 100644 index 0000000..70826eb --- /dev/null +++ b/cmd/code-generator/cmd/informer-gen/generators/factoryinterface.go @@ -0,0 +1,90 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "io" + + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/klog/v2" +) + +// factoryInterfaceGenerator produces a file of interfaces used to break a dependency cycle for +// informer registration +type factoryInterfaceGenerator struct { + generator.DefaultGen + outputPackage string + imports namer.ImportTracker + clientSetPackage string + filtered bool +} + +var _ generator.Generator = &factoryInterfaceGenerator{} + +func (g *factoryInterfaceGenerator) Filter(c *generator.Context, t *types.Type) bool { + if !g.filtered { + g.filtered = true + return true + } + return false +} + +func (g *factoryInterfaceGenerator) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + } +} + +func (g *factoryInterfaceGenerator) Imports(c *generator.Context) (imports []string) { + imports = append(imports, g.imports.ImportLines()...) + return +} + +func (g *factoryInterfaceGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "{{", "}}") + + klog.V(5).Infof("processing type %v", t) + + m := map[string]interface{}{ + "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), + "clientSetPackage": c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}), + "runtimeObject": c.Universe.Type(runtimeObject), + "timeDuration": c.Universe.Type(timeDuration), + "v1ListOptions": c.Universe.Type(v1ListOptions), + } + + sw.Do(externalSharedInformerFactoryInterface, m) + + return sw.Error() +} + +var externalSharedInformerFactoryInterface = ` +// NewInformerFunc takes {{.clientSetPackage|raw}} and {{.timeDuration|raw}} to return a SharedIndexInformer. +type NewInformerFunc func({{.clientSetPackage|raw}}, {{.timeDuration|raw}}) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj {{.runtimeObject|raw}}, newFunc NewInformerFunc) {{.cacheSharedIndexInformer|raw}} +} + +// TweakListOptionsFunc is a function that transforms a {{.v1ListOptions|raw}}. +type TweakListOptionsFunc func(*{{.v1ListOptions|raw}}) +` diff --git a/cmd/code-generator/cmd/informer-gen/generators/generic.go b/cmd/code-generator/cmd/informer-gen/generators/generic.go new file mode 100644 index 0000000..a5a4295 --- /dev/null +++ b/cmd/code-generator/cmd/informer-gen/generators/generic.go @@ -0,0 +1,184 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "io" + "sort" + "strings" + + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" + codegennamer "k8s.io/code-generator/pkg/namer" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" +) + +// genericGenerator generates the generic informer. +type genericGenerator struct { + generator.DefaultGen + outputPackage string + imports namer.ImportTracker + groupVersions map[string]clientgentypes.GroupVersions + groupGoNames map[string]string + pluralExceptions map[string]string + typesForGroupVersion map[clientgentypes.GroupVersion][]*types.Type + filtered bool +} + +var _ generator.Generator = &genericGenerator{} + +func (g *genericGenerator) Filter(c *generator.Context, t *types.Type) bool { + if !g.filtered { + g.filtered = true + return true + } + return false +} + +func (g *genericGenerator) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + "allLowercasePlural": namer.NewAllLowercasePluralNamer(g.pluralExceptions), + "publicPlural": namer.NewPublicPluralNamer(g.pluralExceptions), + "resource": codegennamer.NewTagOverrideNamer("resourceName", namer.NewAllLowercasePluralNamer(g.pluralExceptions)), + } +} + +func (g *genericGenerator) Imports(c *generator.Context) (imports []string) { + imports = append(imports, g.imports.ImportLines()...) + imports = append(imports, "fmt") + return +} + +type group struct { + GroupGoName string + Name string + Versions []*version +} + +type groupSort []group + +func (g groupSort) Len() int { return len(g) } +func (g groupSort) Less(i, j int) bool { + return strings.ToLower(g[i].Name) < strings.ToLower(g[j].Name) +} +func (g groupSort) Swap(i, j int) { g[i], g[j] = g[j], g[i] } + +type version struct { + Name string + GoName string + Resources []*types.Type +} + +type versionSort []*version + +func (v versionSort) Len() int { return len(v) } +func (v versionSort) Less(i, j int) bool { + return strings.ToLower(v[i].Name) < strings.ToLower(v[j].Name) +} +func (v versionSort) Swap(i, j int) { v[i], v[j] = v[j], v[i] } + +func (g *genericGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "{{", "}}") + + groups := []group{} + schemeGVs := make(map[*version]*types.Type) + + orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} + for groupPackageName, groupVersions := range g.groupVersions { + group := group{ + GroupGoName: g.groupGoNames[groupPackageName], + Name: groupVersions.Group.NonEmpty(), + Versions: []*version{}, + } + for _, v := range groupVersions.Versions { + gv := clientgentypes.GroupVersion{Group: groupVersions.Group, Version: v.Version} + version := &version{ + Name: v.Version.NonEmpty(), + GoName: namer.IC(v.Version.NonEmpty()), + Resources: orderer.OrderTypes(g.typesForGroupVersion[gv]), + } + func() { + schemeGVs[version] = c.Universe.Variable(types.Name{Package: g.typesForGroupVersion[gv][0].Name.Package, Name: "SchemeGroupVersion"}) + }() + group.Versions = append(group.Versions, version) + } + sort.Sort(versionSort(group.Versions)) + groups = append(groups, group) + } + sort.Sort(groupSort(groups)) + + m := map[string]interface{}{ + "cacheGenericLister": c.Universe.Type(cacheGenericLister), + "cacheNewGenericLister": c.Universe.Function(cacheNewGenericLister), + "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), + "groups": groups, + "schemeGVs": schemeGVs, + "schemaGroupResource": c.Universe.Type(schemaGroupResource), + "schemaGroupVersionResource": c.Universe.Type(schemaGroupVersionResource), + } + + sw.Do(genericInformer, m) + sw.Do(forResource, m) + + return sw.Error() +} + +var genericInformer = ` +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() {{.cacheSharedIndexInformer|raw}} + Lister() {{.cacheGenericLister|raw}} +} + +type genericInformer struct { + informer {{.cacheSharedIndexInformer|raw}} + resource {{.schemaGroupResource|raw}} +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() {{.cacheSharedIndexInformer|raw}} { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() {{.cacheGenericLister|raw}} { + return {{.cacheNewGenericLister|raw}}(f.Informer().GetIndexer(), f.resource) +} +` + +var forResource = ` +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource {{.schemaGroupVersionResource|raw}}) (GenericInformer, error) { + switch resource { + {{range $group := .groups -}}{{$GroupGoName := .GroupGoName -}} + {{range $version := .Versions -}} + // Group={{$group.Name}}, Version={{.Name}} + {{range .Resources -}} + case {{index $.schemeGVs $version|raw}}.WithResource("{{.|resource}}"): + return &genericInformer{resource: resource.GroupResource(), informer: f.{{$GroupGoName}}().{{$version.GoName}}().{{.|publicPlural}}().Informer()}, nil + {{end}} + {{end}} + {{end -}} + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} +` diff --git a/cmd/code-generator/cmd/informer-gen/generators/groupinterface.go b/cmd/code-generator/cmd/informer-gen/generators/groupinterface.go new file mode 100644 index 0000000..0bba93c --- /dev/null +++ b/cmd/code-generator/cmd/informer-gen/generators/groupinterface.go @@ -0,0 +1,118 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "io" + "path/filepath" + "strings" + + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" +) + +// groupInterfaceGenerator generates the per-group interface file. +type groupInterfaceGenerator struct { + generator.DefaultGen + outputPackage string + imports namer.ImportTracker + groupVersions clientgentypes.GroupVersions + filtered bool + internalInterfacesPackage string +} + +var _ generator.Generator = &groupInterfaceGenerator{} + +func (g *groupInterfaceGenerator) Filter(c *generator.Context, t *types.Type) bool { + if !g.filtered { + g.filtered = true + return true + } + return false +} + +func (g *groupInterfaceGenerator) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + } +} + +func (g *groupInterfaceGenerator) Imports(c *generator.Context) (imports []string) { + imports = append(imports, g.imports.ImportLines()...) + return +} + +type versionData struct { + Name string + Interface *types.Type + New *types.Type +} + +func (g *groupInterfaceGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "$", "$") + + versions := make([]versionData, 0, len(g.groupVersions.Versions)) + for _, version := range g.groupVersions.Versions { + gv := clientgentypes.GroupVersion{Group: g.groupVersions.Group, Version: version.Version} + versionPackage := filepath.Join(g.outputPackage, strings.ToLower(gv.Version.NonEmpty())) + iface := c.Universe.Type(types.Name{Package: versionPackage, Name: "Interface"}) + versions = append(versions, versionData{ + Name: namer.IC(version.Version.NonEmpty()), + Interface: iface, + New: c.Universe.Function(types.Name{Package: versionPackage, Name: "New"}), + }) + } + m := map[string]interface{}{ + "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), + "interfacesSharedInformerFactory": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "SharedInformerFactory"}), + "versions": versions, + } + + sw.Do(groupTemplate, m) + + return sw.Error() +} + +var groupTemplate = ` +// Interface provides access to each of this group's versions. +type Interface interface { + $range .versions -$ + // $.Name$ provides access to shared informers for resources in $.Name$. + $.Name$() $.Interface|raw$ + $end$ +} + +type group struct { + factory $.interfacesSharedInformerFactory|raw$ + namespace string + tweakListOptions $.interfacesTweakListOptionsFunc|raw$ +} + +// New returns a new Interface. +func New(f $.interfacesSharedInformerFactory|raw$, namespace string, tweakListOptions $.interfacesTweakListOptionsFunc|raw$) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +$range .versions$ +// $.Name$ returns a new $.Interface|raw$. +func (g *group) $.Name$() $.Interface|raw$ { + return $.New|raw$(g.factory, g.namespace, g.tweakListOptions) +} +$end$ +` diff --git a/cmd/code-generator/cmd/informer-gen/generators/informer.go b/cmd/code-generator/cmd/informer-gen/generators/informer.go new file mode 100644 index 0000000..da00e6e --- /dev/null +++ b/cmd/code-generator/cmd/informer-gen/generators/informer.go @@ -0,0 +1,186 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "fmt" + "io" + "strings" + + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/code-generator/cmd/client-gen/generators/util" + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" + + "k8s.io/klog/v2" +) + +// informerGenerator produces a file of listers for a given GroupVersion and +// type. +type informerGenerator struct { + generator.DefaultGen + outputPackage string + groupPkgName string + groupVersion clientgentypes.GroupVersion + groupGoName string + typeToGenerate *types.Type + imports namer.ImportTracker + clientSetPackage string + listersPackage string + internalInterfacesPackage string +} + +var _ generator.Generator = &informerGenerator{} + +func (g *informerGenerator) Filter(c *generator.Context, t *types.Type) bool { + return t == g.typeToGenerate +} + +func (g *informerGenerator) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + } +} + +func (g *informerGenerator) Imports(c *generator.Context) (imports []string) { + imports = append(imports, g.imports.ImportLines()...) + return +} + +func (g *informerGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "$", "$") + + klog.V(5).Infof("processing type %v", t) + + listerPackage := fmt.Sprintf("%s/%s/%s", g.listersPackage, g.groupPkgName, strings.ToLower(g.groupVersion.Version.NonEmpty())) + clientSetInterface := c.Universe.Type(types.Name{Package: g.clientSetPackage, Name: "Interface"}) + informerFor := "InformerFor" + + tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) + if err != nil { + return err + } + + m := map[string]interface{}{ + "apiScheme": c.Universe.Type(apiScheme), + "cacheIndexers": c.Universe.Type(cacheIndexers), + "cacheListWatch": c.Universe.Type(cacheListWatch), + "cacheMetaNamespaceIndexFunc": c.Universe.Function(cacheMetaNamespaceIndexFunc), + "cacheNamespaceIndex": c.Universe.Variable(cacheNamespaceIndex), + "cacheNewSharedIndexInformer": c.Universe.Function(cacheNewSharedIndexInformer), + "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), + "clientSetInterface": clientSetInterface, + "group": namer.IC(g.groupGoName), + "informerFor": informerFor, + "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), + "interfacesSharedInformerFactory": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "SharedInformerFactory"}), + "listOptions": c.Universe.Type(listOptions), + "lister": c.Universe.Type(types.Name{Package: listerPackage, Name: t.Name.Name + "Lister"}), + "namespaceAll": c.Universe.Type(metav1NamespaceAll), + "namespaced": !tags.NonNamespaced, + "newLister": c.Universe.Function(types.Name{Package: listerPackage, Name: "New" + t.Name.Name + "Lister"}), + "runtimeObject": c.Universe.Type(runtimeObject), + "timeDuration": c.Universe.Type(timeDuration), + "type": t, + "v1ListOptions": c.Universe.Type(v1ListOptions), + "version": namer.IC(g.groupVersion.Version.String()), + "watchInterface": c.Universe.Type(watchInterface), + } + + sw.Do(typeInformerInterface, m) + sw.Do(typeInformerStruct, m) + sw.Do(typeInformerPublicConstructor, m) + sw.Do(typeFilteredInformerPublicConstructor, m) + sw.Do(typeInformerConstructor, m) + sw.Do(typeInformerInformer, m) + sw.Do(typeInformerLister, m) + + return sw.Error() +} + +var typeInformerInterface = ` +// $.type|public$Informer provides access to a shared informer and lister for +// $.type|publicPlural$. +type $.type|public$Informer interface { + Informer() $.cacheSharedIndexInformer|raw$ + Lister() $.lister|raw$ +} +` + +var typeInformerStruct = ` +type $.type|private$Informer struct { + factory $.interfacesSharedInformerFactory|raw$ + tweakListOptions $.interfacesTweakListOptionsFunc|raw$ + $if .namespaced$namespace string$end$ +} +` + +var typeInformerPublicConstructor = ` +// New$.type|public$Informer constructs a new informer for $.type|public$ type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func New$.type|public$Informer(client $.clientSetInterface|raw$$if .namespaced$, namespace string$end$, resyncPeriod $.timeDuration|raw$, indexers $.cacheIndexers|raw$) $.cacheSharedIndexInformer|raw$ { + return NewFiltered$.type|public$Informer(client$if .namespaced$, namespace$end$, resyncPeriod, indexers, nil) +} +` + +var typeFilteredInformerPublicConstructor = ` +// NewFiltered$.type|public$Informer constructs a new informer for $.type|public$ type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFiltered$.type|public$Informer(client $.clientSetInterface|raw$$if .namespaced$, namespace string$end$, resyncPeriod $.timeDuration|raw$, indexers $.cacheIndexers|raw$, tweakListOptions $.interfacesTweakListOptionsFunc|raw$) $.cacheSharedIndexInformer|raw$ { + return $.cacheNewSharedIndexInformer|raw$( + &$.cacheListWatch|raw${ + ListFunc: func(options $.v1ListOptions|raw$) ($.runtimeObject|raw$, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.$.group$$.version$().$.type|publicPlural$($if .namespaced$namespace$end$).List(context.TODO(), options) + }, + WatchFunc: func(options $.v1ListOptions|raw$) ($.watchInterface|raw$, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.$.group$$.version$().$.type|publicPlural$($if .namespaced$namespace$end$).Watch(context.TODO(), options) + }, + }, + &$.type|raw${}, + resyncPeriod, + indexers, + ) +} +` + +var typeInformerConstructor = ` +func (f *$.type|private$Informer) defaultInformer(client $.clientSetInterface|raw$, resyncPeriod $.timeDuration|raw$) $.cacheSharedIndexInformer|raw$ { + return NewFiltered$.type|public$Informer(client$if .namespaced$, f.namespace$end$, resyncPeriod, $.cacheIndexers|raw${$.cacheNamespaceIndex|raw$: $.cacheMetaNamespaceIndexFunc|raw$}, f.tweakListOptions) +} +` + +var typeInformerInformer = ` +func (f *$.type|private$Informer) Informer() $.cacheSharedIndexInformer|raw$ { + return f.factory.$.informerFor$(&$.type|raw${}, f.defaultInformer) +} +` + +var typeInformerLister = ` +func (f *$.type|private$Informer) Lister() $.lister|raw$ { + return $.newLister|raw$(f.Informer().GetIndexer()) +} +` diff --git a/cmd/code-generator/cmd/informer-gen/generators/packages.go b/cmd/code-generator/cmd/informer-gen/generators/packages.go new file mode 100644 index 0000000..dd2c9cc --- /dev/null +++ b/cmd/code-generator/cmd/informer-gen/generators/packages.go @@ -0,0 +1,347 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "fmt" + "path" + "path/filepath" + "strings" + + "k8s.io/gengo/args" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + "k8s.io/klog/v2" + + "k8s.io/code-generator/cmd/client-gen/generators/util" + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" + informergenargs "k8s.io/code-generator/cmd/informer-gen/args" + genutil "k8s.io/code-generator/pkg/util" +) + +// NameSystems returns the name system used by the generators in this package. +func NameSystems(pluralExceptions map[string]string) namer.NameSystems { + return namer.NameSystems{ + "public": namer.NewPublicNamer(0), + "private": namer.NewPrivateNamer(0), + "raw": namer.NewRawNamer("", nil), + "publicPlural": namer.NewPublicPluralNamer(pluralExceptions), + "allLowercasePlural": namer.NewAllLowercasePluralNamer(pluralExceptions), + "lowercaseSingular": &lowercaseSingularNamer{}, + } +} + +// lowercaseSingularNamer implements Namer +type lowercaseSingularNamer struct{} + +// Name returns t's name in all lowercase. +func (n *lowercaseSingularNamer) Name(t *types.Type) string { + return strings.ToLower(t.Name.Name) +} + +// DefaultNameSystem returns the default name system for ordering the types to be +// processed by the generators in this package. +func DefaultNameSystem() string { + return "public" +} + +// objectMetaForPackage returns the type of ObjectMeta used by package p. +func objectMetaForPackage(p *types.Package) (*types.Type, bool, error) { + generatingForPackage := false + for _, t := range p.Types { + if !util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).GenerateClient { + continue + } + generatingForPackage = true + for _, member := range t.Members { + if member.Name == "ObjectMeta" { + return member.Type, isInternal(member), nil + } + } + } + if generatingForPackage { + return nil, false, fmt.Errorf("unable to find ObjectMeta for any types in package %s", p.Path) + } + return nil, false, nil +} + +// isInternal returns true if the tags for a member do not contain a json tag +func isInternal(m types.Member) bool { + return !strings.Contains(m.Tags, "json") +} + +func packageForInternalInterfaces(base string) string { + return filepath.Join(base, "internalinterfaces") +} + +// Packages makes the client package definition. +func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { + boilerplate, err := arguments.LoadGoBoilerplate() + if err != nil { + klog.Fatalf("Failed loading boilerplate: %v", err) + } + + customArgs, ok := arguments.CustomArgs.(*informergenargs.CustomArgs) + if !ok { + klog.Fatalf("Wrong CustomArgs type: %T", arguments.CustomArgs) + } + + internalVersionPackagePath := filepath.Join(arguments.OutputPackagePath) + externalVersionPackagePath := filepath.Join(arguments.OutputPackagePath) + if !customArgs.SingleDirectory { + internalVersionPackagePath = filepath.Join(arguments.OutputPackagePath, "internalversion") + externalVersionPackagePath = filepath.Join(arguments.OutputPackagePath, "externalversions") + } + + var packageList generator.Packages + typesForGroupVersion := make(map[clientgentypes.GroupVersion][]*types.Type) + + externalGroupVersions := make(map[string]clientgentypes.GroupVersions) + internalGroupVersions := make(map[string]clientgentypes.GroupVersions) + groupGoNames := make(map[string]string) + for _, inputDir := range arguments.InputDirs { + p := context.Universe.Package(genutil.Vendorless(inputDir)) + + objectMeta, internal, err := objectMetaForPackage(p) + if err != nil { + klog.Fatal(err) + } + if objectMeta == nil { + // no types in this package had genclient + continue + } + + var gv clientgentypes.GroupVersion + var targetGroupVersions map[string]clientgentypes.GroupVersions + + if internal { + lastSlash := strings.LastIndex(p.Path, "/") + if lastSlash == -1 { + klog.Fatalf("error constructing internal group version for package %q", p.Path) + } + gv.Group = clientgentypes.Group(p.Path[lastSlash+1:]) + targetGroupVersions = internalGroupVersions + } else { + parts := strings.Split(p.Path, "/") + gv.Group = clientgentypes.Group(parts[len(parts)-2]) + gv.Version = clientgentypes.Version(parts[len(parts)-1]) + targetGroupVersions = externalGroupVersions + } + groupPackageName := gv.Group.NonEmpty() + gvPackage := path.Clean(p.Path) + + // If there's a comment of the form "// +groupName=somegroup" or + // "// +groupName=somegroup.foo.bar.io", use the first field (somegroup) as the name of the + // group when generating. + if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { + gv.Group = clientgentypes.Group(override[0]) + } + + // If there's a comment of the form "// +groupGoName=SomeUniqueShortName", use that as + // the Go group identifier in CamelCase. It defaults + groupGoNames[groupPackageName] = namer.IC(strings.Split(gv.Group.NonEmpty(), ".")[0]) + if override := types.ExtractCommentTags("+", p.Comments)["groupGoName"]; override != nil { + groupGoNames[groupPackageName] = namer.IC(override[0]) + } + + var typesToGenerate []*types.Type + for _, t := range p.Types { + tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) + if !tags.GenerateClient || tags.NoVerbs || !tags.HasVerb("list") || !tags.HasVerb("watch") { + continue + } + + typesToGenerate = append(typesToGenerate, t) + + if _, ok := typesForGroupVersion[gv]; !ok { + typesForGroupVersion[gv] = []*types.Type{} + } + typesForGroupVersion[gv] = append(typesForGroupVersion[gv], t) + } + if len(typesToGenerate) == 0 { + continue + } + + groupVersionsEntry, ok := targetGroupVersions[groupPackageName] + if !ok { + groupVersionsEntry = clientgentypes.GroupVersions{ + PackageName: groupPackageName, + Group: gv.Group, + } + } + groupVersionsEntry.Versions = append(groupVersionsEntry.Versions, clientgentypes.PackageVersion{Version: gv.Version, Package: gvPackage}) + targetGroupVersions[groupPackageName] = groupVersionsEntry + + orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} + typesToGenerate = orderer.OrderTypes(typesToGenerate) + + if internal { + packageList = append(packageList, versionPackage(internalVersionPackagePath, groupPackageName, gv, groupGoNames[groupPackageName], boilerplate, typesToGenerate, customArgs.InternalClientSetPackage, customArgs.ListersPackage)) + } else { + packageList = append(packageList, versionPackage(externalVersionPackagePath, groupPackageName, gv, groupGoNames[groupPackageName], boilerplate, typesToGenerate, customArgs.VersionedClientSetPackage, customArgs.ListersPackage)) + } + } + + if len(externalGroupVersions) != 0 { + packageList = append(packageList, factoryInterfacePackage(externalVersionPackagePath, boilerplate, customArgs.VersionedClientSetPackage)) + packageList = append(packageList, factoryPackage(externalVersionPackagePath, boilerplate, groupGoNames, genutil.PluralExceptionListToMapOrDie(customArgs.PluralExceptions), externalGroupVersions, + customArgs.VersionedClientSetPackage, + typesForGroupVersion)) + for _, gvs := range externalGroupVersions { + packageList = append(packageList, groupPackage(externalVersionPackagePath, gvs, boilerplate)) + } + } + + if len(internalGroupVersions) != 0 { + packageList = append(packageList, factoryInterfacePackage(internalVersionPackagePath, boilerplate, customArgs.InternalClientSetPackage)) + packageList = append(packageList, factoryPackage(internalVersionPackagePath, boilerplate, groupGoNames, genutil.PluralExceptionListToMapOrDie(customArgs.PluralExceptions), internalGroupVersions, customArgs.InternalClientSetPackage, typesForGroupVersion)) + for _, gvs := range internalGroupVersions { + packageList = append(packageList, groupPackage(internalVersionPackagePath, gvs, boilerplate)) + } + } + + return packageList +} + +func factoryPackage(basePackage string, boilerplate []byte, groupGoNames, pluralExceptions map[string]string, groupVersions map[string]clientgentypes.GroupVersions, clientSetPackage string, + typesForGroupVersion map[clientgentypes.GroupVersion][]*types.Type) generator.Package { + return &generator.DefaultPackage{ + PackageName: filepath.Base(basePackage), + PackagePath: basePackage, + HeaderText: boilerplate, + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + generators = append(generators, &factoryGenerator{ + DefaultGen: generator.DefaultGen{ + OptionalName: "factory", + }, + outputPackage: basePackage, + imports: generator.NewImportTracker(), + groupVersions: groupVersions, + clientSetPackage: clientSetPackage, + internalInterfacesPackage: packageForInternalInterfaces(basePackage), + gvGoNames: groupGoNames, + }) + + generators = append(generators, &genericGenerator{ + DefaultGen: generator.DefaultGen{ + OptionalName: "generic", + }, + outputPackage: basePackage, + imports: generator.NewImportTracker(), + groupVersions: groupVersions, + pluralExceptions: pluralExceptions, + typesForGroupVersion: typesForGroupVersion, + groupGoNames: groupGoNames, + }) + + return generators + }, + } +} + +func factoryInterfacePackage(basePackage string, boilerplate []byte, clientSetPackage string) generator.Package { + packagePath := packageForInternalInterfaces(basePackage) + + return &generator.DefaultPackage{ + PackageName: filepath.Base(packagePath), + PackagePath: packagePath, + HeaderText: boilerplate, + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + generators = append(generators, &factoryInterfaceGenerator{ + DefaultGen: generator.DefaultGen{ + OptionalName: "factory_interfaces", + }, + outputPackage: packagePath, + imports: generator.NewImportTracker(), + clientSetPackage: clientSetPackage, + }) + + return generators + }, + } +} + +func groupPackage(basePackage string, groupVersions clientgentypes.GroupVersions, boilerplate []byte) generator.Package { + packagePath := filepath.Join(basePackage, groupVersions.PackageName) + groupPkgName := strings.Split(string(groupVersions.PackageName), ".")[0] + + return &generator.DefaultPackage{ + PackageName: groupPkgName, + PackagePath: packagePath, + HeaderText: boilerplate, + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + generators = append(generators, &groupInterfaceGenerator{ + DefaultGen: generator.DefaultGen{ + OptionalName: "interface", + }, + outputPackage: packagePath, + groupVersions: groupVersions, + imports: generator.NewImportTracker(), + internalInterfacesPackage: packageForInternalInterfaces(basePackage), + }) + return generators + }, + FilterFunc: func(c *generator.Context, t *types.Type) bool { + tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) + return tags.GenerateClient && tags.HasVerb("list") && tags.HasVerb("watch") + }, + } +} + +func versionPackage(basePackage string, groupPkgName string, gv clientgentypes.GroupVersion, groupGoName string, boilerplate []byte, typesToGenerate []*types.Type, clientSetPackage, listersPackage string) generator.Package { + packagePath := filepath.Join(basePackage, groupPkgName, strings.ToLower(gv.Version.NonEmpty())) + + return &generator.DefaultPackage{ + PackageName: strings.ToLower(gv.Version.NonEmpty()), + PackagePath: packagePath, + HeaderText: boilerplate, + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + generators = append(generators, &versionInterfaceGenerator{ + DefaultGen: generator.DefaultGen{ + OptionalName: "interface", + }, + outputPackage: packagePath, + imports: generator.NewImportTracker(), + types: typesToGenerate, + internalInterfacesPackage: packageForInternalInterfaces(basePackage), + }) + + for _, t := range typesToGenerate { + generators = append(generators, &informerGenerator{ + DefaultGen: generator.DefaultGen{ + OptionalName: strings.ToLower(t.Name.Name), + }, + outputPackage: packagePath, + groupPkgName: groupPkgName, + groupVersion: gv, + groupGoName: groupGoName, + typeToGenerate: t, + imports: generator.NewImportTracker(), + clientSetPackage: clientSetPackage, + listersPackage: listersPackage, + internalInterfacesPackage: packageForInternalInterfaces(basePackage), + }) + } + return generators + }, + FilterFunc: func(c *generator.Context, t *types.Type) bool { + tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) + return tags.GenerateClient && tags.HasVerb("list") && tags.HasVerb("watch") + }, + } +} diff --git a/cmd/code-generator/cmd/informer-gen/generators/types.go b/cmd/code-generator/cmd/informer-gen/generators/types.go new file mode 100644 index 0000000..27d4bd5 --- /dev/null +++ b/cmd/code-generator/cmd/informer-gen/generators/types.go @@ -0,0 +1,42 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import "k8s.io/gengo/types" + +var ( + apiScheme = types.Name{Package: "k8s.io/kubernetes/pkg/api/legacyscheme", Name: "Scheme"} + cacheGenericLister = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "GenericLister"} + cacheIndexers = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "Indexers"} + cacheListWatch = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "ListWatch"} + cacheMetaNamespaceIndexFunc = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "MetaNamespaceIndexFunc"} + cacheNamespaceIndex = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "NamespaceIndex"} + cacheNewGenericLister = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "NewGenericLister"} + cacheNewSharedIndexInformer = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "NewSharedIndexInformer"} + cacheSharedIndexInformer = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "SharedIndexInformer"} + listOptions = types.Name{Package: "k8s.io/kubernetes/pkg/apis/core", Name: "ListOptions"} + reflectType = types.Name{Package: "reflect", Name: "Type"} + runtimeObject = types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "Object"} + schemaGroupResource = types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupResource"} + schemaGroupVersionResource = types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersionResource"} + syncMutex = types.Name{Package: "sync", Name: "Mutex"} + timeDuration = types.Name{Package: "time", Name: "Duration"} + v1ListOptions = types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"} + metav1NamespaceAll = types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "NamespaceAll"} + metav1Object = types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "Object"} + watchInterface = types.Name{Package: "k8s.io/apimachinery/pkg/watch", Name: "Interface"} +) diff --git a/cmd/code-generator/cmd/informer-gen/generators/versioninterface.go b/cmd/code-generator/cmd/informer-gen/generators/versioninterface.go new file mode 100644 index 0000000..3b51f8d --- /dev/null +++ b/cmd/code-generator/cmd/informer-gen/generators/versioninterface.go @@ -0,0 +1,109 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "io" + + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/code-generator/cmd/client-gen/generators/util" +) + +// versionInterfaceGenerator generates the per-version interface file. +type versionInterfaceGenerator struct { + generator.DefaultGen + outputPackage string + imports namer.ImportTracker + types []*types.Type + filtered bool + internalInterfacesPackage string +} + +var _ generator.Generator = &versionInterfaceGenerator{} + +func (g *versionInterfaceGenerator) Filter(c *generator.Context, t *types.Type) bool { + if !g.filtered { + g.filtered = true + return true + } + return false +} + +func (g *versionInterfaceGenerator) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + } +} + +func (g *versionInterfaceGenerator) Imports(c *generator.Context) (imports []string) { + imports = append(imports, g.imports.ImportLines()...) + return +} + +func (g *versionInterfaceGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "$", "$") + + m := map[string]interface{}{ + "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), + "interfacesSharedInformerFactory": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "SharedInformerFactory"}), + "types": g.types, + } + + sw.Do(versionTemplate, m) + for _, typeDef := range g.types { + tags, err := util.ParseClientGenTags(append(typeDef.SecondClosestCommentLines, typeDef.CommentLines...)) + if err != nil { + return err + } + m["namespaced"] = !tags.NonNamespaced + m["type"] = typeDef + sw.Do(versionFuncTemplate, m) + } + + return sw.Error() +} + +var versionTemplate = ` +// Interface provides access to all the informers in this group version. +type Interface interface { + $range .types -$ + // $.|publicPlural$ returns a $.|public$Informer. + $.|publicPlural$() $.|public$Informer + $end$ +} + +type version struct { + factory $.interfacesSharedInformerFactory|raw$ + namespace string + tweakListOptions $.interfacesTweakListOptionsFunc|raw$ +} + +// New returns a new Interface. +func New(f $.interfacesSharedInformerFactory|raw$, namespace string, tweakListOptions $.interfacesTweakListOptionsFunc|raw$) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} +` + +var versionFuncTemplate = ` +// $.type|publicPlural$ returns a $.type|public$Informer. +func (v *version) $.type|publicPlural$() $.type|public$Informer { + return &$.type|private$Informer{factory: v.factory$if .namespaced$, namespace: v.namespace$end$, tweakListOptions: v.tweakListOptions} +} +` diff --git a/cmd/code-generator/cmd/informer-gen/main.go b/cmd/code-generator/cmd/informer-gen/main.go new file mode 100644 index 0000000..6148296 --- /dev/null +++ b/cmd/code-generator/cmd/informer-gen/main.go @@ -0,0 +1,63 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "flag" + "path/filepath" + + "github.com/spf13/pflag" + "k8s.io/code-generator/cmd/informer-gen/generators" + "k8s.io/code-generator/pkg/util" + "k8s.io/gengo/args" + "k8s.io/klog/v2" + + generatorargs "k8s.io/code-generator/cmd/informer-gen/args" +) + +func main() { + klog.InitFlags(nil) + genericArgs, customArgs := generatorargs.NewDefaults() + + // Override defaults. + // TODO: move out of informer-gen + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + genericArgs.OutputPackagePath = "k8s.io/kubernetes/pkg/client/informers/informers_generated" + customArgs.VersionedClientSetPackage = "k8s.io/kubernetes/pkg/client/clientset_generated/clientset" + customArgs.InternalClientSetPackage = "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + customArgs.ListersPackage = "k8s.io/kubernetes/pkg/client/listers" + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + if err := generatorargs.Validate(genericArgs); err != nil { + klog.Fatalf("Error: %v", err) + } + + // Run it. + if err := genericArgs.Execute( + generators.NameSystems(util.PluralExceptionListToMapOrDie(customArgs.PluralExceptions)), + generators.DefaultNameSystem(), + generators.Packages, + ); err != nil { + klog.Fatalf("Error: %v", err) + } + klog.V(2).Info("Completed successfully.") +} diff --git a/cmd/code-generator/cmd/lister-gen/args/args.go b/cmd/code-generator/cmd/lister-gen/args/args.go new file mode 100644 index 0000000..1703345 --- /dev/null +++ b/cmd/code-generator/cmd/lister-gen/args/args.go @@ -0,0 +1,64 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + "path" + + "github.com/spf13/pflag" + codegenutil "k8s.io/code-generator/pkg/util" + "k8s.io/gengo/args" +) + +// CustomArgs is used by the gengo framework to pass args specific to this generator. +type CustomArgs struct { + // PluralExceptions specify list of exceptions used when pluralizing certain types. + // For example 'Endpoints:Endpoints', otherwise the pluralizer will generate 'Endpointes'. + PluralExceptions []string +} + +// NewDefaults returns default arguments for the generator. +func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { + genericArgs := args.Default().WithoutDefaultFlagParsing() + customArgs := &CustomArgs{ + PluralExceptions: []string{"Endpoints:Endpoints"}, + } + genericArgs.CustomArgs = customArgs + + if pkg := codegenutil.CurrentPackage(); len(pkg) != 0 { + genericArgs.OutputPackagePath = path.Join(pkg, "pkg/client/listers") + } + + return genericArgs, customArgs +} + +// AddFlags add the generator flags to the flag set. +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { + fs.StringSliceVar(&ca.PluralExceptions, "plural-exceptions", ca.PluralExceptions, "list of comma separated plural exception definitions in Type:PluralizedType format") +} + +// Validate checks the given arguments. +func Validate(genericArgs *args.GeneratorArgs) error { + _ = genericArgs.CustomArgs.(*CustomArgs) + + if len(genericArgs.OutputPackagePath) == 0 { + return fmt.Errorf("output package cannot be empty") + } + + return nil +} diff --git a/cmd/code-generator/cmd/lister-gen/generators/expansion.go b/cmd/code-generator/cmd/lister-gen/generators/expansion.go new file mode 100644 index 0000000..dd45d77 --- /dev/null +++ b/cmd/code-generator/cmd/lister-gen/generators/expansion.go @@ -0,0 +1,67 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "io" + "os" + "path/filepath" + "strings" + + "k8s.io/gengo/generator" + "k8s.io/gengo/types" + + "k8s.io/code-generator/cmd/client-gen/generators/util" +) + +// expansionGenerator produces a file for a expansion interfaces. +type expansionGenerator struct { + generator.DefaultGen + packagePath string + types []*types.Type +} + +// We only want to call GenerateType() once per group. +func (g *expansionGenerator) Filter(c *generator.Context, t *types.Type) bool { + return t == g.types[0] +} + +func (g *expansionGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "$", "$") + for _, t := range g.types { + tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) + if _, err := os.Stat(filepath.Join(g.packagePath, strings.ToLower(t.Name.Name+"_expansion.go"))); os.IsNotExist(err) { + sw.Do(expansionInterfaceTemplate, t) + if !tags.NonNamespaced { + sw.Do(namespacedExpansionInterfaceTemplate, t) + } + } + } + return sw.Error() +} + +var expansionInterfaceTemplate = ` +// $.|public$ListerExpansion allows custom methods to be added to +// $.|public$Lister. +type $.|public$ListerExpansion interface {} +` + +var namespacedExpansionInterfaceTemplate = ` +// $.|public$NamespaceListerExpansion allows custom methods to be added to +// $.|public$NamespaceLister. +type $.|public$NamespaceListerExpansion interface {} +` diff --git a/cmd/code-generator/cmd/lister-gen/generators/lister.go b/cmd/code-generator/cmd/lister-gen/generators/lister.go new file mode 100644 index 0000000..496145b --- /dev/null +++ b/cmd/code-generator/cmd/lister-gen/generators/lister.go @@ -0,0 +1,376 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "fmt" + "io" + "path/filepath" + "strings" + + "k8s.io/gengo/args" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/code-generator/cmd/client-gen/generators/util" + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" + + "k8s.io/klog/v2" +) + +// NameSystems returns the name system used by the generators in this package. +func NameSystems(pluralExceptions map[string]string) namer.NameSystems { + return namer.NameSystems{ + "public": namer.NewPublicNamer(0), + "private": namer.NewPrivateNamer(0), + "raw": namer.NewRawNamer("", nil), + "publicPlural": namer.NewPublicPluralNamer(pluralExceptions), + "allLowercasePlural": namer.NewAllLowercasePluralNamer(pluralExceptions), + "lowercaseSingular": &lowercaseSingularNamer{}, + } +} + +// lowercaseSingularNamer implements Namer +type lowercaseSingularNamer struct{} + +// Name returns t's name in all lowercase. +func (n *lowercaseSingularNamer) Name(t *types.Type) string { + return strings.ToLower(t.Name.Name) +} + +// DefaultNameSystem returns the default name system for ordering the types to be +// processed by the generators in this package. +func DefaultNameSystem() string { + return "public" +} + +// Packages makes the client package definition. +func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { + boilerplate, err := arguments.LoadGoBoilerplate() + if err != nil { + klog.Fatalf("Failed loading boilerplate: %v", err) + } + + var packageList generator.Packages + for _, inputDir := range arguments.InputDirs { + p := context.Universe.Package(inputDir) + + objectMeta, internal, err := objectMetaForPackage(p) + if err != nil { + klog.Fatal(err) + } + if objectMeta == nil { + // no types in this package had genclient + continue + } + + var gv clientgentypes.GroupVersion + var internalGVPkg string + + if internal { + lastSlash := strings.LastIndex(p.Path, "/") + if lastSlash == -1 { + klog.Fatalf("error constructing internal group version for package %q", p.Path) + } + gv.Group = clientgentypes.Group(p.Path[lastSlash+1:]) + internalGVPkg = p.Path + } else { + parts := strings.Split(p.Path, "/") + gv.Group = clientgentypes.Group(parts[len(parts)-2]) + gv.Version = clientgentypes.Version(parts[len(parts)-1]) + + internalGVPkg = strings.Join(parts[0:len(parts)-1], "/") + } + groupPackageName := strings.ToLower(gv.Group.NonEmpty()) + + // If there's a comment of the form "// +groupName=somegroup" or + // "// +groupName=somegroup.foo.bar.io", use the first field (somegroup) as the name of the + // group when generating. + if override := types.ExtractCommentTags("+", p.Comments)["groupName"]; override != nil { + gv.Group = clientgentypes.Group(strings.SplitN(override[0], ".", 2)[0]) + } + + var typesToGenerate []*types.Type + for _, t := range p.Types { + tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) + if !tags.GenerateClient || !tags.HasVerb("list") || !tags.HasVerb("get") { + continue + } + typesToGenerate = append(typesToGenerate, t) + } + if len(typesToGenerate) == 0 { + continue + } + orderer := namer.Orderer{Namer: namer.NewPrivateNamer(0)} + typesToGenerate = orderer.OrderTypes(typesToGenerate) + + packagePath := filepath.Join(arguments.OutputPackagePath, groupPackageName, strings.ToLower(gv.Version.NonEmpty())) + packageList = append(packageList, &generator.DefaultPackage{ + PackageName: strings.ToLower(gv.Version.NonEmpty()), + PackagePath: packagePath, + HeaderText: boilerplate, + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + generators = append(generators, &expansionGenerator{ + DefaultGen: generator.DefaultGen{ + OptionalName: "expansion_generated", + }, + packagePath: filepath.Join(arguments.OutputBase, packagePath), + types: typesToGenerate, + }) + + for _, t := range typesToGenerate { + generators = append(generators, &listerGenerator{ + DefaultGen: generator.DefaultGen{ + OptionalName: strings.ToLower(t.Name.Name), + }, + outputPackage: arguments.OutputPackagePath, + groupVersion: gv, + internalGVPkg: internalGVPkg, + typeToGenerate: t, + imports: generator.NewImportTracker(), + objectMeta: objectMeta, + }) + } + return generators + }, + FilterFunc: func(c *generator.Context, t *types.Type) bool { + tags := util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) + return tags.GenerateClient && tags.HasVerb("list") && tags.HasVerb("get") + }, + }) + } + + return packageList +} + +// objectMetaForPackage returns the type of ObjectMeta used by package p. +func objectMetaForPackage(p *types.Package) (*types.Type, bool, error) { + generatingForPackage := false + for _, t := range p.Types { + // filter out types which dont have genclient. + if !util.MustParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)).GenerateClient { + continue + } + generatingForPackage = true + for _, member := range t.Members { + if member.Name == "ObjectMeta" { + return member.Type, isInternal(member), nil + } + } + } + if generatingForPackage { + return nil, false, fmt.Errorf("unable to find ObjectMeta for any types in package %s", p.Path) + } + return nil, false, nil +} + +// isInternal returns true if the tags for a member do not contain a json tag +func isInternal(m types.Member) bool { + return !strings.Contains(m.Tags, "json") +} + +// listerGenerator produces a file of listers for a given GroupVersion and +// type. +type listerGenerator struct { + generator.DefaultGen + outputPackage string + groupVersion clientgentypes.GroupVersion + internalGVPkg string + typeToGenerate *types.Type + imports namer.ImportTracker + objectMeta *types.Type +} + +var _ generator.Generator = &listerGenerator{} + +func (g *listerGenerator) Filter(c *generator.Context, t *types.Type) bool { + return t == g.typeToGenerate +} + +func (g *listerGenerator) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + } +} + +func (g *listerGenerator) Imports(c *generator.Context) (imports []string) { + imports = append(imports, g.imports.ImportLines()...) + imports = append(imports, "k8s.io/apimachinery/pkg/api/errors") + imports = append(imports, "k8s.io/apimachinery/pkg/labels") + // for Indexer + imports = append(imports, "k8s.io/client-go/tools/cache") + return +} + +func (g *listerGenerator) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + sw := generator.NewSnippetWriter(w, c, "$", "$") + + klog.V(5).Infof("processing type %v", t) + m := map[string]interface{}{ + "Resource": c.Universe.Function(types.Name{Package: t.Name.Package, Name: "Resource"}), + "type": t, + "objectMeta": g.objectMeta, + } + + tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) + if err != nil { + return err + } + + if tags.NonNamespaced { + sw.Do(typeListerInterface_NonNamespaced, m) + } else { + sw.Do(typeListerInterface, m) + } + + sw.Do(typeListerStruct, m) + sw.Do(typeListerConstructor, m) + sw.Do(typeLister_List, m) + + if tags.NonNamespaced { + sw.Do(typeLister_NonNamespacedGet, m) + return sw.Error() + } + + sw.Do(typeLister_NamespaceLister, m) + sw.Do(namespaceListerInterface, m) + sw.Do(namespaceListerStruct, m) + sw.Do(namespaceLister_List, m) + sw.Do(namespaceLister_Get, m) + + return sw.Error() +} + +var typeListerInterface = ` +// $.type|public$Lister helps list $.type|publicPlural$. +// All objects returned here must be treated as read-only. +type $.type|public$Lister interface { + // List lists all $.type|publicPlural$ in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*$.type|raw$, err error) + // $.type|publicPlural$ returns an object that can list and get $.type|publicPlural$. + $.type|publicPlural$(namespace string) $.type|public$NamespaceLister + $.type|public$ListerExpansion +} +` + +var typeListerInterface_NonNamespaced = ` +// $.type|public$Lister helps list $.type|publicPlural$. +// All objects returned here must be treated as read-only. +type $.type|public$Lister interface { + // List lists all $.type|publicPlural$ in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*$.type|raw$, err error) + // Get retrieves the $.type|public$ from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*$.type|raw$, error) + $.type|public$ListerExpansion +} +` + +var typeListerStruct = ` +// $.type|private$Lister implements the $.type|public$Lister interface. +type $.type|private$Lister struct { + indexer cache.Indexer +} +` + +var typeListerConstructor = ` +// New$.type|public$Lister returns a new $.type|public$Lister. +func New$.type|public$Lister(indexer cache.Indexer) $.type|public$Lister { + return &$.type|private$Lister{indexer: indexer} +} +` + +var typeLister_List = ` +// List lists all $.type|publicPlural$ in the indexer. +func (s *$.type|private$Lister) List(selector labels.Selector) (ret []*$.type|raw$, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*$.type|raw$)) + }) + return ret, err +} +` + +var typeLister_NamespaceLister = ` +// $.type|publicPlural$ returns an object that can list and get $.type|publicPlural$. +func (s *$.type|private$Lister) $.type|publicPlural$(namespace string) $.type|public$NamespaceLister { + return $.type|private$NamespaceLister{indexer: s.indexer, namespace: namespace} +} +` + +var typeLister_NonNamespacedGet = ` +// Get retrieves the $.type|public$ from the index for a given name. +func (s *$.type|private$Lister) Get(name string) (*$.type|raw$, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound($.Resource|raw$("$.type|lowercaseSingular$"), name) + } + return obj.(*$.type|raw$), nil +} +` + +var namespaceListerInterface = ` +// $.type|public$NamespaceLister helps list and get $.type|publicPlural$. +// All objects returned here must be treated as read-only. +type $.type|public$NamespaceLister interface { + // List lists all $.type|publicPlural$ in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*$.type|raw$, err error) + // Get retrieves the $.type|public$ from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*$.type|raw$, error) + $.type|public$NamespaceListerExpansion +} +` + +var namespaceListerStruct = ` +// $.type|private$NamespaceLister implements the $.type|public$NamespaceLister +// interface. +type $.type|private$NamespaceLister struct { + indexer cache.Indexer + namespace string +} +` + +var namespaceLister_List = ` +// List lists all $.type|publicPlural$ in the indexer for a given namespace. +func (s $.type|private$NamespaceLister) List(selector labels.Selector) (ret []*$.type|raw$, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*$.type|raw$)) + }) + return ret, err +} +` + +var namespaceLister_Get = ` +// Get retrieves the $.type|public$ from the indexer for a given namespace and name. +func (s $.type|private$NamespaceLister) Get(name string) (*$.type|raw$, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound($.Resource|raw$("$.type|lowercaseSingular$"), name) + } + return obj.(*$.type|raw$), nil +} +` diff --git a/cmd/code-generator/cmd/lister-gen/main.go b/cmd/code-generator/cmd/lister-gen/main.go new file mode 100644 index 0000000..855b4e1 --- /dev/null +++ b/cmd/code-generator/cmd/lister-gen/main.go @@ -0,0 +1,60 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "flag" + "path/filepath" + + "github.com/spf13/pflag" + "k8s.io/code-generator/cmd/lister-gen/generators" + "k8s.io/code-generator/pkg/util" + "k8s.io/gengo/args" + "k8s.io/klog/v2" + + generatorargs "k8s.io/code-generator/cmd/lister-gen/args" +) + +func main() { + klog.InitFlags(nil) + genericArgs, customArgs := generatorargs.NewDefaults() + + // Override defaults. + // TODO: move this out of lister-gen + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + genericArgs.OutputPackagePath = "k8s.io/kubernetes/pkg/client/listers" + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + if err := generatorargs.Validate(genericArgs); err != nil { + klog.Fatalf("Error: %v", err) + } + + // Run it. + if err := genericArgs.Execute( + generators.NameSystems(util.PluralExceptionListToMapOrDie(customArgs.PluralExceptions)), + generators.DefaultNameSystem(), + generators.Packages, + ); err != nil { + klog.Fatalf("Error: %v", err) + } + klog.V(2).Info("Completed successfully.") +} diff --git a/cmd/code-generator/cmd/openapi-gen/main.go b/cmd/code-generator/cmd/openapi-gen/main.go new file mode 100644 index 0000000..c446e80 --- /dev/null +++ b/cmd/code-generator/cmd/openapi-gen/main.go @@ -0,0 +1,57 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This package generates openAPI definition file to be used in open API spec generation on API servers. To generate +// definition for a specific type or package add "+k8s:openapi-gen=true" tag to the type/package comment lines. To +// exclude a type from a tagged package, add "+k8s:openapi-gen=false" tag to the type comment lines. + +package main + +import ( + "flag" + "log" + + generatorargs "k8s.io/kube-openapi/cmd/openapi-gen/args" + "k8s.io/kube-openapi/pkg/generators" + + "github.com/spf13/pflag" + + "k8s.io/klog/v2" +) + +func main() { + klog.InitFlags(nil) + genericArgs, customArgs := generatorargs.NewDefaults() + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + if err := generatorargs.Validate(genericArgs); err != nil { + log.Fatalf("Arguments validation error: %v", err) + } + + // Generates the code for the OpenAPIDefinitions. + if err := genericArgs.Execute( + generators.NameSystems(), + generators.DefaultNameSystem(), + generators.Packages, + ); err != nil { + log.Fatalf("OpenAPI code generation error: %v", err) + } +} diff --git a/cmd/code-generator/cmd/prerelease-lifecycle-gen/args/args.go b/cmd/code-generator/cmd/prerelease-lifecycle-gen/args/args.go new file mode 100644 index 0000000..ca23a90 --- /dev/null +++ b/cmd/code-generator/cmd/prerelease-lifecycle-gen/args/args.go @@ -0,0 +1,52 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + + "github.com/spf13/pflag" + statusgenerators "k8s.io/code-generator/cmd/prerelease-lifecycle-gen/prerelease-lifecycle-generators" + "k8s.io/gengo/args" +) + +// CustomArgs is used by the gengo framework to pass args specific to this generator. +type CustomArgs statusgenerators.CustomArgs + +// NewDefaults returns default arguments for the generator. +func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { + genericArgs := args.Default().WithoutDefaultFlagParsing() + customArgs := &CustomArgs{} + genericArgs.CustomArgs = (*statusgenerators.CustomArgs)(customArgs) // convert to upstream type to make type-casts work there + genericArgs.OutputFileBaseName = "zz_prerelease_lifecycle_generated" + return genericArgs, customArgs +} + +// AddFlags add the generator flags to the flag set. +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { +} + +// Validate checks the given arguments. +func Validate(genericArgs *args.GeneratorArgs) error { + _ = genericArgs.CustomArgs.(*statusgenerators.CustomArgs) + + if len(genericArgs.OutputFileBaseName) == 0 { + return fmt.Errorf("output file base name cannot be empty") + } + + return nil +} diff --git a/cmd/code-generator/cmd/prerelease-lifecycle-gen/main.go b/cmd/code-generator/cmd/prerelease-lifecycle-gen/main.go new file mode 100644 index 0000000..43a39f4 --- /dev/null +++ b/cmd/code-generator/cmd/prerelease-lifecycle-gen/main.go @@ -0,0 +1,74 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// prerelease-lifecycle-gen is a tool for auto-generating api-status.csv files. +// +// Given a list of input directories, it will create a zz_api_status.go file for all beta APIs which indicates the kinds, +// the release it was introduced, the release it will be deprecated, and the release it will be removed. +// +// Generation is governed by comment tags in the source. Any package may +// request Status generation by including a comment in the file-comments of +// one file, of the form: +// // +k8s:prerelease-lifecycle-gen=package +// +// // +k8s:prerelease-lifecycle-gen:introduced=1.19 +// // +k8s:prerelease-lifecycle-gen:to-be-deprecated=1.22 +// // +k8s:prerelease-lifecycle-gen:to-be-removed=1.25 +// +// Note that registration is a whole-package option, and is not available for +// individual types. +package main + +import ( + "flag" + "path/filepath" + + "github.com/spf13/pflag" + generatorargs "k8s.io/code-generator/cmd/prerelease-lifecycle-gen/args" + statusgenerators "k8s.io/code-generator/cmd/prerelease-lifecycle-gen/prerelease-lifecycle-generators" + "k8s.io/code-generator/pkg/util" + "k8s.io/gengo/args" + "k8s.io/klog/v2" +) + +func main() { + klog.InitFlags(nil) + genericArgs, customArgs := generatorargs.NewDefaults() + + // Override defaults. + // TODO: move this out of prerelease-lifecycle-gen + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + if err := generatorargs.Validate(genericArgs); err != nil { + klog.Fatalf("Error: %v", err) + } + + // Run it. + if err := genericArgs.Execute( + statusgenerators.NameSystems(), + statusgenerators.DefaultNameSystem(), + statusgenerators.Packages, + ); err != nil { + klog.Fatalf("Error: %v", err) + } + klog.V(2).Info("Completed successfully.") +} diff --git a/cmd/code-generator/cmd/prerelease-lifecycle-gen/prerelease-lifecycle-generators/status.go b/cmd/code-generator/cmd/prerelease-lifecycle-gen/prerelease-lifecycle-generators/status.go new file mode 100644 index 0000000..4456ca4 --- /dev/null +++ b/cmd/code-generator/cmd/prerelease-lifecycle-gen/prerelease-lifecycle-generators/status.go @@ -0,0 +1,499 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package prereleaselifecyclegenerators + +import ( + "fmt" + "io" + "path/filepath" + "strconv" + "strings" + + "k8s.io/gengo/args" + "k8s.io/gengo/examples/set-gen/sets" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/klog/v2" +) + +// CustomArgs is used tby the go2idl framework to pass args specific to this generator. +type CustomArgs struct { +} + +// This is the comment tag that carries parameters for API status generation. Because the cadence is fixed, we can predict +// with near certainty when this lifecycle happens as the API is introduced. +const ( + tagEnabledName = "k8s:prerelease-lifecycle-gen" + introducedTagName = tagEnabledName + ":introduced" + deprecatedTagName = tagEnabledName + ":deprecated" + removedTagName = tagEnabledName + ":removed" + + replacementTagName = tagEnabledName + ":replacement" +) + +// enabledTagValue holds parameters from a tagName tag. +type tagValue struct { + value string +} + +func extractEnabledTypeTag(t *types.Type) *tagValue { + comments := append(append([]string{}, t.SecondClosestCommentLines...), t.CommentLines...) + return extractTag(tagEnabledName, comments) +} + +func tagExists(tagName string, t *types.Type) bool { + comments := append(append([]string{}, t.SecondClosestCommentLines...), t.CommentLines...) + rawTag := extractTag(tagName, comments) + return rawTag != nil +} + +func extractKubeVersionTag(tagName string, t *types.Type) (*tagValue, int, int, error) { + comments := append(append([]string{}, t.SecondClosestCommentLines...), t.CommentLines...) + rawTag := extractTag(tagName, comments) + if rawTag == nil || len(rawTag.value) == 0 { + return nil, -1, -1, fmt.Errorf("%v missing %v=Version tag", t, tagName) + } + + splitValue := strings.Split(rawTag.value, ".") + if len(splitValue) != 2 || len(splitValue[0]) == 0 || len(splitValue[0]) == 0 { + return nil, -1, -1, fmt.Errorf("%v format must match %v=xx.yy tag", t, tagName) + } + major, err := strconv.ParseInt(splitValue[0], 10, 32) + if err != nil { + return nil, -1, -1, fmt.Errorf("%v format must match %v=xx.yy : %w", t, tagName, err) + } + minor, err := strconv.ParseInt(splitValue[1], 10, 32) + if err != nil { + return nil, -1, -1, fmt.Errorf("%v format must match %v=xx.yy : %w", t, tagName, err) + } + + return rawTag, int(major), int(minor), nil +} + +func extractIntroducedTag(t *types.Type) (*tagValue, int, int, error) { + return extractKubeVersionTag(introducedTagName, t) +} + +func extractDeprecatedTag(t *types.Type) (*tagValue, int, int, error) { + return extractKubeVersionTag(deprecatedTagName, t) +} + +func extractRemovedTag(t *types.Type) (*tagValue, int, int, error) { + return extractKubeVersionTag(removedTagName, t) +} + +func extractReplacementTag(t *types.Type) (group, version, kind string, hasReplacement bool, err error) { + comments := append(append([]string{}, t.SecondClosestCommentLines...), t.CommentLines...) + + tagVals := types.ExtractCommentTags("+", comments)[replacementTagName] + if len(tagVals) == 0 { + // No match for the tag. + return "", "", "", false, nil + } + // If there are multiple values, abort. + if len(tagVals) > 1 { + return "", "", "", false, fmt.Errorf("Found %d %s tags: %q", len(tagVals), replacementTagName, tagVals) + } + tagValue := tagVals[0] + parts := strings.Split(tagValue, ",") + if len(parts) != 3 { + return "", "", "", false, fmt.Errorf(`%s value must be ",,", got %q`, replacementTagName, tagValue) + } + group, version, kind = parts[0], parts[1], parts[2] + if len(version) == 0 || len(kind) == 0 { + return "", "", "", false, fmt.Errorf(`%s value must be ",,", got %q`, replacementTagName, tagValue) + } + // sanity check the group + if strings.ToLower(group) != group { + return "", "", "", false, fmt.Errorf(`replacement group must be all lower-case, got %q`, group) + } + // sanity check the version + if !strings.HasPrefix(version, "v") || strings.ToLower(version) != version { + return "", "", "", false, fmt.Errorf(`replacement version must start with "v" and be all lower-case, got %q`, version) + } + // sanity check the kind + if strings.ToUpper(kind[:1]) != kind[:1] { + return "", "", "", false, fmt.Errorf(`replacement kind must start with uppercase-letter, got %q`, kind) + } + return group, version, kind, true, nil +} + +func extractTag(tagName string, comments []string) *tagValue { + tagVals := types.ExtractCommentTags("+", comments)[tagName] + if tagVals == nil { + // No match for the tag. + return nil + } + // If there are multiple values, abort. + if len(tagVals) > 1 { + klog.Fatalf("Found %d %s tags: %q", len(tagVals), tagName, tagVals) + } + + // If we got here we are returning something. + tag := &tagValue{} + + // Get the primary value. + parts := strings.Split(tagVals[0], ",") + if len(parts) >= 1 { + tag.value = parts[0] + } + + // Parse extra arguments. + parts = parts[1:] + for i := range parts { + kv := strings.SplitN(parts[i], "=", 2) + k := kv[0] + //v := "" + //if len(kv) == 2 { + // v = kv[1] + //} + switch k { + //case "register": + // if v != "false" { + // tag.register = true + // } + default: + klog.Fatalf("Unsupported %s param: %q", tagName, parts[i]) + } + } + return tag +} + +// NameSystems returns the name system used by the generators in this package. +func NameSystems() namer.NameSystems { + return namer.NameSystems{ + "public": namer.NewPublicNamer(1), + "raw": namer.NewRawNamer("", nil), + } +} + +// DefaultNameSystem returns the default name system for ordering the types to be +// processed by the generators in this package. +func DefaultNameSystem() string { + return "public" +} + +// Packages makes the package definition. +func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { + boilerplate, err := arguments.LoadGoBoilerplate() + if err != nil { + klog.Fatalf("Failed loading boilerplate: %v", err) + } + + inputs := sets.NewString(context.Inputs...) + packages := generator.Packages{} + header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...) + + for i := range inputs { + klog.V(5).Infof("Considering pkg %q", i) + pkg := context.Universe[i] + if pkg == nil { + // If the input had no Go files, for example. + continue + } + + ptag := extractTag(tagEnabledName, pkg.Comments) + pkgNeedsGeneration := false + if ptag != nil { + pkgNeedsGeneration, err = strconv.ParseBool(ptag.value) + if err != nil { + klog.Fatalf("Package %v: unsupported %s value: %q :%w", i, tagEnabledName, ptag.value, err) + } + } + if !pkgNeedsGeneration { + klog.V(5).Infof(" skipping package") + continue + } + klog.V(3).Infof("Generating package %q", pkg.Path) + + // If the pkg-scoped tag says to generate, we can skip scanning types. + if !pkgNeedsGeneration { + // If the pkg-scoped tag did not exist, scan all types for one that + // explicitly wants generation. + for _, t := range pkg.Types { + klog.V(5).Infof(" considering type %q", t.Name.String()) + ttag := extractEnabledTypeTag(t) + if ttag != nil && ttag.value == "true" { + klog.V(5).Infof(" tag=true") + if !isAPIType(t) { + klog.Fatalf("Type %v requests deepcopy generation but is not copyable", t) + } + pkgNeedsGeneration = true + break + } + } + } + + if pkgNeedsGeneration { + path := pkg.Path + // if the source path is within a /vendor/ directory (for example, + // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow + // generation to output to the proper relative path (under vendor). + // Otherwise, the generator will create the file in the wrong location + // in the output directory. + // TODO: build a more fundamental concept in gengo for dealing with modifications + // to vendored packages. + if strings.HasPrefix(pkg.SourcePath, arguments.OutputBase) { + expandedPath := strings.TrimPrefix(pkg.SourcePath, arguments.OutputBase) + if strings.Contains(expandedPath, "/vendor/") { + path = expandedPath + } + } + packages = append(packages, + &generator.DefaultPackage{ + PackageName: strings.Split(filepath.Base(pkg.Path), ".")[0], + PackagePath: path, + HeaderText: header, + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + return []generator.Generator{ + NewPrereleaseLifecycleGen(arguments.OutputFileBaseName, pkg.Path), + } + }, + FilterFunc: func(c *generator.Context, t *types.Type) bool { + return t.Name.Package == pkg.Path + }, + }) + } + } + return packages +} + +// genDeepCopy produces a file with autogenerated deep-copy functions. +type genPreleaseLifecycle struct { + generator.DefaultGen + targetPackage string + imports namer.ImportTracker + typesForInit []*types.Type +} + +// NewPrereleaseLifecycleGen creates a generator for the prerelease-lifecycle-generator +func NewPrereleaseLifecycleGen(sanitizedName, targetPackage string) generator.Generator { + return &genPreleaseLifecycle{ + DefaultGen: generator.DefaultGen{ + OptionalName: sanitizedName, + }, + targetPackage: targetPackage, + imports: generator.NewImportTracker(), + typesForInit: make([]*types.Type, 0), + } +} + +func (g *genPreleaseLifecycle) Namers(c *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "public": namer.NewPublicNamer(1), + "intrapackage": namer.NewPublicNamer(0), + "raw": namer.NewRawNamer("", nil), + } +} + +func (g *genPreleaseLifecycle) Filter(c *generator.Context, t *types.Type) bool { + // Filter out types not being processed or not copyable within the package. + if !isAPIType(t) { + klog.V(2).Infof("Type %v is not a valid target for status", t) + return false + } + g.typesForInit = append(g.typesForInit, t) + return true +} + +// versionMethod returns the signature of an () method, nil or an error +// if the type is wrong. Introduced() allows more efficient deep copy +// implementations to be defined by the type's author. The correct signature +// func (t *T) () string +func versionMethod(methodName string, t *types.Type) (*types.Signature, error) { + f, found := t.Methods[methodName] + if !found { + return nil, nil + } + if len(f.Signature.Parameters) != 0 { + return nil, fmt.Errorf("type %v: invalid %v signature, expected no parameters", t, methodName) + } + if len(f.Signature.Results) != 2 { + return nil, fmt.Errorf("type %v: invalid %v signature, expected exactly two result types", t, methodName) + } + + ptrRcvr := f.Signature.Receiver != nil && f.Signature.Receiver.Kind == types.Pointer && f.Signature.Receiver.Elem.Name == t.Name + nonPtrRcvr := f.Signature.Receiver != nil && f.Signature.Receiver.Name == t.Name + + if !ptrRcvr && !nonPtrRcvr { + // this should never happen + return nil, fmt.Errorf("type %v: invalid %v signature, expected a receiver of type %s or *%s", t, methodName, t.Name.Name, t.Name.Name) + } + + return f.Signature, nil +} + +// versionedMethodOrDie returns the signature of a () method, nil or calls klog.Fatalf +// if the type is wrong. +func versionedMethodOrDie(methodName string, t *types.Type) *types.Signature { + ret, err := versionMethod(methodName, t) + if err != nil { + klog.Fatal(err) + } + return ret +} + +// isAPIType indicates whether or not a type could be used to serve an API. That means, "does it have TypeMeta". +// This doesn't mean the type is served, but we will handle all TypeMeta types. +func isAPIType(t *types.Type) bool { + // Filter out private types. + if namer.IsPrivateGoName(t.Name.Name) { + return false + } + + if t.Kind != types.Struct { + return false + } + + for _, currMember := range t.Members { + if currMember.Embedded && currMember.Name == "TypeMeta" { + return true + } + } + + if t.Kind == types.Alias { + return isAPIType(t.Underlying) + } + + return false +} + +func (g *genPreleaseLifecycle) isOtherPackage(pkg string) bool { + if pkg == g.targetPackage { + return false + } + if strings.HasSuffix(pkg, "\""+g.targetPackage+"\"") { + return false + } + return true +} + +func (g *genPreleaseLifecycle) Imports(c *generator.Context) (imports []string) { + importLines := []string{} + for _, singleImport := range g.imports.ImportLines() { + if g.isOtherPackage(singleImport) { + importLines = append(importLines, singleImport) + } + } + return importLines +} + +func (g *genPreleaseLifecycle) argsFromType(c *generator.Context, t *types.Type) (generator.Args, error) { + a := generator.Args{ + "type": t, + } + _, introducedMajor, introducedMinor, err := extractIntroducedTag(t) + if err != nil { + return nil, err + } + a = a. + With("introducedMajor", introducedMajor). + With("introducedMinor", introducedMinor) + + // compute based on our policy + deprecatedMajor := introducedMajor + deprecatedMinor := introducedMinor + 3 + // if someone intentionally override the deprecation release + if tagExists(deprecatedTagName, t) { + _, deprecatedMajor, deprecatedMinor, err = extractDeprecatedTag(t) + if err != nil { + return nil, err + } + } + a = a. + With("deprecatedMajor", deprecatedMajor). + With("deprecatedMinor", deprecatedMinor) + + // compute based on our policy + removedMajor := deprecatedMajor + removedMinor := deprecatedMinor + 3 + // if someone intentionally override the removed release + if tagExists(removedTagName, t) { + _, removedMajor, removedMinor, err = extractRemovedTag(t) + if err != nil { + return nil, err + } + } + a = a. + With("removedMajor", removedMajor). + With("removedMinor", removedMinor) + + replacementGroup, replacementVersion, replacementKind, hasReplacement, err := extractReplacementTag(t) + if err != nil { + return nil, err + } + if hasReplacement { + gvkType := c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersionKind"}) + g.imports.AddType(gvkType) + a = a. + With("replacementGroup", replacementGroup). + With("replacementVersion", replacementVersion). + With("replacementKind", replacementKind). + With("GroupVersionKind", gvkType) + } + + return a, nil +} + +func (g *genPreleaseLifecycle) Init(c *generator.Context, w io.Writer) error { + return nil +} + +func (g *genPreleaseLifecycle) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + klog.V(3).Infof("Generating prerelease-lifecycle for type %v", t) + + sw := generator.NewSnippetWriter(w, c, "$", "$") + args, err := g.argsFromType(c, t) + if err != nil { + return err + } + + if versionedMethodOrDie("APILifecycleIntroduced", t) == nil { + sw.Do("// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison.\n", args) + sw.Do("// It is controlled by \""+introducedTagName+"\" tags in types.go.\n", args) + sw.Do("func (in *$.type|intrapackage$) APILifecycleIntroduced() (major, minor int) {\n", args) + sw.Do(" return $.introducedMajor$, $.introducedMinor$\n", args) + sw.Do("}\n\n", nil) + } + if versionedMethodOrDie("APILifecycleDeprecated", t) == nil { + sw.Do("// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison.\n", args) + sw.Do("// It is controlled by \""+deprecatedTagName+"\" tags in types.go or \""+introducedTagName+"\" plus three minor.\n", args) + sw.Do("func (in *$.type|intrapackage$) APILifecycleDeprecated() (major, minor int) {\n", args) + sw.Do(" return $.deprecatedMajor$, $.deprecatedMinor$\n", args) + sw.Do("}\n\n", nil) + } + if _, hasReplacement := args["replacementKind"]; hasReplacement { + if versionedMethodOrDie("APILifecycleReplacement", t) == nil { + sw.Do("// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type.\n", args) + sw.Do("// It is controlled by \""+replacementTagName+"=,,\" tags in types.go.\n", args) + sw.Do("func (in *$.type|intrapackage$) APILifecycleReplacement() ($.GroupVersionKind|raw$) {\n", args) + sw.Do(" return $.GroupVersionKind|raw${Group:\"$.replacementGroup$\", Version:\"$.replacementVersion$\", Kind:\"$.replacementKind$\"}\n", args) + sw.Do("}\n\n", nil) + } + } + if versionedMethodOrDie("APILifecycleRemoved", t) == nil { + sw.Do("// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison.\n", args) + sw.Do("// It is controlled by \""+removedTagName+"\" tags in types.go or \""+deprecatedTagName+"\" plus three minor.\n", args) + sw.Do("func (in *$.type|intrapackage$) APILifecycleRemoved() (major, minor int) {\n", args) + sw.Do(" return $.removedMajor$, $.removedMinor$\n", args) + sw.Do("}\n\n", nil) + } + + return sw.Error() +} diff --git a/cmd/code-generator/cmd/register-gen/args/args.go b/cmd/code-generator/cmd/register-gen/args/args.go new file mode 100644 index 0000000..2e3ab08 --- /dev/null +++ b/cmd/code-generator/cmd/register-gen/args/args.go @@ -0,0 +1,39 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package args + +import ( + "fmt" + + "k8s.io/gengo/args" +) + +// NewDefaults returns default arguments for the generator. +func NewDefaults() *args.GeneratorArgs { + genericArgs := args.Default().WithoutDefaultFlagParsing() + genericArgs.OutputFileBaseName = "zz_generated.register" + return genericArgs +} + +// Validate checks the given arguments. +func Validate(genericArgs *args.GeneratorArgs) error { + if len(genericArgs.OutputFileBaseName) == 0 { + return fmt.Errorf("output file base name cannot be empty") + } + + return nil +} diff --git a/cmd/code-generator/cmd/register-gen/generators/packages.go b/cmd/code-generator/cmd/register-gen/generators/packages.go new file mode 100644 index 0000000..037adca --- /dev/null +++ b/cmd/code-generator/cmd/register-gen/generators/packages.go @@ -0,0 +1,137 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "fmt" + "os" + "path" + "strings" + + "k8s.io/klog/v2" + + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" + "k8s.io/gengo/args" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" +) + +// NameSystems returns the name system used by the generators in this package. +func NameSystems() namer.NameSystems { + return namer.NameSystems{} +} + +// DefaultNameSystem returns the default name system for ordering the types to be +// processed by the generators in this package. +func DefaultNameSystem() string { + return "public" +} + +// Packages makes packages to generate. +func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { + boilerplate, err := arguments.LoadGoBoilerplate() + if err != nil { + klog.Fatalf("Failed loading boilerplate: %v", err) + } + + packages := generator.Packages{} + for _, inputDir := range arguments.InputDirs { + pkg := context.Universe.Package(inputDir) + internal, err := isInternal(pkg) + if err != nil { + klog.V(5).Infof("skipping the generation of %s file, due to err %v", arguments.OutputFileBaseName, err) + continue + } + if internal { + klog.V(5).Infof("skipping the generation of %s file because %s package contains internal types, note that internal types don't have \"json\" tags", arguments.OutputFileBaseName, pkg.Name) + continue + } + registerFileName := "register.go" + searchPath := path.Join(args.DefaultSourceTree(), inputDir, registerFileName) + if _, err := os.Stat(path.Join(searchPath)); err == nil { + klog.V(5).Infof("skipping the generation of %s file because %s already exists in the path %s", arguments.OutputFileBaseName, registerFileName, searchPath) + continue + } else if err != nil && !os.IsNotExist(err) { + klog.Fatalf("an error %v has occurred while checking if %s exists", err, registerFileName) + } + + gv := clientgentypes.GroupVersion{} + { + pathParts := strings.Split(pkg.Path, "/") + if len(pathParts) < 2 { + klog.Errorf("the path of the package must contain the group name and the version, path = %s", pkg.Path) + continue + } + gv.Group = clientgentypes.Group(pathParts[len(pathParts)-2]) + gv.Version = clientgentypes.Version(pathParts[len(pathParts)-1]) + + // if there is a comment of the form "// +groupName=somegroup" or "// +groupName=somegroup.foo.bar.io", + // extract the fully qualified API group name from it and overwrite the group inferred from the package path + if override := types.ExtractCommentTags("+", pkg.DocComments)["groupName"]; override != nil { + groupName := override[0] + klog.V(5).Infof("overriding the group name with = %s", groupName) + gv.Group = clientgentypes.Group(groupName) + } + } + + typesToRegister := []*types.Type{} + for _, t := range pkg.Types { + klog.V(5).Infof("considering type = %s", t.Name.String()) + for _, typeMember := range t.Members { + if typeMember.Name == "TypeMeta" && typeMember.Embedded == true { + typesToRegister = append(typesToRegister, t) + } + } + } + + packages = append(packages, + &generator.DefaultPackage{ + PackageName: pkg.Name, + PackagePath: pkg.Path, + HeaderText: boilerplate, + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + return []generator.Generator{ + ®isterExternalGenerator{ + DefaultGen: generator.DefaultGen{ + OptionalName: arguments.OutputFileBaseName, + }, + gv: gv, + typesToGenerate: typesToRegister, + outputPackage: pkg.Path, + imports: generator.NewImportTracker(), + }, + } + }, + }) + } + + return packages +} + +// isInternal determines whether the given package +// contains the internal types or not +func isInternal(p *types.Package) (bool, error) { + for _, t := range p.Types { + for _, member := range t.Members { + if member.Name == "TypeMeta" { + return !strings.Contains(member.Tags, "json"), nil + } + } + } + return false, fmt.Errorf("unable to find TypeMeta for any types in package %s", p.Path) +} diff --git a/cmd/code-generator/cmd/register-gen/generators/register_external.go b/cmd/code-generator/cmd/register-gen/generators/register_external.go new file mode 100644 index 0000000..c831c57 --- /dev/null +++ b/cmd/code-generator/cmd/register-gen/generators/register_external.go @@ -0,0 +1,117 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package generators + +import ( + "io" + "sort" + + clientgentypes "k8s.io/code-generator/cmd/client-gen/types" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" +) + +type registerExternalGenerator struct { + generator.DefaultGen + outputPackage string + gv clientgentypes.GroupVersion + typesToGenerate []*types.Type + imports namer.ImportTracker +} + +var _ generator.Generator = ®isterExternalGenerator{} + +func (g *registerExternalGenerator) Filter(_ *generator.Context, _ *types.Type) bool { + return false +} + +func (g *registerExternalGenerator) Imports(c *generator.Context) (imports []string) { + return g.imports.ImportLines() +} + +func (g *registerExternalGenerator) Namers(_ *generator.Context) namer.NameSystems { + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + } +} + +func (g *registerExternalGenerator) Finalize(context *generator.Context, w io.Writer) error { + typesToGenerateOnlyNames := make([]string, len(g.typesToGenerate)) + for index, typeToGenerate := range g.typesToGenerate { + typesToGenerateOnlyNames[index] = typeToGenerate.Name.Name + } + + // sort the list of types to register, so that the generator produces stable output + sort.Strings(typesToGenerateOnlyNames) + + sw := generator.NewSnippetWriter(w, context, "$", "$") + m := map[string]interface{}{ + "groupName": g.gv.Group, + "version": g.gv.Version, + "types": typesToGenerateOnlyNames, + "addToGroupVersion": context.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "AddToGroupVersion"}), + "groupVersion": context.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GroupVersion"}), + } + sw.Do(registerExternalTypesTemplate, m) + return sw.Error() +} + +var registerExternalTypesTemplate = ` +// GroupName specifies the group name used to register the objects. +const GroupName = "$.groupName$" + +// GroupVersion specifies the group and the version used to register the objects. +var GroupVersion = $.groupVersion|raw${Group: GroupName, Version: "$.version$"} + +// SchemeGroupVersion is group version used to register these objects +// Deprecated: use GroupVersion instead. +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "$.version$"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + // Depreciated: use Install instead + AddToScheme = localSchemeBuilder.AddToScheme + Install = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Adds the list of known types to Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + $range .types -$ + &$.${}, + $end$ + ) + // AddToGroupVersion allows the serialization of client types like ListOptions. + $.addToGroupVersion|raw$(scheme, SchemeGroupVersion) + return nil +} +` diff --git a/cmd/code-generator/cmd/register-gen/main.go b/cmd/code-generator/cmd/register-gen/main.go new file mode 100644 index 0000000..816bd81 --- /dev/null +++ b/cmd/code-generator/cmd/register-gen/main.go @@ -0,0 +1,53 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "flag" + "path/filepath" + + "github.com/spf13/pflag" + "k8s.io/klog/v2" + + generatorargs "k8s.io/code-generator/cmd/register-gen/args" + "k8s.io/code-generator/cmd/register-gen/generators" + "k8s.io/code-generator/pkg/util" + "k8s.io/gengo/args" +) + +func main() { + klog.InitFlags(nil) + genericArgs := generatorargs.NewDefaults() + genericArgs.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + genericArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + + pflag.Parse() + if err := generatorargs.Validate(genericArgs); err != nil { + klog.Fatalf("Error: %v", err) + } + + if err := genericArgs.Execute( + generators.NameSystems(), + generators.DefaultNameSystem(), + generators.Packages, + ); err != nil { + klog.Fatalf("Error: %v", err) + } + klog.V(2).Info("Completed successfully.") +} diff --git a/cmd/code-generator/cmd/set-gen/.gitignore b/cmd/code-generator/cmd/set-gen/.gitignore new file mode 100644 index 0000000..ffe6458 --- /dev/null +++ b/cmd/code-generator/cmd/set-gen/.gitignore @@ -0,0 +1 @@ +set-gen diff --git a/cmd/code-generator/cmd/set-gen/main.go b/cmd/code-generator/cmd/set-gen/main.go new file mode 100644 index 0000000..2d98a1b --- /dev/null +++ b/cmd/code-generator/cmd/set-gen/main.go @@ -0,0 +1,56 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// set-gen is an example usage of gengo. +// +// Structs in the input directories with the below line in their comments will +// have sets generated for them. +// // +genset +// +// Any builtin type referenced anywhere in the input directories will have a +// set generated for it. +package main + +import ( + "os" + "path/filepath" + + "k8s.io/code-generator/pkg/util" + "k8s.io/gengo/args" + "k8s.io/gengo/examples/set-gen/generators" + + "k8s.io/klog/v2" +) + +func main() { + klog.InitFlags(nil) + arguments := args.Default() + + // Override defaults. + arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) + arguments.InputDirs = []string{"k8s.io/kubernetes/pkg/util/sets/types"} + arguments.OutputPackagePath = "k8s.io/apimachinery/pkg/util/sets" + + if err := arguments.Execute( + generators.NameSystems(), + generators.DefaultNameSystem(), + generators.Packages, + ); err != nil { + klog.Errorf("Error: %v", err) + os.Exit(1) + } + klog.V(2).Info("Completed successfully.") +} diff --git a/cmd/code-generator/code-of-conduct.md b/cmd/code-generator/code-of-conduct.md new file mode 100644 index 0000000..0d15c00 --- /dev/null +++ b/cmd/code-generator/code-of-conduct.md @@ -0,0 +1,3 @@ +# Kubernetes Community Code of Conduct + +Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) diff --git a/cmd/code-generator/generate-groups.sh b/cmd/code-generator/generate-groups.sh new file mode 100755 index 0000000..1c2fd7a --- /dev/null +++ b/cmd/code-generator/generate-groups.sh @@ -0,0 +1,95 @@ +#!/usr/bin/env bash + +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +# generate-groups generates everything for a project with external types only, e.g. a project based +# on CustomResourceDefinitions. + +if [ "$#" -lt 4 ] || [ "${1}" == "--help" ]; then + cat < ... + + the generators comma separated to run (deepcopy,defaulter,client,lister,informer) or "all". + the output package name (e.g. github.com/example/project/pkg/generated). + the external types dir (e.g. github.com/example/api or github.com/example/project/pkg/apis). + the groups and their versions in the format "groupA:v1,v2 groupB:v1 groupC:v2", relative + to . + ... arbitrary flags passed to all generator binaries. + + +Examples: + $(basename "$0") all github.com/example/project/pkg/client github.com/example/project/pkg/apis "foo:v1 bar:v1alpha1,v1beta1" + $(basename "$0") deepcopy,client github.com/example/project/pkg/client github.com/example/project/pkg/apis "foo:v1 bar:v1alpha1,v1beta1" +EOF + exit 0 +fi + +GENS="$1" +OUTPUT_PKG="$2" +APIS_PKG="$3" +GROUPS_WITH_VERSIONS="$4" +shift 4 + +( + # To support running this script from anywhere, we have to first cd into this directory + # so we can install the tools. + cd "$(dirname "${0}")" + go install ./cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen} +) +# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise: +GOBIN="$(go env GOBIN)" +gobin="${GOBIN:-$(go env GOPATH)/bin}" + +function codegen::join() { local IFS="$1"; shift; echo "$*"; } + +# enumerate group versions +FQ_APIS=() # e.g. k8s.io/api/apps/v1 +for GVs in ${GROUPS_WITH_VERSIONS}; do + IFS=: read -r G Vs <<<"${GVs}" + + # enumerate versions + for V in ${Vs//,/ }; do + FQ_APIS+=("${APIS_PKG}/${G}/${V}") + done +done + +if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then + echo "Generating deepcopy funcs" + "${gobin}/deepcopy-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${APIS_PKG}" "$@" +fi + +if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then + echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" + "${gobin}/client-gen" --clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" --input-base "" --input "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@" +fi + +if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then + echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers" + "${gobin}/lister-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/listers" "$@" +fi + +if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then + echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers" + "${gobin}/informer-gen" \ + --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" \ + --versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned}" \ + --listers-package "${OUTPUT_PKG}/listers" \ + --output-package "${OUTPUT_PKG}/informers" \ + "$@" +fi diff --git a/cmd/code-generator/generate-internal-groups.sh b/cmd/code-generator/generate-internal-groups.sh new file mode 100755 index 0000000..8c31d93 --- /dev/null +++ b/cmd/code-generator/generate-internal-groups.sh @@ -0,0 +1,122 @@ +#!/usr/bin/env bash + +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +# generate-internal-groups generates everything for a project with internal types, e.g. an +# user-provided API server based on k8s.io/apiserver. + +if [ "$#" -lt 5 ] || [ "${1}" == "--help" ]; then + cat < ... + + the generators comma separated to run (deepcopy,defaulter,conversion,client,lister,informer,openapi) or "all". + the output package name (e.g. github.com/example/project/pkg/generated). + the internal types dir (e.g. github.com/example/project/pkg/apis). + the external types dir (e.g. github.com/example/project/pkg/apis or githubcom/example/apis). + the groups and their versions in the format "groupA:v1,v2 groupB:v1 groupC:v2", relative + to . + ... arbitrary flags passed to all generator binaries. + +Examples: + $(basename "$0") all github.com/example/project/pkg/client github.com/example/project/pkg/apis github.com/example/project/pkg/apis "foo:v1 bar:v1alpha1,v1beta1" + $(basename "$0") deepcopy,defaulter,conversion github.com/example/project/pkg/client github.com/example/project/pkg/apis github.com/example/project/apis "foo:v1 bar:v1alpha1,v1beta1" +EOF + exit 0 +fi + +GENS="$1" +OUTPUT_PKG="$2" +INT_APIS_PKG="$3" +EXT_APIS_PKG="$4" +GROUPS_WITH_VERSIONS="$5" +shift 5 + +go install ./"$(dirname "${0}")"/cmd/{defaulter-gen,conversion-gen,client-gen,lister-gen,informer-gen,deepcopy-gen,openapi-gen} + +function codegen::join() { local IFS="$1"; shift; echo "$*"; } + +# enumerate group versions +ALL_FQ_APIS=() # e.g. k8s.io/kubernetes/pkg/apis/apps k8s.io/api/apps/v1 +INT_FQ_APIS=() # e.g. k8s.io/kubernetes/pkg/apis/apps +EXT_FQ_APIS=() # e.g. k8s.io/api/apps/v1 +for GVs in ${GROUPS_WITH_VERSIONS}; do + IFS=: read -r G Vs <<<"${GVs}" + + if [ -n "${INT_APIS_PKG}" ]; then + ALL_FQ_APIS+=("${INT_APIS_PKG}/${G}") + INT_FQ_APIS+=("${INT_APIS_PKG}/${G}") + fi + + # enumerate versions + for V in ${Vs//,/ }; do + ALL_FQ_APIS+=("${EXT_APIS_PKG}/${G}/${V}") + EXT_FQ_APIS+=("${EXT_APIS_PKG}/${G}/${V}") + done +done + +if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then + echo "Generating deepcopy funcs" + "${GOPATH}/bin/deepcopy-gen" --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${INT_APIS_PKG},${EXT_APIS_PKG}" "$@" +fi + +if [ "${GENS}" = "all" ] || grep -qw "defaulter" <<<"${GENS}"; then + echo "Generating defaulters" + "${GOPATH}/bin/defaulter-gen" --input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}")" -O zz_generated.defaults "$@" +fi + +if [ "${GENS}" = "all" ] || grep -qw "conversion" <<<"${GENS}"; then + echo "Generating conversions" + "${GOPATH}/bin/conversion-gen" --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" -O zz_generated.conversion "$@" +fi + +if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then + echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" + if [ -n "${INT_APIS_PKG}" ]; then + IFS=" " read -r -a APIS <<< "$(printf '%s/ ' "${INT_FQ_APIS[@]}")" + "${GOPATH}/bin/client-gen" --clientset-name "${CLIENTSET_NAME_INTERNAL:-internalversion}" --input-base "" --input "$(codegen::join , "${APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@" + fi + "${GOPATH}/bin/client-gen" --clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" --input-base "" --input "$(codegen::join , "${EXT_FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@" +fi + +if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then + echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers" + "${GOPATH}/bin/lister-gen" --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/listers" "$@" +fi + +if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then + echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers" + "${GOPATH}/bin/informer-gen" \ + --input-dirs "$(codegen::join , "${ALL_FQ_APIS[@]}")" \ + --versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned}" \ + --internal-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_INTERNAL:-internalversion}" \ + --listers-package "${OUTPUT_PKG}/listers" \ + --output-package "${OUTPUT_PKG}/informers" \ + "$@" +fi + +if [ "${GENS}" = "all" ] || grep -qw "openapi" <<<"${GENS}"; then + echo "Generating OpenAPI definitions for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/openapi" + declare -a OPENAPI_EXTRA_PACKAGES + "${GOPATH}/bin/openapi-gen" \ + --input-dirs "$(codegen::join , "${EXT_FQ_APIS[@]}" "${OPENAPI_EXTRA_PACKAGES[@]}")" \ + --input-dirs "k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/version" \ + --output-package "${OUTPUT_PKG}/openapi" \ + -O zz_generated.openapi \ + "$@" +fi diff --git a/cmd/code-generator/go.mod b/cmd/code-generator/go.mod new file mode 100644 index 0000000..47424a1 --- /dev/null +++ b/cmd/code-generator/go.mod @@ -0,0 +1,24 @@ +// This is a generated file. Do not edit directly. + +module k8s.io/code-generator + +go 1.15 + +require ( + github.com/emicklei/go-restful v2.9.5+incompatible // indirect + github.com/go-openapi/jsonreference v0.19.3 // indirect + github.com/go-openapi/spec v0.19.3 // indirect + github.com/gogo/protobuf v1.3.1 + github.com/json-iterator/go v1.1.10 // indirect + github.com/mailru/easyjson v0.7.0 // indirect + github.com/spf13/pflag v1.0.5 + github.com/stretchr/testify v1.4.0 // indirect + golang.org/x/mod v0.3.0 // indirect + golang.org/x/net v0.0.0-20200707034311-ab3426394381 // indirect + golang.org/x/text v0.3.3 // indirect + golang.org/x/tools v0.0.0-20200616133436-c1934b75d054 // indirect + k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14 + k8s.io/klog/v2 v2.2.0 + k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 + sigs.k8s.io/yaml v1.2.0 // indirect +) diff --git a/cmd/code-generator/go.sum b/cmd/code-generator/go.sum new file mode 100644 index 0000000..3607705 --- /dev/null +++ b/cmd/code-generator/go.sum @@ -0,0 +1,140 @@ +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= +github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +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= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200616133436-c1934b75d054 h1:HHeAlu5H9b71C+Fx0K+1dGgVFN1DM1/wz4aoGOA5qS8= +golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14 h1:t4L10Qfx/p7ASH3gXCdIUtPbbIuegCoUJf3TMSFekjw= +k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 h1:+WnxoVtG8TMiudHBSEtrVL1egv36TkkJm+bA8AxicmQ= +k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/cmd/code-generator/hack/boilerplate.go.txt b/cmd/code-generator/hack/boilerplate.go.txt new file mode 100644 index 0000000..b7c650d --- /dev/null +++ b/cmd/code-generator/hack/boilerplate.go.txt @@ -0,0 +1,16 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + diff --git a/cmd/code-generator/hack/update-codegen.sh b/cmd/code-generator/hack/update-codegen.sh new file mode 100755 index 0000000..baac3d9 --- /dev/null +++ b/cmd/code-generator/hack/update-codegen.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. + +# generate the code with: +# - --output-base because this script should also be able to run inside the vendor dir of +# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir +# instead of the $GOPATH directly. For normal projects this can be dropped. +"$(dirname "${BASH_SOURCE[0]}")"/../generate-internal-groups.sh all \ + k8s.io/code-generator/_examples/apiserver k8s.io/code-generator/_examples/apiserver/apis k8s.io/code-generator/_examples/apiserver/apis \ + "example:v1 example2:v1 example3.io:v1" \ + --output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \ + --go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt" +"$(dirname "${BASH_SOURCE[0]}")"/../generate-groups.sh all \ + k8s.io/code-generator/_examples/crd k8s.io/code-generator/_examples/crd/apis \ + "example:v1 example2:v1" \ + --output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \ + --go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt" +"$(dirname "${BASH_SOURCE[0]}")"/../generate-groups.sh all \ + k8s.io/code-generator/_examples/MixedCase k8s.io/code-generator/_examples/MixedCase/apis \ + "example:v1" \ + --output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \ + --go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt" +"$(dirname "${BASH_SOURCE[0]}")"/../generate-groups.sh all \ + k8s.io/code-generator/_examples/HyphenGroup k8s.io/code-generator/_examples/HyphenGroup/apis \ + "example:v1" \ + --output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \ + --go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt" + diff --git a/cmd/code-generator/hack/verify-codegen.sh b/cmd/code-generator/hack/verify-codegen.sh new file mode 100755 index 0000000..3a9093e --- /dev/null +++ b/cmd/code-generator/hack/verify-codegen.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. + +DIFFROOT="${SCRIPT_ROOT}/_examples" +TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/_examples" +_tmp="${SCRIPT_ROOT}/_tmp" + +cleanup() { + rm -rf "${_tmp}" +} +trap "cleanup" EXIT SIGINT + +cleanup + +mkdir -p "${TMP_DIFFROOT}" +cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}" + +"${SCRIPT_ROOT}/hack/update-codegen.sh" +echo "diffing ${DIFFROOT} against freshly generated codegen" +ret=0 +diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" || ret=$? +cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}" +if [[ $ret -eq 0 ]] +then + echo "${DIFFROOT} up to date." +else + echo "${DIFFROOT} is out of date. Please run hack/update-codegen.sh" + exit 1 +fi + +# smoke test +echo "Smoke testing _example by compiling..." +go build "./${SCRIPT_ROOT}/_examples/crd/..." +go build "./${SCRIPT_ROOT}/_examples/apiserver/..." +go build "./${SCRIPT_ROOT}/_examples/MixedCase/..." +go build "./${SCRIPT_ROOT}/_examples/HyphenGroup/..." diff --git a/cmd/code-generator/pkg/namer/tag-override.go b/cmd/code-generator/pkg/namer/tag-override.go new file mode 100644 index 0000000..fd8c3a8 --- /dev/null +++ b/cmd/code-generator/pkg/namer/tag-override.go @@ -0,0 +1,58 @@ +/* +Copyright 2016 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package namer + +import ( + "k8s.io/gengo/namer" + "k8s.io/gengo/types" +) + +// TagOverrideNamer is a namer which pulls names from a given tag, if specified, +// and otherwise falls back to a different namer. +type TagOverrideNamer struct { + tagName string + fallback namer.Namer +} + +// Name returns the tag value if it exists. It no tag was found the fallback namer will be used +func (n *TagOverrideNamer) Name(t *types.Type) string { + if nameOverride := extractTag(n.tagName, append(t.SecondClosestCommentLines, t.CommentLines...)); nameOverride != "" { + return nameOverride + } + + return n.fallback.Name(t) +} + +// NewTagOverrideNamer creates a namer.Namer which uses the contents of the given tag as +// the name, or falls back to another Namer if the tag is not present. +func NewTagOverrideNamer(tagName string, fallback namer.Namer) namer.Namer { + return &TagOverrideNamer{ + tagName: tagName, + fallback: fallback, + } +} + +// extractTag gets the comment-tags for the key. If the tag did not exist, it +// returns the empty string. +func extractTag(key string, lines []string) string { + val, present := types.ExtractCommentTags("+", lines)[key] + if !present || len(val) < 1 { + return "" + } + + return val[0] +} diff --git a/cmd/code-generator/pkg/util/build.go b/cmd/code-generator/pkg/util/build.go new file mode 100644 index 0000000..6ed1fe4 --- /dev/null +++ b/cmd/code-generator/pkg/util/build.go @@ -0,0 +1,69 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package util + +import ( + gobuild "go/build" + "path" + "path/filepath" + "reflect" + "strings" +) + +type empty struct{} + +// CurrentPackage returns the go package of the current directory, or "" if it cannot +// be derived from the GOPATH. +func CurrentPackage() string { + for _, root := range gobuild.Default.SrcDirs() { + if pkg, ok := hasSubdir(root, "."); ok { + return pkg + } + } + return "" +} + +func hasSubdir(root, dir string) (rel string, ok bool) { + // ensure a tailing separator to properly compare on word-boundaries + const sep = string(filepath.Separator) + root = filepath.Clean(root) + if !strings.HasSuffix(root, sep) { + root += sep + } + + // check whether root dir starts with root + dir = filepath.Clean(dir) + if !strings.HasPrefix(dir, root) { + return "", false + } + + // cut off root + return filepath.ToSlash(dir[len(root):]), true +} + +// BoilerplatePath uses the boilerplate in code-generator by calculating the relative path to it. +func BoilerplatePath() string { + return path.Join(reflect.TypeOf(empty{}).PkgPath(), "/../../hack/boilerplate.go.txt") +} + +// Vendorless trims vendor prefix from a package path to make it canonical +func Vendorless(p string) string { + if pos := strings.LastIndex(p, "/vendor/"); pos != -1 { + return p[pos+len("/vendor/"):] + } + return p +} diff --git a/cmd/code-generator/pkg/util/plural_exceptions.go b/cmd/code-generator/pkg/util/plural_exceptions.go new file mode 100644 index 0000000..73c648d --- /dev/null +++ b/cmd/code-generator/pkg/util/plural_exceptions.go @@ -0,0 +1,37 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package util + +import ( + "fmt" + "strings" +) + +// PluralExceptionListToMapOrDie converts the list in "Type:PluralType" to map[string]string. +// This is used for pluralizer. +// If the format is wrong, this function will panic. +func PluralExceptionListToMapOrDie(pluralExceptions []string) map[string]string { + pluralExceptionMap := make(map[string]string, len(pluralExceptions)) + for i := range pluralExceptions { + parts := strings.Split(pluralExceptions[i], ":") + if len(parts) != 2 { + panic(fmt.Sprintf("invalid plural exception definition: %s", pluralExceptions[i])) + } + pluralExceptionMap[parts[0]] = parts[1] + } + return pluralExceptionMap +} diff --git a/cmd/code-generator/third_party/forked/golang/reflect/type.go b/cmd/code-generator/third_party/forked/golang/reflect/type.go new file mode 100644 index 0000000..67957ee --- /dev/null +++ b/cmd/code-generator/third_party/forked/golang/reflect/type.go @@ -0,0 +1,91 @@ +//This package is copied from Go library reflect/type.go. +//The struct tag library provides no way to extract the list of struct tags, only +//a specific tag +package reflect + +import ( + "fmt" + + "strconv" + "strings" +) + +type StructTag struct { + Name string + Value string +} + +func (t StructTag) String() string { + return fmt.Sprintf("%s:%q", t.Name, t.Value) +} + +type StructTags []StructTag + +func (tags StructTags) String() string { + s := make([]string, 0, len(tags)) + for _, tag := range tags { + s = append(s, tag.String()) + } + return "`" + strings.Join(s, " ") + "`" +} + +func (tags StructTags) Has(name string) bool { + for i := range tags { + if tags[i].Name == name { + return true + } + } + return false +} + +// ParseStructTags returns the full set of fields in a struct tag in the order they appear in +// the struct tag. +func ParseStructTags(tag string) (StructTags, error) { + tags := StructTags{} + for tag != "" { + // Skip leading space. + i := 0 + for i < len(tag) && tag[i] == ' ' { + i++ + } + tag = tag[i:] + if tag == "" { + break + } + + // Scan to colon. A space, a quote or a control character is a syntax error. + // Strictly speaking, control chars include the range [0x7f, 0x9f], not just + // [0x00, 0x1f], but in practice, we ignore the multi-byte control characters + // as it is simpler to inspect the tag's bytes than the tag's runes. + i = 0 + for i < len(tag) && tag[i] > ' ' && tag[i] != ':' && tag[i] != '"' && tag[i] != 0x7f { + i++ + } + if i == 0 || i+1 >= len(tag) || tag[i] != ':' || tag[i+1] != '"' { + break + } + name := string(tag[:i]) + tag = tag[i+1:] + + // Scan quoted string to find value. + i = 1 + for i < len(tag) && tag[i] != '"' { + if tag[i] == '\\' { + i++ + } + i++ + } + if i >= len(tag) { + break + } + qvalue := string(tag[:i+1]) + tag = tag[i+1:] + + value, err := strconv.Unquote(qvalue) + if err != nil { + return nil, err + } + tags = append(tags, StructTag{Name: name, Value: value}) + } + return tags, nil +} diff --git a/cmd/code-generator/tools.go b/cmd/code-generator/tools.go new file mode 100644 index 0000000..7d13de5 --- /dev/null +++ b/cmd/code-generator/tools.go @@ -0,0 +1,35 @@ +// +build tools + +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This package contains code generation utilities +// This package imports things required by build scripts, to force `go mod` to see them as dependencies +package tools + +import ( + _ "k8s.io/code-generator/cmd/client-gen" + _ "k8s.io/code-generator/cmd/conversion-gen" + _ "k8s.io/code-generator/cmd/deepcopy-gen" + _ "k8s.io/code-generator/cmd/defaulter-gen" + _ "k8s.io/code-generator/cmd/go-to-protobuf" + _ "k8s.io/code-generator/cmd/import-boss" + _ "k8s.io/code-generator/cmd/informer-gen" + _ "k8s.io/code-generator/cmd/lister-gen" + _ "k8s.io/code-generator/cmd/openapi-gen" + _ "k8s.io/code-generator/cmd/register-gen" + _ "k8s.io/code-generator/cmd/set-gen" +) diff --git a/hack/generate.sh b/hack/generate.sh index fc5c77b..2a0b177 100755 --- a/hack/generate.sh +++ b/hack/generate.sh @@ -10,7 +10,6 @@ echo "Running validation scripts..." scripts=( "make verify-generation-complete" - "make generate-docs" ) fail=0 for s in "${scripts[@]}"; do From 8bd1d20a4a51966e6819e3d053e00f71d147ccb0 Mon Sep 17 00:00:00 2001 From: James Rawlings Date: Wed, 30 Sep 2020 22:42:42 +0100 Subject: [PATCH 6/9] chore: go mod tidy --- go.mod | 2 -- go.sum | 11 ----------- 2 files changed, 13 deletions(-) diff --git a/go.mod b/go.mod index da07f0f..b17e79a 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,6 @@ require ( github.com/ghodss/yaml v1.0.0 github.com/go-openapi/spec v0.19.7 // indirect github.com/imdario/mergo v0.3.9 - github.com/jenkins-x/gen-crd-api-reference-docs v0.1.6 // indirect github.com/jenkins-x/jx-logging/v3 v3.0.0 github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a github.com/pkg/errors v0.9.1 @@ -26,5 +25,4 @@ require ( replace ( golang.org/x/sys => golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // pinned to release-branch.go1.13 golang.org/x/tools => golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 // pinned to release-branch.go1.13 - ) diff --git a/go.sum b/go.sum index 24653f7..c27ef19 100644 --- a/go.sum +++ b/go.sum @@ -140,8 +140,6 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/jenkins-x/gen-crd-api-reference-docs v0.1.6 h1:jV0THW6KeMYC0rcawdPeix7+ZmDZMR0UMU+QJr5gU6Y= -github.com/jenkins-x/gen-crd-api-reference-docs v0.1.6/go.mod h1:a4dzSf/nNLMMMqultm6IlV/04xq26uICEYPkSTOahWQ= github.com/jenkins-x/jx-logging/v3 v3.0.0 h1:Oqidp7EL+PUlZUUdPvOeWju9mMq2mzpd9/HWXdVM68E= github.com/jenkins-x/jx-logging/v3 v3.0.0/go.mod h1:bOYlj+Cdd9v7/vDXjkwlUylxGs5sfQJvYnuYbCL0IrY= github.com/jenkins-x/logrus-stackdriver-formatter v0.2.3 h1:NuRWKUPCEX1wKlXA8ZYSG28qGKd41R7BK11YDQkPwqo= @@ -196,7 +194,6 @@ github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGV github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -205,16 +202,11 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/rickar/props v0.0.0-20170718221555-0b06aeb2f037 h1:HFsTO5S+nnw/Xs9lRYF+UUJvH8wMSRMRal321W0hfdY= github.com/rickar/props v0.0.0-20170718221555-0b06aeb2f037/go.mod h1:F1p8BNM4IXv2UcptwSp8HJOapKurodd/PYu1D6Gtn9Y= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= @@ -383,12 +375,9 @@ k8s.io/client-go v0.19.2 h1:gMJuU3xJZs86L1oQ99R4EViAADUPMHHtS9jFshasHSc= k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA= k8s.io/code-generator v0.19.2 h1:7uaWJll6fyCPj2j3sfNN1AiY2gZU1VFN2dFR2uoxGWI= k8s.io/code-generator v0.19.2/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14 h1:t4L10Qfx/p7ASH3gXCdIUtPbbIuegCoUJf3TMSFekjw= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog v0.2.0 h1:0ElL0OHzF3N+OhoJTL0uca20SxtYt4X4+bzHeqrB83c= -k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= From c59c43370cab61e988620c850a9a887b6ecb5a30 Mon Sep 17 00:00:00 2001 From: James Rawlings Date: Thu, 1 Oct 2020 09:36:59 +0100 Subject: [PATCH 7/9] chore: avoid linting generated code --- hack/linter.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hack/linter.sh b/hack/linter.sh index 97ca928..20bd826 100755 --- a/hack/linter.sh +++ b/hack/linter.sh @@ -11,11 +11,13 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if ! [ -x "$(command -v golangci-lint)" ]; then echo "Installing GolangCI-Lint" - ${DIR}/install_golint.sh -b $GOPATH/bin v1.27.0 + ${DIR}/install_golint.sh -b $GOPATH/bin v1.31.0 fi export GOGC=10 GO111MODULE=on golangci-lint run \ --timeout 15m \ --verbose \ - --build-tags build + --build-tags build \ + --skip-dirs pkg/client \ + --skip-files pkg/apis/jenkins.io/v1/zz_generated.deepcopy.go From 0b14e425092989dde623a4591119456b95090426 Mon Sep 17 00:00:00 2001 From: James Rawlings Date: Thu, 1 Oct 2020 13:52:14 +0100 Subject: [PATCH 8/9] refactor: move project to semver v3 --- README.md | 2 +- .../apiserver/apis/example/install/install.go | 2 +- .../apis/example2/install/install.go | 2 +- .../apis/example3.io/install/install.go | 2 +- go.mod | 2 +- go.sum | 116 ++++++++++++++++++ hack/update-codegen.sh | 11 +- pkg/apis/jenkins.io/register.go | 2 +- pkg/apis/jenkins.io/v1/register.go | 2 +- .../jenkins.io/v1/types_environment_test.go | 2 +- pkg/apis/jenkins.io/v1/types_extensions.go | 2 +- pkg/client/clientset/versioned/clientset.go | 2 +- .../versioned/fake/clientset_generated.go | 6 +- .../clientset/versioned/fake/register.go | 2 +- .../clientset/versioned/scheme/register.go | 2 +- .../versioned/typed/jenkins.io/v1/app.go | 4 +- .../typed/jenkins.io/v1/buildpack.go | 4 +- .../typed/jenkins.io/v1/commitstatus.go | 4 +- .../typed/jenkins.io/v1/environment.go | 4 +- .../jenkins.io/v1/environmentrolebinding.go | 4 +- .../typed/jenkins.io/v1/extension.go | 4 +- .../versioned/typed/jenkins.io/v1/fact.go | 4 +- .../typed/jenkins.io/v1/fake/fake_app.go | 2 +- .../jenkins.io/v1/fake/fake_buildpack.go | 2 +- .../jenkins.io/v1/fake/fake_commitstatus.go | 2 +- .../jenkins.io/v1/fake/fake_environment.go | 2 +- .../v1/fake/fake_environmentrolebinding.go | 2 +- .../jenkins.io/v1/fake/fake_extension.go | 2 +- .../typed/jenkins.io/v1/fake/fake_fact.go | 2 +- .../jenkins.io/v1/fake/fake_gitservice.go | 2 +- .../v1/fake/fake_jenkins.io_client.go | 2 +- .../v1/fake/fake_pipelineactivity.go | 2 +- .../v1/fake/fake_pipelinestructure.go | 2 +- .../typed/jenkins.io/v1/fake/fake_plugin.go | 2 +- .../typed/jenkins.io/v1/fake/fake_release.go | 2 +- .../jenkins.io/v1/fake/fake_scheduler.go | 2 +- .../v1/fake/fake_sourcerepository.go | 2 +- .../v1/fake/fake_sourcerepositorygroup.go | 2 +- .../typed/jenkins.io/v1/fake/fake_team.go | 2 +- .../typed/jenkins.io/v1/fake/fake_user.go | 2 +- .../typed/jenkins.io/v1/fake/fake_workflow.go | 2 +- .../typed/jenkins.io/v1/gitservice.go | 4 +- .../typed/jenkins.io/v1/jenkins.io_client.go | 4 +- .../typed/jenkins.io/v1/pipelineactivity.go | 4 +- .../typed/jenkins.io/v1/pipelinestructure.go | 4 +- .../versioned/typed/jenkins.io/v1/plugin.go | 4 +- .../versioned/typed/jenkins.io/v1/release.go | 4 +- .../typed/jenkins.io/v1/scheduler.go | 4 +- .../typed/jenkins.io/v1/sourcerepository.go | 4 +- .../jenkins.io/v1/sourcerepositorygroup.go | 4 +- .../versioned/typed/jenkins.io/v1/team.go | 4 +- .../versioned/typed/jenkins.io/v1/user.go | 4 +- .../versioned/typed/jenkins.io/v1/workflow.go | 4 +- .../informers/externalversions/factory.go | 6 +- .../informers/externalversions/generic.go | 2 +- .../internalinterfaces/factory_interfaces.go | 2 +- .../externalversions/jenkins.io/interface.go | 4 +- .../externalversions/jenkins.io/v1/app.go | 8 +- .../jenkins.io/v1/buildpack.go | 8 +- .../jenkins.io/v1/commitstatus.go | 8 +- .../jenkins.io/v1/environment.go | 8 +- .../jenkins.io/v1/environmentrolebinding.go | 8 +- .../jenkins.io/v1/extension.go | 8 +- .../externalversions/jenkins.io/v1/fact.go | 8 +- .../jenkins.io/v1/gitservice.go | 8 +- .../jenkins.io/v1/interface.go | 2 +- .../jenkins.io/v1/pipelineactivity.go | 8 +- .../jenkins.io/v1/pipelinestructure.go | 8 +- .../externalversions/jenkins.io/v1/plugin.go | 8 +- .../externalversions/jenkins.io/v1/release.go | 8 +- .../jenkins.io/v1/scheduler.go | 8 +- .../jenkins.io/v1/sourcerepository.go | 8 +- .../jenkins.io/v1/sourcerepositorygroup.go | 8 +- .../externalversions/jenkins.io/v1/team.go | 8 +- .../externalversions/jenkins.io/v1/user.go | 8 +- .../jenkins.io/v1/workflow.go | 8 +- pkg/client/listers/jenkins.io/v1/app.go | 2 +- pkg/client/listers/jenkins.io/v1/buildpack.go | 2 +- .../listers/jenkins.io/v1/commitstatus.go | 2 +- .../listers/jenkins.io/v1/environment.go | 2 +- .../jenkins.io/v1/environmentrolebinding.go | 2 +- pkg/client/listers/jenkins.io/v1/extension.go | 2 +- pkg/client/listers/jenkins.io/v1/fact.go | 2 +- .../listers/jenkins.io/v1/gitservice.go | 2 +- .../listers/jenkins.io/v1/pipelineactivity.go | 2 +- .../jenkins.io/v1/pipelinestructure.go | 2 +- pkg/client/listers/jenkins.io/v1/plugin.go | 2 +- pkg/client/listers/jenkins.io/v1/release.go | 2 +- pkg/client/listers/jenkins.io/v1/scheduler.go | 2 +- .../listers/jenkins.io/v1/sourcerepository.go | 2 +- .../jenkins.io/v1/sourcerepositorygroup.go | 2 +- pkg/client/listers/jenkins.io/v1/team.go | 2 +- pkg/client/listers/jenkins.io/v1/user.go | 2 +- pkg/client/listers/jenkins.io/v1/workflow.go | 2 +- pkg/config/install_applications.go | 2 +- pkg/config/install_applications_test.go | 2 +- pkg/config/install_requirements.go | 6 +- pkg/config/install_requirements_test.go | 6 +- pkg/util/commands_test.go | 2 +- pkg/util/files_test.go | 2 +- pkg/util/json/patch_test.go | 4 +- pkg/util/urls_test.go | 2 +- 102 files changed, 308 insertions(+), 185 deletions(-) diff --git a/README.md b/README.md index 4c5d7e0..3068629 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Here's an example which also uses [Jenkins X logging](https://github.com/jenkins import ( "github.com/jenkins-x/jx-kube-client/v3/pkg/kubeclient" "github.com/jenkins-x/jx-logging/v3/pkg/log" - "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" + "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" ) func main() { diff --git a/cmd/code-generator/_examples/apiserver/apis/example/install/install.go b/cmd/code-generator/_examples/apiserver/apis/example/install/install.go index dc99fc3..17c4000 100644 --- a/cmd/code-generator/_examples/apiserver/apis/example/install/install.go +++ b/cmd/code-generator/_examples/apiserver/apis/example/install/install.go @@ -19,7 +19,7 @@ limitations under the License. package install import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/code-generator/_examples/apiserver/apis/example" diff --git a/cmd/code-generator/_examples/apiserver/apis/example2/install/install.go b/cmd/code-generator/_examples/apiserver/apis/example2/install/install.go index d949969..92659b0 100644 --- a/cmd/code-generator/_examples/apiserver/apis/example2/install/install.go +++ b/cmd/code-generator/_examples/apiserver/apis/example2/install/install.go @@ -19,7 +19,7 @@ limitations under the License. package install import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/code-generator/_examples/apiserver/apis/example2" diff --git a/cmd/code-generator/_examples/apiserver/apis/example3.io/install/install.go b/cmd/code-generator/_examples/apiserver/apis/example3.io/install/install.go index f692668..305a558 100644 --- a/cmd/code-generator/_examples/apiserver/apis/example3.io/install/install.go +++ b/cmd/code-generator/_examples/apiserver/apis/example3.io/install/install.go @@ -19,7 +19,7 @@ limitations under the License. package install import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" example3 "k8s.io/code-generator/_examples/apiserver/apis/example3.io" diff --git a/go.mod b/go.mod index b17e79a..b065c3e 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/jenkins-x/jx-api +module github.com/jenkins-x/jx-api/v3 go 1.15 diff --git a/go.sum b/go.sum index c27ef19..287bc79 100644 --- a/go.sum +++ b/go.sum @@ -25,6 +25,7 @@ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbt github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -33,18 +34,34 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/alecthomas/jsonschema v0.0.0-20190504002508-159cbd5dba26 h1:b/CA15BzZIj8xNKnBxUwUmXt3USfJjb4Gl9eJIfMLtE= github.com/alecthomas/jsonschema v0.0.0-20190504002508-159cbd5dba26/go.mod h1:qpebaTNSsyUn5rPSJMsfqEtDw71TTggXM6stUDI16HA= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= @@ -52,6 +69,7 @@ github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= @@ -63,6 +81,9 @@ github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2H github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= @@ -85,15 +106,21 @@ github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tF github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -115,6 +142,7 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -128,33 +156,51 @@ github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jenkins-x/jx-api v0.0.24 h1:i39bsG8lJpKsFBqXOjSXxTR++/OEX9uKAdgaeGKUpyc= +github.com/jenkins-x/jx-api v0.0.24/go.mod h1:QKLHk4VzI+sDBPSzN4K+QdEjNIBnCHS3DKY5YbGeCdY= +github.com/jenkins-x/jx-logging v0.0.11 h1:t4T653u6oy4SJ2VYlrY5rIobr16jJS9Gf8RWlHqtJvw= +github.com/jenkins-x/jx-logging v0.0.11/go.mod h1:mjEejiArk2Mk+J+72/YcSKGo9bZlJ/LwKYjMgAiv+G4= github.com/jenkins-x/jx-logging/v3 v3.0.0 h1:Oqidp7EL+PUlZUUdPvOeWju9mMq2mzpd9/HWXdVM68E= github.com/jenkins-x/jx-logging/v3 v3.0.0/go.mod h1:bOYlj+Cdd9v7/vDXjkwlUylxGs5sfQJvYnuYbCL0IrY= github.com/jenkins-x/logrus-stackdriver-formatter v0.2.3 h1:NuRWKUPCEX1wKlXA8ZYSG28qGKd41R7BK11YDQkPwqo= github.com/jenkins-x/logrus-stackdriver-formatter v0.2.3/go.mod h1:litPp7VZWDRCl8LvXuqGngy+65kkg/+T23TgFnDmfTk= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -163,6 +209,7 @@ github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= @@ -176,49 +223,87 @@ github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 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= +github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/petergtz/pegomock v2.7.0+incompatible/go.mod h1:nuBLWZpVyv/fLo56qTwt/AUau7jgouO1h7bEvZCq82o= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 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 v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rickar/props v0.0.0-20170718221555-0b06aeb2f037 h1:HFsTO5S+nnw/Xs9lRYF+UUJvH8wMSRMRal321W0hfdY= github.com/rickar/props v0.0.0-20170718221555-0b06aeb2f037/go.mod h1:F1p8BNM4IXv2UcptwSp8HJOapKurodd/PYu1D6Gtn9Y= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/satori/go.uuid v1.2.1-0.20180103174451-36e9d2ebbde5/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/vrischmann/envconfig v1.2.0 h1:5/u4fI34/g3m0SdTQj/6f3r640jv9E5+yTXIZOWsxk0= github.com/vrischmann/envconfig v1.2.0/go.mod h1:c5DuUlkzfsnspy1g7qiqryPCsW+NjsrLsYq4zhwsoHo= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c= @@ -227,13 +312,22 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= @@ -257,19 +351,24 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= @@ -288,6 +387,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a h1:aYOabOQFp6Vj6W1F80affTUvO9UxmJRx8K0gsfABByQ= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= @@ -329,6 +429,7 @@ google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -343,6 +444,7 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -353,8 +455,10 @@ gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -367,26 +471,38 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +k8s.io/api v0.16.5/go.mod h1:6ijJb2BQAkGSn+8Z3173M0LXe2gBAH+i/JAJptd/rJo= k8s.io/api v0.19.2 h1:q+/krnHWKsL7OBZg/rxnycsl9569Pud76UJ77MvKXms= k8s.io/api v0.19.2/go.mod h1:IQpK0zFQ1xc5iNIQPqzgoOwuFugaYHK4iCknlAQP9nI= +k8s.io/apimachinery v0.16.5/go.mod h1:mhhO3hoLkWO+2eCvqjPtH2Ly92l9nJDwsswzWKpkN2w= k8s.io/apimachinery v0.19.2 h1:5Gy9vQpAGTKHPVOh5c4plE274X8D/6cuEiTO2zve7tc= k8s.io/apimachinery v0.19.2/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= +k8s.io/client-go v0.16.5/go.mod h1:0Y5GaECkDkadoJg7lBQLiQQGFl67O4Gia/dHZboA7xg= k8s.io/client-go v0.19.2 h1:gMJuU3xJZs86L1oQ99R4EViAADUPMHHtS9jFshasHSc= k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA= k8s.io/code-generator v0.19.2 h1:7uaWJll6fyCPj2j3sfNN1AiY2gZU1VFN2dFR2uoxGWI= k8s.io/code-generator v0.19.2/go.mod h1:moqLn7w0t9cMs4+5CQyxnfA/HV8MF6aAVENF+WZZhgk= +k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14 h1:t4L10Qfx/p7ASH3gXCdIUtPbbIuegCoUJf3TMSFekjw= k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= +k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488 h1:mNpvQf4lkIHNOXCoM+Veu/UXwA56Yx1J7hY1Tvcs/oM= k8s.io/kube-openapi v0.0.0-20200923155610-8b5066479488/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= +k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200729134348-d5654de09c73 h1:uJmqzgNWG7XyClnU/mLPBWwfKKF1K8Hf8whTseBgJcg= k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 5c7adc2..62abdb8 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -22,12 +22,19 @@ set -o pipefail SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ./cmd/code-generator)} +rm -rf "${SCRIPT_ROOT}"/pkg/client + # generate the code with: # --output-base because this script should also be able to run inside the vendor dir of # k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir # instead of the $GOPATH directly. For normal projects this can be dropped. bash "${CODEGEN_PKG}"/generate-groups.sh all \ - github.com/jenkins-x/jx-api/pkg/client github.com/jenkins-x/jx-api/pkg/apis \ + github.com/jenkins-x/jx-api/v3/pkg/client github.com/jenkins-x/jx-api/v3/pkg/apis \ jenkins.io:v1 \ --output-base "$(dirname "${BASH_SOURCE[0]}")/../../../.." \ - --go-header-file "${SCRIPT_ROOT}"/hack/custom-boilerplate.go.txt \ No newline at end of file + --go-header-file "${SCRIPT_ROOT}"/hack/custom-boilerplate.go.txt + +cp -R "${SCRIPT_ROOT}"/v3/pkg/client/ "${SCRIPT_ROOT}"/pkg/client +cp -R "${SCRIPT_ROOT}"/v3/pkg/apis/jenkins.io/v1/zz_generated.deepcopy.go "${SCRIPT_ROOT}"/pkg/apis/jenkins.io/v1/zz_generated.deepcopy.go + +rm -rf "${SCRIPT_ROOT}"/v3 diff --git a/pkg/apis/jenkins.io/register.go b/pkg/apis/jenkins.io/register.go index 7d53366..08478bf 100644 --- a/pkg/apis/jenkins.io/register.go +++ b/pkg/apis/jenkins.io/register.go @@ -10,5 +10,5 @@ const ( GroupAndVersion = GroupName + "/" + Version // Package is the Go package in which the apis live - Package = "github.com/jenkins-x/jx-api/pkg/apis" + Package = "github.com/jenkins-x/jx-api/v3/pkg/apis" ) diff --git a/pkg/apis/jenkins.io/v1/register.go b/pkg/apis/jenkins.io/v1/register.go index afb0607..1b95162 100644 --- a/pkg/apis/jenkins.io/v1/register.go +++ b/pkg/apis/jenkins.io/v1/register.go @@ -1,7 +1,7 @@ package v1 import ( - jenkinsio "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io" + jenkinsio "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/apis/jenkins.io/v1/types_environment_test.go b/pkg/apis/jenkins.io/v1/types_environment_test.go index 3f22e7a..9f0fab4 100644 --- a/pkg/apis/jenkins.io/v1/types_environment_test.go +++ b/pkg/apis/jenkins.io/v1/types_environment_test.go @@ -6,7 +6,7 @@ import ( "path" "testing" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/stretchr/testify/assert" diff --git a/pkg/apis/jenkins.io/v1/types_extensions.go b/pkg/apis/jenkins.io/v1/types_extensions.go index 0cf01a1..c12a824 100644 --- a/pkg/apis/jenkins.io/v1/types_extensions.go +++ b/pkg/apis/jenkins.io/v1/types_extensions.go @@ -6,7 +6,7 @@ import ( "io/ioutil" "path/filepath" - "github.com/jenkins-x/jx-api/pkg/util" + "github.com/jenkins-x/jx-api/v3/pkg/util" "github.com/jenkins-x/jx-logging/v3/pkg/log" v1 "k8s.io/api/rbac/v1" diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 10c96df..76dc073 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -20,7 +20,7 @@ package versioned import ( "fmt" - jenkinsv1 "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/typed/jenkins.io/v1" + jenkinsv1 "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/typed/jenkins.io/v1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index a61a876..4de97e6 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -18,9 +18,9 @@ limitations under the License. package fake import ( - clientset "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - jenkinsv1 "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/typed/jenkins.io/v1" - fakejenkinsv1 "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake" + clientset "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + jenkinsv1 "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/typed/jenkins.io/v1" + fakejenkinsv1 "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 6b7ef57..cb1295b 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -18,7 +18,7 @@ limitations under the License. package fake import ( - jenkinsv1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsv1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index c6cbfc4..f1a4778 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -18,7 +18,7 @@ limitations under the License. package scheme import ( - jenkinsv1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsv1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/app.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/app.go index 2a81dbb..7eff789 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/app.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/app.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack.go index e707fae..7227986 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/buildpack.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus.go index 008b1b4..da02a2f 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/commitstatus.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment.go index b4d111d..d60d5ae 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environment.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding.go index 219f86a..348440d 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/environmentrolebinding.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension.go index 064f745..ca4320b 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/extension.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go index 8b218c5..e6c6927 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app.go index b0e07a2..22dc961 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_app.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack.go index 44e0c42..715aaf2 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_buildpack.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus.go index 334b40e..c7d8a02 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_commitstatus.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment.go index f815bbb..b3d386f 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environment.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding.go index 61c16e6..130f676 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_environmentrolebinding.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension.go index 66485cb..1fba7e1 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_extension.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go index 888c595..5c9705b 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice.go index a5f1393..fa4d698 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_gitservice.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_jenkins.io_client.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_jenkins.io_client.go index da3ac9c..1c2add0 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_jenkins.io_client.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_jenkins.io_client.go @@ -18,7 +18,7 @@ limitations under the License. package fake import ( - v1 "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/typed/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/typed/jenkins.io/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity.go index edbec78..4b4f756 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelineactivity.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go index c4b3f6b..28e7412 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin.go index 93c11f3..ceded06 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_plugin.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release.go index 9c53373..40f9b24 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_release.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go index 5441a9e..b3a5664 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository.go index 4cf1ee8..818fc0b 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepository.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepositorygroup.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepositorygroup.go index eb3eed5..e3445b3 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepositorygroup.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_sourcerepositorygroup.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team.go index 3d5b3a3..2c9b884 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_team.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user.go index 7add6c5..826ff67 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_user.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go index 54bce72..d86e251 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go @@ -20,7 +20,7 @@ package fake import ( "context" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice.go index b15a47c..dbbf3ab 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/gitservice.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/jenkins.io_client.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/jenkins.io_client.go index f42565f..f965017 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/jenkins.io_client.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/jenkins.io_client.go @@ -18,8 +18,8 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity.go index 4fc7e38..a2e9ca7 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelineactivity.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go index d87f2da..e6d5044 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin.go index 70e0a8b..886d233 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/plugin.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/release.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/release.go index 559135d..d3b6fd0 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/release.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/release.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go index db56690..228ef2a 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository.go index 7a72df9..3af0f39 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepository.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepositorygroup.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepositorygroup.go index 7e59c04..a534d49 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepositorygroup.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/sourcerepositorygroup.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/team.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/team.go index a81aa71..2da0c89 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/team.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/team.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/user.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/user.go index 5248185..d335097 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/user.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/user.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go index 677c170..a5c0ea0 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go @@ -21,8 +21,8 @@ import ( "context" "time" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned/scheme" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 9717c95..83c509d 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -22,9 +22,9 @@ import ( sync "sync" time "time" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - jenkinsio "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/jenkins.io" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + jenkinsio "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/jenkins.io" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 787a794..fc0a59c 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -20,7 +20,7 @@ package externalversions import ( "fmt" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) diff --git a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go index c8459a8..a85f568 100644 --- a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -20,7 +20,7 @@ package internalinterfaces import ( time "time" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" diff --git a/pkg/client/informers/externalversions/jenkins.io/interface.go b/pkg/client/informers/externalversions/jenkins.io/interface.go index f7179e9..da77084 100644 --- a/pkg/client/informers/externalversions/jenkins.io/interface.go +++ b/pkg/client/informers/externalversions/jenkins.io/interface.go @@ -18,8 +18,8 @@ limitations under the License. package jenkins import ( - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/jenkins.io/v1" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/jenkins.io/v1" ) // Interface provides access to each of this group's versions. diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/app.go b/pkg/client/informers/externalversions/jenkins.io/v1/app.go index ca1ff19..bc947dc 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/app.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/app.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/buildpack.go b/pkg/client/informers/externalversions/jenkins.io/v1/buildpack.go index 65def86..9474a8d 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/buildpack.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/buildpack.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/commitstatus.go b/pkg/client/informers/externalversions/jenkins.io/v1/commitstatus.go index 96b41df..d84e0cb 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/commitstatus.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/commitstatus.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/environment.go b/pkg/client/informers/externalversions/jenkins.io/v1/environment.go index 138d4c4..acca1df 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/environment.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/environment.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/environmentrolebinding.go b/pkg/client/informers/externalversions/jenkins.io/v1/environmentrolebinding.go index 71d014a..418fc82 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/environmentrolebinding.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/environmentrolebinding.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/extension.go b/pkg/client/informers/externalversions/jenkins.io/v1/extension.go index 0950c7c..2dcf88c 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/extension.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/extension.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/fact.go b/pkg/client/informers/externalversions/jenkins.io/v1/fact.go index cfacdb5..11a58dd 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/fact.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/fact.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/gitservice.go b/pkg/client/informers/externalversions/jenkins.io/v1/gitservice.go index c8efd91..ff1fa7f 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/gitservice.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/gitservice.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/interface.go b/pkg/client/informers/externalversions/jenkins.io/v1/interface.go index a6dfbb2..881150a 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/interface.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/interface.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" ) // Interface provides access to all the informers in this group version. diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/pipelineactivity.go b/pkg/client/informers/externalversions/jenkins.io/v1/pipelineactivity.go index 79cee10..9f83199 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/pipelineactivity.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/pipelineactivity.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go b/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go index d6de95b..927bb22 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/plugin.go b/pkg/client/informers/externalversions/jenkins.io/v1/plugin.go index bf145c1..f8be6bc 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/plugin.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/plugin.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/release.go b/pkg/client/informers/externalversions/jenkins.io/v1/release.go index 3fbaadd..12a195f 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/release.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/release.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go b/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go index d4e3aa2..d98f04e 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepository.go b/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepository.go index b0362b5..7a8c3fd 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepository.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepository.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepositorygroup.go b/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepositorygroup.go index fadf077..d66e625 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepositorygroup.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/sourcerepositorygroup.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/team.go b/pkg/client/informers/externalversions/jenkins.io/v1/team.go index 7ffb15a..e7ea3bd 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/team.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/team.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/user.go b/pkg/client/informers/externalversions/jenkins.io/v1/user.go index 852dcee..7e7fe77 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/user.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/user.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go b/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go index b1acb94..3801187 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go @@ -21,10 +21,10 @@ import ( "context" time "time" - jenkinsiov1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/pkg/client/listers/jenkins.io/v1" + jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" + versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" + internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/client/listers/jenkins.io/v1/app.go b/pkg/client/listers/jenkins.io/v1/app.go index 6704a64..5ee23be 100644 --- a/pkg/client/listers/jenkins.io/v1/app.go +++ b/pkg/client/listers/jenkins.io/v1/app.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/buildpack.go b/pkg/client/listers/jenkins.io/v1/buildpack.go index fc2a227..5bb4f8c 100644 --- a/pkg/client/listers/jenkins.io/v1/buildpack.go +++ b/pkg/client/listers/jenkins.io/v1/buildpack.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/commitstatus.go b/pkg/client/listers/jenkins.io/v1/commitstatus.go index 0e3fd59..24781f9 100644 --- a/pkg/client/listers/jenkins.io/v1/commitstatus.go +++ b/pkg/client/listers/jenkins.io/v1/commitstatus.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/environment.go b/pkg/client/listers/jenkins.io/v1/environment.go index 89159e4..d03b4c8 100644 --- a/pkg/client/listers/jenkins.io/v1/environment.go +++ b/pkg/client/listers/jenkins.io/v1/environment.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/environmentrolebinding.go b/pkg/client/listers/jenkins.io/v1/environmentrolebinding.go index e183e52..dd9c14a 100644 --- a/pkg/client/listers/jenkins.io/v1/environmentrolebinding.go +++ b/pkg/client/listers/jenkins.io/v1/environmentrolebinding.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/extension.go b/pkg/client/listers/jenkins.io/v1/extension.go index 09c977e..a7d786f 100644 --- a/pkg/client/listers/jenkins.io/v1/extension.go +++ b/pkg/client/listers/jenkins.io/v1/extension.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/fact.go b/pkg/client/listers/jenkins.io/v1/fact.go index 924231f..0d1e217 100644 --- a/pkg/client/listers/jenkins.io/v1/fact.go +++ b/pkg/client/listers/jenkins.io/v1/fact.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/gitservice.go b/pkg/client/listers/jenkins.io/v1/gitservice.go index d35321b..00459b5 100644 --- a/pkg/client/listers/jenkins.io/v1/gitservice.go +++ b/pkg/client/listers/jenkins.io/v1/gitservice.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/pipelineactivity.go b/pkg/client/listers/jenkins.io/v1/pipelineactivity.go index cd682f2..16547b4 100644 --- a/pkg/client/listers/jenkins.io/v1/pipelineactivity.go +++ b/pkg/client/listers/jenkins.io/v1/pipelineactivity.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/pipelinestructure.go b/pkg/client/listers/jenkins.io/v1/pipelinestructure.go index 47431aa..7ae8afa 100644 --- a/pkg/client/listers/jenkins.io/v1/pipelinestructure.go +++ b/pkg/client/listers/jenkins.io/v1/pipelinestructure.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/plugin.go b/pkg/client/listers/jenkins.io/v1/plugin.go index 1ac189c..d882c43 100644 --- a/pkg/client/listers/jenkins.io/v1/plugin.go +++ b/pkg/client/listers/jenkins.io/v1/plugin.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/release.go b/pkg/client/listers/jenkins.io/v1/release.go index 6c05246..ea583fb 100644 --- a/pkg/client/listers/jenkins.io/v1/release.go +++ b/pkg/client/listers/jenkins.io/v1/release.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/scheduler.go b/pkg/client/listers/jenkins.io/v1/scheduler.go index eec9220..4bdbe2e 100644 --- a/pkg/client/listers/jenkins.io/v1/scheduler.go +++ b/pkg/client/listers/jenkins.io/v1/scheduler.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/sourcerepository.go b/pkg/client/listers/jenkins.io/v1/sourcerepository.go index ccb093a..697a8d0 100644 --- a/pkg/client/listers/jenkins.io/v1/sourcerepository.go +++ b/pkg/client/listers/jenkins.io/v1/sourcerepository.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/sourcerepositorygroup.go b/pkg/client/listers/jenkins.io/v1/sourcerepositorygroup.go index 8ad0fe9..ae41f9b 100644 --- a/pkg/client/listers/jenkins.io/v1/sourcerepositorygroup.go +++ b/pkg/client/listers/jenkins.io/v1/sourcerepositorygroup.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/team.go b/pkg/client/listers/jenkins.io/v1/team.go index aa8693d..9732c93 100644 --- a/pkg/client/listers/jenkins.io/v1/team.go +++ b/pkg/client/listers/jenkins.io/v1/team.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/user.go b/pkg/client/listers/jenkins.io/v1/user.go index 73e662c..4a9c1fa 100644 --- a/pkg/client/listers/jenkins.io/v1/user.go +++ b/pkg/client/listers/jenkins.io/v1/user.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/client/listers/jenkins.io/v1/workflow.go b/pkg/client/listers/jenkins.io/v1/workflow.go index eae8a58..e89e72f 100644 --- a/pkg/client/listers/jenkins.io/v1/workflow.go +++ b/pkg/client/listers/jenkins.io/v1/workflow.go @@ -18,7 +18,7 @@ limitations under the License. package v1 import ( - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/config/install_applications.go b/pkg/config/install_applications.go index cb7f914..dedd1f6 100644 --- a/pkg/config/install_applications.go +++ b/pkg/config/install_applications.go @@ -6,7 +6,7 @@ import ( "path/filepath" "strings" - "github.com/jenkins-x/jx-api/pkg/util" + "github.com/jenkins-x/jx-api/v3/pkg/util" "github.com/ghodss/yaml" "github.com/pkg/errors" diff --git a/pkg/config/install_applications_test.go b/pkg/config/install_applications_test.go index f6bcf23..afe895d 100644 --- a/pkg/config/install_applications_test.go +++ b/pkg/config/install_applications_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/jenkins-x/jx-api/pkg/config" + "github.com/jenkins-x/jx-api/v3/pkg/config" "github.com/stretchr/testify/assert" ) diff --git a/pkg/config/install_requirements.go b/pkg/config/install_requirements.go index 920292d..e6f2d7f 100644 --- a/pkg/config/install_requirements.go +++ b/pkg/config/install_requirements.go @@ -4,8 +4,8 @@ import ( "encoding/json" "fmt" - "github.com/jenkins-x/jx-api/pkg/cloud" - "github.com/jenkins-x/jx-api/pkg/util" + "github.com/jenkins-x/jx-api/v3/pkg/cloud" + "github.com/jenkins-x/jx-api/v3/pkg/util" "github.com/jenkins-x/jx-logging/v3/pkg/log" "io/ioutil" @@ -20,7 +20,7 @@ import ( "github.com/pkg/errors" "github.com/vrischmann/envconfig" - v1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" ) var ( diff --git a/pkg/config/install_requirements_test.go b/pkg/config/install_requirements_test.go index 6faee83..bd34293 100644 --- a/pkg/config/install_requirements_test.go +++ b/pkg/config/install_requirements_test.go @@ -11,9 +11,9 @@ import ( "github.com/stretchr/testify/require" "github.com/ghodss/yaml" - "github.com/jenkins-x/jx-api/pkg/cloud" - "github.com/jenkins-x/jx-api/pkg/config" - "github.com/jenkins-x/jx-api/pkg/util" + "github.com/jenkins-x/jx-api/v3/pkg/cloud" + "github.com/jenkins-x/jx-api/v3/pkg/config" + "github.com/jenkins-x/jx-api/v3/pkg/util" "github.com/jenkins-x/jx-logging/v3/pkg/log" "github.com/stretchr/testify/assert" ) diff --git a/pkg/util/commands_test.go b/pkg/util/commands_test.go index 9efa891..32df348 100644 --- a/pkg/util/commands_test.go +++ b/pkg/util/commands_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/jenkins-x/jx-api/pkg/util" + "github.com/jenkins-x/jx-api/v3/pkg/util" "github.com/stretchr/testify/assert" ) diff --git a/pkg/util/files_test.go b/pkg/util/files_test.go index 2372d6f..127b164 100644 --- a/pkg/util/files_test.go +++ b/pkg/util/files_test.go @@ -6,7 +6,7 @@ import ( "path/filepath" "testing" - "github.com/jenkins-x/jx-api/pkg/util" + "github.com/jenkins-x/jx-api/v3/pkg/util" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/pkg/util/json/patch_test.go b/pkg/util/json/patch_test.go index 5e0007a..e79d3e2 100644 --- a/pkg/util/json/patch_test.go +++ b/pkg/util/json/patch_test.go @@ -3,9 +3,9 @@ package json_test import ( "testing" - "github.com/jenkins-x/jx-api/pkg/util/json" + "github.com/jenkins-x/jx-api/v3/pkg/util/json" - jenkinsv1 "github.com/jenkins-x/jx-api/pkg/apis/jenkins.io/v1" + jenkinsv1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" "github.com/stretchr/testify/assert" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/pkg/util/urls_test.go b/pkg/util/urls_test.go index 558119a..466e5eb 100644 --- a/pkg/util/urls_test.go +++ b/pkg/util/urls_test.go @@ -3,7 +3,7 @@ package util_test import ( "testing" - "github.com/jenkins-x/jx-api/pkg/util" + "github.com/jenkins-x/jx-api/v3/pkg/util" "github.com/stretchr/testify/assert" ) From 1622e797dbe933522546bb5f9655dc51d8845ba3 Mon Sep 17 00:00:00 2001 From: James Rawlings Date: Fri, 2 Oct 2020 09:18:15 +0100 Subject: [PATCH 9/9] refactor: remove old Jenkins X APIs fact, pipeline_sheduler, pipelinestructure and workflow --- pkg/apis/jenkins.io/v1/register.go | 8 - pkg/apis/jenkins.io/v1/types_fact.go | 125 -- .../jenkins.io/v1/types_pipeline_scheduler.go | 485 ----- .../jenkins.io/v1/types_pipelinestructure.go | 137 -- pkg/apis/jenkins.io/v1/types_workflow.go | 97 - .../jenkins.io/v1/zz_generated.deepcopy.go | 1846 +---------------- .../versioned/typed/jenkins.io/v1/fact.go | 177 -- .../typed/jenkins.io/v1/fake/fake_fact.go | 129 -- .../v1/fake/fake_jenkins.io_client.go | 16 - .../v1/fake/fake_pipelinestructure.go | 129 -- .../jenkins.io/v1/fake/fake_scheduler.go | 129 -- .../typed/jenkins.io/v1/fake/fake_workflow.go | 129 -- .../jenkins.io/v1/generated_expansion.go | 8 - .../typed/jenkins.io/v1/jenkins.io_client.go | 20 - .../typed/jenkins.io/v1/pipelinestructure.go | 177 -- .../typed/jenkins.io/v1/scheduler.go | 177 -- .../versioned/typed/jenkins.io/v1/workflow.go | 177 -- .../informers/externalversions/generic.go | 8 - .../externalversions/jenkins.io/v1/fact.go | 89 - .../jenkins.io/v1/interface.go | 28 - .../jenkins.io/v1/pipelinestructure.go | 89 - .../jenkins.io/v1/scheduler.go | 89 - .../jenkins.io/v1/workflow.go | 89 - .../jenkins.io/v1/expansion_generated.go | 32 - pkg/client/listers/jenkins.io/v1/fact.go | 98 - .../jenkins.io/v1/pipelinestructure.go | 98 - pkg/client/listers/jenkins.io/v1/scheduler.go | 98 - pkg/client/listers/jenkins.io/v1/workflow.go | 98 - 28 files changed, 78 insertions(+), 4704 deletions(-) delete mode 100644 pkg/apis/jenkins.io/v1/types_fact.go delete mode 100644 pkg/apis/jenkins.io/v1/types_pipeline_scheduler.go delete mode 100644 pkg/apis/jenkins.io/v1/types_pipelinestructure.go delete mode 100644 pkg/apis/jenkins.io/v1/types_workflow.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go delete mode 100644 pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go delete mode 100644 pkg/client/informers/externalversions/jenkins.io/v1/fact.go delete mode 100644 pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go delete mode 100644 pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go delete mode 100644 pkg/client/informers/externalversions/jenkins.io/v1/workflow.go delete mode 100644 pkg/client/listers/jenkins.io/v1/fact.go delete mode 100644 pkg/client/listers/jenkins.io/v1/pipelinestructure.go delete mode 100644 pkg/client/listers/jenkins.io/v1/scheduler.go delete mode 100644 pkg/client/listers/jenkins.io/v1/workflow.go diff --git a/pkg/apis/jenkins.io/v1/register.go b/pkg/apis/jenkins.io/v1/register.go index 1b95162..2f87d9d 100644 --- a/pkg/apis/jenkins.io/v1/register.go +++ b/pkg/apis/jenkins.io/v1/register.go @@ -51,18 +51,12 @@ func addKnownTypes(scheme *runtime.Scheme) error { &EnvironmentRoleBindingList{}, &Extension{}, &ExtensionList{}, - &Fact{}, - &FactList{}, &GitService{}, &GitServiceList{}, &PluginList{}, &Plugin{}, &PipelineActivity{}, &PipelineActivityList{}, - &Scheduler{}, - &SchedulerList{}, - &PipelineStructure{}, - &PipelineStructureList{}, &Release{}, &ReleaseList{}, &SourceRepository{}, @@ -73,8 +67,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &TeamList{}, &User{}, &UserList{}, - &Workflow{}, - &WorkflowList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/pkg/apis/jenkins.io/v1/types_fact.go b/pkg/apis/jenkins.io/v1/types_fact.go deleted file mode 100644 index 58944f4..0000000 --- a/pkg/apis/jenkins.io/v1/types_fact.go +++ /dev/null @@ -1,125 +0,0 @@ -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true - -// Fact represents observed facts. Apps will generate Facts about the system. -// A naming schema is required since each Fact has a name that's unique for the whole system. -// Apps should prefix their generated Facts with the name of the App, like -. -// This makes that different Apps can't possibly have conflicting Fact names. -// -// For an app generating facts on a pipeline, which will be have several different executions, we recommend --. -type Fact struct { - metav1.TypeMeta `json:",inline"` - // The Fact labels will be used to query the API for interesting Facts. - // The Apps responsible for creating Facts need to add the relevant labels. - // For example, creating Facts on a pipeline would create Facts with the following labels - // { - // subjectkind: PipelineActivity - // pipelineName: my-org-my-app-master-23 - // org: my-org - // repo: my-app - // branch: master - // buildNumber: 23 - // } - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - Spec FactSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` - Status FactStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// FactSpec is the specification of a Fact -type FactSpec struct { - Name string `json:"name" protobuf:"bytes,1,opt,name=name"` - FactType string `json:"factType" protobuf:"bytes,3,opt,name=factType"` - Measurements []Measurement `json:"measurements,omitempty" protobuf:"bytes,4,opt,name=measurements"` - // +optional - Statements []Statement `json:"statements,omitempty" protobuf:"bytes,5,opt,name=statements"` - // +optional - Original Original `json:"original,omitempty" protobuf:"bytes,6,opt,name=original"` - // +optional - Tags []string `json:"tags,omitempty" protobuf:"bytes,7,opt,name=tags"` - SubjectReference ResourceReference `json:"subject" protobuf:"bytes,8,opt,name=subject"` -} - -// FactStatus is the status for an Fact resource -type FactStatus struct { - Version string `json:"version,omitempty" protobuf:"bytes,1,opt,name=version"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// FactList is a list of Fact resources -type FactList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []Fact `json:"items"` -} - -// Measurement is a percentage or a count, something measured that the system will capture within a fact -type Measurement struct { - Name string `json:"name" protobuf:"bytes,1,opt,name=name"` - MeasurementType string `json:"measurementType" protobuf:"bytes,2,opt,name=measurementType"` - MeasurementValue int `json:"measurementValue" protobuf:"bytes,3,opt,name=measurementValue"` - Tags []string `json:"tags,omitempty" protobuf:"bytes,4,opt,name=tags"` -} - -// Statement represents a decision that was made, for example that a promotion was approved or denied -type Statement struct { - Name string `json:"name" protobuf:"bytes,1,opt,name=name"` - StatementType string `json:"statementType" protobuf:"bytes,2,opt,name=statementType"` - MeasurementValue bool `json:"measurementValue" protobuf:"bytes,3,opt,name=measurementValue"` - Tags []string `json:"tags,omitempty" protobuf:"bytes,4,opt,name=tags"` -} - -// Original contains the report -type Original struct { - MimeType string `json:"mimetype,omitempty" protobuf:"bytes,1,opt,name=mimetype"` - URL string `json:"url,omitempty" protobuf:"bytes,1,opt,name=url"` - Tags []string `json:"tags,omitempty" protobuf:"bytes,8,opt,name=tags"` -} - -// Recommended measurements for static program analysis -const ( - StaticProgramAnalysisTotalClasses = "TotalClasses" - StaticProgramAnalysisTotalBugs = "TotalBugs" - StaticProgramAnalysisHighPriority = "High" - StaticProgramAnalysisNormalPriority = "Normal" - StaticProgramAnalysisLowPriority = "Low" - StaticProgramAnalysisIgnored = "Ignored" -) - -// Recommended measurements for code coverage -const ( - CodeCoverageMeasurementTotal = "Total" - CodeCoverageMeasurementMissed = "Missed" - CodeCoverageMeasurementCoverage = "Covered" -) - -// Recommended types for code coverage count -const ( - CodeCoverageCountTypeInstructions = "Instructions" - CodeCoverageCountTypeBranches = "Branches" - CodeCoverageCountTypeComplexity = "Complexity" - CodeCoverageCountTypeLines = "Lines" - CodeCoverageCountTypeMethods = "Methods" - CodeCoverageCountTypeClasses = "Classes" -) - -const ( - MeasurementPercent = "percent" - MeasurementCount = "count" -) - -const ( - FactTypeCoverage = "jx.coverage" - FactTypeStaticProgramAnalysis = "jx.staticProgramAnalysis" -) diff --git a/pkg/apis/jenkins.io/v1/types_pipeline_scheduler.go b/pkg/apis/jenkins.io/v1/types_pipeline_scheduler.go deleted file mode 100644 index 001e2f7..0000000 --- a/pkg/apis/jenkins.io/v1/types_pipeline_scheduler.go +++ /dev/null @@ -1,485 +0,0 @@ -package v1 - -import ( - "time" - - v1 "k8s.io/api/core/v1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true - -// Scheduler is configuration for a pipeline scheduler -type Scheduler struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - Spec SchedulerSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// SchedulerList is a list of configurations for a pipeline scheduler -type SchedulerList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []Scheduler `json:"items"` -} - -// TODO Support Label plugin? -// TODO Support Size plugin? -// TODO Support Welcome plugin? -// TODO Support Blockade plugin? -// TODO Support Golint plugin? -// TODO Support RepoMilestone plugin? -// TODO Support RequireMatchingLabel plugin? -// TODO Support Blunderbuss plugin? -// TODO Support Config Updater Plugin? -// TODO Support Owners plugin? -// TODO Support Heart plugin? -// TODO Support requiresig plugin? -// TODO support sigmention plugin? -// TODO support slack plugin? - -// SchedulerSpec defines the pipeline scheduler (e.g. Prow) configuration -type SchedulerSpec struct { - ScehdulerAgent *SchedulerAgent `json:"schedulerAgent,omitempty" protobuf:"bytes,1,opt,name=schedulerAgent"` - Policy *GlobalProtectionPolicy `json:"policy,omitempty" protobuf:"bytes,2,opt,name=policy"` - Presubmits *Presubmits `json:"presubmits,omitempty" protobuf:"bytes,3,opt,name=presubmits"` - Postsubmits *Postsubmits `json:"postsubmits,omitempty" protobuf:"bytes,4,opt,name=postsubmits"` - Trigger *Trigger `json:"trigger,omitempty" protobuf:"bytes,5,opt,name=trigger"` - Approve *Approve `json:"approve,omitempty" protobuf:"bytes,6,opt,name=approve"` - LGTM *Lgtm `json:"lgtm,omitempty" protobuf:"bytes,7,opt,name=lgtm"` - ExternalPlugins *ReplaceableSliceOfExternalPlugins `json:"externalPlugins,omitempty" protobuf:"bytes,8,opt,name=externalPlugins"` - - Merger *Merger `json:"merger,omitempty" protobuf:"bytes,9,opt,name=merger"` - - // Plugins is a list of plugin names enabled for a repo - Plugins *ReplaceableSliceOfStrings `json:"plugins,omitempty" protobuf:"bytes,10,opt,name=plugins"` - ConfigUpdater *ConfigUpdater `json:"configUpdater,omitempty" protobuf:"bytes,11,opt,name=configUpdater"` - Welcome []*Welcome `json:"welcome,omitempty" protobuf:"bytes,12,opt,name=welcome"` - Periodics *Periodics `json:"periodics,omitempty" protobuf:"bytes,13,opt,name=periodics"` - Attachments []*Attachment `json:"attachments,omitempty" protobuf:"bytes,13,opt,name=attachments"` -} - -// ConfigMapSpec contains configuration options for the configMap being updated -// by the config-updater plugin. -type ConfigMapSpec struct { - // Name of ConfigMap - Name string `json:"name"` - // Key is the key in the ConfigMap to update with the file contents. - // If no explicit key is given, the basename of the file will be used. - Key string `json:"key,omitempty"` - // Namespace in which the configMap needs to be deployed. If no namespace is specified - // it will be deployed to the ProwJobNamespace. - Namespace string `json:"namespace,omitempty"` - // Namespaces in which the configMap needs to be deployed, in addition to the above - // namespace provided, or the default if it is not set. - AdditionalNamespaces []string `json:"additional_namespaces,omitempty"` - - // Namespaces is the fully resolved list of Namespaces to deploy the ConfigMap in - Namespaces []string `json:"-"` -} - -// ConfigUpdater holds configuration for the config updater plugin -type ConfigUpdater struct { - Map map[string]ConfigMapSpec `json:"map,omitempty" protobuf:"bytes,1,opt,name=map"` - ConfigFile string `json:"configFile,omitempty" protobuf:"bytes,2,opt,name=configFile"` - PluginFile string `json:"pluginFile,omitempty" protobuf:"bytes,3,opt,name=pluginFile"` - // +optional - ConfigMap ConfigMapSpec -} - -// ExternalPlugin holds configuration for registering an external -// plugin. -type ExternalPlugin struct { - // Name of the plugin. - Name *string `json:"name" protobuf:"bytes,1,opt,name=name"` - // Endpoint is the location of the external plugin. Defaults to - // the name of the plugin, ie. "http://{{name}}". - Endpoint *string `json:"endpoint,omitempty" protobuf:"bytes,2,opt,name=endpoint"` - // ReplaceableSliceOfStrings are the events that need to be demuxed by the hook - // server to the external plugin. If no events are specified, - // everything is sent. - Events *ReplaceableSliceOfStrings `json:"events,omitempty" protobuf:"bytes,3,opt,name=events"` -} - -// ReplaceableSliceOfStrings is a slice of strings that can optionally completely replace the slice of strings -// defined in the parent scheduler -type ReplaceableSliceOfStrings struct { - // Items is the string values - Items []string `json:"entries,omitempty" protobuf:"bytes,1,opt,name=entries"` - // Replace the existing entries - Replace bool `json:"replace,omitempty" protobuf:"bytes,2,opt,name=replace"` -} - -// Lgtm specifies a configuration for a single lgtm. -// The configuration for the lgtm plugin is defined as a list of these structures. -type Lgtm struct { - // ReviewActsAsLgtm indicates that a Github review of "approve" or "request changes" - // acts as adding or removing the lgtm label - ReviewActsAsLgtm *bool `json:"reviewActsAsLgtm,omitempty" protobuf:"bytes,1,opt,name=reviewActsAsLgtm"` - // StoreTreeHash indicates if tree_hash should be stored inside a comment to detect - // squashed commits before removing lgtm labels - StoreTreeHash *bool `json:"storeTreeHash,omitempty" protobuf:"bytes,2,opt,name=storeTreeHash"` - // WARNING: This disables the security mechanism that prevents a malicious member (or - // compromised GitHub account) from merging arbitrary code. Use with caution. - // - // StickyLgtmTeam specifies the Github team whose members are trusted with sticky LGTM, - // which eliminates the need to re-lgtm minor fixes/updates. - StickyLgtmTeam *string `json:"trustedTeamForStickyLgtm,omitempty" protobuf:"bytes,3,opt,name=stickyLgtmTeam"` -} - -// Approve specifies a configuration for a single approve. -// -// The configuration for the approve plugin is defined as a list of these structures. -type Approve struct { - // IssueRequired indicates if an associated issue is required for approval in - // the specified repos. - IssueRequired *bool `json:"issueRequired,omitempty" protobuf:"bytes,1,opt,name=issueRequired"` - - // RequireSelfApproval requires PR authors to explicitly approve their PRs. - // Otherwise the plugin assumes the author of the PR approves the changes in the PR. - RequireSelfApproval *bool `json:"requireSelfApproval,omitempty" protobuf:"bytes,2,opt,name=requireSelfApproval"` - - // LgtmActsAsApprove indicates that the lgtm command should be used to - // indicate approval - LgtmActsAsApprove *bool `json:"lgtmActsAsApprove,omitempty" protobuf:"bytes,3,opt,name=lgtmActsAsApprove"` - - // IgnoreReviewState causes the approve plugin to ignore the GitHub review state. Otherwise: - // * an APPROVE github review is equivalent to leaving an "/approve" message. - // * A REQUEST_CHANGES github review is equivalent to leaving an /approve cancel" message. - IgnoreReviewState *bool `json:"ignoreReviewState,omitempty" protobuf:"bytes,4,opt,name=ignoreReviewState"` -} - -// Trigger specifies a configuration for a single trigger. -// -// The configuration for the trigger plugin is defined as a list of these structures. -type Trigger struct { - // TrustedOrg is the org whose members' PRs will be automatically built - // for PRs to the above repos. The default is the PR's org. - TrustedOrg *string `json:"trustedOrg,omitempty" protobuf:"bytes,1,opt,name=trustedOrg"` - // JoinOrgURL is a link that redirects users to a location where they - // should be able to read more about joining the organization in order - // to become trusted members. Defaults to the Github link of TrustedOrg. - JoinOrgURL *string `json:"joinOrgUrl,omitempty" protobuf:"bytes,2,opt,name=joinOrgUrl"` - // OnlyOrgMembers requires PRs and/or /ok-to-test comments to come from org members. - // By default, trigger also include repo collaborators. - OnlyOrgMembers *bool `json:"onlyOrgMembers,omitempty" protobuf:"bytes,3,opt,name=onlyOrgMembers"` - // IgnoreOkToTest makes trigger ignore /ok-to-test comments. - // This is a security mitigation to only allow testing from trusted users. - IgnoreOkToTest *bool `json:"ignoreOkToTest,omitempty" protobuf:"bytes,4,opt,name=ignoreOkToTest"` -} - -// Postsubmits is a list of Postsubmit job configurations that can optionally completely replace the Postsubmit job -// configurations in the parent scheduler -type Postsubmits struct { - // Items are the post submit configurations - Items []*Postsubmit `json:"entries,omitempty" protobuf:"bytes,1,opt,name=entries"` - // Replace the existing entries - Replace bool `json:"replace,omitempty" protobuf:"bytes,2,opt,name=replace"` -} - -// Postsubmit runs on push events. -type Postsubmit struct { - // +optional - *JobBase - // +optional - *RegexpChangeMatcher - // +optional - *Brancher - - // Context is the name of the GitHub status context for the job. - Context *string `json:"context" protobuf:"bytes,1,opt,name=context"` - - // Report will comment and set status on GitHub. - Report *bool `json:"report,omitempty" protobuf:"bytes,2,opt,name=report"` -} - -// JobBase contains attributes common to all job types -type JobBase struct { - // The name of the job. Must match regex [A-Za-z0-9-._]+ - // e.g. pull-test-infra-bazel-build - Name *string `json:"name" protobuf:"bytes,1,opt,name=name"` - // ReplaceableMapOfStringString are added to jobs and pods created for this job. - Labels *ReplaceableMapOfStringString `json:"labels,omitempty" protobuf:"bytes,2,opt,name=labels"` - // MaximumConcurrency of this job, 0 implies no limit. - MaxConcurrency *int `json:"maxConcurrency,omitempty" protobuf:"bytes,3,opt,name=maxConcurrency"` - // Agent that will take care of running this job. - Agent *string `json:"agent" protobuf:"bytes,4,opt,name=agent"` - // Cluster is the alias of the cluster to run this job in. - // (Default: kube.DefaultClusterAlias) - Cluster *string `json:"cluster,omitempty" protobuf:"bytes,5,opt,name=cluster"` - // Namespace is the namespace in which pods schedule. - // empty: results in scheduler.DefaultNamespace - Namespace *string `json:"namespace,omitempty" protobuf:"bytes,6,opt,name=namespace"` - // Spec is the Kubernetes pod spec used if Agent is kubernetes. - Spec *v1.PodSpec `json:"spec,omitempty"` -} - -// ReplaceableMapOfStringString is a map of strings that can optionally completely replace the map of strings in the -// parent scheduler -type ReplaceableMapOfStringString struct { - Items map[string]string `json:"entries,omitempty" protobuf:"bytes,1,opt,name=entries"` - // Replace the existing entries - Replace bool `json:"replace,omitempty" protobuf:"bytes,2,opt,name=replace"` -} - -// Presubmits is a list of Presubmit job configurations that can optionally completely replace the Presubmit job -// configurations in the parent scheduler -type Presubmits struct { - // Items are the Presubmit configurtations - Items []*Presubmit `json:"entries,omitempty" protobuf:"bytes,1,opt,name=entries"` - // Replace the existing entries - Replace bool `json:"replace,omitempty" protobuf:"bytes,2,opt,name=replace"` -} - -// Presubmit defines a job configuration for pull requests -type Presubmit struct { - // +optional - *JobBase - // +optional - *Brancher - // +optional - *RegexpChangeMatcher - - // AlwaysRun automatically for every PR, or only when a comment triggers it. By default true. - AlwaysRun *bool `json:"alwaysRun" protobuf:"bytes,1,opt,name=alwaysRun"` - - // Context is the name of the Git Provider status context for the job. - Context *string `json:"context" protobuf:"bytes,2,opt,name=context"` - // Optional indicates that the job's status context should not be required for merge. By default false. - Optional *bool `json:"optional,omitempty" protobuf:"bytes,3,opt,name=optional"` - // Report enables reporting the job status on the git provider - Report *bool `json:"report,omitempty" protobuf:"bytes,4,opt,name=report"` - - // Trigger is the regular expression to trigger the job. - // e.g. `@k8s-bot e2e test this` - // RerunCommand must also be specified if this field is specified. - // (Default: `(?m)^/test (?:.*? )?(?: .*?)?$`) - Trigger *string `json:"trigger" protobuf:"bytes,5,opt,name=trigger"` - // The RerunCommand to give users. Must match Trigger. - // Trigger must also be specified if this field is specified. - // (Default: `/test `) - RerunCommand *string `json:"rerunCommand" protobuf:"bytes,6,opt,name=rerunCommand"` - // Override the default method of merge. Valid options are squash, rebase, and merge. - MergeType *string `json:"mergeMethod,omitempty" protobuf:"bytes,7,opt,name=mergeMethod"` - - Queries []*Query `json:"queries,omitempty" protobuf:"bytes,8,opt,name=query"` - - Policy *ProtectionPolicies `json:"policy,omitempty" protobuf:"bytes,9,opt,name=policy"` - // ContextOptions defines the merge options. If not set it will infer - // the required and optional contexts from the jobs configured and use the Git Provider - // combined status; otherwise it may apply the branch protection setting or let user - // define their own options in case branch protection is not used. - ContextPolicy *RepoContextPolicy `json:"context_options,omitempty" protobuf:"bytes,10,opt,name=contextPolicy"` -} - -// Periodics is a list of jobs to be run periodically -type Periodics struct { - // Items are the post submit configurations - Items []*Periodic `json:"entries,omitempty" protobuf:"bytes,1,opt,name=entries"` - // Replace the existing entries - Replace bool `json:"replace,omitempty" protobuf:"bytes,2,opt,name=replace"` -} - -// Periodic defines a job to be run periodically -type Periodic struct { - // +optional - *JobBase - // Interval to wait between two runs of the job. - Interval *string `json:"interval"` - // Cron representation of job trigger time - Cron *string `json:"cron"` - // Tags for config entries - Tags *ReplaceableSliceOfStrings `json:"tags,omitempty"` -} - -// Query is turned into a Git Provider search query. See the docs for details: -// https://help.github.com/articles/searching-issues-and-pull-requests/ -type Query struct { - ExcludedBranches *ReplaceableSliceOfStrings `json:"excludedBranches,omitempty" protobuf:"bytes,1,opt,name=excludedBranches"` - IncludedBranches *ReplaceableSliceOfStrings `json:"includedBranches,omitempty" protobuf:"bytes,2,opt,name=includedBranches"` - Labels *ReplaceableSliceOfStrings `json:"labels,omitempty" protobuf:"bytes,3,opt,name=labels"` - MissingLabels *ReplaceableSliceOfStrings `json:"missingLabels,omitempty" protobuf:"bytes,4,opt,name=missingLabels"` - Milestone *string `json:"milestone,omitempty" protobuf:"bytes,5,opt,name=milestone"` - ReviewApprovedRequired *bool `json:"reviewApprovedRequired,omitempty" protobuf:"bytes,6,opt,name=reviewApprovedRequired"` -} - -// PullRequestMergeType enumerates the types of merges the Git Provider API can -// perform -// https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button -type PullRequestMergeType string - -// Possible types of merges for the Git Provider merge API -const ( - MergeMerge PullRequestMergeType = "merge" - MergeRebase PullRequestMergeType = "rebase" - MergeSquash PullRequestMergeType = "squash" -) - -// Merger defines the options used to merge the PR -type Merger struct { - // SyncPeriod specifies how often Merger will sync jobs with Github. Defaults to 1m. - SyncPeriod *time.Duration `json:"-"` - // StatusUpdatePeriod - StatusUpdatePeriod *time.Duration `json:"-"` - - // URL for status contexts. - TargetURL *string `json:"targetUrl,omitempty" protobuf:"bytes,1,opt,name=targetUrl"` - - // PRStatusBaseURL is the base URL for the PR status page. - // This is used to link to a merge requirements overview - // in the status context. - PRStatusBaseURL *string `json:"prStatusBaseUrl,omitempty" protobuf:"bytes,2,opt,name=prStatusBaseURL"` - - // BlockerLabel is an optional label that is used to identify merge blocking - // Git Provider issues. - // Leave this blank to disable this feature and save 1 API token per sync loop. - BlockerLabel *string `json:"blockerLabel,omitempty"` - - // SquashLabel is an optional label that is used to identify PRs that should - // always be squash merged. - // Leave this blank to disable this feature. - SquashLabel *string `json:"squashLabel,omitempty"` - - // MaxGoroutines is the maximum number of goroutines spawned inside the - // controller to handle org/repo:branch pools. Defaults to 20. Needs to be a - // positive number. - MaxGoroutines *int `json:"maxGoroutines,omitempty"` - - // Override the default method of merge. Valid options are squash, rebase, and merge. - MergeType *string `json:"mergeMethod,omitempty"` - - // ContextOptions defines the default merge options. If not set it will infer - // the required and optional contexts from the jobs configured and use the Git Provider - // combined status; otherwise it may apply the branch protection setting or let user - // define their own options in case branch protection is not used. - ContextPolicy *ContextPolicy `json:"policy,omitempty"` -} - -// RepoContextPolicy overrides the policy for repo, and any branch overrides. -type RepoContextPolicy struct { - *ContextPolicy - Branches *ReplaceableMapOfStringContextPolicy `json:"branches,omitempty"` -} - -// ReplaceableMapOfStringContextPolicy is a map of context policies that can optionally completely replace any -// context policies defined in the parent scheduler -type ReplaceableMapOfStringContextPolicy struct { - Replace bool `json:"replace,omitempty"` - Items map[string]*ContextPolicy -} - -// ContextPolicy configures options about how to handle various contexts. -type ContextPolicy struct { - // whether to consider unknown contexts optional (skip) or required. - SkipUnknownContexts *bool `json:"skipUnknownContexts,omitempty"` - RequiredContexts *ReplaceableSliceOfStrings `json:"requiredContexts,omitempty"` - RequiredIfPresentContexts *ReplaceableSliceOfStrings `json:"requiredIfPresentContexts,omitempty"` - OptionalContexts *ReplaceableSliceOfStrings `json:"optionalContexts,omitempty"` - // Infer required and optional jobs from Branch Protection configuration - FromBranchProtection *bool `json:"fromBranchProtection,omitempty"` -} - -// Welcome welcome plugin config -type Welcome struct { - MessageTemplate *string `json:"message_template,omitempty"` -} - -// Brancher is for shared code between jobs that only run against certain -// branches. An empty brancher runs against all branches. -type Brancher struct { - // Do not run against these branches. Default is no branches. - SkipBranches *ReplaceableSliceOfStrings `json:"skipBranches,omitempty"` - // Only run against these branches. Default is all branches. - Branches *ReplaceableSliceOfStrings `json:"branches,omitempty"` -} - -// RegexpChangeMatcher is for code shared between jobs that run only when certain files are changed. -type RegexpChangeMatcher struct { - // RunIfChanged defines a regex used to select which subset of file changes should trigger this job. - // If any file in the changeset matches this regex, the job will be triggered - RunIfChanged *string `json:"runIfChanged,omitempty"` -} - -// GlobalProtectionPolicy defines the default branch protection policy for the scheduler -type GlobalProtectionPolicy struct { - // +optional - *ProtectionPolicy - ProtectTested *bool `json:"protectTested,omitempty"` -} - -// ProtectionPolicy for merging. -type ProtectionPolicy struct { - // Protect overrides whether branch protection is enabled if set. - Protect *bool `json:"protect,omitempty"` - // RequiredStatusChecks configures github contexts - RequiredStatusChecks *BranchProtectionContextPolicy `json:"requiredStatusChecks,omitempty"` - // Admins overrides whether protections apply to admins if set. - Admins *bool `json:"enforceAdmins,omitempty"` - // Restrictions limits who can merge - Restrictions *Restrictions `json:"restrictions,omitempty"` - // RequiredPullRequestReviews specifies approval/review criteria. - RequiredPullRequestReviews *ReviewPolicy `json:"requiredPullRequestReviews,omitempty"` -} - -// ReviewPolicy specifies git provider approval/review criteria. -// Any nil values inherit the policy from the parent, otherwise bool/ints are overridden. -// Non-empty lists are appended to parent lists. -type ReviewPolicy struct { - // Restrictions appends users/teams that are allowed to merge - DismissalRestrictions *Restrictions `json:"dismissalRestrictions,omitempty"` - // DismissStale overrides whether new commits automatically dismiss old reviews if set - DismissStale *bool `json:"dismissStaleReviews,omitempty"` - // RequireOwners overrides whether CODEOWNERS must approve PRs if set - RequireOwners *bool `json:"requireCodeOwnerReviews,omitempty"` - // Approvals overrides the number of approvals required if set (set to 0 to disable) - Approvals *int `json:"requiredApprovingReviewCount,omitempty"` -} - -// Restrictions limits who can merge -// Users and Teams entries are appended to parent lists. -type Restrictions struct { - Users *ReplaceableSliceOfStrings `json:"users"` - Teams *ReplaceableSliceOfStrings `json:"teams"` -} - -// BranchProtectionContextPolicy configures required git provider contexts. -// Strict determines whether merging to the branch invalidates existing contexts. -type BranchProtectionContextPolicy struct { - // Contexts appends required contexts that must be green to merge - Contexts *ReplaceableSliceOfStrings `json:"contexts,omitempty"` - // Strict overrides whether new commits in the base branch require updating the PR if set - Strict *bool `json:"strict,omitempty"` -} - -// SchedulerAgent defines the scheduler agent configuration -type SchedulerAgent struct { - // Agent defines the agent used to schedule jobs, by default Prow - Agent *string `json:"agent"` -} - -// ProtectionPolicies defines the branch protection policies -type ProtectionPolicies struct { - // +optional - *ProtectionPolicy - // +optional - Replace bool - Items map[string]*ProtectionPolicy `json:"entries,omitempty" protobuf:"bytes,1,opt,name=entries"` -} - -// ReplaceableSliceOfExternalPlugins is a list of external plugins that can optionally completely replace the plugins -// in any parent SchedulerSpec -type ReplaceableSliceOfExternalPlugins struct { - Replace bool - Items []*ExternalPlugin `json:"entries,omitempty" protobuf:"bytes,1,opt,name=entries"` -} diff --git a/pkg/apis/jenkins.io/v1/types_pipelinestructure.go b/pkg/apis/jenkins.io/v1/types_pipelinestructure.go deleted file mode 100644 index 6a27175..0000000 --- a/pkg/apis/jenkins.io/v1/types_pipelinestructure.go +++ /dev/null @@ -1,137 +0,0 @@ -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true - -// PipelineStructure contains references to the Pipeline and PipelineRun, and a list of PipelineStructureStages in the -// pipeline. This allows us to map between a running Pod to its TaskRun, to the TaskRun's Task and PipelineRun, and -// finally from there to the stage and potential parent stages that the Pod is actually executing, for use with -// populating PipelineActivity and providing logs. -type PipelineStructure struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - PipelineRef *string `json:"pipelineRef" protobuf:"bytes,2,opt,name=pipelineref"` - PipelineRunRef *string `json:"pipelineRunRef" protobuf:"bytes,3,opt,name=pipelinerunref"` - - Stages []PipelineStructureStage `json:"stages,omitempty" protobuf:"bytes,3,opt,name=stages"` -} - -// PipelineStructureStage contains the stage's name, one of either a reference to the Task corresponding -// to the stage if it has steps, a list of sequential stage names nested within this stage, or a list of parallel stage -// names nested within this stage, and information on this stage's depth within the PipelineStructure as a whole, the -// name of its parent stage, if any, the name of the stage before it in execution order, if any, and the name of the -// stage after it in execution order, if any. -type PipelineStructureStage struct { - Name string `json:"name" protobuf:"bytes,1,opt,name=name"` - - // Must have one of TaskRef+TaskRunRef, Stages, or Parallel - // +optional - TaskRef *string `json:"taskRef,omitempty" protobuf:"bytes,2,opt,name=taskref"` - // Populated during pod discovery, not at initial creation time. - // +optional - TaskRunRef *string `json:"taskRunRef,omitempty" protobuf:"bytes,3,opt,name=taskrunref"` - // +optional - Stages []string `json:"stages,omitempty" protobuf:"bytes,4,opt,name=stages"` - // +optional - Parallel []string `json:"parallel,omitempty" protobuf:"bytes,5,opt,name=parallel"` - - Depth int8 `json:"depth" protobuf:"bytes,6,opt,name=depth"` - // +optional - Parent *string `json:"parent,omitempty" protobuf:"bytes,7,opt,name=parent"` - // +optional - Previous *string `json:"previous,omitempty" protobuf:"bytes,8,opt,name=previous"` - // +optional - Next *string `json:"next,omitempty" protobuf:"bytes,9,opt,name=next"` -} - -// GetStage will get the PipelineStructureStage with the given name, if it exists. -func (ps *PipelineStructure) GetStage(name string) *PipelineStructureStage { - for _, s := range ps.Stages { - if s.Name == name { - return &s - } - } - - return nil -} - -// PipelineStageAndChildren represents a single stage and its children. -// +k8s:openapi-gen=false -type PipelineStageAndChildren struct { - Stage PipelineStructureStage - Parallel []PipelineStageAndChildren - Stages []PipelineStageAndChildren -} - -// GetAllStagesAndChildren will get a slice of all top-level stages in this pipeline, with their children -func (ps *PipelineStructure) GetAllStagesAndChildren() []*PipelineStageAndChildren { - var stages []*PipelineStageAndChildren - - for _, s := range ps.Stages { - if s.Depth == 0 { - psc := ps.GetStageAndChildren(s.Name) - if psc != nil { - stages = append(stages, psc) - } - } - } - - return stages -} - -// GetStageAndChildren will get a stage of a given name and all of its child stages. -func (ps *PipelineStructure) GetStageAndChildren(name string) *PipelineStageAndChildren { - stage := ps.GetStage(name) - if stage != nil { - psc := &PipelineStageAndChildren{ - Stage: *stage.DeepCopy(), - } - for _, s := range stage.Parallel { - childPsc := ps.GetStageAndChildren(s) - if childPsc != nil { - psc.Parallel = append(psc.Parallel, *childPsc) - } - } - for _, s := range stage.Stages { - childPsc := ps.GetStageAndChildren(s) - if childPsc != nil { - psc.Stages = append(psc.Stages, *childPsc) - } - } - - return psc - } - - return nil -} - -// GetAllStagesWithSteps gets all stages in this pipeline that have steps, and therefore will have a pod. -func (ps *PipelineStructure) GetAllStagesWithSteps() []PipelineStructureStage { - var stages []PipelineStructureStage - - for _, s := range ps.Stages { - if len(s.Stages) == 0 && len(s.Parallel) == 0 { - stages = append(stages, s) - } - } - return stages -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// PipelineStructureList is a list of PipelineStructureList resources -type PipelineStructureList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []PipelineStructure `json:"items"` -} diff --git a/pkg/apis/jenkins.io/v1/types_workflow.go b/pkg/apis/jenkins.io/v1/types_workflow.go deleted file mode 100644 index 320cb19..0000000 --- a/pkg/apis/jenkins.io/v1/types_workflow.go +++ /dev/null @@ -1,97 +0,0 @@ -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +genclient:noStatus -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:openapi-gen=true - -// Workflow represents pipeline activity for a particular run of a pipeline -type Workflow struct { - metav1.TypeMeta `json:",inline"` - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - Spec WorkflowSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` - Status WorkflowStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` -} - -// WorkflowSpec is the specification of the pipeline activity -type WorkflowSpec struct { - PipelineName string `json:"pipeline,omitempty" protobuf:"bytes,1,opt,name=pipeline"` - Steps []WorkflowStep `json:"steps,omitempty" protobuf:"bytes,7,opt,name=steps"` -} - -// WorkflowStep represents a step in a pipeline activity -type WorkflowStep struct { - Kind WorkflowStepKindType `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"` - Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` - Description string `json:"description,omitempty" protobuf:"bytes,2,opt,name=description"` - Preconditions WorkflowPreconditions `json:"trigger,omitempty" protobuf:"bytes,3,opt,name=trigger"` - Promote *PromoteWorkflowStep `json:"promote,omitempty" protobuf:"bytes,4,opt,name=promote"` -} - -// PromoteWorkflowStep is the step of promoting a version of an application to an environment -type PromoteWorkflowStep struct { - Environment string `json:"environment,omitempty" protobuf:"bytes,1,opt,name=environment"` -} - -// WorkflowPreconditions is the trigger to start a step -type WorkflowPreconditions struct { - // the names of the environments which need to have promoted before this step can be triggered - Environments []string `json:"environments,omitempty" protobuf:"bytes,1,opt,name=environments"` -} - -// WorkflowStatus is the status for an Environment resource -type WorkflowStatus struct { - Version string `json:"version,omitempty" protobuf:"bytes,1,opt,name=version"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// WorkflowList is a list of Workflow resources -type WorkflowList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata"` - - Items []Workflow `json:"items"` -} - -// WorkflowStepKindType is a kind of step -type WorkflowStepKindType string - -const ( - // WorkflowStepKindTypeNone no kind yet - WorkflowStepKindTypeNone WorkflowStepKindType = "" - // WorkflowStepKindTypePromote a promote activity - WorkflowStepKindTypePromote WorkflowStepKindType = "Promote" -) - -// WorkflowStatusType is the status of an activity; usually succeeded or failed/error on completion -type WorkflowStatusType string - -const ( - // WorkflowStatusTypeNone an activity step has not started yet - WorkflowStatusTypeNone WorkflowStatusType = "" - // WorkflowStatusTypePending an activity step is waiting to start - WorkflowStatusTypePending WorkflowStatusType = "Pending" - // WorkflowStatusTypeRunning an activity is running - WorkflowStatusTypeRunning WorkflowStatusType = "Running" - // WorkflowStatusTypeSucceeded an activity completed successfully - WorkflowStatusTypeSucceeded WorkflowStatusType = "Succeeded" - // WorkflowStatusTypeFailed an activity failed - WorkflowStatusTypeFailed WorkflowStatusType = "Failed" - // WorkflowStatusTypeWaitingForApproval an activity is waiting for approval - WorkflowStatusTypeWaitingForApproval WorkflowStatusType = "WaitingForApproval" - // WorkflowStatusTypeError there is some error with an activity - WorkflowStatusTypeError WorkflowStatusType = "Error" -) - -func (s WorkflowStatusType) String() string { - return string(s) -} diff --git a/pkg/apis/jenkins.io/v1/zz_generated.deepcopy.go b/pkg/apis/jenkins.io/v1/zz_generated.deepcopy.go index 90a0b33..082908e 100644 --- a/pkg/apis/jenkins.io/v1/zz_generated.deepcopy.go +++ b/pkg/apis/jenkins.io/v1/zz_generated.deepcopy.go @@ -20,8 +20,6 @@ limitations under the License. package v1 import ( - time "time" - batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" @@ -135,42 +133,6 @@ func (in *AppSpec) DeepCopy() *AppSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Approve) DeepCopyInto(out *Approve) { - *out = *in - if in.IssueRequired != nil { - in, out := &in.IssueRequired, &out.IssueRequired - *out = new(bool) - **out = **in - } - if in.RequireSelfApproval != nil { - in, out := &in.RequireSelfApproval, &out.RequireSelfApproval - *out = new(bool) - **out = **in - } - if in.LgtmActsAsApprove != nil { - in, out := &in.LgtmActsAsApprove, &out.LgtmActsAsApprove - *out = new(bool) - **out = **in - } - if in.IgnoreReviewState != nil { - in, out := &in.IgnoreReviewState, &out.IgnoreReviewState - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Approve. -func (in *Approve) DeepCopy() *Approve { - if in == nil { - return nil - } - out := new(Approve) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Attachment) DeepCopyInto(out *Attachment) { *out = *in @@ -229,58 +191,6 @@ func (in *Binary) DeepCopy() *Binary { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BranchProtectionContextPolicy) DeepCopyInto(out *BranchProtectionContextPolicy) { - *out = *in - if in.Contexts != nil { - in, out := &in.Contexts, &out.Contexts - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - if in.Strict != nil { - in, out := &in.Strict, &out.Strict - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BranchProtectionContextPolicy. -func (in *BranchProtectionContextPolicy) DeepCopy() *BranchProtectionContextPolicy { - if in == nil { - return nil - } - out := new(BranchProtectionContextPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Brancher) DeepCopyInto(out *Brancher) { - *out = *in - if in.SkipBranches != nil { - in, out := &in.SkipBranches, &out.SkipBranches - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - if in.Branches != nil { - in, out := &in.Branches, &out.Branches - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Brancher. -func (in *Brancher) DeepCopy() *Brancher { - if in == nil { - return nil - } - out := new(Brancher) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BuildPack) DeepCopyInto(out *BuildPack) { *out = *in @@ -549,97 +459,6 @@ func (in *CommitSummary) DeepCopy() *CommitSummary { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigMapSpec) DeepCopyInto(out *ConfigMapSpec) { - *out = *in - if in.AdditionalNamespaces != nil { - in, out := &in.AdditionalNamespaces, &out.AdditionalNamespaces - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Namespaces != nil { - in, out := &in.Namespaces, &out.Namespaces - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapSpec. -func (in *ConfigMapSpec) DeepCopy() *ConfigMapSpec { - if in == nil { - return nil - } - out := new(ConfigMapSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ConfigUpdater) DeepCopyInto(out *ConfigUpdater) { - *out = *in - if in.Map != nil { - in, out := &in.Map, &out.Map - *out = make(map[string]ConfigMapSpec, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - in.ConfigMap.DeepCopyInto(&out.ConfigMap) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigUpdater. -func (in *ConfigUpdater) DeepCopy() *ConfigUpdater { - if in == nil { - return nil - } - out := new(ConfigUpdater) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ContextPolicy) DeepCopyInto(out *ContextPolicy) { - *out = *in - if in.SkipUnknownContexts != nil { - in, out := &in.SkipUnknownContexts, &out.SkipUnknownContexts - *out = new(bool) - **out = **in - } - if in.RequiredContexts != nil { - in, out := &in.RequiredContexts, &out.RequiredContexts - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - if in.RequiredIfPresentContexts != nil { - in, out := &in.RequiredIfPresentContexts, &out.RequiredIfPresentContexts - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - if in.OptionalContexts != nil { - in, out := &in.OptionalContexts, &out.OptionalContexts - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - if in.FromBranchProtection != nil { - in, out := &in.FromBranchProtection, &out.FromBranchProtection - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContextPolicy. -func (in *ContextPolicy) DeepCopy() *ContextPolicy { - if in == nil { - return nil - } - out := new(ContextPolicy) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CoreActivityStep) DeepCopyInto(out *CoreActivityStep) { *out = *in @@ -1360,151 +1179,6 @@ func (in *ExtensionSpec) DeepCopy() *ExtensionSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExternalPlugin) DeepCopyInto(out *ExternalPlugin) { - *out = *in - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.Endpoint != nil { - in, out := &in.Endpoint, &out.Endpoint - *out = new(string) - **out = **in - } - if in.Events != nil { - in, out := &in.Events, &out.Events - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalPlugin. -func (in *ExternalPlugin) DeepCopy() *ExternalPlugin { - if in == nil { - return nil - } - out := new(ExternalPlugin) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Fact) DeepCopyInto(out *Fact) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Fact. -func (in *Fact) DeepCopy() *Fact { - if in == nil { - return nil - } - out := new(Fact) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Fact) 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 *FactList) DeepCopyInto(out *FactList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Fact, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FactList. -func (in *FactList) DeepCopy() *FactList { - if in == nil { - return nil - } - out := new(FactList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *FactList) 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 *FactSpec) DeepCopyInto(out *FactSpec) { - *out = *in - if in.Measurements != nil { - in, out := &in.Measurements, &out.Measurements - *out = make([]Measurement, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Statements != nil { - in, out := &in.Statements, &out.Statements - *out = make([]Statement, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.Original.DeepCopyInto(&out.Original) - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - out.SubjectReference = in.SubjectReference - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FactSpec. -func (in *FactSpec) DeepCopy() *FactSpec { - if in == nil { - return nil - } - out := new(FactSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FactStatus) DeepCopyInto(out *FactStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FactStatus. -func (in *FactStatus) DeepCopy() *FactStatus { - if in == nil { - return nil - } - out := new(FactStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GitService) DeepCopyInto(out *GitService) { *out = *in @@ -1597,32 +1271,6 @@ func (in *GitStatus) DeepCopy() *GitStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GlobalProtectionPolicy) DeepCopyInto(out *GlobalProtectionPolicy) { - *out = *in - if in.ProtectionPolicy != nil { - in, out := &in.ProtectionPolicy, &out.ProtectionPolicy - *out = new(ProtectionPolicy) - (*in).DeepCopyInto(*out) - } - if in.ProtectTested != nil { - in, out := &in.ProtectTested, &out.ProtectTested - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalProtectionPolicy. -func (in *GlobalProtectionPolicy) DeepCopy() *GlobalProtectionPolicy { - if in == nil { - return nil - } - out := new(GlobalProtectionPolicy) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IssueLabel) DeepCopyInto(out *IssueLabel) { *out = *in @@ -1682,269 +1330,21 @@ func (in *IssueSummary) DeepCopy() *IssueSummary { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JobBase) DeepCopyInto(out *JobBase) { +func (in *PipelineActivity) DeepCopyInto(out *PipelineActivity) { *out = *in - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = new(ReplaceableMapOfStringString) - (*in).DeepCopyInto(*out) - } - if in.MaxConcurrency != nil { - in, out := &in.MaxConcurrency, &out.MaxConcurrency - *out = new(int) - **out = **in - } - if in.Agent != nil { - in, out := &in.Agent, &out.Agent - *out = new(string) - **out = **in - } - if in.Cluster != nil { - in, out := &in.Cluster, &out.Cluster - *out = new(string) - **out = **in - } - if in.Namespace != nil { - in, out := &in.Namespace, &out.Namespace - *out = new(string) - **out = **in - } - if in.Spec != nil { - in, out := &in.Spec, &out.Spec - *out = new(corev1.PodSpec) - (*in).DeepCopyInto(*out) - } + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobBase. -func (in *JobBase) DeepCopy() *JobBase { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineActivity. +func (in *PipelineActivity) DeepCopy() *PipelineActivity { if in == nil { return nil } - out := new(JobBase) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Lgtm) DeepCopyInto(out *Lgtm) { - *out = *in - if in.ReviewActsAsLgtm != nil { - in, out := &in.ReviewActsAsLgtm, &out.ReviewActsAsLgtm - *out = new(bool) - **out = **in - } - if in.StoreTreeHash != nil { - in, out := &in.StoreTreeHash, &out.StoreTreeHash - *out = new(bool) - **out = **in - } - if in.StickyLgtmTeam != nil { - in, out := &in.StickyLgtmTeam, &out.StickyLgtmTeam - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Lgtm. -func (in *Lgtm) DeepCopy() *Lgtm { - if in == nil { - return nil - } - out := new(Lgtm) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Measurement) DeepCopyInto(out *Measurement) { - *out = *in - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Measurement. -func (in *Measurement) DeepCopy() *Measurement { - if in == nil { - return nil - } - out := new(Measurement) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Merger) DeepCopyInto(out *Merger) { - *out = *in - if in.SyncPeriod != nil { - in, out := &in.SyncPeriod, &out.SyncPeriod - *out = new(time.Duration) - **out = **in - } - if in.StatusUpdatePeriod != nil { - in, out := &in.StatusUpdatePeriod, &out.StatusUpdatePeriod - *out = new(time.Duration) - **out = **in - } - if in.TargetURL != nil { - in, out := &in.TargetURL, &out.TargetURL - *out = new(string) - **out = **in - } - if in.PRStatusBaseURL != nil { - in, out := &in.PRStatusBaseURL, &out.PRStatusBaseURL - *out = new(string) - **out = **in - } - if in.BlockerLabel != nil { - in, out := &in.BlockerLabel, &out.BlockerLabel - *out = new(string) - **out = **in - } - if in.SquashLabel != nil { - in, out := &in.SquashLabel, &out.SquashLabel - *out = new(string) - **out = **in - } - if in.MaxGoroutines != nil { - in, out := &in.MaxGoroutines, &out.MaxGoroutines - *out = new(int) - **out = **in - } - if in.MergeType != nil { - in, out := &in.MergeType, &out.MergeType - *out = new(string) - **out = **in - } - if in.ContextPolicy != nil { - in, out := &in.ContextPolicy, &out.ContextPolicy - *out = new(ContextPolicy) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Merger. -func (in *Merger) DeepCopy() *Merger { - if in == nil { - return nil - } - out := new(Merger) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Original) DeepCopyInto(out *Original) { - *out = *in - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Original. -func (in *Original) DeepCopy() *Original { - if in == nil { - return nil - } - out := new(Original) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Periodic) DeepCopyInto(out *Periodic) { - *out = *in - if in.JobBase != nil { - in, out := &in.JobBase, &out.JobBase - *out = new(JobBase) - (*in).DeepCopyInto(*out) - } - if in.Interval != nil { - in, out := &in.Interval, &out.Interval - *out = new(string) - **out = **in - } - if in.Cron != nil { - in, out := &in.Cron, &out.Cron - *out = new(string) - **out = **in - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Periodic. -func (in *Periodic) DeepCopy() *Periodic { - if in == nil { - return nil - } - out := new(Periodic) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Periodics) DeepCopyInto(out *Periodics) { - *out = *in - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]*Periodic, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(Periodic) - (*in).DeepCopyInto(*out) - } - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Periodics. -func (in *Periodics) DeepCopy() *Periodics { - if in == nil { - return nil - } - out := new(Periodics) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PipelineActivity) DeepCopyInto(out *PipelineActivity) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineActivity. -func (in *PipelineActivity) DeepCopy() *PipelineActivity { - if in == nil { - return nil - } - out := new(PipelineActivity) + out := new(PipelineActivity) in.DeepCopyInto(out) return out } @@ -2104,164 +1504,6 @@ func (in *PipelineExtension) DeepCopy() *PipelineExtension { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PipelineStageAndChildren) DeepCopyInto(out *PipelineStageAndChildren) { - *out = *in - in.Stage.DeepCopyInto(&out.Stage) - if in.Parallel != nil { - in, out := &in.Parallel, &out.Parallel - *out = make([]PipelineStageAndChildren, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Stages != nil { - in, out := &in.Stages, &out.Stages - *out = make([]PipelineStageAndChildren, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineStageAndChildren. -func (in *PipelineStageAndChildren) DeepCopy() *PipelineStageAndChildren { - if in == nil { - return nil - } - out := new(PipelineStageAndChildren) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PipelineStructure) DeepCopyInto(out *PipelineStructure) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.PipelineRef != nil { - in, out := &in.PipelineRef, &out.PipelineRef - *out = new(string) - **out = **in - } - if in.PipelineRunRef != nil { - in, out := &in.PipelineRunRef, &out.PipelineRunRef - *out = new(string) - **out = **in - } - if in.Stages != nil { - in, out := &in.Stages, &out.Stages - *out = make([]PipelineStructureStage, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineStructure. -func (in *PipelineStructure) DeepCopy() *PipelineStructure { - if in == nil { - return nil - } - out := new(PipelineStructure) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PipelineStructure) 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 *PipelineStructureList) DeepCopyInto(out *PipelineStructureList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PipelineStructure, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineStructureList. -func (in *PipelineStructureList) DeepCopy() *PipelineStructureList { - if in == nil { - return nil - } - out := new(PipelineStructureList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PipelineStructureList) 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 *PipelineStructureStage) DeepCopyInto(out *PipelineStructureStage) { - *out = *in - if in.TaskRef != nil { - in, out := &in.TaskRef, &out.TaskRef - *out = new(string) - **out = **in - } - if in.TaskRunRef != nil { - in, out := &in.TaskRunRef, &out.TaskRunRef - *out = new(string) - **out = **in - } - if in.Stages != nil { - in, out := &in.Stages, &out.Stages - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Parallel != nil { - in, out := &in.Parallel, &out.Parallel - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Parent != nil { - in, out := &in.Parent, &out.Parent - *out = new(string) - **out = **in - } - if in.Previous != nil { - in, out := &in.Previous, &out.Previous - *out = new(string) - **out = **in - } - if in.Next != nil { - in, out := &in.Next, &out.Next - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineStructureStage. -func (in *PipelineStructureStage) DeepCopy() *PipelineStructureStage { - if in == nil { - return nil - } - out := new(PipelineStructureStage) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Plugin) DeepCopyInto(out *Plugin) { *out = *in @@ -2344,206 +1586,24 @@ func (in *PluginSpec) DeepCopy() *PluginSpec { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Postsubmit) DeepCopyInto(out *Postsubmit) { +func (in *PreviewActivityStep) DeepCopyInto(out *PreviewActivityStep) { *out = *in - if in.JobBase != nil { - in, out := &in.JobBase, &out.JobBase - *out = new(JobBase) - (*in).DeepCopyInto(*out) - } - if in.RegexpChangeMatcher != nil { - in, out := &in.RegexpChangeMatcher, &out.RegexpChangeMatcher - *out = new(RegexpChangeMatcher) - (*in).DeepCopyInto(*out) - } - if in.Brancher != nil { - in, out := &in.Brancher, &out.Brancher - *out = new(Brancher) - (*in).DeepCopyInto(*out) - } - if in.Context != nil { - in, out := &in.Context, &out.Context - *out = new(string) - **out = **in - } - if in.Report != nil { - in, out := &in.Report, &out.Report - *out = new(bool) - **out = **in - } + in.CoreActivityStep.DeepCopyInto(&out.CoreActivityStep) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Postsubmit. -func (in *Postsubmit) DeepCopy() *Postsubmit { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreviewActivityStep. +func (in *PreviewActivityStep) DeepCopy() *PreviewActivityStep { if in == nil { return nil } - out := new(Postsubmit) + out := new(PreviewActivityStep) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Postsubmits) DeepCopyInto(out *Postsubmits) { - *out = *in - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]*Postsubmit, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(Postsubmit) - (*in).DeepCopyInto(*out) - } - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Postsubmits. -func (in *Postsubmits) DeepCopy() *Postsubmits { - if in == nil { - return nil - } - out := new(Postsubmits) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Presubmit) DeepCopyInto(out *Presubmit) { - *out = *in - if in.JobBase != nil { - in, out := &in.JobBase, &out.JobBase - *out = new(JobBase) - (*in).DeepCopyInto(*out) - } - if in.Brancher != nil { - in, out := &in.Brancher, &out.Brancher - *out = new(Brancher) - (*in).DeepCopyInto(*out) - } - if in.RegexpChangeMatcher != nil { - in, out := &in.RegexpChangeMatcher, &out.RegexpChangeMatcher - *out = new(RegexpChangeMatcher) - (*in).DeepCopyInto(*out) - } - if in.AlwaysRun != nil { - in, out := &in.AlwaysRun, &out.AlwaysRun - *out = new(bool) - **out = **in - } - if in.Context != nil { - in, out := &in.Context, &out.Context - *out = new(string) - **out = **in - } - if in.Optional != nil { - in, out := &in.Optional, &out.Optional - *out = new(bool) - **out = **in - } - if in.Report != nil { - in, out := &in.Report, &out.Report - *out = new(bool) - **out = **in - } - if in.Trigger != nil { - in, out := &in.Trigger, &out.Trigger - *out = new(string) - **out = **in - } - if in.RerunCommand != nil { - in, out := &in.RerunCommand, &out.RerunCommand - *out = new(string) - **out = **in - } - if in.MergeType != nil { - in, out := &in.MergeType, &out.MergeType - *out = new(string) - **out = **in - } - if in.Queries != nil { - in, out := &in.Queries, &out.Queries - *out = make([]*Query, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(Query) - (*in).DeepCopyInto(*out) - } - } - } - if in.Policy != nil { - in, out := &in.Policy, &out.Policy - *out = new(ProtectionPolicies) - (*in).DeepCopyInto(*out) - } - if in.ContextPolicy != nil { - in, out := &in.ContextPolicy, &out.ContextPolicy - *out = new(RepoContextPolicy) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Presubmit. -func (in *Presubmit) DeepCopy() *Presubmit { - if in == nil { - return nil - } - out := new(Presubmit) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Presubmits) DeepCopyInto(out *Presubmits) { - *out = *in - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]*Presubmit, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(Presubmit) - (*in).DeepCopyInto(*out) - } - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Presubmits. -func (in *Presubmits) DeepCopy() *Presubmits { - if in == nil { - return nil - } - out := new(Presubmits) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PreviewActivityStep) DeepCopyInto(out *PreviewActivityStep) { - *out = *in - in.CoreActivityStep.DeepCopyInto(&out.CoreActivityStep) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PreviewActivityStep. -func (in *PreviewActivityStep) DeepCopy() *PreviewActivityStep { - if in == nil { - return nil - } - out := new(PreviewActivityStep) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PreviewGitSpec) DeepCopyInto(out *PreviewGitSpec) { +func (in *PreviewGitSpec) DeepCopyInto(out *PreviewGitSpec) { *out = *in out.User = in.User return @@ -2625,99 +1685,6 @@ func (in *PromoteUpdateStep) DeepCopy() *PromoteUpdateStep { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PromoteWorkflowStep) DeepCopyInto(out *PromoteWorkflowStep) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PromoteWorkflowStep. -func (in *PromoteWorkflowStep) DeepCopy() *PromoteWorkflowStep { - if in == nil { - return nil - } - out := new(PromoteWorkflowStep) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProtectionPolicies) DeepCopyInto(out *ProtectionPolicies) { - *out = *in - if in.ProtectionPolicy != nil { - in, out := &in.ProtectionPolicy, &out.ProtectionPolicy - *out = new(ProtectionPolicy) - (*in).DeepCopyInto(*out) - } - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make(map[string]*ProtectionPolicy, len(*in)) - for key, val := range *in { - var outVal *ProtectionPolicy - if val == nil { - (*out)[key] = nil - } else { - in, out := &val, &outVal - *out = new(ProtectionPolicy) - (*in).DeepCopyInto(*out) - } - (*out)[key] = outVal - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProtectionPolicies. -func (in *ProtectionPolicies) DeepCopy() *ProtectionPolicies { - if in == nil { - return nil - } - out := new(ProtectionPolicies) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProtectionPolicy) DeepCopyInto(out *ProtectionPolicy) { - *out = *in - if in.Protect != nil { - in, out := &in.Protect, &out.Protect - *out = new(bool) - **out = **in - } - if in.RequiredStatusChecks != nil { - in, out := &in.RequiredStatusChecks, &out.RequiredStatusChecks - *out = new(BranchProtectionContextPolicy) - (*in).DeepCopyInto(*out) - } - if in.Admins != nil { - in, out := &in.Admins, &out.Admins - *out = new(bool) - **out = **in - } - if in.Restrictions != nil { - in, out := &in.Restrictions, &out.Restrictions - *out = new(Restrictions) - (*in).DeepCopyInto(*out) - } - if in.RequiredPullRequestReviews != nil { - in, out := &in.RequiredPullRequestReviews, &out.RequiredPullRequestReviews - *out = new(ReviewPolicy) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProtectionPolicy. -func (in *ProtectionPolicy) DeepCopy() *ProtectionPolicy { - if in == nil { - return nil - } - out := new(ProtectionPolicy) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PullRequestInfo) DeepCopyInto(out *PullRequestInfo) { *out = *in @@ -2734,52 +1701,6 @@ func (in *PullRequestInfo) DeepCopy() *PullRequestInfo { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Query) DeepCopyInto(out *Query) { - *out = *in - if in.ExcludedBranches != nil { - in, out := &in.ExcludedBranches, &out.ExcludedBranches - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - if in.IncludedBranches != nil { - in, out := &in.IncludedBranches, &out.IncludedBranches - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - if in.MissingLabels != nil { - in, out := &in.MissingLabels, &out.MissingLabels - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - if in.Milestone != nil { - in, out := &in.Milestone, &out.Milestone - *out = new(string) - **out = **in - } - if in.ReviewApprovedRequired != nil { - in, out := &in.ReviewApprovedRequired, &out.ReviewApprovedRequired - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Query. -func (in *Query) DeepCopy() *Query { - if in == nil { - return nil - } - out := new(Query) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *QuickStartLocation) DeepCopyInto(out *QuickStartLocation) { *out = *in @@ -2806,27 +1727,6 @@ func (in *QuickStartLocation) DeepCopy() *QuickStartLocation { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RegexpChangeMatcher) DeepCopyInto(out *RegexpChangeMatcher) { - *out = *in - if in.RunIfChanged != nil { - in, out := &in.RunIfChanged, &out.RunIfChanged - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegexpChangeMatcher. -func (in *RegexpChangeMatcher) DeepCopy() *RegexpChangeMatcher { - if in == nil { - return nil - } - out := new(RegexpChangeMatcher) - 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 @@ -2851,365 +1751,18 @@ func (in *Release) DeepCopy() *Release { 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]) - } - } - return -} - -// 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 *ReleaseSpec) DeepCopyInto(out *ReleaseSpec) { - *out = *in - if in.Commits != nil { - in, out := &in.Commits, &out.Commits - *out = make([]CommitSummary, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Issues != nil { - in, out := &in.Issues, &out.Issues - *out = make([]IssueSummary, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.PullRequests != nil { - in, out := &in.PullRequests, &out.PullRequests - *out = make([]IssueSummary, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.DependencyUpdates != nil { - in, out := &in.DependencyUpdates, &out.DependencyUpdates - *out = make([]DependencyUpdate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseSpec. -func (in *ReleaseSpec) DeepCopy() *ReleaseSpec { - if in == nil { - return nil - } - out := new(ReleaseSpec) - in.DeepCopyInto(out) - return out -} - -// 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 - return -} - -// 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 *ReplaceableMapOfStringContextPolicy) DeepCopyInto(out *ReplaceableMapOfStringContextPolicy) { - *out = *in - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make(map[string]*ContextPolicy, len(*in)) - for key, val := range *in { - var outVal *ContextPolicy - if val == nil { - (*out)[key] = nil - } else { - in, out := &val, &outVal - *out = new(ContextPolicy) - (*in).DeepCopyInto(*out) - } - (*out)[key] = outVal - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplaceableMapOfStringContextPolicy. -func (in *ReplaceableMapOfStringContextPolicy) DeepCopy() *ReplaceableMapOfStringContextPolicy { - if in == nil { - return nil - } - out := new(ReplaceableMapOfStringContextPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReplaceableMapOfStringString) DeepCopyInto(out *ReplaceableMapOfStringString) { - *out = *in - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplaceableMapOfStringString. -func (in *ReplaceableMapOfStringString) DeepCopy() *ReplaceableMapOfStringString { - if in == nil { - return nil - } - out := new(ReplaceableMapOfStringString) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReplaceableSliceOfExternalPlugins) DeepCopyInto(out *ReplaceableSliceOfExternalPlugins) { - *out = *in - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]*ExternalPlugin, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(ExternalPlugin) - (*in).DeepCopyInto(*out) - } - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplaceableSliceOfExternalPlugins. -func (in *ReplaceableSliceOfExternalPlugins) DeepCopy() *ReplaceableSliceOfExternalPlugins { - if in == nil { - return nil - } - out := new(ReplaceableSliceOfExternalPlugins) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReplaceableSliceOfStrings) DeepCopyInto(out *ReplaceableSliceOfStrings) { - *out = *in - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplaceableSliceOfStrings. -func (in *ReplaceableSliceOfStrings) DeepCopy() *ReplaceableSliceOfStrings { - if in == nil { - return nil - } - out := new(ReplaceableSliceOfStrings) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RepoContextPolicy) DeepCopyInto(out *RepoContextPolicy) { - *out = *in - if in.ContextPolicy != nil { - in, out := &in.ContextPolicy, &out.ContextPolicy - *out = new(ContextPolicy) - (*in).DeepCopyInto(*out) - } - if in.Branches != nil { - in, out := &in.Branches, &out.Branches - *out = new(ReplaceableMapOfStringContextPolicy) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RepoContextPolicy. -func (in *RepoContextPolicy) DeepCopy() *RepoContextPolicy { - if in == nil { - return nil - } - out := new(RepoContextPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceReference) DeepCopyInto(out *ResourceReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceReference. -func (in *ResourceReference) DeepCopy() *ResourceReference { - if in == nil { - return nil - } - out := new(ResourceReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Restrictions) DeepCopyInto(out *Restrictions) { - *out = *in - if in.Users != nil { - in, out := &in.Users, &out.Users - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - if in.Teams != nil { - in, out := &in.Teams, &out.Teams - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Restrictions. -func (in *Restrictions) DeepCopy() *Restrictions { - if in == nil { - return nil - } - out := new(Restrictions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReviewPolicy) DeepCopyInto(out *ReviewPolicy) { - *out = *in - if in.DismissalRestrictions != nil { - in, out := &in.DismissalRestrictions, &out.DismissalRestrictions - *out = new(Restrictions) - (*in).DeepCopyInto(*out) - } - if in.DismissStale != nil { - in, out := &in.DismissStale, &out.DismissStale - *out = new(bool) - **out = **in - } - if in.RequireOwners != nil { - in, out := &in.RequireOwners, &out.RequireOwners - *out = new(bool) - **out = **in - } - if in.Approvals != nil { - in, out := &in.Approvals, &out.Approvals - *out = new(int) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReviewPolicy. -func (in *ReviewPolicy) DeepCopy() *ReviewPolicy { - if in == nil { - return nil - } - out := new(ReviewPolicy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Scheduler) DeepCopyInto(out *Scheduler) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Scheduler. -func (in *Scheduler) DeepCopy() *Scheduler { - if in == nil { - return nil - } - out := new(Scheduler) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Scheduler) 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 *SchedulerAgent) DeepCopyInto(out *SchedulerAgent) { - *out = *in - if in.Agent != nil { - in, out := &in.Agent, &out.Agent - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulerAgent. -func (in *SchedulerAgent) DeepCopy() *SchedulerAgent { - if in == nil { - return nil - } - out := new(SchedulerAgent) - in.DeepCopyInto(out) - return out + } + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SchedulerList) DeepCopyInto(out *SchedulerList) { +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([]Scheduler, len(*in)) + *out = make([]Release, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -3217,18 +1770,18 @@ func (in *SchedulerList) DeepCopyInto(out *SchedulerList) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulerList. -func (in *SchedulerList) DeepCopy() *SchedulerList { +// 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(SchedulerList) + out := new(ReleaseList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *SchedulerList) DeepCopyObject() runtime.Object { +func (in *ReleaseList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -3236,99 +1789,77 @@ func (in *SchedulerList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SchedulerSpec) DeepCopyInto(out *SchedulerSpec) { +func (in *ReleaseSpec) DeepCopyInto(out *ReleaseSpec) { *out = *in - if in.ScehdulerAgent != nil { - in, out := &in.ScehdulerAgent, &out.ScehdulerAgent - *out = new(SchedulerAgent) - (*in).DeepCopyInto(*out) - } - if in.Policy != nil { - in, out := &in.Policy, &out.Policy - *out = new(GlobalProtectionPolicy) - (*in).DeepCopyInto(*out) - } - if in.Presubmits != nil { - in, out := &in.Presubmits, &out.Presubmits - *out = new(Presubmits) - (*in).DeepCopyInto(*out) - } - if in.Postsubmits != nil { - in, out := &in.Postsubmits, &out.Postsubmits - *out = new(Postsubmits) - (*in).DeepCopyInto(*out) - } - if in.Trigger != nil { - in, out := &in.Trigger, &out.Trigger - *out = new(Trigger) - (*in).DeepCopyInto(*out) - } - if in.Approve != nil { - in, out := &in.Approve, &out.Approve - *out = new(Approve) - (*in).DeepCopyInto(*out) - } - if in.LGTM != nil { - in, out := &in.LGTM, &out.LGTM - *out = new(Lgtm) - (*in).DeepCopyInto(*out) - } - if in.ExternalPlugins != nil { - in, out := &in.ExternalPlugins, &out.ExternalPlugins - *out = new(ReplaceableSliceOfExternalPlugins) - (*in).DeepCopyInto(*out) - } - if in.Merger != nil { - in, out := &in.Merger, &out.Merger - *out = new(Merger) - (*in).DeepCopyInto(*out) - } - if in.Plugins != nil { - in, out := &in.Plugins, &out.Plugins - *out = new(ReplaceableSliceOfStrings) - (*in).DeepCopyInto(*out) - } - if in.ConfigUpdater != nil { - in, out := &in.ConfigUpdater, &out.ConfigUpdater - *out = new(ConfigUpdater) - (*in).DeepCopyInto(*out) + if in.Commits != nil { + in, out := &in.Commits, &out.Commits + *out = make([]CommitSummary, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } - if in.Welcome != nil { - in, out := &in.Welcome, &out.Welcome - *out = make([]*Welcome, len(*in)) + if in.Issues != nil { + in, out := &in.Issues, &out.Issues + *out = make([]IssueSummary, len(*in)) for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(Welcome) - (*in).DeepCopyInto(*out) - } + (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.Periodics != nil { - in, out := &in.Periodics, &out.Periodics - *out = new(Periodics) - (*in).DeepCopyInto(*out) + if in.PullRequests != nil { + in, out := &in.PullRequests, &out.PullRequests + *out = make([]IssueSummary, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } - if in.Attachments != nil { - in, out := &in.Attachments, &out.Attachments - *out = make([]*Attachment, len(*in)) + if in.DependencyUpdates != nil { + in, out := &in.DependencyUpdates, &out.DependencyUpdates + *out = make([]DependencyUpdate, len(*in)) for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(Attachment) - (*in).DeepCopyInto(*out) - } + (*in)[i].DeepCopyInto(&(*out)[i]) } } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulerSpec. -func (in *SchedulerSpec) DeepCopy() *SchedulerSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReleaseSpec. +func (in *ReleaseSpec) DeepCopy() *ReleaseSpec { + if in == nil { + return nil + } + out := new(ReleaseSpec) + in.DeepCopyInto(out) + return out +} + +// 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 + return +} + +// 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 *ResourceReference) DeepCopyInto(out *ResourceReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceReference. +func (in *ResourceReference) DeepCopy() *ResourceReference { if in == nil { return nil } - out := new(SchedulerSpec) + out := new(ResourceReference) in.DeepCopyInto(out) return out } @@ -3518,27 +2049,6 @@ func (in *StageActivityStep) DeepCopy() *StageActivityStep { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Statement) DeepCopyInto(out *Statement) { - *out = *in - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Statement. -func (in *Statement) DeepCopy() *Statement { - if in == nil { - return nil - } - out := new(Statement) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageLocation) DeepCopyInto(out *StorageLocation) { *out = *in @@ -3699,42 +2209,6 @@ func (in *TeamStatus) DeepCopy() *TeamStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Trigger) DeepCopyInto(out *Trigger) { - *out = *in - if in.TrustedOrg != nil { - in, out := &in.TrustedOrg, &out.TrustedOrg - *out = new(string) - **out = **in - } - if in.JoinOrgURL != nil { - in, out := &in.JoinOrgURL, &out.JoinOrgURL - *out = new(string) - **out = **in - } - if in.OnlyOrgMembers != nil { - in, out := &in.OnlyOrgMembers, &out.OnlyOrgMembers - *out = new(bool) - **out = **in - } - if in.IgnoreOkToTest != nil { - in, out := &in.IgnoreOkToTest, &out.IgnoreOkToTest - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Trigger. -func (in *Trigger) DeepCopy() *Trigger { - if in == nil { - return nil - } - out := new(Trigger) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *User) DeepCopyInto(out *User) { *out = *in @@ -3836,167 +2310,3 @@ func (in *UserSpec) DeepCopy() *UserSpec { in.DeepCopyInto(out) return out } - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Welcome) DeepCopyInto(out *Welcome) { - *out = *in - if in.MessageTemplate != nil { - in, out := &in.MessageTemplate, &out.MessageTemplate - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Welcome. -func (in *Welcome) DeepCopy() *Welcome { - if in == nil { - return nil - } - out := new(Welcome) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Workflow) DeepCopyInto(out *Workflow) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - out.Status = in.Status - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Workflow. -func (in *Workflow) DeepCopy() *Workflow { - if in == nil { - return nil - } - out := new(Workflow) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Workflow) 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 *WorkflowList) DeepCopyInto(out *WorkflowList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Workflow, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowList. -func (in *WorkflowList) DeepCopy() *WorkflowList { - if in == nil { - return nil - } - out := new(WorkflowList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *WorkflowList) 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 *WorkflowPreconditions) DeepCopyInto(out *WorkflowPreconditions) { - *out = *in - if in.Environments != nil { - in, out := &in.Environments, &out.Environments - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowPreconditions. -func (in *WorkflowPreconditions) DeepCopy() *WorkflowPreconditions { - if in == nil { - return nil - } - out := new(WorkflowPreconditions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WorkflowSpec) DeepCopyInto(out *WorkflowSpec) { - *out = *in - if in.Steps != nil { - in, out := &in.Steps, &out.Steps - *out = make([]WorkflowStep, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowSpec. -func (in *WorkflowSpec) DeepCopy() *WorkflowSpec { - if in == nil { - return nil - } - out := new(WorkflowSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WorkflowStatus) DeepCopyInto(out *WorkflowStatus) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStatus. -func (in *WorkflowStatus) DeepCopy() *WorkflowStatus { - if in == nil { - return nil - } - out := new(WorkflowStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WorkflowStep) DeepCopyInto(out *WorkflowStep) { - *out = *in - in.Preconditions.DeepCopyInto(&out.Preconditions) - if in.Promote != nil { - in, out := &in.Promote, &out.Promote - *out = new(PromoteWorkflowStep) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkflowStep. -func (in *WorkflowStep) DeepCopy() *WorkflowStep { - if in == nil { - return nil - } - out := new(WorkflowStep) - in.DeepCopyInto(out) - return out -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go deleted file mode 100644 index e6c6927..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fact.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// FactsGetter has a method to return a FactInterface. -// A group's client should implement this interface. -type FactsGetter interface { - Facts(namespace string) FactInterface -} - -// FactInterface has methods to work with Fact resources. -type FactInterface interface { - Create(ctx context.Context, fact *v1.Fact, opts metav1.CreateOptions) (*v1.Fact, error) - Update(ctx context.Context, fact *v1.Fact, opts metav1.UpdateOptions) (*v1.Fact, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Fact, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.FactList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Fact, err error) - FactExpansion -} - -// facts implements FactInterface -type facts struct { - client rest.Interface - ns string -} - -// newFacts returns a Facts -func newFacts(c *JenkinsV1Client, namespace string) *facts { - return &facts{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the fact, and returns the corresponding fact object, and an error if there is any. -func (c *facts) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Fact, err error) { - result = &v1.Fact{} - err = c.client.Get(). - Namespace(c.ns). - Resource("facts"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Facts that match those selectors. -func (c *facts) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FactList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.FactList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("facts"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested facts. -func (c *facts) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("facts"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a fact and creates it. Returns the server's representation of the fact, and an error, if there is any. -func (c *facts) Create(ctx context.Context, fact *v1.Fact, opts metav1.CreateOptions) (result *v1.Fact, err error) { - result = &v1.Fact{} - err = c.client.Post(). - Namespace(c.ns). - Resource("facts"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(fact). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a fact and updates it. Returns the server's representation of the fact, and an error, if there is any. -func (c *facts) Update(ctx context.Context, fact *v1.Fact, opts metav1.UpdateOptions) (result *v1.Fact, err error) { - result = &v1.Fact{} - err = c.client.Put(). - Namespace(c.ns). - Resource("facts"). - Name(fact.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(fact). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the fact and deletes it. Returns an error if one occurs. -func (c *facts) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("facts"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *facts) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("facts"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched fact. -func (c *facts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Fact, err error) { - result = &v1.Fact{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("facts"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go deleted file mode 100644 index 5c9705b..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_fact.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeFacts implements FactInterface -type FakeFacts struct { - Fake *FakeJenkinsV1 - ns string -} - -var factsResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v1", Resource: "facts"} - -var factsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "Fact"} - -// Get takes name of the fact, and returns the corresponding fact object, and an error if there is any. -func (c *FakeFacts) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.Fact, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(factsResource, c.ns, name), &jenkinsiov1.Fact{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.Fact), err -} - -// List takes label and field selectors, and returns the list of Facts that match those selectors. -func (c *FakeFacts) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.FactList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(factsResource, factsKind, c.ns, opts), &jenkinsiov1.FactList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &jenkinsiov1.FactList{ListMeta: obj.(*jenkinsiov1.FactList).ListMeta} - for _, item := range obj.(*jenkinsiov1.FactList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested facts. -func (c *FakeFacts) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(factsResource, c.ns, opts)) - -} - -// Create takes the representation of a fact and creates it. Returns the server's representation of the fact, and an error, if there is any. -func (c *FakeFacts) Create(ctx context.Context, fact *jenkinsiov1.Fact, opts v1.CreateOptions) (result *jenkinsiov1.Fact, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(factsResource, c.ns, fact), &jenkinsiov1.Fact{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.Fact), err -} - -// Update takes the representation of a fact and updates it. Returns the server's representation of the fact, and an error, if there is any. -func (c *FakeFacts) Update(ctx context.Context, fact *jenkinsiov1.Fact, opts v1.UpdateOptions) (result *jenkinsiov1.Fact, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(factsResource, c.ns, fact), &jenkinsiov1.Fact{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.Fact), err -} - -// Delete takes name of the fact and deletes it. Returns an error if one occurs. -func (c *FakeFacts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(factsResource, c.ns, name), &jenkinsiov1.Fact{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeFacts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(factsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &jenkinsiov1.FactList{}) - return err -} - -// Patch applies the patch and returns the patched fact. -func (c *FakeFacts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.Fact, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(factsResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.Fact{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.Fact), err -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_jenkins.io_client.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_jenkins.io_client.go index 1c2add0..045e2a2 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_jenkins.io_client.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_jenkins.io_client.go @@ -51,10 +51,6 @@ func (c *FakeJenkinsV1) Extensions(namespace string) v1.ExtensionInterface { return &FakeExtensions{c, namespace} } -func (c *FakeJenkinsV1) Facts(namespace string) v1.FactInterface { - return &FakeFacts{c, namespace} -} - func (c *FakeJenkinsV1) GitServices(namespace string) v1.GitServiceInterface { return &FakeGitServices{c, namespace} } @@ -63,10 +59,6 @@ func (c *FakeJenkinsV1) PipelineActivities(namespace string) v1.PipelineActivity return &FakePipelineActivities{c, namespace} } -func (c *FakeJenkinsV1) PipelineStructures(namespace string) v1.PipelineStructureInterface { - return &FakePipelineStructures{c, namespace} -} - func (c *FakeJenkinsV1) Plugins(namespace string) v1.PluginInterface { return &FakePlugins{c, namespace} } @@ -75,10 +67,6 @@ func (c *FakeJenkinsV1) Releases(namespace string) v1.ReleaseInterface { return &FakeReleases{c, namespace} } -func (c *FakeJenkinsV1) Schedulers(namespace string) v1.SchedulerInterface { - return &FakeSchedulers{c, namespace} -} - func (c *FakeJenkinsV1) SourceRepositories(namespace string) v1.SourceRepositoryInterface { return &FakeSourceRepositories{c, namespace} } @@ -95,10 +83,6 @@ func (c *FakeJenkinsV1) Users(namespace string) v1.UserInterface { return &FakeUsers{c, namespace} } -func (c *FakeJenkinsV1) Workflows(namespace string) v1.WorkflowInterface { - return &FakeWorkflows{c, namespace} -} - // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeJenkinsV1) RESTClient() rest.Interface { diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go deleted file mode 100644 index 28e7412..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_pipelinestructure.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakePipelineStructures implements PipelineStructureInterface -type FakePipelineStructures struct { - Fake *FakeJenkinsV1 - ns string -} - -var pipelinestructuresResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v1", Resource: "pipelinestructures"} - -var pipelinestructuresKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "PipelineStructure"} - -// Get takes name of the pipelineStructure, and returns the corresponding pipelineStructure object, and an error if there is any. -func (c *FakePipelineStructures) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.PipelineStructure, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(pipelinestructuresResource, c.ns, name), &jenkinsiov1.PipelineStructure{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.PipelineStructure), err -} - -// List takes label and field selectors, and returns the list of PipelineStructures that match those selectors. -func (c *FakePipelineStructures) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.PipelineStructureList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(pipelinestructuresResource, pipelinestructuresKind, c.ns, opts), &jenkinsiov1.PipelineStructureList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &jenkinsiov1.PipelineStructureList{ListMeta: obj.(*jenkinsiov1.PipelineStructureList).ListMeta} - for _, item := range obj.(*jenkinsiov1.PipelineStructureList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested pipelineStructures. -func (c *FakePipelineStructures) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(pipelinestructuresResource, c.ns, opts)) - -} - -// Create takes the representation of a pipelineStructure and creates it. Returns the server's representation of the pipelineStructure, and an error, if there is any. -func (c *FakePipelineStructures) Create(ctx context.Context, pipelineStructure *jenkinsiov1.PipelineStructure, opts v1.CreateOptions) (result *jenkinsiov1.PipelineStructure, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(pipelinestructuresResource, c.ns, pipelineStructure), &jenkinsiov1.PipelineStructure{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.PipelineStructure), err -} - -// Update takes the representation of a pipelineStructure and updates it. Returns the server's representation of the pipelineStructure, and an error, if there is any. -func (c *FakePipelineStructures) Update(ctx context.Context, pipelineStructure *jenkinsiov1.PipelineStructure, opts v1.UpdateOptions) (result *jenkinsiov1.PipelineStructure, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(pipelinestructuresResource, c.ns, pipelineStructure), &jenkinsiov1.PipelineStructure{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.PipelineStructure), err -} - -// Delete takes name of the pipelineStructure and deletes it. Returns an error if one occurs. -func (c *FakePipelineStructures) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(pipelinestructuresResource, c.ns, name), &jenkinsiov1.PipelineStructure{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakePipelineStructures) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(pipelinestructuresResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &jenkinsiov1.PipelineStructureList{}) - return err -} - -// Patch applies the patch and returns the patched pipelineStructure. -func (c *FakePipelineStructures) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.PipelineStructure, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(pipelinestructuresResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.PipelineStructure{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.PipelineStructure), err -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go deleted file mode 100644 index b3a5664..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_scheduler.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeSchedulers implements SchedulerInterface -type FakeSchedulers struct { - Fake *FakeJenkinsV1 - ns string -} - -var schedulersResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v1", Resource: "schedulers"} - -var schedulersKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "Scheduler"} - -// Get takes name of the scheduler, and returns the corresponding scheduler object, and an error if there is any. -func (c *FakeSchedulers) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.Scheduler, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(schedulersResource, c.ns, name), &jenkinsiov1.Scheduler{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.Scheduler), err -} - -// List takes label and field selectors, and returns the list of Schedulers that match those selectors. -func (c *FakeSchedulers) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.SchedulerList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(schedulersResource, schedulersKind, c.ns, opts), &jenkinsiov1.SchedulerList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &jenkinsiov1.SchedulerList{ListMeta: obj.(*jenkinsiov1.SchedulerList).ListMeta} - for _, item := range obj.(*jenkinsiov1.SchedulerList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested schedulers. -func (c *FakeSchedulers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(schedulersResource, c.ns, opts)) - -} - -// Create takes the representation of a scheduler and creates it. Returns the server's representation of the scheduler, and an error, if there is any. -func (c *FakeSchedulers) Create(ctx context.Context, scheduler *jenkinsiov1.Scheduler, opts v1.CreateOptions) (result *jenkinsiov1.Scheduler, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(schedulersResource, c.ns, scheduler), &jenkinsiov1.Scheduler{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.Scheduler), err -} - -// Update takes the representation of a scheduler and updates it. Returns the server's representation of the scheduler, and an error, if there is any. -func (c *FakeSchedulers) Update(ctx context.Context, scheduler *jenkinsiov1.Scheduler, opts v1.UpdateOptions) (result *jenkinsiov1.Scheduler, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(schedulersResource, c.ns, scheduler), &jenkinsiov1.Scheduler{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.Scheduler), err -} - -// Delete takes name of the scheduler and deletes it. Returns an error if one occurs. -func (c *FakeSchedulers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(schedulersResource, c.ns, name), &jenkinsiov1.Scheduler{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeSchedulers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(schedulersResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &jenkinsiov1.SchedulerList{}) - return err -} - -// Patch applies the patch and returns the patched scheduler. -func (c *FakeSchedulers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.Scheduler, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(schedulersResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.Scheduler{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.Scheduler), err -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go deleted file mode 100644 index d86e251..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/fake/fake_workflow.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by client-gen. DO NOT EDIT. - -package fake - -import ( - "context" - - jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeWorkflows implements WorkflowInterface -type FakeWorkflows struct { - Fake *FakeJenkinsV1 - ns string -} - -var workflowsResource = schema.GroupVersionResource{Group: "jenkins.io", Version: "v1", Resource: "workflows"} - -var workflowsKind = schema.GroupVersionKind{Group: "jenkins.io", Version: "v1", Kind: "Workflow"} - -// Get takes name of the workflow, and returns the corresponding workflow object, and an error if there is any. -func (c *FakeWorkflows) Get(ctx context.Context, name string, options v1.GetOptions) (result *jenkinsiov1.Workflow, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(workflowsResource, c.ns, name), &jenkinsiov1.Workflow{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.Workflow), err -} - -// List takes label and field selectors, and returns the list of Workflows that match those selectors. -func (c *FakeWorkflows) List(ctx context.Context, opts v1.ListOptions) (result *jenkinsiov1.WorkflowList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(workflowsResource, workflowsKind, c.ns, opts), &jenkinsiov1.WorkflowList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &jenkinsiov1.WorkflowList{ListMeta: obj.(*jenkinsiov1.WorkflowList).ListMeta} - for _, item := range obj.(*jenkinsiov1.WorkflowList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested workflows. -func (c *FakeWorkflows) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(workflowsResource, c.ns, opts)) - -} - -// Create takes the representation of a workflow and creates it. Returns the server's representation of the workflow, and an error, if there is any. -func (c *FakeWorkflows) Create(ctx context.Context, workflow *jenkinsiov1.Workflow, opts v1.CreateOptions) (result *jenkinsiov1.Workflow, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(workflowsResource, c.ns, workflow), &jenkinsiov1.Workflow{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.Workflow), err -} - -// Update takes the representation of a workflow and updates it. Returns the server's representation of the workflow, and an error, if there is any. -func (c *FakeWorkflows) Update(ctx context.Context, workflow *jenkinsiov1.Workflow, opts v1.UpdateOptions) (result *jenkinsiov1.Workflow, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(workflowsResource, c.ns, workflow), &jenkinsiov1.Workflow{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.Workflow), err -} - -// Delete takes name of the workflow and deletes it. Returns an error if one occurs. -func (c *FakeWorkflows) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteAction(workflowsResource, c.ns, name), &jenkinsiov1.Workflow{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeWorkflows) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(workflowsResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &jenkinsiov1.WorkflowList{}) - return err -} - -// Patch applies the patch and returns the patched workflow. -func (c *FakeWorkflows) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *jenkinsiov1.Workflow, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(workflowsResource, c.ns, name, pt, data, subresources...), &jenkinsiov1.Workflow{}) - - if obj == nil { - return nil, err - } - return obj.(*jenkinsiov1.Workflow), err -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/generated_expansion.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/generated_expansion.go index 1cde34e..90e5626 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/generated_expansion.go @@ -29,20 +29,14 @@ type EnvironmentRoleBindingExpansion interface{} type ExtensionExpansion interface{} -type FactExpansion interface{} - type GitServiceExpansion interface{} type PipelineActivityExpansion interface{} -type PipelineStructureExpansion interface{} - type PluginExpansion interface{} type ReleaseExpansion interface{} -type SchedulerExpansion interface{} - type SourceRepositoryExpansion interface{} type SourceRepositoryGroupExpansion interface{} @@ -50,5 +44,3 @@ type SourceRepositoryGroupExpansion interface{} type TeamExpansion interface{} type UserExpansion interface{} - -type WorkflowExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/jenkins.io_client.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/jenkins.io_client.go index f965017..34be639 100644 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/jenkins.io_client.go +++ b/pkg/client/clientset/versioned/typed/jenkins.io/v1/jenkins.io_client.go @@ -31,18 +31,14 @@ type JenkinsV1Interface interface { EnvironmentsGetter EnvironmentRoleBindingsGetter ExtensionsGetter - FactsGetter GitServicesGetter PipelineActivitiesGetter - PipelineStructuresGetter PluginsGetter ReleasesGetter - SchedulersGetter SourceRepositoriesGetter SourceRepositoryGroupsGetter TeamsGetter UsersGetter - WorkflowsGetter } // JenkinsV1Client is used to interact with features provided by the jenkins.io group. @@ -74,10 +70,6 @@ func (c *JenkinsV1Client) Extensions(namespace string) ExtensionInterface { return newExtensions(c, namespace) } -func (c *JenkinsV1Client) Facts(namespace string) FactInterface { - return newFacts(c, namespace) -} - func (c *JenkinsV1Client) GitServices(namespace string) GitServiceInterface { return newGitServices(c, namespace) } @@ -86,10 +78,6 @@ func (c *JenkinsV1Client) PipelineActivities(namespace string) PipelineActivityI return newPipelineActivities(c, namespace) } -func (c *JenkinsV1Client) PipelineStructures(namespace string) PipelineStructureInterface { - return newPipelineStructures(c, namespace) -} - func (c *JenkinsV1Client) Plugins(namespace string) PluginInterface { return newPlugins(c, namespace) } @@ -98,10 +86,6 @@ func (c *JenkinsV1Client) Releases(namespace string) ReleaseInterface { return newReleases(c, namespace) } -func (c *JenkinsV1Client) Schedulers(namespace string) SchedulerInterface { - return newSchedulers(c, namespace) -} - func (c *JenkinsV1Client) SourceRepositories(namespace string) SourceRepositoryInterface { return newSourceRepositories(c, namespace) } @@ -118,10 +102,6 @@ func (c *JenkinsV1Client) Users(namespace string) UserInterface { return newUsers(c, namespace) } -func (c *JenkinsV1Client) Workflows(namespace string) WorkflowInterface { - return newWorkflows(c, namespace) -} - // NewForConfig creates a new JenkinsV1Client for the given config. func NewForConfig(c *rest.Config) (*JenkinsV1Client, error) { config := *c diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go deleted file mode 100644 index e6d5044..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/pipelinestructure.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// PipelineStructuresGetter has a method to return a PipelineStructureInterface. -// A group's client should implement this interface. -type PipelineStructuresGetter interface { - PipelineStructures(namespace string) PipelineStructureInterface -} - -// PipelineStructureInterface has methods to work with PipelineStructure resources. -type PipelineStructureInterface interface { - Create(ctx context.Context, pipelineStructure *v1.PipelineStructure, opts metav1.CreateOptions) (*v1.PipelineStructure, error) - Update(ctx context.Context, pipelineStructure *v1.PipelineStructure, opts metav1.UpdateOptions) (*v1.PipelineStructure, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PipelineStructure, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.PipelineStructureList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PipelineStructure, err error) - PipelineStructureExpansion -} - -// pipelineStructures implements PipelineStructureInterface -type pipelineStructures struct { - client rest.Interface - ns string -} - -// newPipelineStructures returns a PipelineStructures -func newPipelineStructures(c *JenkinsV1Client, namespace string) *pipelineStructures { - return &pipelineStructures{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the pipelineStructure, and returns the corresponding pipelineStructure object, and an error if there is any. -func (c *pipelineStructures) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PipelineStructure, err error) { - result = &v1.PipelineStructure{} - err = c.client.Get(). - Namespace(c.ns). - Resource("pipelinestructures"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PipelineStructures that match those selectors. -func (c *pipelineStructures) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PipelineStructureList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.PipelineStructureList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("pipelinestructures"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested pipelineStructures. -func (c *pipelineStructures) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("pipelinestructures"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a pipelineStructure and creates it. Returns the server's representation of the pipelineStructure, and an error, if there is any. -func (c *pipelineStructures) Create(ctx context.Context, pipelineStructure *v1.PipelineStructure, opts metav1.CreateOptions) (result *v1.PipelineStructure, err error) { - result = &v1.PipelineStructure{} - err = c.client.Post(). - Namespace(c.ns). - Resource("pipelinestructures"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(pipelineStructure). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a pipelineStructure and updates it. Returns the server's representation of the pipelineStructure, and an error, if there is any. -func (c *pipelineStructures) Update(ctx context.Context, pipelineStructure *v1.PipelineStructure, opts metav1.UpdateOptions) (result *v1.PipelineStructure, err error) { - result = &v1.PipelineStructure{} - err = c.client.Put(). - Namespace(c.ns). - Resource("pipelinestructures"). - Name(pipelineStructure.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(pipelineStructure). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the pipelineStructure and deletes it. Returns an error if one occurs. -func (c *pipelineStructures) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("pipelinestructures"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *pipelineStructures) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("pipelinestructures"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched pipelineStructure. -func (c *pipelineStructures) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PipelineStructure, err error) { - result = &v1.PipelineStructure{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("pipelinestructures"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go deleted file mode 100644 index 228ef2a..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/scheduler.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// SchedulersGetter has a method to return a SchedulerInterface. -// A group's client should implement this interface. -type SchedulersGetter interface { - Schedulers(namespace string) SchedulerInterface -} - -// SchedulerInterface has methods to work with Scheduler resources. -type SchedulerInterface interface { - Create(ctx context.Context, scheduler *v1.Scheduler, opts metav1.CreateOptions) (*v1.Scheduler, error) - Update(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (*v1.Scheduler, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Scheduler, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.SchedulerList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Scheduler, err error) - SchedulerExpansion -} - -// schedulers implements SchedulerInterface -type schedulers struct { - client rest.Interface - ns string -} - -// newSchedulers returns a Schedulers -func newSchedulers(c *JenkinsV1Client, namespace string) *schedulers { - return &schedulers{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the scheduler, and returns the corresponding scheduler object, and an error if there is any. -func (c *schedulers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Scheduler, err error) { - result = &v1.Scheduler{} - err = c.client.Get(). - Namespace(c.ns). - Resource("schedulers"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Schedulers that match those selectors. -func (c *schedulers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SchedulerList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.SchedulerList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("schedulers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested schedulers. -func (c *schedulers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("schedulers"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a scheduler and creates it. Returns the server's representation of the scheduler, and an error, if there is any. -func (c *schedulers) Create(ctx context.Context, scheduler *v1.Scheduler, opts metav1.CreateOptions) (result *v1.Scheduler, err error) { - result = &v1.Scheduler{} - err = c.client.Post(). - Namespace(c.ns). - Resource("schedulers"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(scheduler). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a scheduler and updates it. Returns the server's representation of the scheduler, and an error, if there is any. -func (c *schedulers) Update(ctx context.Context, scheduler *v1.Scheduler, opts metav1.UpdateOptions) (result *v1.Scheduler, err error) { - result = &v1.Scheduler{} - err = c.client.Put(). - Namespace(c.ns). - Resource("schedulers"). - Name(scheduler.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(scheduler). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the scheduler and deletes it. Returns an error if one occurs. -func (c *schedulers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("schedulers"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *schedulers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("schedulers"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched scheduler. -func (c *schedulers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Scheduler, err error) { - result = &v1.Scheduler{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("schedulers"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go b/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go deleted file mode 100644 index a5c0ea0..0000000 --- a/pkg/client/clientset/versioned/typed/jenkins.io/v1/workflow.go +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by client-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - "time" - - v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - scheme "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" -) - -// WorkflowsGetter has a method to return a WorkflowInterface. -// A group's client should implement this interface. -type WorkflowsGetter interface { - Workflows(namespace string) WorkflowInterface -} - -// WorkflowInterface has methods to work with Workflow resources. -type WorkflowInterface interface { - Create(ctx context.Context, workflow *v1.Workflow, opts metav1.CreateOptions) (*v1.Workflow, error) - Update(ctx context.Context, workflow *v1.Workflow, opts metav1.UpdateOptions) (*v1.Workflow, error) - Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Workflow, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.WorkflowList, error) - Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Workflow, err error) - WorkflowExpansion -} - -// workflows implements WorkflowInterface -type workflows struct { - client rest.Interface - ns string -} - -// newWorkflows returns a Workflows -func newWorkflows(c *JenkinsV1Client, namespace string) *workflows { - return &workflows{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the workflow, and returns the corresponding workflow object, and an error if there is any. -func (c *workflows) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Workflow, err error) { - result = &v1.Workflow{} - err = c.client.Get(). - Namespace(c.ns). - Resource("workflows"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Workflows that match those selectors. -func (c *workflows) List(ctx context.Context, opts metav1.ListOptions) (result *v1.WorkflowList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1.WorkflowList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("workflows"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested workflows. -func (c *workflows) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("workflows"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a workflow and creates it. Returns the server's representation of the workflow, and an error, if there is any. -func (c *workflows) Create(ctx context.Context, workflow *v1.Workflow, opts metav1.CreateOptions) (result *v1.Workflow, err error) { - result = &v1.Workflow{} - err = c.client.Post(). - Namespace(c.ns). - Resource("workflows"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(workflow). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a workflow and updates it. Returns the server's representation of the workflow, and an error, if there is any. -func (c *workflows) Update(ctx context.Context, workflow *v1.Workflow, opts metav1.UpdateOptions) (result *v1.Workflow, err error) { - result = &v1.Workflow{} - err = c.client.Put(). - Namespace(c.ns). - Resource("workflows"). - Name(workflow.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(workflow). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the workflow and deletes it. Returns an error if one occurs. -func (c *workflows) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("workflows"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *workflows) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("workflows"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched workflow. -func (c *workflows) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Workflow, err error) { - result = &v1.Workflow{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("workflows"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return -} diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index fc0a59c..7c14c56 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -64,20 +64,14 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V1().EnvironmentRoleBindings().Informer()}, nil case v1.SchemeGroupVersion.WithResource("extensions"): return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V1().Extensions().Informer()}, nil - case v1.SchemeGroupVersion.WithResource("facts"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V1().Facts().Informer()}, nil case v1.SchemeGroupVersion.WithResource("gitservices"): return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V1().GitServices().Informer()}, nil case v1.SchemeGroupVersion.WithResource("pipelineactivities"): return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V1().PipelineActivities().Informer()}, nil - case v1.SchemeGroupVersion.WithResource("pipelinestructures"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V1().PipelineStructures().Informer()}, nil case v1.SchemeGroupVersion.WithResource("plugins"): return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V1().Plugins().Informer()}, nil case v1.SchemeGroupVersion.WithResource("releases"): return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V1().Releases().Informer()}, nil - case v1.SchemeGroupVersion.WithResource("schedulers"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V1().Schedulers().Informer()}, nil case v1.SchemeGroupVersion.WithResource("sourcerepositories"): return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V1().SourceRepositories().Informer()}, nil case v1.SchemeGroupVersion.WithResource("sourcerepositorygroups"): @@ -86,8 +80,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V1().Teams().Informer()}, nil case v1.SchemeGroupVersion.WithResource("users"): return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V1().Users().Informer()}, nil - case v1.SchemeGroupVersion.WithResource("workflows"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Jenkins().V1().Workflows().Informer()}, nil } diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/fact.go b/pkg/client/informers/externalversions/jenkins.io/v1/fact.go deleted file mode 100644 index 11a58dd..0000000 --- a/pkg/client/informers/externalversions/jenkins.io/v1/fact.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// FactInformer provides access to a shared informer and lister for -// Facts. -type FactInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.FactLister -} - -type factInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewFactInformer constructs a new informer for Fact type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFactInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredFactInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredFactInformer constructs a new informer for Fact type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredFactInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV1().Facts(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV1().Facts(namespace).Watch(context.TODO(), options) - }, - }, - &jenkinsiov1.Fact{}, - resyncPeriod, - indexers, - ) -} - -func (f *factInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredFactInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *factInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov1.Fact{}, f.defaultInformer) -} - -func (f *factInformer) Lister() v1.FactLister { - return v1.NewFactLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/interface.go b/pkg/client/informers/externalversions/jenkins.io/v1/interface.go index 881150a..5eb2f1f 100644 --- a/pkg/client/informers/externalversions/jenkins.io/v1/interface.go +++ b/pkg/client/informers/externalversions/jenkins.io/v1/interface.go @@ -35,20 +35,14 @@ type Interface interface { EnvironmentRoleBindings() EnvironmentRoleBindingInformer // Extensions returns a ExtensionInformer. Extensions() ExtensionInformer - // Facts returns a FactInformer. - Facts() FactInformer // GitServices returns a GitServiceInformer. GitServices() GitServiceInformer // PipelineActivities returns a PipelineActivityInformer. PipelineActivities() PipelineActivityInformer - // PipelineStructures returns a PipelineStructureInformer. - PipelineStructures() PipelineStructureInformer // Plugins returns a PluginInformer. Plugins() PluginInformer // Releases returns a ReleaseInformer. Releases() ReleaseInformer - // Schedulers returns a SchedulerInformer. - Schedulers() SchedulerInformer // SourceRepositories returns a SourceRepositoryInformer. SourceRepositories() SourceRepositoryInformer // SourceRepositoryGroups returns a SourceRepositoryGroupInformer. @@ -57,8 +51,6 @@ type Interface interface { Teams() TeamInformer // Users returns a UserInformer. Users() UserInformer - // Workflows returns a WorkflowInformer. - Workflows() WorkflowInformer } type version struct { @@ -102,11 +94,6 @@ func (v *version) Extensions() ExtensionInformer { return &extensionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Facts returns a FactInformer. -func (v *version) Facts() FactInformer { - return &factInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // GitServices returns a GitServiceInformer. func (v *version) GitServices() GitServiceInformer { return &gitServiceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} @@ -117,11 +104,6 @@ func (v *version) PipelineActivities() PipelineActivityInformer { return &pipelineActivityInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// PipelineStructures returns a PipelineStructureInformer. -func (v *version) PipelineStructures() PipelineStructureInformer { - return &pipelineStructureInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // Plugins returns a PluginInformer. func (v *version) Plugins() PluginInformer { return &pluginInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} @@ -132,11 +114,6 @@ func (v *version) Releases() ReleaseInformer { return &releaseInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } -// Schedulers returns a SchedulerInformer. -func (v *version) Schedulers() SchedulerInformer { - return &schedulerInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} - // SourceRepositories returns a SourceRepositoryInformer. func (v *version) SourceRepositories() SourceRepositoryInformer { return &sourceRepositoryInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} @@ -156,8 +133,3 @@ func (v *version) Teams() TeamInformer { func (v *version) Users() UserInformer { return &userInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } - -// Workflows returns a WorkflowInformer. -func (v *version) Workflows() WorkflowInformer { - return &workflowInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} -} diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go b/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go deleted file mode 100644 index 927bb22..0000000 --- a/pkg/client/informers/externalversions/jenkins.io/v1/pipelinestructure.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// PipelineStructureInformer provides access to a shared informer and lister for -// PipelineStructures. -type PipelineStructureInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.PipelineStructureLister -} - -type pipelineStructureInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewPipelineStructureInformer constructs a new informer for PipelineStructure type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewPipelineStructureInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredPipelineStructureInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredPipelineStructureInformer constructs a new informer for PipelineStructure type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredPipelineStructureInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV1().PipelineStructures(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV1().PipelineStructures(namespace).Watch(context.TODO(), options) - }, - }, - &jenkinsiov1.PipelineStructure{}, - resyncPeriod, - indexers, - ) -} - -func (f *pipelineStructureInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredPipelineStructureInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *pipelineStructureInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov1.PipelineStructure{}, f.defaultInformer) -} - -func (f *pipelineStructureInformer) Lister() v1.PipelineStructureLister { - return v1.NewPipelineStructureLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go b/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go deleted file mode 100644 index d98f04e..0000000 --- a/pkg/client/informers/externalversions/jenkins.io/v1/scheduler.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// SchedulerInformer provides access to a shared informer and lister for -// Schedulers. -type SchedulerInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.SchedulerLister -} - -type schedulerInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewSchedulerInformer constructs a new informer for Scheduler type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewSchedulerInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredSchedulerInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredSchedulerInformer constructs a new informer for Scheduler type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredSchedulerInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV1().Schedulers(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV1().Schedulers(namespace).Watch(context.TODO(), options) - }, - }, - &jenkinsiov1.Scheduler{}, - resyncPeriod, - indexers, - ) -} - -func (f *schedulerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredSchedulerInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *schedulerInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov1.Scheduler{}, f.defaultInformer) -} - -func (f *schedulerInformer) Lister() v1.SchedulerLister { - return v1.NewSchedulerLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go b/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go deleted file mode 100644 index 3801187..0000000 --- a/pkg/client/informers/externalversions/jenkins.io/v1/workflow.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by informer-gen. DO NOT EDIT. - -package v1 - -import ( - "context" - time "time" - - jenkinsiov1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - versioned "github.com/jenkins-x/jx-api/v3/pkg/client/clientset/versioned" - internalinterfaces "github.com/jenkins-x/jx-api/v3/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/jenkins-x/jx-api/v3/pkg/client/listers/jenkins.io/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - cache "k8s.io/client-go/tools/cache" -) - -// WorkflowInformer provides access to a shared informer and lister for -// Workflows. -type WorkflowInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1.WorkflowLister -} - -type workflowInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc - namespace string -} - -// NewWorkflowInformer constructs a new informer for Workflow type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewWorkflowInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredWorkflowInformer(client, namespace, resyncPeriod, indexers, nil) -} - -// NewFilteredWorkflowInformer constructs a new informer for Workflow type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredWorkflowInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV1().Workflows(namespace).List(context.TODO(), options) - }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.JenkinsV1().Workflows(namespace).Watch(context.TODO(), options) - }, - }, - &jenkinsiov1.Workflow{}, - resyncPeriod, - indexers, - ) -} - -func (f *workflowInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredWorkflowInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *workflowInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&jenkinsiov1.Workflow{}, f.defaultInformer) -} - -func (f *workflowInformer) Lister() v1.WorkflowLister { - return v1.NewWorkflowLister(f.Informer().GetIndexer()) -} diff --git a/pkg/client/listers/jenkins.io/v1/expansion_generated.go b/pkg/client/listers/jenkins.io/v1/expansion_generated.go index ac87c9a..18a37d9 100644 --- a/pkg/client/listers/jenkins.io/v1/expansion_generated.go +++ b/pkg/client/listers/jenkins.io/v1/expansion_generated.go @@ -65,14 +65,6 @@ type ExtensionListerExpansion interface{} // ExtensionNamespaceLister. type ExtensionNamespaceListerExpansion interface{} -// FactListerExpansion allows custom methods to be added to -// FactLister. -type FactListerExpansion interface{} - -// FactNamespaceListerExpansion allows custom methods to be added to -// FactNamespaceLister. -type FactNamespaceListerExpansion interface{} - // GitServiceListerExpansion allows custom methods to be added to // GitServiceLister. type GitServiceListerExpansion interface{} @@ -89,14 +81,6 @@ type PipelineActivityListerExpansion interface{} // PipelineActivityNamespaceLister. type PipelineActivityNamespaceListerExpansion interface{} -// PipelineStructureListerExpansion allows custom methods to be added to -// PipelineStructureLister. -type PipelineStructureListerExpansion interface{} - -// PipelineStructureNamespaceListerExpansion allows custom methods to be added to -// PipelineStructureNamespaceLister. -type PipelineStructureNamespaceListerExpansion interface{} - // PluginListerExpansion allows custom methods to be added to // PluginLister. type PluginListerExpansion interface{} @@ -113,14 +97,6 @@ type ReleaseListerExpansion interface{} // ReleaseNamespaceLister. type ReleaseNamespaceListerExpansion interface{} -// SchedulerListerExpansion allows custom methods to be added to -// SchedulerLister. -type SchedulerListerExpansion interface{} - -// SchedulerNamespaceListerExpansion allows custom methods to be added to -// SchedulerNamespaceLister. -type SchedulerNamespaceListerExpansion interface{} - // SourceRepositoryListerExpansion allows custom methods to be added to // SourceRepositoryLister. type SourceRepositoryListerExpansion interface{} @@ -152,11 +128,3 @@ type UserListerExpansion interface{} // UserNamespaceListerExpansion allows custom methods to be added to // UserNamespaceLister. type UserNamespaceListerExpansion interface{} - -// WorkflowListerExpansion allows custom methods to be added to -// WorkflowLister. -type WorkflowListerExpansion interface{} - -// WorkflowNamespaceListerExpansion allows custom methods to be added to -// WorkflowNamespaceLister. -type WorkflowNamespaceListerExpansion interface{} diff --git a/pkg/client/listers/jenkins.io/v1/fact.go b/pkg/client/listers/jenkins.io/v1/fact.go deleted file mode 100644 index 0d1e217..0000000 --- a/pkg/client/listers/jenkins.io/v1/fact.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// FactLister helps list Facts. -// All objects returned here must be treated as read-only. -type FactLister interface { - // List lists all Facts in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Fact, err error) - // Facts returns an object that can list and get Facts. - Facts(namespace string) FactNamespaceLister - FactListerExpansion -} - -// factLister implements the FactLister interface. -type factLister struct { - indexer cache.Indexer -} - -// NewFactLister returns a new FactLister. -func NewFactLister(indexer cache.Indexer) FactLister { - return &factLister{indexer: indexer} -} - -// List lists all Facts in the indexer. -func (s *factLister) List(selector labels.Selector) (ret []*v1.Fact, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Fact)) - }) - return ret, err -} - -// Facts returns an object that can list and get Facts. -func (s *factLister) Facts(namespace string) FactNamespaceLister { - return factNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// FactNamespaceLister helps list and get Facts. -// All objects returned here must be treated as read-only. -type FactNamespaceLister interface { - // List lists all Facts in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Fact, err error) - // Get retrieves the Fact from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.Fact, error) - FactNamespaceListerExpansion -} - -// factNamespaceLister implements the FactNamespaceLister -// interface. -type factNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Facts in the indexer for a given namespace. -func (s factNamespaceLister) List(selector labels.Selector) (ret []*v1.Fact, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Fact)) - }) - return ret, err -} - -// Get retrieves the Fact from the indexer for a given namespace and name. -func (s factNamespaceLister) Get(name string) (*v1.Fact, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("fact"), name) - } - return obj.(*v1.Fact), nil -} diff --git a/pkg/client/listers/jenkins.io/v1/pipelinestructure.go b/pkg/client/listers/jenkins.io/v1/pipelinestructure.go deleted file mode 100644 index 7ae8afa..0000000 --- a/pkg/client/listers/jenkins.io/v1/pipelinestructure.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// PipelineStructureLister helps list PipelineStructures. -// All objects returned here must be treated as read-only. -type PipelineStructureLister interface { - // List lists all PipelineStructures in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.PipelineStructure, err error) - // PipelineStructures returns an object that can list and get PipelineStructures. - PipelineStructures(namespace string) PipelineStructureNamespaceLister - PipelineStructureListerExpansion -} - -// pipelineStructureLister implements the PipelineStructureLister interface. -type pipelineStructureLister struct { - indexer cache.Indexer -} - -// NewPipelineStructureLister returns a new PipelineStructureLister. -func NewPipelineStructureLister(indexer cache.Indexer) PipelineStructureLister { - return &pipelineStructureLister{indexer: indexer} -} - -// List lists all PipelineStructures in the indexer. -func (s *pipelineStructureLister) List(selector labels.Selector) (ret []*v1.PipelineStructure, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PipelineStructure)) - }) - return ret, err -} - -// PipelineStructures returns an object that can list and get PipelineStructures. -func (s *pipelineStructureLister) PipelineStructures(namespace string) PipelineStructureNamespaceLister { - return pipelineStructureNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// PipelineStructureNamespaceLister helps list and get PipelineStructures. -// All objects returned here must be treated as read-only. -type PipelineStructureNamespaceLister interface { - // List lists all PipelineStructures in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.PipelineStructure, err error) - // Get retrieves the PipelineStructure from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.PipelineStructure, error) - PipelineStructureNamespaceListerExpansion -} - -// pipelineStructureNamespaceLister implements the PipelineStructureNamespaceLister -// interface. -type pipelineStructureNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all PipelineStructures in the indexer for a given namespace. -func (s pipelineStructureNamespaceLister) List(selector labels.Selector) (ret []*v1.PipelineStructure, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.PipelineStructure)) - }) - return ret, err -} - -// Get retrieves the PipelineStructure from the indexer for a given namespace and name. -func (s pipelineStructureNamespaceLister) Get(name string) (*v1.PipelineStructure, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("pipelinestructure"), name) - } - return obj.(*v1.PipelineStructure), nil -} diff --git a/pkg/client/listers/jenkins.io/v1/scheduler.go b/pkg/client/listers/jenkins.io/v1/scheduler.go deleted file mode 100644 index 4bdbe2e..0000000 --- a/pkg/client/listers/jenkins.io/v1/scheduler.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// SchedulerLister helps list Schedulers. -// All objects returned here must be treated as read-only. -type SchedulerLister interface { - // List lists all Schedulers in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Scheduler, err error) - // Schedulers returns an object that can list and get Schedulers. - Schedulers(namespace string) SchedulerNamespaceLister - SchedulerListerExpansion -} - -// schedulerLister implements the SchedulerLister interface. -type schedulerLister struct { - indexer cache.Indexer -} - -// NewSchedulerLister returns a new SchedulerLister. -func NewSchedulerLister(indexer cache.Indexer) SchedulerLister { - return &schedulerLister{indexer: indexer} -} - -// List lists all Schedulers in the indexer. -func (s *schedulerLister) List(selector labels.Selector) (ret []*v1.Scheduler, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Scheduler)) - }) - return ret, err -} - -// Schedulers returns an object that can list and get Schedulers. -func (s *schedulerLister) Schedulers(namespace string) SchedulerNamespaceLister { - return schedulerNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// SchedulerNamespaceLister helps list and get Schedulers. -// All objects returned here must be treated as read-only. -type SchedulerNamespaceLister interface { - // List lists all Schedulers in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Scheduler, err error) - // Get retrieves the Scheduler from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.Scheduler, error) - SchedulerNamespaceListerExpansion -} - -// schedulerNamespaceLister implements the SchedulerNamespaceLister -// interface. -type schedulerNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Schedulers in the indexer for a given namespace. -func (s schedulerNamespaceLister) List(selector labels.Selector) (ret []*v1.Scheduler, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Scheduler)) - }) - return ret, err -} - -// Get retrieves the Scheduler from the indexer for a given namespace and name. -func (s schedulerNamespaceLister) Get(name string) (*v1.Scheduler, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("scheduler"), name) - } - return obj.(*v1.Scheduler), nil -} diff --git a/pkg/client/listers/jenkins.io/v1/workflow.go b/pkg/client/listers/jenkins.io/v1/workflow.go deleted file mode 100644 index e89e72f..0000000 --- a/pkg/client/listers/jenkins.io/v1/workflow.go +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2020 The Jenkins X Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by lister-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "github.com/jenkins-x/jx-api/v3/pkg/apis/jenkins.io/v1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// WorkflowLister helps list Workflows. -// All objects returned here must be treated as read-only. -type WorkflowLister interface { - // List lists all Workflows in the indexer. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Workflow, err error) - // Workflows returns an object that can list and get Workflows. - Workflows(namespace string) WorkflowNamespaceLister - WorkflowListerExpansion -} - -// workflowLister implements the WorkflowLister interface. -type workflowLister struct { - indexer cache.Indexer -} - -// NewWorkflowLister returns a new WorkflowLister. -func NewWorkflowLister(indexer cache.Indexer) WorkflowLister { - return &workflowLister{indexer: indexer} -} - -// List lists all Workflows in the indexer. -func (s *workflowLister) List(selector labels.Selector) (ret []*v1.Workflow, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Workflow)) - }) - return ret, err -} - -// Workflows returns an object that can list and get Workflows. -func (s *workflowLister) Workflows(namespace string) WorkflowNamespaceLister { - return workflowNamespaceLister{indexer: s.indexer, namespace: namespace} -} - -// WorkflowNamespaceLister helps list and get Workflows. -// All objects returned here must be treated as read-only. -type WorkflowNamespaceLister interface { - // List lists all Workflows in the indexer for a given namespace. - // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Workflow, err error) - // Get retrieves the Workflow from the indexer for a given namespace and name. - // Objects returned here must be treated as read-only. - Get(name string) (*v1.Workflow, error) - WorkflowNamespaceListerExpansion -} - -// workflowNamespaceLister implements the WorkflowNamespaceLister -// interface. -type workflowNamespaceLister struct { - indexer cache.Indexer - namespace string -} - -// List lists all Workflows in the indexer for a given namespace. -func (s workflowNamespaceLister) List(selector labels.Selector) (ret []*v1.Workflow, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.Workflow)) - }) - return ret, err -} - -// Get retrieves the Workflow from the indexer for a given namespace and name. -func (s workflowNamespaceLister) Get(name string) (*v1.Workflow, error) { - obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1.Resource("workflow"), name) - } - return obj.(*v1.Workflow), nil -}